{"type": "func", "start": 4800676, "end": 4801076, "name": "GJBaseGameLayer::sortSectionVector", "pseudocode": "// \n// GJBaseGameLayer::sortSectionVector from 0x4940a4 to 0x494234 (400 bytes)\n// \n// 1 xrefs:\n// > PlayLayer::resetLevel @ 0x31fe56\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 GJBaseGameLayer::sortSectionVector(GJBaseGameLayer *a1)\n{\n  std::vector<std::vector<std::vector<GameObject *> *, std::allocator<std::vector<GameObject *> *>> *, std::allocator<std::vector<std::vector<GameObject *> *, std::allocator<std::vector<GameObject *> *>> *>> *p_m_nonEffectObjects; // r7\n  std::vector<std::vector<int> *, std::allocator<std::vector<int> *>> *p_m_nonEffectObjectsSizes; // r9\n  unsigned int i; // r6\n  std::vector<std::vector<GameObject *> *, std::allocator<std::vector<GameObject *> *>> *v5; // r2\n  int v6; // r5\n  int j; // r8\n  char **v8; // r10\n  int k; // r3\n  std::vector<std::vector<GameObject *> *, std::allocator<std::vector<GameObject *> *>> *p_m_collisionBlockSections; // r7\n  std::vector<std::vector<int> *, std::allocator<std::vector<int> *>> *p_m_collisionBlockSectionSizes; // r4\n  unsigned int m; // r6\n  std::vector<GameObject *> *v13; // r2\n  int v14; // r3\n  int v15; // r8\n  int **v16; // r10\n  int *v17; // r5\n  int v18; // r3\n  int v19; // r11\n  int *v20; // r9\n  unsigned int v21; // r3\n  int *n; // r5\n  int ii; // r3\n  int v24; // [sp+0h] [bp-14h]\n  int v25; // [sp+0h] [bp-14h]\n  int v26; // [sp+4h] [bp-10h]\n\n  p_m_nonEffectObjects = &a1->m_nonEffectObjects;\n  p_m_nonEffectObjectsSizes = &a1->m_nonEffectObjectsSizes;\n  for ( i = 0; i < p_m_nonEffectObjects->m_finish - p_m_nonEffectObjects->m_start; ++i )\n  {\n    v5 = p_m_nonEffectObjects->m_start[i];\n    if ( v5 )\n      v6 = v5->m_finish - v5->m_start;\n    else\n      v6 = -1;\n    for ( j = 0; j < v6; ++j )\n    {\n      v8 = (char **)p_m_nonEffectObjects->m_start[i]->m_start[j];\n      if ( v8 )\n      {\n        v24 = p_m_nonEffectObjectsSizes->m_start[i]->m_start[j];\n        std::__sort<__gnu_cxx::__normal_iterator<GameObject **,std::vector<GameObject *>>,__gnu_cxx::__ops::_Iter_comp_iter<bool (*)(GameObject * const&,GameObject * const&)>>(\n          *v8,\n          &(*v8)[4 * v24],\n          (int (__fastcall *)(int, int))mIDCompSort);\n        for ( k = 0; k < v24; ++k )\n          *(_DWORD *)(*(_DWORD *)&(*v8)[4 * k] + 524) = k;\n      }\n    }\n  }\n  p_m_collisionBlockSections = &a1->m_collisionBlockSections;\n  p_m_collisionBlockSectionSizes = &a1->m_collisionBlockSectionSizes;\n  for ( m = 0; m < p_m_collisionBlockSections->m_finish - p_m_collisionBlockSections->m_start; ++m )\n  {\n    v13 = p_m_collisionBlockSections->m_start[m];\n    if ( v13 )\n      v14 = v13->m_finish - v13->m_start;\n    else\n      v14 = -1;\n    v15 = 0;\n    v25 = v14;\n    while ( v15 < v25 )\n    {\n      v16 = (int **)p_m_collisionBlockSections->m_start[m]->m_start[v15];\n      if ( v16 )\n      {\n        v17 = *v16;\n        v18 = p_m_collisionBlockSectionSizes->m_start[m]->m_start[v15];\n        v19 = 4 * v18;\n        v26 = v18;\n        v20 = &(*v16)[v18];\n        if ( *v16 != v20 )\n        {\n          std::__introsort_loop<__gnu_cxx::__normal_iterator<EffectGameObject **,std::vector<EffectGameObject *>>,int,__gnu_cxx::__ops::_Iter_comp_iter<bool (*)(GameObject * const&,GameObject * const&)>>(\n            (int)v17,\n            (char *)&v17[v18],\n            2 * (31 - __clz(v19 >> 2)),\n            (int (__fastcall *)(_DWORD **, _DWORD *))mIDCompSort);\n          if ( v19 <= 67 )\n          {\n            std::__insertion_sort<__gnu_cxx::__normal_iterator<EffectGameObject **,std::vector<EffectGameObject *>>,__gnu_cxx::__ops::_Iter_comp_iter<bool (*)(GameObject * const&,GameObject * const&)>>(\n              v17,\n              v20,\n              (int (__fastcall *)(int *, int *))mIDCompSort,\n              v21);\n          }\n          else\n          {\n            std::__insertion_sort<__gnu_cxx::__normal_iterator<EffectGameObject **,std::vector<EffectGameObject *>>,__gnu_cxx::__ops::_Iter_comp_iter<bool (*)(GameObject * const&,GameObject * const&)>>(\n              v17,\n              v17 + 16,\n              (int (__fastcall *)(int *, int *))mIDCompSort,\n              (unsigned int)(v17 + 16));\n            for ( n = v17 + 16; n != v20; ++n )\n              std::__unguarded_linear_insert<__gnu_cxx::__normal_iterator<EffectGameObject **,std::vector<EffectGameObject *>>,__gnu_cxx::__ops::_Val_comp_iter<bool (*)(GameObject * const&,GameObject * const&)>>(\n                n,\n                (int (__fastcall *)(int *, int *))mIDCompSort);\n          }\n        }\n        for ( ii = 0; ii < v26; ++ii )\n          *(_DWORD *)((*v16)[ii] + 524) = ii;\n      }\n      ++v15;\n    }\n  }\n}", "assembly": "; \n; GJBaseGameLayer::sortSectionVector from 0x4940a4 to 0x494234 (400 bytes)\n; \n; 1 xrefs:\n; > PlayLayer::resetLevel @ 0x31fe56\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.W          {R4-R11,LR}                                            ; +0x0, 0x4940a4\nADD.W           R7, R0, #0x2C80                                        ; +0x4, 0x4940a8\nADD.W           R9, R0, #0x2D00                                        ; +0x8, 0x4940ac\nSUB             SP, SP, #0x14                                          ; +0xc, 0x4940b0\nADDS            R7, #0x38 ; '8'                                        ; +0xe, 0x4940b2\nADD.W           R9, R9, #0xC                                           ; +0x10, 0x4940b4\nMOV             R4, R0                                                 ; +0x14, 0x4940b8\nMOVS            R6, #0                                                 ; +0x16, 0x4940ba\nLDM.W           R7, {R2,R3}                                            ; +0x18, 0x4940bc\nSUBS            R3, R3, R2                                             ; +0x1c, 0x4940c0\nCMP.W           R6, R3,ASR#2                                           ; +0x1e, 0x4940c2\nBCS             loc_494142                                             ; +0x22, 0x4940c6\nLDR.W           R2, [R2,R6,LSL#2]                                      ; +0x24, 0x4940c8\nMOV.W           R11, R6,LSL#2                                          ; +0x28, 0x4940cc\nCBZ             R2, loc_4940DC                                         ; +0x2c, 0x4940d0\nLDR             R3, [R2,#4]                                            ; +0x2e, 0x4940d2\nLDR             R5, [R2]                                               ; +0x30, 0x4940d4\nSUBS            R5, R3, R5                                             ; +0x32, 0x4940d6\nASRS            R5, R5, #2                                             ; +0x34, 0x4940d8\nB               loc_4940E0                                             ; +0x36, 0x4940da\nMOV.W           R5, #0xFFFFFFFF                                        ; +0x38, 0x4940dc\nMOV.W           R8, #0                                                 ; +0x3c, 0x4940e0\nCMP             R8, R5                                                 ; +0x40, 0x4940e4\nBGE             loc_49413E                                             ; +0x42, 0x4940e6\nLDR             R3, [R7]                                               ; +0x44, 0x4940e8\nLDR.W           R3, [R3,R11]                                           ; +0x46, 0x4940ea\nLDR             R3, [R3]                                               ; +0x4a, 0x4940ee\nLDR.W           R10, [R3,R8,LSL#2]                                     ; +0x4c, 0x4940f0\nCMP.W           R10, #0                                                ; +0x50, 0x4940f4\nBEQ             loc_494138                                             ; +0x54, 0x4940f8\nLDR.W           R3, [R9]                                               ; +0x56, 0x4940fa\nLDR.W           R0, [R10]                                              ; +0x5a, 0x4940fe\nLDR             R2, =(_Z11mIDCompSortRKP10GameObjectS2__ptr - 0x49410C) ; +0x5e, 0x494102\nLDR.W           R3, [R3,R11]                                           ; +0x60, 0x494104\nADD             R2, PC; _Z11mIDCompSortRKP10GameObjectS2__ptr          ; +0x64, 0x494108\nLDR             R2, [R2]; mIDCompSort(GameObject * const&,GameObject * const&) ; +0x66, 0x49410a\nLDR             R3, [R3]                                               ; +0x68, 0x49410c\nLDR.W           R12, [R3,R8,LSL#2]                                     ; +0x6a, 0x49410e\nADD.W           R1, R0, R12,LSL#2                                      ; +0x6e, 0x494112\nSTR.W           R12, [SP,#0x14+var_14]                                 ; +0x72, 0x494116\nBL              _ZSt6__sortIN9__gnu_cxx17__normal_iteratorIPP10GameObjectSt6vectorIS3_SaIS3_EEEENS0_5__ops15_Iter_comp_iterIPFbRKS3_SC_EEEEvT_SG_T0_; std::__sort<__gnu_cxx::__normal_iterator<GameObject **,std::vector<GameObject *>>,__gnu_cxx::__ops::_Iter_comp_iter<bool (*)(GameObject * const&,GameObject * const&)>>(__gnu_cxx::__normal_iterator<GameObject **,std::vector<GameObject *>>,__gnu_cxx::__normal_iterator<GameObject **,std::vector<GameObject *>>,__gnu_cxx::__ops::_Iter_comp_iter<bool (*)(GameObject * const&,GameObject * const&)>) ; +0x76, 0x49411a\nLDR.W           R12, [SP,#0x14+var_14]                                 ; +0x7a, 0x49411e\nMOVS            R3, #0                                                 ; +0x7e, 0x494122\nCMP             R3, R12                                                ; +0x80, 0x494124\nBGE             loc_494138                                             ; +0x82, 0x494126\nLDR.W           R2, [R10]                                              ; +0x84, 0x494128\nLDR.W           R2, [R2,R3,LSL#2]                                      ; +0x88, 0x49412c\nSTR.W           R3, [R2,#0x20C]                                        ; +0x8c, 0x494130\nADDS            R3, #1                                                 ; +0x90, 0x494134\nB               loc_494124                                             ; +0x92, 0x494136\nADD.W           R8, R8, #1                                             ; +0x94, 0x494138\nB               loc_4940E4                                             ; +0x98, 0x49413c\nADDS            R6, #1                                                 ; +0x9a, 0x49413e\nB               loc_4940BC                                             ; +0x9c, 0x494140\nADD.W           R7, R4, #0x2CC0                                        ; +0x9e, 0x494142\nADD.W           R4, R4, #0x2D00                                        ; +0xa2, 0x494146\nADDS            R7, #4                                                 ; +0xa6, 0x49414a\nADDS            R4, #0x18                                              ; +0xa8, 0x49414c\nMOVS            R6, #0                                                 ; +0xaa, 0x49414e\nLDM.W           R7, {R2,R3}                                            ; +0xac, 0x494150\nSUBS            R3, R3, R2                                             ; +0xb0, 0x494154\nCMP.W           R6, R3,ASR#2                                           ; +0xb2, 0x494156\nBCS             loc_49422E                                             ; +0xb6, 0x49415a\nLDR.W           R2, [R2,R6,LSL#2]                                      ; +0xb8, 0x49415c\nLSLS            R3, R6, #2                                             ; +0xbc, 0x494160\nSTR             R3, [SP,#0x14+var_C]                                   ; +0xbe, 0x494162\nCBZ             R2, loc_49416E                                         ; +0xc0, 0x494164\nLDM             R2, {R2,R3}                                            ; +0xc2, 0x494166\nSUBS            R3, R3, R2                                             ; +0xc4, 0x494168\nASRS            R3, R3, #2                                             ; +0xc6, 0x49416a\nB               loc_494172                                             ; +0xc8, 0x49416c\nMOV.W           R3, #0xFFFFFFFF                                        ; +0xca, 0x49416e\nMOV.W           R8, #0                                                 ; +0xce, 0x494172\nSTR             R3, [SP,#0x14+var_14]                                  ; +0xd2, 0x494176\nLDR             R3, [SP,#0x14+var_14]                                  ; +0xd4, 0x494178\nCMP             R8, R3                                                 ; +0xd6, 0x49417a\nBGE             loc_49422A                                             ; +0xd8, 0x49417c\nLDR             R3, [R7]                                               ; +0xda, 0x49417e\nLDR             R2, [SP,#0x14+var_C]                                   ; +0xdc, 0x494180\nLDR             R3, [R3,R2]                                            ; +0xde, 0x494182\nLDR             R3, [R3]                                               ; +0xe0, 0x494184\nLDR.W           R10, [R3,R8,LSL#2]                                     ; +0xe2, 0x494186\nCMP.W           R10, #0                                                ; +0xe6, 0x49418a\nBEQ             loc_494224                                             ; +0xea, 0x49418e\nLDR             R3, [R4]                                               ; +0xec, 0x494190\nLDR.W           R5, [R10]                                              ; +0xee, 0x494192\nLDR             R3, [R3,R2]                                            ; +0xf2, 0x494196\nLDR             R3, [R3]                                               ; +0xf4, 0x494198\nLDR.W           R3, [R3,R8,LSL#2]                                      ; +0xf6, 0x49419a\nMOV.W           R11, R3,LSL#2                                          ; +0xfa, 0x49419e\nSTR             R3, [SP,#0x14+var_10]                                  ; +0xfe, 0x4941a2\nADD.W           R9, R5, R11                                            ; +0x100, 0x4941a4\nCMP             R5, R9                                                 ; +0x104, 0x4941a8\nBEQ             loc_49420C                                             ; +0x106, 0x4941aa\nMOV.W           R2, R11,ASR#2                                          ; +0x108, 0x4941ac\nLDR.W           R12, =(_Z11mIDCompSortRKP10GameObjectS2__ptr - 0x4941BE) ; +0x10c, 0x4941b0\nCLZ.W           R2, R2                                                 ; +0x110, 0x4941b4\nMOV             R0, R5                                                 ; +0x114, 0x4941b8\nADD             R12, PC; _Z11mIDCompSortRKP10GameObjectS2__ptr         ; +0x116, 0x4941ba\nLDR.W           R12, [R12]; mIDCompSort(GameObject * const&,GameObject * const&) ; +0x118, 0x4941bc\nRSB.W           R2, R2, #0x1F                                          ; +0x11c, 0x4941c0\nMOV             R1, R9                                                 ; +0x120, 0x4941c4\nSTR.W           R12, [SP,#0x14+var_8]                                  ; +0x122, 0x4941c6\nMOV             R3, R12                                                ; +0x126, 0x4941ca\nLSLS            R2, R2, #1                                             ; +0x128, 0x4941cc\nBL              _ZSt16__introsort_loopIN9__gnu_cxx17__normal_iteratorIPP16EffectGameObjectSt6vectorIS3_SaIS3_EEEEiNS0_5__ops15_Iter_comp_iterIPFbRKP10GameObjectSE_EEEEvT_SI_T0_T1_; std::__introsort_loop<__gnu_cxx::__normal_iterator<EffectGameObject **,std::vector<EffectGameObject *>>,int,__gnu_cxx::__ops::_Iter_comp_iter<bool (*)(GameObject * const&,GameObject * const&)>>(__gnu_cxx::__normal_iterator<EffectGameObject **,std::vector<EffectGameObject *>>,__gnu_cxx::__normal_iterator<EffectGameObject **,std::vector<EffectGameObject *>>,int,__gnu_cxx::__ops::_Iter_comp_iter<bool (*)(GameObject * const&,GameObject * const&)>) ; +0x12a, 0x4941ce\nLDR.W           R12, [SP,#0x14+var_8]                                  ; +0x12e, 0x4941d2\nCMP.W           R11, #0x43 ; 'C'                                       ; +0x132, 0x4941d6\nMOV             R11, R12                                               ; +0x136, 0x4941da\nBLE             loc_494202                                             ; +0x138, 0x4941dc\nADD.W           R3, R5, #0x40 ; '@'                                    ; +0x13a, 0x4941de\nMOV             R0, R5                                                 ; +0x13e, 0x4941e2\nMOV             R2, R12                                                ; +0x140, 0x4941e4\nSTR             R3, [SP,#0x14+var_8]                                   ; +0x142, 0x4941e6\nMOV             R1, R3                                                 ; +0x144, 0x4941e8\nBL              _ZSt16__insertion_sortIN9__gnu_cxx17__normal_iteratorIPP16EffectGameObjectSt6vectorIS3_SaIS3_EEEENS0_5__ops15_Iter_comp_iterIPFbRKP10GameObjectSE_EEEEvT_SI_T0_; std::__insertion_sort<__gnu_cxx::__normal_iterator<EffectGameObject **,std::vector<EffectGameObject *>>,__gnu_cxx::__ops::_Iter_comp_iter<bool (*)(GameObject * const&,GameObject * const&)>>(__gnu_cxx::__normal_iterator<EffectGameObject **,std::vector<EffectGameObject *>>,__gnu_cxx::__normal_iterator<EffectGameObject **,std::vector<EffectGameObject *>>,__gnu_cxx::__ops::_Iter_comp_iter<bool (*)(GameObject * const&,GameObject * const&)>) ; +0x146, 0x4941ea\nLDR             R3, [SP,#0x14+var_8]                                   ; +0x14a, 0x4941ee\nMOV             R5, R3                                                 ; +0x14c, 0x4941f0\nCMP             R5, R9                                                 ; +0x14e, 0x4941f2\nBEQ             loc_49420C                                             ; +0x150, 0x4941f4\nMOV             R0, R5                                                 ; +0x152, 0x4941f6\nMOV             R1, R11                                                ; +0x154, 0x4941f8\nBL              _ZSt25__unguarded_linear_insertIN9__gnu_cxx17__normal_iteratorIPP16EffectGameObjectSt6vectorIS3_SaIS3_EEEENS0_5__ops14_Val_comp_iterIPFbRKP10GameObjectSE_EEEEvT_T0_; std::__unguarded_linear_insert<__gnu_cxx::__normal_iterator<EffectGameObject **,std::vector<EffectGameObject *>>,__gnu_cxx::__ops::_Val_comp_iter<bool (*)(GameObject * const&,GameObject * const&)>>(__gnu_cxx::__normal_iterator<EffectGameObject **,std::vector<EffectGameObject *>>,__gnu_cxx::__ops::_Val_comp_iter<bool (*)(GameObject * const&,GameObject * const&)>) ; +0x156, 0x4941fa\nADDS            R5, #4                                                 ; +0x15a, 0x4941fe\nB               loc_4941F2                                             ; +0x15c, 0x494200\nMOV             R0, R5                                                 ; +0x15e, 0x494202\nMOV             R1, R9                                                 ; +0x160, 0x494204\nMOV             R2, R12                                                ; +0x162, 0x494206\nBL              _ZSt16__insertion_sortIN9__gnu_cxx17__normal_iteratorIPP16EffectGameObjectSt6vectorIS3_SaIS3_EEEENS0_5__ops15_Iter_comp_iterIPFbRKP10GameObjectSE_EEEEvT_SI_T0_; std::__insertion_sort<__gnu_cxx::__normal_iterator<EffectGameObject **,std::vector<EffectGameObject *>>,__gnu_cxx::__ops::_Iter_comp_iter<bool (*)(GameObject * const&,GameObject * const&)>>(__gnu_cxx::__normal_iterator<EffectGameObject **,std::vector<EffectGameObject *>>,__gnu_cxx::__normal_iterator<EffectGameObject **,std::vector<EffectGameObject *>>,__gnu_cxx::__ops::_Iter_comp_iter<bool (*)(GameObject * const&,GameObject * const&)>) ; +0x164, 0x494208\nMOVS            R3, #0                                                 ; +0x168, 0x49420c\nLDR             R2, [SP,#0x14+var_10]                                  ; +0x16a, 0x49420e\nCMP             R3, R2                                                 ; +0x16c, 0x494210\nBGE             loc_494224                                             ; +0x16e, 0x494212\nLDR.W           R2, [R10]                                              ; +0x170, 0x494214\nLDR.W           R2, [R2,R3,LSL#2]                                      ; +0x174, 0x494218\nSTR.W           R3, [R2,#0x20C]                                        ; +0x178, 0x49421c\nADDS            R3, #1                                                 ; +0x17c, 0x494220\nB               loc_49420E                                             ; +0x17e, 0x494222\nADD.W           R8, R8, #1                                             ; +0x180, 0x494224\nB               loc_494178                                             ; +0x184, 0x494228\nADDS            R6, #1                                                 ; +0x186, 0x49422a\nB               loc_494150                                             ; +0x188, 0x49422c\nADD             SP, SP, #0x14                                          ; +0x18a, 0x49422e\nPOP.W           {R4-R11,PC}                                            ; +0x18c, 0x494230", "xrefs": ["PlayLayer::resetLevel @ 0x31fe56"], "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"}