{"type": "func", "start": 4770216, "end": 4770472, "name": "EditorUI::assignNewGroups", "pseudocode": "// \n// EditorUI::assignNewGroups from 0x48c9a8 to 0x48caa8 (256 bytes)\n// \n// 3 xrefs:\n// > EditorUI::handleEditorAction @ 0x6f2078\n// > EditorUI::handleEditorAction @ 0x6f2088\n// > EditorCommandsPopup::onCommand @ 0x77a804\n// \n// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\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 11:49:31 +0000\n// \n\nint __fastcall EditorUI::assignNewGroups(int this, int a2)\n{\n  cocos2d::CCArray **v2; // r6\n  cocos2d::CCArray *v4; // r0\n  cocos2d::CCObject *v5; // r1\n  cocos2d::CCArray *v6; // r4\n  size_t *v7; // r3\n  void *v8; // r0\n  size_t v9; // r1\n  int (*v10)(const void *, const void *); // r3\n  _DWORD *v11; // r2\n  int *v12; // r4\n  int *v13; // r5\n  int v14; // r8\n  int v15; // t1\n  LevelEditorLayer *v16; // r0\n  int NextFreeGroupID; // r11\n  _DWORD v18[5]; // [sp+0h] [bp-1Ch] BYREF\n\n  v2 = (cocos2d::CCArray **)this;\n  if ( *(_DWORD *)(this + 996) || (this = cocos2d::CCArray::count(*(cocos2d::CCArray **)(this + 668))) != 0 )\n  {\n    v4 = (cocos2d::CCArray *)cocos2d::CCArray::create((cocos2d::CCArray *)this);\n    v5 = v2[249];\n    v6 = v4;\n    if ( v5 )\n      cocos2d::CCArray::addObject(v4, v5);\n    else\n      cocos2d::CCArray::addObjectsFromArray(v4, v2[167]);\n    v7 = *((size_t **)v6 + 13);\n    v8 = (void *)v7[3];\n    v9 = *v7;\n    if ( a2 )\n      v10 = alignYSort;\n    else\n      v10 = alignXSort;\n    qsort(v8, v9, 4u, v10);\n    v11 = *((_DWORD **)v6 + 13);\n    if ( *v11 )\n    {\n      v12 = (int *)v11[3];\n      v13 = &v12[*v11 - 1];\n      while ( v12 <= v13 )\n      {\n        v15 = *v12++;\n        v14 = v15;\n        if ( !v15 )\n          break;\n        v16 = v2[236];\n        memset(v18, 0, 16);\n        v18[4] = 1.0;\n        NextFreeGroupID = LevelEditorLayer::getNextFreeGroupID(v16, (int)v18);\n        std::__hash_table<int,std::hash<int>,std::equal_to<int>,std::allocator<int>>::~__hash_table((int)v18);\n        if ( (*(int (__fastcall **)(int, int))(*(_DWORD *)v14 + 800))(v14, NextFreeGroupID) == 1 )\n          (*(void (__fastcall **)(cocos2d::CCArray *, int, int, _DWORD))(*(_DWORD *)v2[236] + 676))(\n            v2[236],\n            v14,\n            NextFreeGroupID,\n            0);\n      }\n    }\n    return EditorUI::updateObjectInfoLabel(v2);\n  }\n  return this;\n}", "assembly": "; \n; EditorUI::assignNewGroups from 0x48c9a8 to 0x48caa8 (256 bytes)\n; \n; 3 xrefs:\n; > EditorUI::handleEditorAction @ 0x6f2078\n; > EditorUI::handleEditorAction @ 0x6f2088\n; > EditorCommandsPopup::onCommand @ 0x77a804\n; \n; This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\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 11:49:31 +0000\n; \nPUSH.W          {R4-R11,LR}                                            ; +0x0, 0x48c9a8\nMOV             R6, R0                                                 ; +0x4, 0x48c9ac\nLDR             R7, =(__stack_chk_guard_ptr - 0x48C9BA)                ; +0x6, 0x48c9ae\nMOV             R5, R1                                                 ; +0x8, 0x48c9b0\nVPUSH           {D8}                                                   ; +0xa, 0x48c9b2\nADD             R7, PC; __stack_chk_guard_ptr                          ; +0xe, 0x48c9b6\nLDR             R7, [R7]; __stack_chk_guard                            ; +0x10, 0x48c9b8\nLDR             R3, [R7]                                               ; +0x12, 0x48c9ba\nSUB             SP, SP, #0x1C                                          ; +0x14, 0x48c9bc\nSTR             R3, [SP,#0x1C+var_8]                                   ; +0x16, 0x48c9be\nLDR.W           R3, [R0,#0x3E4]                                        ; +0x18, 0x48c9c0\nCBNZ            R3, loc_48C9D2                                         ; +0x1c, 0x48c9c4\nLDR.W           R0, [R0,#0x29C]; this                                  ; +0x1e, 0x48c9c6\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x22, 0x48c9ca\nCMP             R0, #0                                                 ; +0x26, 0x48c9ce\nBEQ             loc_48CA92                                             ; +0x28, 0x48c9d0\nBL              _ZN7cocos2d7CCArray6createEv; cocos2d::CCArray::create(void) ; +0x2a, 0x48c9d2\nLDR.W           R1, [R6,#0x3E4]; cocos2d::CCObject *                   ; +0x2e, 0x48c9d6\nMOV             R4, R0                                                 ; +0x32, 0x48c9da\nCBZ             R1, loc_48C9E4                                         ; +0x34, 0x48c9dc\nBL              _ZN7cocos2d7CCArray9addObjectEPNS_8CCObjectE; cocos2d::CCArray::addObject(cocos2d::CCObject *) ; +0x36, 0x48c9de\nB               loc_48C9EC                                             ; +0x3a, 0x48c9e2\nLDR.W           R1, [R6,#0x29C]; cocos2d::CCArray *                    ; +0x3c, 0x48c9e4\nBL              _ZN7cocos2d7CCArray19addObjectsFromArrayEPS0_; cocos2d::CCArray::addObjectsFromArray(cocos2d::CCArray*) ; +0x40, 0x48c9e8\nLDR             R3, [R4,#0x34]                                         ; +0x44, 0x48c9ec\nMOVS            R2, #4; size_t                                         ; +0x46, 0x48c9ee\nLDR             R0, [R3,#0xC]; void *                                  ; +0x48, 0x48c9f0\nLDR             R1, [R3]; size_t                                       ; +0x4a, 0x48c9f2\nCBZ             R5, loc_48C9FE                                         ; +0x4c, 0x48c9f4\nLDR             R3, =(_Z10alignYSortPKvS0__ptr - 0x48C9FC)             ; +0x4e, 0x48c9f6\nADD             R3, PC; _Z10alignYSortPKvS0__ptr                       ; +0x50, 0x48c9f8\nLDR             R3, [R3]; alignYSort(void const*,void const*)          ; +0x52, 0x48c9fa\nB               loc_48CA04                                             ; +0x54, 0x48c9fc\nLDR             R3, =(_Z10alignXSortPKvS0__ptr - 0x48CA04)             ; +0x56, 0x48c9fe\nADD             R3, PC; _Z10alignXSortPKvS0__ptr                       ; +0x58, 0x48ca00\nLDR             R3, [R3]; alignXSort(void const*,void const*) ; int (*)(const void *, const void *) ; +0x5a, 0x48ca02\nBLX             qsort                                                  ; +0x5c, 0x48ca04\nLDR             R2, [R4,#0x34]                                         ; +0x60, 0x48ca08\nLDR             R3, [R2]                                               ; +0x62, 0x48ca0a\nCBZ             R3, loc_48CA28                                         ; +0x64, 0x48ca0c\nVMOV.F32        S16, #1.0                                              ; +0x66, 0x48ca0e\nADD.W           R3, R3, #0x40000000                                    ; +0x6a, 0x48ca12\nLDR             R4, [R2,#0xC]                                          ; +0x6e, 0x48ca16\nSUBS            R3, #1                                                 ; +0x70, 0x48ca18\nMOV.W           R9, #0                                                 ; +0x72, 0x48ca1a\nMOV             R10, SP                                                ; +0x76, 0x48ca1e\nADD.W           R5, R4, R3,LSL#2                                       ; +0x78, 0x48ca20\nCMP             R4, R5                                                 ; +0x7c, 0x48ca24\nBLS             loc_48CA30                                             ; +0x7e, 0x48ca26\nMOV             R0, R6; this                                           ; +0x80, 0x48ca28\nBL              _ZN8EditorUI21updateObjectInfoLabelEv; EditorUI::updateObjectInfoLabel(void) ; +0x82, 0x48ca2a\nB               loc_48CA92                                             ; +0x86, 0x48ca2e\nLDR.W           R8, [R4],#4                                            ; +0x88, 0x48ca30\nCMP.W           R8, #0                                                 ; +0x8c, 0x48ca34\nBEQ             loc_48CA28                                             ; +0x90, 0x48ca38\nLDR.W           R0, [R6,#0x3B0]                                        ; +0x92, 0x48ca3a\nMOV             R1, R10                                                ; +0x96, 0x48ca3e\nSTR.W           R9, [SP,#0x1C+var_1C]                                  ; +0x98, 0x48ca40\nSTR.W           R9, [SP,#0x1C+var_18]                                  ; +0x9c, 0x48ca44\nSTR.W           R9, [SP,#0x1C+var_14]                                  ; +0xa0, 0x48ca48\nSTR.W           R9, [SP,#0x1C+var_10]                                  ; +0xa4, 0x48ca4c\nVSTR            S16, [SP,#0x1C+var_C]                                  ; +0xa8, 0x48ca50\nBL              _ZN16LevelEditorLayer18getNextFreeGroupIDERKNSt6__ndk113unordered_setIiNS0_4hashIiEENS0_8equal_toIiEENS0_9allocatorIiEEEE; LevelEditorLayer::getNextFreeGroupID(std::unordered_set<int> const&) ; +0xac, 0x48ca54\nB               loc_48CA64                                             ; +0xb0, 0x48ca58\nMOV             R0, R10                                                ; +0xb2, 0x48ca5a\nBL              _ZNSt6__ndk112__hash_tableIiNS_4hashIiEENS_8equal_toIiEENS_9allocatorIiEEED2Ev; std::__hash_table<int,std::hash<int>,std::equal_to<int>,std::allocator<int>>::~__hash_table() ; +0xb4, 0x48ca5c\nBL              __cxa_end_cleanup                                      ; +0xb8, 0x48ca60\nMOV             R11, R0                                                ; +0xbc, 0x48ca64\nMOV             R0, R10                                                ; +0xbe, 0x48ca66\nBL              _ZNSt6__ndk112__hash_tableIiNS_4hashIiEENS_8equal_toIiEENS_9allocatorIiEEED2Ev; std::__hash_table<int,std::hash<int>,std::equal_to<int>,std::allocator<int>>::~__hash_table() ; +0xc0, 0x48ca68\nLDR.W           R3, [R8]                                               ; +0xc4, 0x48ca6c\nMOV             R0, R8                                                 ; +0xc8, 0x48ca70\nMOV             R1, R11                                                ; +0xca, 0x48ca72\nLDR.W           R3, [R3,#0x320]                                        ; +0xcc, 0x48ca74\nBLX             R3                                                     ; +0xd0, 0x48ca78\nCMP             R0, #1                                                 ; +0xd2, 0x48ca7a\nBNE             loc_48CA24                                             ; +0xd4, 0x48ca7c\nLDR.W           R0, [R6,#0x3B0]                                        ; +0xd6, 0x48ca7e\nMOV             R1, R8                                                 ; +0xda, 0x48ca82\nMOV             R2, R11                                                ; +0xdc, 0x48ca84\nLDR             R3, [R0]                                               ; +0xde, 0x48ca86\nLDR.W           R12, [R3,#0x2A4]                                       ; +0xe0, 0x48ca88\nMOVS            R3, #0                                                 ; +0xe4, 0x48ca8c\nBLX             R12                                                    ; +0xe6, 0x48ca8e\nB               loc_48CA24                                             ; +0xe8, 0x48ca90\nLDR             R2, [SP,#0x1C+var_8]                                   ; +0xea, 0x48ca92\nLDR             R3, [R7]                                               ; +0xec, 0x48ca94\nCMP             R2, R3                                                 ; +0xee, 0x48ca96\nBEQ             loc_48CA9E                                             ; +0xf0, 0x48ca98\nBLX             __stack_chk_fail                                       ; +0xf2, 0x48ca9a\nADD             SP, SP, #0x1C                                          ; +0xf6, 0x48ca9e\nVPOP            {D8}                                                   ; +0xf8, 0x48caa0\nPOP.W           {R4-R11,PC}                                            ; +0xfc, 0x48caa4", "xrefs": ["EditorUI::handleEditorAction @ 0x6f2078", "EditorUI::handleEditorAction @ 0x6f2088", "EditorCommandsPopup::onCommand @ 0x77a804"], "is_objc": false, "is_32_bit": true, "is_64_bit": false, "idp_name": "arm", "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"}