{"type": "func", "start": 4220440, "end": 4220542, "name": "GJGarageLayer::selectTab", "pseudocode": "// \n// GJGarageLayer::selectTab from 0x406618 to 0x40667e (102 bytes)\n// \n// 2 xrefs:\n// > GJGarageLayer::setupIconSelect @ 0x406e1e\n// > GJGarageLayer::onSelectTab @ 0x406e74\n// \n// This function is hookable on this platform!\n// \n// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings\n// \n\nvoid GJGarageLayer::selectTab(GJGarageLayer *a1, IconType a2)\n{\n  unsigned int v3; // r5\n  int v4; // r2\n  CCMenuItemToggler *v5; // r0\n  CCMenuItemToggler *v6; // r6\n  int v7; // r7\n  int *v8; // r0\n  IconType v9[2]; // [sp+4h] [bp-8h] BYREF\n\n  v3 = 0;\n  v9[0] = a2;\n  while ( v3 < cocos2d::CCArray::count(a1->m_tabButtons) )\n  {\n    v5 = (CCMenuItemToggler *)cocos2d::CCArray::objectAtIndex(a1->m_tabButtons, v3++);\n    v6 = v5;\n    v7 = v5->getTag(v5);\n    CCMenuItemToggler::toggle(v6, v9[0] == v7);\n    v6->setEnabled(v6, v9[0] != v7);\n  }\n  v8 = (int *)std::map<IconType,int>::operator[](&a1->m_iconPages.compare.pad, v9, v4);\n  GJGarageLayer::setupPage(a1, *v8, v9[0]);\n}", "assembly": "; \n; GJGarageLayer::selectTab from 0x406618 to 0x40667e (102 bytes)\n; \n; 2 xrefs:\n; > GJGarageLayer::setupIconSelect @ 0x406e1e\n; > GJGarageLayer::onSelectTab @ 0x406e74\n; \n; This function is hookable on this platform!\n; \n; Using BromaIDA 8.0.0 @ https:;github.com/Stazzical/BromaIDA\n; Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https:;github.com/geode-sdk/bindings\n; \n\nPUSH            {R0-R2,R4-R7,LR}                                       ; +0x0, 0x406618\nMOV             R4, R0                                                 ; +0x2, 0x40661a\nMOVS            R5, #0                                                 ; +0x4, 0x40661c\nSTR             R1, [SP,#0xC+var_8]                                    ; +0x6, 0x40661e\nLDR.W           R0, [R4,#0x160]; this                                  ; +0x8, 0x406620\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0xc, 0x406624\nCMP             R5, R0                                                 ; +0x10, 0x406628\nBCS             loc_406664                                             ; +0x12, 0x40662a\nMOV             R1, R5; unsigned int                                   ; +0x14, 0x40662c\nLDR.W           R0, [R4,#0x160]; this                                  ; +0x16, 0x40662e\nBL              _ZN7cocos2d7CCArray13objectAtIndexEj; cocos2d::CCArray::objectAtIndex(uint) ; +0x1a, 0x406632\nADDS            R5, #1                                                 ; +0x1e, 0x406636\nLDR             R3, [R0]                                               ; +0x20, 0x406638\nMOV             R6, R0                                                 ; +0x22, 0x40663a\nLDR             R3, [R3,#0x20]                                         ; +0x24, 0x40663c\nBLX             R3                                                     ; +0x26, 0x40663e\nLDR             R1, [SP,#0xC+var_8]                                    ; +0x28, 0x406640\nMOV             R7, R0                                                 ; +0x2a, 0x406642\nSUBS            R3, R1, R7                                             ; +0x2c, 0x406644\nNEGS            R1, R3                                                 ; +0x2e, 0x406646\nMOV             R0, R6; this                                           ; +0x30, 0x406648\nADCS            R1, R3; bool                                           ; +0x32, 0x40664a\nBL              _ZN17CCMenuItemToggler6toggleEb; CCMenuItemToggler::toggle(bool) ; +0x34, 0x40664c\nLDR             R1, [SP,#0xC+var_8]                                    ; +0x38, 0x406650\nLDR             R3, [R6]                                               ; +0x3a, 0x406652\nMOV             R0, R6                                                 ; +0x3c, 0x406654\nSUBS            R1, R1, R7                                             ; +0x3e, 0x406656\nLDR.W           R3, [R3,#0x208]                                        ; +0x40, 0x406658\nIT NE                                                                  ; +0x44, 0x40665c\nMOVNE           R1, #1                                                 ; +0x46, 0x40665e\nBLX             R3                                                     ; +0x48, 0x406660\nB               loc_406620                                             ; +0x4a, 0x406662\nADD             R1, SP, #0xC+var_8                                     ; +0x4c, 0x406664\nADD.W           R0, R4, #0x178                                         ; +0x4e, 0x406666\nBL              _ZNSt3mapI8IconTypeiSt4lessIS0_ESaISt4pairIKS0_iEEEixERS4_; std::map<IconType,int>::operator[](IconType const&) ; +0x52, 0x40666a\nLDR             R2, [SP,#0xC+var_8]                                    ; +0x56, 0x40666e\nMOV             R3, R0                                                 ; +0x58, 0x406670\nMOV             R0, R4                                                 ; +0x5a, 0x406672\nLDR             R1, [R3]                                               ; +0x5c, 0x406674\nBL              _ZN13GJGarageLayer9setupPageEi8IconType; GJGarageLayer::setupPage(int,IconType) ; +0x5e, 0x406676\nADD             SP, SP, #0xC                                           ; +0x62, 0x40667a\nPOP             {R4-R7,PC}                                             ; +0x64, 0x40667c", "xrefs": ["GJGarageLayer::setupIconSelect @ 0x406e1e", "GJGarageLayer::onSelectTab @ 0x406e74"], "is_objc": false, "is_arm32": false, "is_arm64": false, "bida_info": "8.0.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings"}