{"type": "func", "start": 6443113840, "end": 6443113980, "name": "sub_1800A1D70", "pseudocode": "// \n// sub_1800A1D70 from 0x1800a1d70 to 0x1800a1dfc (140 bytes)\n// \n// 9 xrefs:\n// > cocos2d::CCNode::getChildren @ 0x18000346d\n// > cocos2d::CCNode::qsortAllChildrenWithIndex @ 0x180004619\n// > cocos2d::CCNode::updateChildIndexes @ 0x180005654\n// > sub_1800A1380 @ 0x1800a13c8\n// > sub_1800A16E0 @ 0x1800a16f8\n// > sub_1800A19E0 @ 0x1800a19e9\n// > <???> @ 0x1801481e4\n// > <???> @ 0x180148218\n// > <???> @ 0x1801c17c4\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 11:22:13 +0000\n// \n\n__int64 __fastcall sub_1800A1D70(__int64 a1)\n{\n  __int64 result; // rax\n  int v2; // r10d\n  int v3; // r11d\n  __int64 v4; // rsi\n  __int64 v5; // r9\n  __int64 v6; // r8\n  __int64 v7; // rbx\n  __int64 v8; // rdx\n\n  result = *(int *)(a1 + 8);\n  if ( (_DWORD)result != -1 )\n  {\n    v2 = 0;\n    v3 = 0;\n    v4 = *(int *)(a1 + 8);\n    if ( (int)result > 0 )\n    {\n      result = 0;\n      v5 = 0;\n      do\n      {\n        v6 = *(_QWORD *)(a1 + 16);\n        v7 = *(_QWORD *)(v6 + 8 * result);\n        if ( v7 )\n        {\n          if ( v5 > 0 )\n          {\n            v8 = 8 * (result - v5);\n            *(_QWORD *)(v8 + v6) = v7;\n            *(_DWORD *)(*(_QWORD *)(v8 + *(_QWORD *)(a1 + 16)) + 36LL) = v3 - v2;\n          }\n        }\n        else\n        {\n          ++v2;\n          ++v5;\n        }\n        ++v3;\n        ++result;\n      }\n      while ( result < v4 );\n    }\n    *(_DWORD *)(a1 + 8) = -1;\n  }\n  return result;\n}", "assembly": "; \n; sub_1800A1D70 from 0x1800a1d70 to 0x1800a1dfc (140 bytes)\n; \n; 9 xrefs:\n; > cocos2d::CCNode::getChildren @ 0x18000346d\n; > cocos2d::CCNode::qsortAllChildrenWithIndex @ 0x180004619\n; > cocos2d::CCNode::updateChildIndexes @ 0x180005654\n; > sub_1800A1380 @ 0x1800a13c8\n; > sub_1800A16E0 @ 0x1800a16f8\n; > sub_1800A19E0 @ 0x1800a19e9\n; > <???> @ 0x1801481e4\n; > <???> @ 0x180148218\n; > <???> @ 0x1801c17c4\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 11:22:13 +0000\n; \npush    rdi                                                            ; +0x0, 0x1800a1d70\nmovsxd  rax, dword ptr [rcx+8]                                         ; +0x2, 0x1800a1d72\nmov     rdi, rcx                                                       ; +0x6, 0x1800a1d76\ncmp     eax, 0FFFFFFFFh                                                ; +0x9, 0x1800a1d79\njz      short loc_1800A1DFA                                            ; +0xc, 0x1800a1d7c\nxor     r10d, r10d                                                     ; +0xe, 0x1800a1d7e\nmov     [rsp+8+arg_8], rsi                                             ; +0x11, 0x1800a1d81\nmov     r11d, r10d                                                     ; +0x16, 0x1800a1d86\nmov     rsi, rax                                                       ; +0x19, 0x1800a1d89\ntest    eax, eax                                                       ; +0x1c, 0x1800a1d8c\njle     short loc_1800A1DEE                                            ; +0x1e, 0x1800a1d8e\nmov     [rsp+8+arg_0], rbx                                             ; +0x20, 0x1800a1d90\nmov     eax, r10d                                                      ; +0x25, 0x1800a1d95\nmov     r9d, r10d                                                      ; +0x28, 0x1800a1d98\nnop     dword ptr [rax+rax+00h]                                        ; +0x2b, 0x1800a1d9b\nmov     r8, [rdi+10h]                                                  ; +0x30, 0x1800a1da0\nmov     rbx, [r8+rax*8]                                                ; +0x34, 0x1800a1da4\ntest    rbx, rbx                                                       ; +0x38, 0x1800a1da8\njnz     short loc_1800A1DB5                                            ; +0x3b, 0x1800a1dab\ninc     r10d                                                           ; +0x3d, 0x1800a1dad\ninc     r9                                                             ; +0x40, 0x1800a1db0\njmp     short loc_1800A1DDE                                            ; +0x43, 0x1800a1db3\ntest    r9, r9                                                         ; +0x45, 0x1800a1db5\njle     short loc_1800A1DDE                                            ; +0x48, 0x1800a1db8\nmov     rcx, rax                                                       ; +0x4a, 0x1800a1dba\nsub     rcx, r9                                                        ; +0x4d, 0x1800a1dbd\nlea     rdx, ds:0[rcx*8]                                               ; +0x50, 0x1800a1dc0\nmov     [rdx+r8], rbx                                                  ; +0x58, 0x1800a1dc8\nmov     r8d, r11d                                                      ; +0x5c, 0x1800a1dcc\nmov     rcx, [rdi+10h]                                                 ; +0x5f, 0x1800a1dcf\nsub     r8d, r10d                                                      ; +0x63, 0x1800a1dd3\nmov     rdx, [rdx+rcx]                                                 ; +0x66, 0x1800a1dd6\nmov     [rdx+24h], r8d                                                 ; +0x6a, 0x1800a1dda\ninc     r11d                                                           ; +0x6e, 0x1800a1dde\ninc     rax                                                            ; +0x71, 0x1800a1de1\ncmp     rax, rsi                                                       ; +0x74, 0x1800a1de4\njl      short loc_1800A1DA0                                            ; +0x77, 0x1800a1de7\nmov     rbx, [rsp+8+arg_0]                                             ; +0x79, 0x1800a1de9\nmov     rsi, [rsp+8+arg_8]                                             ; +0x7e, 0x1800a1dee\nmov     dword ptr [rdi+8], 0FFFFFFFFh                                  ; +0x83, 0x1800a1df3\npop     rdi                                                            ; +0x8a, 0x1800a1dfa\nretn                                                                   ; +0x8b, 0x1800a1dfb", "xrefs": ["cocos2d::CCNode::getChildren @ 0x18000346d", "cocos2d::CCNode::qsortAllChildrenWithIndex @ 0x180004619", "cocos2d::CCNode::updateChildIndexes @ 0x180005654", "sub_1800A1380 @ 0x1800a13c8", "sub_1800A16E0 @ 0x1800a16f8", "sub_1800A19E0 @ 0x1800a19e9", "<???> @ 0x1801481e4", "<???> @ 0x180148218", "<???> @ 0x1801c17c4"], "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"}