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

0000000000003568         push       rbp                                         ; CODE XREF=_GPUWranglerGPUGetRegistryEntryID+95
0000000000003569         mov        rbp, rsp
000000000000356c         push       r15
000000000000356e         push       r14
0000000000003570         push       rbx
0000000000003571         push       rax
0000000000003572         mov        r14, rsi
0000000000003575         mov        rbx, rdi
0000000000003578         xor        edi, edi
000000000000357a         test       rbx, rbx
000000000000357d         setne      dil                                         ; argument #1 for method sub_2e45
0000000000003581         lea        rsi, qword [aGpu]                           ; argument #2 for method sub_2e45, "gpu"
0000000000003588         call       sub_2e45                                    ; sub_2e45
000000000000358d         mov        rdi, rbx                                    ; argument "cf" for method imp___stubs__CFGetTypeID
0000000000003590         call       imp___stubs__CFGetTypeID                    ; CFGetTypeID
0000000000003595         mov        r15, rax
0000000000003598         cmp        qword [qword_65b0], 0xffffffffffffffff      ; qword_65b0
00000000000035a0         jne        loc_35d9

                     loc_35a2:
00000000000035a2         xor        edi, edi                                    ; CODE XREF=_GPUWranglerGPUGetFramebufferRegistryEntryID+132
00000000000035a4         cmp        r15, qword [qword_65a8]                     ; qword_65a8
00000000000035ab         sete       dil                                         ; argument #1 for method sub_2e45
00000000000035af         lea        rsi, qword [aCfgettypeidgpu]                ; argument #2 for method sub_2e45, "CFGetTypeID(gpu) == (GPUWranglerGPUGetTypeID())"
00000000000035b6         call       sub_2e45                                    ; sub_2e45
00000000000035bb         cmp        qword [rbx+0x32], r14
00000000000035bf         jbe        loc_35cc

00000000000035c1         shl        r14, 0x4
00000000000035c5         mov        rax, qword [rbx+r14+0x3a]
00000000000035ca         jmp        loc_35ce

                     loc_35cc:
00000000000035cc         xor        eax, eax                                    ; CODE XREF=_GPUWranglerGPUGetFramebufferRegistryEntryID+87

                     loc_35ce:
00000000000035ce         add        rsp, 0x8                                    ; CODE XREF=_GPUWranglerGPUGetFramebufferRegistryEntryID+98
00000000000035d2         pop        rbx
00000000000035d3         pop        r14
00000000000035d5         pop        r15
00000000000035d7         pop        rbp
00000000000035d8         ret
                        ; endp

                     loc_35d9:
00000000000035d9         lea        rdi, qword [qword_65b0]                     ; argument "predicate" for method imp___stubs__dispatch_once, qword_65b0, CODE XREF=_GPUWranglerGPUGetFramebufferRegistryEntryID+56
00000000000035e0         lea        rsi, qword [0x63e8]                         ; argument "block" for method imp___stubs__dispatch_once, 0x63e8
00000000000035e7         call       imp___stubs__dispatch_once                  ; dispatch_once
00000000000035ec         jmp        loc_35a2
