{"type": "func", "start": 4298465312, "end": 4298465618, "name": "GJGarageLayer::selectTab", "pseudocode": "// \n// GJGarageLayer::selectTab from 0x100356020 to 0x100356152 (306 bytes)\n// \n// 2 xrefs:\n// > GJGarageLayer::setupIconSelect @ 0x100355315\n// > GJGarageLayer::onSelectTab @ 0x100355ebd\n// \n// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 12:28:52 +0000\n// \n\n__int64 __fastcall GJGarageLayer::selectTab(__int64 a1, signed int a2)\n{\n  unsigned int v2; // r15d\n  __int64 v3; // r12\n  int v4; // eax\n  _BOOL4 v5; // r13d\n  _QWORD *v6; // rax\n  _QWORD *v7; // r12\n  _QWORD *v8; // r15\n  _QWORD *v9; // r13\n  __int64 v10; // rax\n\n  if ( (unsigned int)sub_1007FEF90(*(_QWORD *)(a1 + 480)) )\n  {\n    v2 = 0;\n    do\n    {\n      v3 = sub_1007FEFE0(*(_QWORD *)(a1 + 480), v2);\n      v4 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v3 + 64LL))(v3);\n      v5 = v4 != a2;\n      CCMenuItemToggler::toggle(v3, v4 == a2);\n      (*(void (__fastcall **)(__int64, _BOOL4))(*(_QWORD *)v3 + 1056LL))(v3, v5);\n      ++v2;\n    }\n    while ( v2 < (unsigned int)sub_1007FEF90(*(_QWORD *)(a1 + 480)) );\n  }\n  v6 = *(_QWORD **)(a1 + 528);\n  if ( v6 )\n  {\n    while ( 1 )\n    {\n      while ( 1 )\n      {\n        v8 = v6;\n        if ( *((_DWORD *)v6 + 7) <= a2 )\n          break;\n        v6 = (_QWORD *)*v6;\n        v7 = v8;\n        if ( !*v8 )\n          goto LABEL_11;\n      }\n      if ( *((_DWORD *)v6 + 7) >= a2 )\n        break;\n      v6 = (_QWORD *)v6[1];\n      if ( !v6 )\n      {\n        v7 = v8 + 1;\n        goto LABEL_11;\n      }\n    }\n  }\n  else\n  {\n    v7 = (_QWORD *)(a1 + 528);\n    v8 = (_QWORD *)(a1 + 528);\nLABEL_11:\n    v9 = v8;\n    v8 = operator new(0x28u);\n    *((_DWORD *)v8 + 7) = a2;\n    *((_DWORD *)v8 + 8) = 0;\n    *(_OWORD *)v8 = 0;\n    v8[2] = v9;\n    *v7 = v8;\n    v10 = **(_QWORD **)(a1 + 520);\n    if ( v10 )\n      *(_QWORD *)(a1 + 520) = v10;\n    sub_10001B680(*(__int64 **)(a1 + 528), v8);\n    ++*(_QWORD *)(a1 + 536);\n  }\n  return GJGarageLayer::setupPage(a1, *((unsigned int *)v8 + 8), (unsigned int)a2);\n}", "assembly": "; \n; GJGarageLayer::selectTab from 0x100356020 to 0x100356152 (306 bytes)\n; \n; 2 xrefs:\n; > GJGarageLayer::setupIconSelect @ 0x100355315\n; > GJGarageLayer::onSelectTab @ 0x100355ebd\n; \n; This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 12:28:52 +0000\n; \npush    rbp                                                            ; +0x0, 0x100356020\nmov     rbp, rsp                                                       ; +0x1, 0x100356021\npush    r15                                                            ; +0x4, 0x100356024\npush    r14                                                            ; +0x6, 0x100356026\npush    r13                                                            ; +0x8, 0x100356028\npush    r12                                                            ; +0xa, 0x10035602a\npush    rbx                                                            ; +0xc, 0x10035602c\npush    rax                                                            ; +0xd, 0x10035602d\nmov     ebx, esi                                                       ; +0xe, 0x10035602e\nmov     r14, rdi                                                       ; +0x10, 0x100356030\nmov     rdi, [rdi+1E0h]                                                ; +0x13, 0x100356033\ncall    sub_1007FEF90                                                  ; +0x1a, 0x10035603a\ntest    eax, eax                                                       ; +0x1f, 0x10035603f\njz      short loc_1003560A6                                            ; +0x21, 0x100356041\nxor     r15d, r15d                                                     ; +0x23, 0x100356043\nnop     word ptr [rax+rax+00000000h]                                   ; +0x26, 0x100356046\nmov     rdi, [r14+1E0h]                                                ; +0x30, 0x100356050\nmov     esi, r15d                                                      ; +0x37, 0x100356057\ncall    sub_1007FEFE0                                                  ; +0x3a, 0x10035605a\nmov     r12, rax                                                       ; +0x3f, 0x10035605f\nmov     rax, [rax]                                                     ; +0x42, 0x100356062\nmov     rdi, r12                                                       ; +0x45, 0x100356065\ncall    qword ptr [rax+40h]                                            ; +0x48, 0x100356068\nxor     esi, esi                                                       ; +0x4b, 0x10035606b\nxor     r13d, r13d                                                     ; +0x4d, 0x10035606d\ncmp     eax, ebx                                                       ; +0x50, 0x100356070\nsetz    sil                                                            ; +0x52, 0x100356072\nsetnz   r13b                                                           ; +0x56, 0x100356076\nmov     rdi, r12                                                       ; +0x5a, 0x10035607a\ncall    CCMenuItemToggler__toggle                                      ; +0x5d, 0x10035607d\nmov     rax, [r12]                                                     ; +0x62, 0x100356082\nmov     rdi, r12                                                       ; +0x66, 0x100356086\nmov     esi, r13d                                                      ; +0x69, 0x100356089\ncall    qword ptr [rax+420h]                                           ; +0x6c, 0x10035608c\ninc     r15d                                                           ; +0x72, 0x100356092\nmov     rdi, [r14+1E0h]                                                ; +0x75, 0x100356095\ncall    sub_1007FEF90                                                  ; +0x7c, 0x10035609c\ncmp     r15d, eax                                                      ; +0x81, 0x1003560a1\njb      short loc_100356050                                            ; +0x84, 0x1003560a4\nmov     rax, [r14+210h]                                                ; +0x86, 0x1003560a6\ntest    rax, rax                                                       ; +0x8d, 0x1003560ad\njnz     short loc_1003560CB                                            ; +0x90, 0x1003560b0\nlea     r12, [r14+210h]                                                ; +0x92, 0x1003560b2\nmov     r15, r12                                                       ; +0x99, 0x1003560b9\njmp     short loc_1003560E2                                            ; +0x9c, 0x1003560bc\nalign 20h                                                              ; +0x9e, 0x1003560be\nmov     rax, [r15]                                                     ; +0xa0, 0x1003560c0\nmov     r12, r15                                                       ; +0xa3, 0x1003560c3\ntest    rax, rax                                                       ; +0xa6, 0x1003560c6\njz      short loc_1003560E2                                            ; +0xa9, 0x1003560c9\nmov     r15, rax                                                       ; +0xab, 0x1003560cb\ncmp     [rax+1Ch], ebx                                                 ; +0xae, 0x1003560ce\njg      short loc_1003560C0                                            ; +0xb1, 0x1003560d1\njge     short loc_100356136                                            ; +0xb3, 0x1003560d3\nmov     rax, [r15+8]                                                   ; +0xb5, 0x1003560d5\ntest    rax, rax                                                       ; +0xb9, 0x1003560d9\njnz     short loc_1003560CB                                            ; +0xbc, 0x1003560dc\nlea     r12, [r15+8]                                                   ; +0xbe, 0x1003560de\nmov     r13, r15                                                       ; +0xc2, 0x1003560e2\nmov     edi, 28h ; '('; __sz                                           ; +0xc5, 0x1003560e5\ncall    __Znwm; operator new(ulong)                                    ; +0xca, 0x1003560ea\nmov     r15, rax                                                       ; +0xcf, 0x1003560ef\nmov     [rax+1Ch], ebx                                                 ; +0xd2, 0x1003560f2\nmov     dword ptr [rax+20h], 0                                         ; +0xd5, 0x1003560f5\nxorps   xmm0, xmm0                                                     ; +0xdc, 0x1003560fc\nmovups  xmmword ptr [rax], xmm0                                        ; +0xdf, 0x1003560ff\nmov     [rax+10h], r13                                                 ; +0xe2, 0x100356102\nmov     [r12], rax                                                     ; +0xe6, 0x100356106\nmov     rax, [r14+208h]                                                ; +0xea, 0x10035610a\nmov     rax, [rax]                                                     ; +0xf1, 0x100356111\ntest    rax, rax                                                       ; +0xf4, 0x100356114\njz      short loc_100356120                                            ; +0xf7, 0x100356117\nmov     [r14+208h], rax                                                ; +0xf9, 0x100356119\nmov     rdi, [r14+210h]                                                ; +0x100, 0x100356120\nmov     rsi, r15                                                       ; +0x107, 0x100356127\ncall    sub_10001B680                                                  ; +0x10a, 0x10035612a\ninc     qword ptr [r14+218h]                                           ; +0x10f, 0x10035612f\nmov     esi, [r15+20h]                                                 ; +0x116, 0x100356136\nmov     rdi, r14                                                       ; +0x11a, 0x10035613a\nmov     edx, ebx                                                       ; +0x11d, 0x10035613d\nadd     rsp, 8                                                         ; +0x11f, 0x10035613f\npop     rbx                                                            ; +0x123, 0x100356143\npop     r12                                                            ; +0x124, 0x100356144\npop     r13                                                            ; +0x126, 0x100356146\npop     r14                                                            ; +0x128, 0x100356148\npop     r15                                                            ; +0x12a, 0x10035614a\npop     rbp                                                            ; +0x12c, 0x10035614c\njmp     GJGarageLayer__setupPage                                       ; +0x12d, 0x10035614d", "xrefs": ["GJGarageLayer::setupIconSelect @ 0x100355315", "GJGarageLayer::onSelectTab @ 0x100355ebd"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "pc", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}