{"type": "func", "start": 6443050208, "end": 6443050651, "name": "cocos2d::CCSpriteBatchNode::updateAtlasIndex", "pseudocode": "// \n// cocos2d::CCSpriteBatchNode::updateAtlasIndex from 0x1800924e0 to 0x18009269b (443 bytes)\n// \n// 8 xrefs:\n// > cocos2d::CCSpriteBatchNode::sortAllChildren @ 0x1800923a0\n// > cocos2d::CCSpriteBatchNode::updateAtlasIndex @ 0x180092552\n// > cocos2d::CCSpriteBatchNode::updateAtlasIndex @ 0x18009261a\n// > <???> @ 0x180146bf4\n// > <???> @ 0x180146c04\n// > <???> @ 0x180146c18\n// > <???> @ 0x18014cf68\n// > <???> @ 0x1801c03fc\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:08 +0000\n// \n\nvoid __fastcall cocos2d::CCSpriteBatchNode::updateAtlasIndex(\n        cocos2d::CCSpriteBatchNode *this,\n        struct cocos2d::CCSprite *a2,\n        int *a3)\n{\n  __int64 v6; // rax\n  char v7; // cl\n  __int64 v8; // rdi\n  unsigned int *v9; // rdx\n  __int64 v10; // rcx\n  struct cocos2d::CCSprite **v11; // rdi\n  struct cocos2d::CCSprite **i; // rsi\n  char v13; // bp\n  int v14; // edx\n  unsigned int *v15; // rsi\n  __int64 v16; // rax\n  struct cocos2d::CCSprite **v17; // rsi\n  struct cocos2d::CCSprite **j; // r12\n  struct cocos2d::CCSprite *v19; // rdi\n  int v20; // edx\n  int v21; // edx\n  int v22; // edx\n\n  v6 = (*(__int64 (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)a2 + 480LL))(a2);\n  v7 = *((_BYTE *)a2 + 559);\n  v8 = v6;\n  if ( v6 && (v9 = *(unsigned int **)(v6 + 56), *v9) )\n  {\n    if ( v7 )\n    {\n      v10 = *v9;\n      if ( (_DWORD)v10 )\n      {\n        v11 = *((struct cocos2d::CCSprite ***)v9 + 2);\n        for ( i = &v11[v10 - 1]; v11 <= i; ++v11 )\n        {\n          if ( !*v11 )\n            break;\n          cocos2d::CCSpriteBatchNode::updateAtlasIndex(this, *v11, a3);\n        }\n      }\n    }\n    else\n    {\n      v13 = 1;\n      if ( (*(int (__fastcall **)(_QWORD))(***((_QWORD ***)v9 + 2) + 96LL))(**((_QWORD **)v9 + 2)) >= 0 )\n      {\n        v14 = *((_DWORD *)a2 + 90);\n        *((_DWORD *)a2 + 90) = *a3;\n        if ( v14 != *a3 )\n          cocos2d::CCSpriteBatchNode::swap(this, v14, *a3);\n        ++*a3;\n        v13 = 0;\n      }\n      v15 = *(unsigned int **)(v8 + 56);\n      v16 = *v15;\n      if ( (_DWORD)v16 )\n      {\n        v17 = *((struct cocos2d::CCSprite ***)v15 + 2);\n        for ( j = &v17[v16 - 1]; v17 <= j; ++v17 )\n        {\n          v19 = *v17;\n          if ( !*v17 )\n            break;\n          if ( v13 && (*(int (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v19 + 96LL))(*v17) >= 0 )\n          {\n            v20 = *((_DWORD *)a2 + 90);\n            *((_DWORD *)a2 + 90) = *a3;\n            if ( v20 != *a3 )\n              cocos2d::CCSpriteBatchNode::swap(this, v20, *a3);\n            ++*a3;\n            v13 = 0;\n          }\n          cocos2d::CCSpriteBatchNode::updateAtlasIndex(this, v19, a3);\n        }\n      }\n      if ( v13 )\n      {\n        v21 = *((_DWORD *)a2 + 90);\n        *((_DWORD *)a2 + 90) = *a3;\n        if ( v21 != *a3 )\n          cocos2d::CCSpriteBatchNode::swap(this, v21, *a3);\n        ++*a3;\n      }\n    }\n  }\n  else if ( !v7 )\n  {\n    v22 = *((_DWORD *)a2 + 90);\n    *((_DWORD *)a2 + 90) = *a3;\n    if ( v22 != *a3 )\n      cocos2d::CCSpriteBatchNode::swap(this, v22, *a3);\n    ++*a3;\n  }\n}", "assembly": "; \n; cocos2d::CCSpriteBatchNode::updateAtlasIndex from 0x1800924e0 to 0x18009269b (443 bytes)\n; \n; 8 xrefs:\n; > cocos2d::CCSpriteBatchNode::sortAllChildren @ 0x1800923a0\n; > cocos2d::CCSpriteBatchNode::updateAtlasIndex @ 0x180092552\n; > cocos2d::CCSpriteBatchNode::updateAtlasIndex @ 0x18009261a\n; > <???> @ 0x180146bf4\n; > <???> @ 0x180146c04\n; > <???> @ 0x180146c18\n; > <???> @ 0x18014cf68\n; > <???> @ 0x1801c03fc\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:08 +0000\n; \nmov     [rsp+arg_18], rbx                                              ; +0x0, 0x1800924e0\npush    rdi                                                            ; +0x5, 0x1800924e5\npush    r14                                                            ; +0x6, 0x1800924e6\npush    r15                                                            ; +0x8, 0x1800924e8\nsub     rsp, 20h                                                       ; +0xa, 0x1800924ea\nmov     rax, [rdx]                                                     ; +0xe, 0x1800924ee\nmov     r15, rcx                                                       ; +0x11, 0x1800924f1\nmov     rcx, rdx                                                       ; +0x14, 0x1800924f4\nmov     rbx, r8                                                        ; +0x17, 0x1800924f7\nmov     r14, rdx                                                       ; +0x1a, 0x1800924fa\ncall    qword ptr [rax+1E0h]                                           ; +0x1d, 0x1800924fd\nmovzx   ecx, byte ptr [r14+22Fh]                                       ; +0x23, 0x180092503\nmov     rdi, rax                                                       ; +0x2b, 0x18009250b\ntest    rax, rax                                                       ; +0x2e, 0x18009250e\njz      loc_180092662                                                  ; +0x31, 0x180092511\nmov     rdx, [rax+38h]                                                 ; +0x37, 0x180092517\ncmp     dword ptr [rdx], 0                                             ; +0x3b, 0x18009251b\njz      loc_180092662                                                  ; +0x3e, 0x18009251e\nmov     [rsp+38h+arg_8], rsi                                           ; +0x44, 0x180092524\ntest    cl, cl                                                         ; +0x49, 0x180092529\njz      short loc_180092574                                            ; +0x4b, 0x18009252b\nmov     ecx, [rdx]                                                     ; +0x4d, 0x18009252d\ntest    ecx, ecx                                                       ; +0x4f, 0x18009252f\njz      short loc_180092560                                            ; +0x51, 0x180092531\nmov     rdi, [rdx+10h]                                                 ; +0x53, 0x180092533\nlea     rsi, [rcx-1]                                                   ; +0x57, 0x180092537\nlea     rsi, [rdi+rsi*8]                                               ; +0x5b, 0x18009253b\ncmp     rdi, rsi                                                       ; +0x5f, 0x18009253f\nja      short loc_180092560                                            ; +0x62, 0x180092542\nmov     rdx, [rdi]; struct cocos2d::CCSprite *                         ; +0x64, 0x180092544\ntest    rdx, rdx                                                       ; +0x67, 0x180092547\njz      short loc_180092560                                            ; +0x6a, 0x18009254a\nmov     r8, rbx; int *                                                 ; +0x6c, 0x18009254c\nmov     rcx, r15; this                                                 ; +0x6f, 0x18009254f\ncall    ?updateAtlasIndex@CCSpriteBatchNode@cocos2d@@AEAAXPEAVCCSprite@2@PEAH@Z; cocos2d::CCSpriteBatchNode::updateAtlasIndex(cocos2d::CCSprite *,int *) ; +0x72, 0x180092552\nadd     rdi, 8                                                         ; +0x77, 0x180092557\ncmp     rdi, rsi                                                       ; +0x7b, 0x18009255b\njbe     short loc_180092544                                            ; +0x7e, 0x18009255e\nmov     rsi, [rsp+38h+arg_8]                                           ; +0x80, 0x180092560\nmov     rbx, [rsp+38h+arg_18]                                          ; +0x85, 0x180092565\nadd     rsp, 20h                                                       ; +0x8a, 0x18009256a\npop     r15                                                            ; +0x8e, 0x18009256e\npop     r14                                                            ; +0x90, 0x180092570\npop     rdi                                                            ; +0x92, 0x180092572\nretn                                                                   ; +0x93, 0x180092573\nmov     rax, [rdx+10h]                                                 ; +0x94, 0x180092574\nmov     [rsp+38h+arg_0], rbp                                           ; +0x98, 0x180092578\nmov     bpl, 1                                                         ; +0x9d, 0x18009257d\nmov     rcx, [rax]                                                     ; +0xa0, 0x180092580\nmov     rax, [rcx]                                                     ; +0xa3, 0x180092583\ncall    qword ptr [rax+60h]                                            ; +0xa6, 0x180092586\ntest    eax, eax                                                       ; +0xa9, 0x180092589\njs      short loc_1800925B2                                            ; +0xab, 0x18009258b\nmov     edx, [r14+168h]; int                                           ; +0xad, 0x18009258d\nmov     eax, [rbx]                                                     ; +0xb4, 0x180092594\nmov     [r14+168h], eax                                                ; +0xb6, 0x180092596\nmov     r8d, [rbx]; int                                                ; +0xbd, 0x18009259d\ncmp     edx, r8d                                                       ; +0xc0, 0x1800925a0\njz      short loc_1800925AD                                            ; +0xc3, 0x1800925a3\nmov     rcx, r15; this                                                 ; +0xc5, 0x1800925a5\ncall    ?swap@CCSpriteBatchNode@cocos2d@@AEAAXHH@Z; cocos2d::CCSpriteBatchNode::swap(int,int) ; +0xc8, 0x1800925a8\ninc     dword ptr [rbx]                                                ; +0xcd, 0x1800925ad\nxor     bpl, bpl                                                       ; +0xcf, 0x1800925af\nmov     rsi, [rdi+38h]                                                 ; +0xd2, 0x1800925b2\nmov     eax, [rsi]                                                     ; +0xd6, 0x1800925b6\ntest    eax, eax                                                       ; +0xd8, 0x1800925b8\njz      short loc_18009262D                                            ; +0xda, 0x1800925ba\nmov     rsi, [rsi+10h]                                                 ; +0xdc, 0x1800925bc\nmov     [rsp+38h+arg_10], r12                                          ; +0xe0, 0x1800925c0\nlea     r12, [rax-1]                                                   ; +0xe5, 0x1800925c5\nlea     r12, [rsi+r12*8]                                               ; +0xe9, 0x1800925c9\ncmp     rsi, r12                                                       ; +0xed, 0x1800925cd\nja      short loc_180092628                                            ; +0xf0, 0x1800925d0\nmov     rdi, [rsi]                                                     ; +0xf2, 0x1800925d2\ntest    rdi, rdi                                                       ; +0xf5, 0x1800925d5\njz      short loc_180092628                                            ; +0xf8, 0x1800925d8\ntest    bpl, bpl                                                       ; +0xfa, 0x1800925da\njz      short loc_180092611                                            ; +0xfd, 0x1800925dd\nmov     rax, [rdi]                                                     ; +0xff, 0x1800925df\nmov     rcx, rdi                                                       ; +0x102, 0x1800925e2\ncall    qword ptr [rax+60h]                                            ; +0x105, 0x1800925e5\ntest    eax, eax                                                       ; +0x108, 0x1800925e8\njs      short loc_180092611                                            ; +0x10a, 0x1800925ea\nmov     edx, [r14+168h]; int                                           ; +0x10c, 0x1800925ec\nmov     eax, [rbx]                                                     ; +0x113, 0x1800925f3\nmov     [r14+168h], eax                                                ; +0x115, 0x1800925f5\nmov     r8d, [rbx]; int                                                ; +0x11c, 0x1800925fc\ncmp     edx, r8d                                                       ; +0x11f, 0x1800925ff\njz      short loc_18009260C                                            ; +0x122, 0x180092602\nmov     rcx, r15; this                                                 ; +0x124, 0x180092604\ncall    ?swap@CCSpriteBatchNode@cocos2d@@AEAAXHH@Z; cocos2d::CCSpriteBatchNode::swap(int,int) ; +0x127, 0x180092607\ninc     dword ptr [rbx]                                                ; +0x12c, 0x18009260c\nxor     bpl, bpl                                                       ; +0x12e, 0x18009260e\nmov     r8, rbx; int *                                                 ; +0x131, 0x180092611\nmov     rdx, rdi; struct cocos2d::CCSprite *                           ; +0x134, 0x180092614\nmov     rcx, r15; this                                                 ; +0x137, 0x180092617\ncall    ?updateAtlasIndex@CCSpriteBatchNode@cocos2d@@AEAAXPEAVCCSprite@2@PEAH@Z; cocos2d::CCSpriteBatchNode::updateAtlasIndex(cocos2d::CCSprite *,int *) ; +0x13a, 0x18009261a\nadd     rsi, 8                                                         ; +0x13f, 0x18009261f\ncmp     rsi, r12                                                       ; +0x143, 0x180092623\njbe     short loc_1800925D2                                            ; +0x146, 0x180092626\nmov     r12, [rsp+38h+arg_10]                                          ; +0x148, 0x180092628\ntest    bpl, bpl                                                       ; +0x14d, 0x18009262d\nmov     rbp, [rsp+38h+arg_0]                                           ; +0x150, 0x180092630\njz      loc_180092560                                                  ; +0x155, 0x180092635\nmov     edx, [r14+168h]; int                                           ; +0x15b, 0x18009263b\nmov     eax, [rbx]                                                     ; +0x162, 0x180092642\nmov     [r14+168h], eax                                                ; +0x164, 0x180092644\nmov     r8d, [rbx]; int                                                ; +0x16b, 0x18009264b\ncmp     edx, r8d                                                       ; +0x16e, 0x18009264e\njz      short loc_18009265B                                            ; +0x171, 0x180092651\nmov     rcx, r15; this                                                 ; +0x173, 0x180092653\ncall    ?swap@CCSpriteBatchNode@cocos2d@@AEAAXHH@Z; cocos2d::CCSpriteBatchNode::swap(int,int) ; +0x176, 0x180092656\ninc     dword ptr [rbx]                                                ; +0x17b, 0x18009265b\njmp     loc_180092560                                                  ; +0x17d, 0x18009265d\ntest    cl, cl                                                         ; +0x182, 0x180092662\njnz     loc_180092565                                                  ; +0x184, 0x180092664\nmov     edx, [r14+168h]; int                                           ; +0x18a, 0x18009266a\nmov     eax, [rbx]                                                     ; +0x191, 0x180092671\nmov     [r14+168h], eax                                                ; +0x193, 0x180092673\nmov     r8d, [rbx]; int                                                ; +0x19a, 0x18009267a\ncmp     edx, r8d                                                       ; +0x19d, 0x18009267d\njz      short loc_18009268A                                            ; +0x1a0, 0x180092680\nmov     rcx, r15; this                                                 ; +0x1a2, 0x180092682\ncall    ?swap@CCSpriteBatchNode@cocos2d@@AEAAXHH@Z; cocos2d::CCSpriteBatchNode::swap(int,int) ; +0x1a5, 0x180092685\ninc     dword ptr [rbx]                                                ; +0x1aa, 0x18009268a\nmov     rbx, [rsp+38h+arg_18]                                          ; +0x1ac, 0x18009268c\nadd     rsp, 20h                                                       ; +0x1b1, 0x180092691\npop     r15                                                            ; +0x1b5, 0x180092695\npop     r14                                                            ; +0x1b7, 0x180092697\npop     rdi                                                            ; +0x1b9, 0x180092699\nretn                                                                   ; +0x1ba, 0x18009269a", "xrefs": ["cocos2d::CCSpriteBatchNode::sortAllChildren @ 0x1800923a0", "cocos2d::CCSpriteBatchNode::updateAtlasIndex @ 0x180092552", "cocos2d::CCSpriteBatchNode::updateAtlasIndex @ 0x18009261a", "<???> @ 0x180146bf4", "<???> @ 0x180146c04", "<???> @ 0x180146c18", "<???> @ 0x18014cf68", "<???> @ 0x1801c03fc"], "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"}