{"type": "func", "start": 6443036800, "end": 6443037068, "name": "cocos2d::CCSpriteBatchNode::sortAllChildren", "pseudocode": "// \n// cocos2d::CCSpriteBatchNode::sortAllChildren from 0x18008f080 to 0x18008f18c (268 bytes)\n// \n// 7 xrefs:\n// > <???> @ 0x1800ec4c0\n// > <???> @ 0x180103ec0\n// > <???> @ 0x180105c28\n// > <???> @ 0x18013d8e8\n// > <???> @ 0x18013d8f8\n// > <???> @ 0x1801438a8\n// > <???> @ 0x1801b6114\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 __fastcall cocos2d::CCSpriteBatchNode::sortAllChildren(cocos2d::CCSpriteBatchNode *this)\n{\n  cocos2d::CCArray *m_pChildren; // rax\n  cocos2d::ccArray *data; // rdi\n  __int64 num; // rax\n  cocos2d::CCObject **arr; // rdi\n  cocos2d::CCObject **i; // rsi\n  cocos2d::CCArray *v7; // rax\n  cocos2d::ccArray *v8; // rdi\n  __int64 v9; // rax\n  struct cocos2d::CCSprite **v10; // rdi\n  struct cocos2d::CCSprite **j; // rsi\n  int v12; // [rsp+30h] [rbp+8h] BYREF\n\n  if ( this->m_bReorderChildDirty && (!this->m_bManualSortChildren || this->m_bManualSortAllChildrenDirty) )\n  {\n    if ( this->m_bUseChildIndex )\n      cocos2d::CCNode::sortAllChildrenWithIndex(this);\n    else\n      cocos2d::CCNode::sortAllChildrenNoIndex(this);\n    if ( (unsigned int)cocos2d::CCArray::count(this->m_pChildren) )\n    {\n      m_pChildren = this->m_pChildren;\n      if ( m_pChildren )\n      {\n        data = m_pChildren->data;\n        num = data->num;\n        if ( (_DWORD)num )\n        {\n          arr = data->arr;\n          for ( i = &arr[num - 1]; arr <= i; ++arr )\n          {\n            if ( !*arr )\n              break;\n            ((void (__fastcall *)(cocos2d::CCObject *))(*arr)->__vftable[8].copyWithZone)(*arr);\n          }\n        }\n      }\n      v7 = this->m_pChildren;\n      v12 = 0;\n      if ( v7 )\n      {\n        v8 = v7->data;\n        v9 = v8->num;\n        if ( (_DWORD)v9 )\n        {\n          v10 = (struct cocos2d::CCSprite **)v8->arr;\n          for ( j = &v10[v9 - 1]; v10 <= j; ++v10 )\n          {\n            if ( !*v10 )\n              break;\n            cocos2d::CCSpriteBatchNode::updateAtlasIndex(this, *v10, &v12);\n          }\n        }\n      }\n    }\n    this->m_bReorderChildDirty = 0;\n    this->m_bManualSortAllChildrenDirty = 0;\n  }\n}", "assembly": "; \n; cocos2d::CCSpriteBatchNode::sortAllChildren from 0x18008f080 to 0x18008f18c (268 bytes)\n; \n; 7 xrefs:\n; > <???> @ 0x1800ec4c0\n; > <???> @ 0x180103ec0\n; > <???> @ 0x180105c28\n; > <???> @ 0x18013d8e8\n; > <???> @ 0x18013d8f8\n; > <???> @ 0x1801438a8\n; > <???> @ 0x1801b6114\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    rbx                                                            ; +0x0, 0x18008f080\nsub     rsp, 20h                                                       ; +0x2, 0x18008f082\ncmp     byte ptr [rcx+120h], 0                                         ; +0x6, 0x18008f086\nmov     rbx, rcx                                                       ; +0xd, 0x18008f08d\njz      loc_18008F186                                                  ; +0x10, 0x18008f090\ncmp     byte ptr [rcx+160h], 0                                         ; +0x16, 0x18008f096\njz      short loc_18008F0AC                                            ; +0x1d, 0x18008f09d\ncmp     byte ptr [rcx+161h], 0                                         ; +0x1f, 0x18008f09f\njz      loc_18008F186                                                  ; +0x26, 0x18008f0a6\ncmp     byte ptr [rcx+138h], 0                                         ; +0x2c, 0x18008f0ac\njz      short loc_18008F0BC                                            ; +0x33, 0x18008f0b3\ncall    ?sortAllChildrenWithIndex@CCNode@cocos2d@@QEAAXXZ; cocos2d::CCNode::sortAllChildrenWithIndex(void) ; +0x35, 0x18008f0b5\njmp     short loc_18008F0C1                                            ; +0x3a, 0x18008f0ba\ncall    ?sortAllChildrenNoIndex@CCNode@cocos2d@@QEAAXXZ; cocos2d::CCNode::sortAllChildrenNoIndex(void) ; +0x3c, 0x18008f0bc\nmov     rcx, [rbx+0D0h]; this                                          ; +0x41, 0x18008f0c1\ncall    ?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x48, 0x18008f0c8\ntest    eax, eax                                                       ; +0x4d, 0x18008f0cd\njz      loc_18008F178                                                  ; +0x4f, 0x18008f0cf\nmov     rax, [rbx+0D0h]                                                ; +0x55, 0x18008f0d5\nmov     [rsp+28h+arg_8], rsi                                           ; +0x5c, 0x18008f0dc\nmov     [rsp+28h+arg_10], rdi                                          ; +0x61, 0x18008f0e1\ntest    rax, rax                                                       ; +0x66, 0x18008f0e6\njz      short loc_18008F120                                            ; +0x69, 0x18008f0e9\nmov     rdi, [rax+38h]                                                 ; +0x6b, 0x18008f0eb\nmov     eax, [rdi]                                                     ; +0x6f, 0x18008f0ef\ntest    eax, eax                                                       ; +0x71, 0x18008f0f1\njz      short loc_18008F120                                            ; +0x73, 0x18008f0f3\nmov     rdi, [rdi+10h]                                                 ; +0x75, 0x18008f0f5\nlea     rsi, [rax-1]                                                   ; +0x79, 0x18008f0f9\nlea     rsi, [rdi+rsi*8]                                               ; +0x7d, 0x18008f0fd\ncmp     rdi, rsi                                                       ; +0x81, 0x18008f101\nja      short loc_18008F120                                            ; +0x84, 0x18008f104\nmov     rcx, [rdi]                                                     ; +0x86, 0x18008f106\ntest    rcx, rcx                                                       ; +0x89, 0x18008f109\njz      short loc_18008F120                                            ; +0x8c, 0x18008f10c\nmov     rax, [rcx]                                                     ; +0x8e, 0x18008f10e\ncall    qword ptr [rax+240h]                                           ; +0x91, 0x18008f111\nadd     rdi, 8                                                         ; +0x97, 0x18008f117\ncmp     rdi, rsi                                                       ; +0x9b, 0x18008f11b\njbe     short loc_18008F106                                            ; +0x9e, 0x18008f11e\nmov     rax, [rbx+0D0h]                                                ; +0xa0, 0x18008f120\nmov     [rsp+28h+arg_0], 0                                             ; +0xa7, 0x18008f127\ntest    rax, rax                                                       ; +0xaf, 0x18008f12f\njz      short loc_18008F16E                                            ; +0xb2, 0x18008f132\nmov     rdi, [rax+38h]                                                 ; +0xb4, 0x18008f134\nmov     eax, [rdi]                                                     ; +0xb8, 0x18008f138\ntest    eax, eax                                                       ; +0xba, 0x18008f13a\njz      short loc_18008F16E                                            ; +0xbc, 0x18008f13c\nmov     rdi, [rdi+10h]                                                 ; +0xbe, 0x18008f13e\nlea     rsi, [rax-1]                                                   ; +0xc2, 0x18008f142\nlea     rsi, [rdi+rsi*8]                                               ; +0xc6, 0x18008f146\ncmp     rdi, rsi                                                       ; +0xca, 0x18008f14a\nja      short loc_18008F16E                                            ; +0xcd, 0x18008f14d\nnop                                                                    ; +0xcf, 0x18008f14f\nmov     rdx, [rdi]; struct cocos2d::CCSprite *                         ; +0xd0, 0x18008f150\ntest    rdx, rdx                                                       ; +0xd3, 0x18008f153\njz      short loc_18008F16E                                            ; +0xd6, 0x18008f156\nlea     r8, [rsp+28h+arg_0]; int *                                     ; +0xd8, 0x18008f158\nmov     rcx, rbx; this                                                 ; +0xdd, 0x18008f15d\ncall    ?updateAtlasIndex@CCSpriteBatchNode@cocos2d@@AEAAXPEAVCCSprite@2@PEAH@Z; cocos2d::CCSpriteBatchNode::updateAtlasIndex(cocos2d::CCSprite *,int *) ; +0xe0, 0x18008f160\nadd     rdi, 8                                                         ; +0xe5, 0x18008f165\ncmp     rdi, rsi                                                       ; +0xe9, 0x18008f169\njbe     short loc_18008F150                                            ; +0xec, 0x18008f16c\nmov     rsi, [rsp+28h+arg_8]                                           ; +0xee, 0x18008f16e\nmov     rdi, [rsp+28h+arg_10]                                          ; +0xf3, 0x18008f173\nmov     byte ptr [rbx+120h], 0                                         ; +0xf8, 0x18008f178\nmov     byte ptr [rbx+161h], 0                                         ; +0xff, 0x18008f17f\nadd     rsp, 20h                                                       ; +0x106, 0x18008f186\npop     rbx                                                            ; +0x10a, 0x18008f18a\nretn                                                                   ; +0x10b, 0x18008f18b", "xrefs": ["<???> @ 0x1800ec4c0", "<???> @ 0x180103ec0", "<???> @ 0x180105c28", "<???> @ 0x18013d8e8", "<???> @ 0x18013d8f8", "<???> @ 0x1801438a8", "<???> @ 0x1801b6114"], "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"}