int _GPUWranglerGPUGetFramebufferRegistryEntryID(int arg0, int arg1) {
    r14 = arg1;
    rbx = arg0;
    sub_2e25(rbx != 0x0 ? 0x1 : 0x0, "gpu");
    r15 = CFGetTypeID(rbx);
    if (*qword_65b0 != 0xffffffffffffffff) {
            dispatch_once(qword_65b0, ^ {/* block implemented at sub_35d2 */ } });
    }
    sub_2e25(r15 == *qword_65a8 ? 0x1 : 0x0, "CFGetTypeID(gpu) == (GPUWranglerGPUGetTypeID())");
    if (*(rbx + 0x32) > r14) {
            rax = *(rbx + (r14 + r14 * 0x2 << 0x4) + 0x3a);
    }
    else {
            rax = 0x0;
    }
    return rax;
}

0000000000003548         push       rbp                                         ; CODE XREF=_GPUWranglerGPUGetRegistryEntryID+95
0000000000003549         mov        rbp, rsp
000000000000354c         push       r15
000000000000354e         push       r14
0000000000003550         push       rbx
0000000000003551         push       rax
0000000000003552         mov        r14, rsi
0000000000003555         mov        rbx, rdi
0000000000003558         xor        edi, edi
000000000000355a         test       rbx, rbx
000000000000355d         setne      dil                                         ; argument #1 for method sub_2e25
0000000000003561         lea        rsi, qword [aGpu]                           ; argument #2 for method sub_2e25, "gpu"
0000000000003568         call       sub_2e25                                    ; sub_2e25
000000000000356d         mov        rdi, rbx                                    ; argument "cf" for method imp___stubs__CFGetTypeID
0000000000003570         call       imp___stubs__CFGetTypeID                    ; CFGetTypeID
0000000000003575         mov        r15, rax
0000000000003578         cmp        qword [qword_65b0], 0xffffffffffffffff      ; qword_65b0
0000000000003580         jne        loc_35bd

                     loc_3582:
0000000000003582         xor        edi, edi                                    ; CODE XREF=_GPUWranglerGPUGetFramebufferRegistryEntryID+136
0000000000003584         cmp        r15, qword [qword_65a8]                     ; qword_65a8
000000000000358b         sete       dil                                         ; argument #1 for method sub_2e25
000000000000358f         lea        rsi, qword [aCfgettypeidgpu]                ; argument #2 for method sub_2e25, "CFGetTypeID(gpu) == (GPUWranglerGPUGetTypeID())"
0000000000003596         call       sub_2e25                                    ; sub_2e25
000000000000359b         cmp        qword [rbx+0x32], r14
000000000000359f         jbe        loc_35b0

00000000000035a1         lea        rax, qword [r14+r14*2]
00000000000035a5         shl        rax, 0x4
00000000000035a9         mov        rax, qword [rbx+rax+0x3a]
00000000000035ae         jmp        loc_35b2

                     loc_35b0:
00000000000035b0         xor        eax, eax                                    ; CODE XREF=_GPUWranglerGPUGetFramebufferRegistryEntryID+87

                     loc_35b2:
00000000000035b2         add        rsp, 0x8                                    ; CODE XREF=_GPUWranglerGPUGetFramebufferRegistryEntryID+102
00000000000035b6         pop        rbx
00000000000035b7         pop        r14
00000000000035b9         pop        r15
00000000000035bb         pop        rbp
00000000000035bc         ret
                        ; endp

                     loc_35bd:
00000000000035bd         lea        rdi, qword [qword_65b0]                     ; argument "predicate" for method imp___stubs__dispatch_once, qword_65b0, CODE XREF=_GPUWranglerGPUGetFramebufferRegistryEntryID+56
00000000000035c4         lea        rsi, qword [0x63e8]                         ; argument "block" for method imp___stubs__dispatch_once, 0x63e8
00000000000035cb         call       imp___stubs__dispatch_once                  ; dispatch_once
00000000000035d0         jmp        loc_3582