{"type": "func", "start": 6443049088, "end": 6443049453, "name": "cocos2d::CCSpriteBatchNode::removeSpriteFromAtlas", "pseudocode": "// \n// cocos2d::CCSpriteBatchNode::removeSpriteFromAtlas from 0x180092080 to 0x1800921ed (365 bytes)\n// \n// 9 xrefs:\n// > cocos2d::CCSprite::removeAllChildrenWithCleanup @ 0x18008f268\n// > cocos2d::CCSprite::removeChild @ 0x18008f2d5\n// > cocos2d::CCSpriteBatchNode::removeChild @ 0x18009204e\n// > cocos2d::CCSpriteBatchNode::removeSpriteFromAtlas @ 0x18009216b\n// > cocos2d::CCSpriteBatchNode::removeSpriteFromAtlas @ 0x1800921cf\n// > <???> @ 0x180146a9c\n// > <???> @ 0x180146aac\n// > <???> @ 0x18014cf68\n// > <???> @ 0x1801c0390\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::removeSpriteFromAtlas(\n        cocos2d::CCTextureAtlas **this,\n        struct cocos2d::CCSprite *a2)\n{\n  unsigned int v4; // esi\n  unsigned int v5; // ebp\n  __int64 v6; // r8\n  cocos2d::CCArray *v7; // rax\n  cocos2d::CCArray *v8; // rbx\n  unsigned int *v9; // rbx\n  __int64 v10; // rax\n  struct cocos2d::CCSprite **v11; // rbx\n  struct cocos2d::CCSprite **j; // rsi\n  cocos2d::CCArray *v13; // rax\n  cocos2d::CCArray *v14; // rbx\n  unsigned int *v15; // rbx\n  __int64 v16; // rax\n  struct cocos2d::CCSprite **v17; // rbx\n  struct cocos2d::CCSprite **i; // rsi\n\n  if ( *((_BYTE *)a2 + 559) )\n  {\n    v13 = (cocos2d::CCArray *)(*(__int64 (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)a2 + 480LL))(a2);\n    v14 = v13;\n    if ( v13 )\n    {\n      if ( (unsigned int)cocos2d::CCArray::count(v13) )\n      {\n        v15 = *((unsigned int **)v14 + 7);\n        v16 = *v15;\n        if ( (_DWORD)v16 )\n        {\n          v17 = *((struct cocos2d::CCSprite ***)v15 + 2);\n          for ( i = &v17[v16 - 1]; v17 <= i; ++v17 )\n          {\n            if ( !*v17 )\n              break;\n            cocos2d::CCSpriteBatchNode::removeSpriteFromAtlas((cocos2d::CCSpriteBatchNode *)this, *v17);\n          }\n        }\n      }\n    }\n  }\n  else\n  {\n    v4 = *((_DWORD *)a2 + 10);\n    if ( v4 != -1 )\n    {\n      v5 = cocos2d::CCArray::count(*(this + 43)) - 1;\n      if ( v4 < v5 )\n        cocos2d::CCSpriteBatchNode::swap((cocos2d::CCSpriteBatchNode *)this, v4, v5);\n      cocos2d::CCTextureAtlas::removeQuadAtIndex(*(this + 41), v5);\n      *((_BYTE *)this + 288) = 1;\n      (*(void (__fastcall **)(struct cocos2d::CCSprite *, _QWORD))(*(_QWORD *)a2 + 968LL))(a2, 0);\n      LOBYTE(v6) = 1;\n      sub_1800A1BE0(*((_QWORD *)*(this + 43) + 7), (unsigned int)(**((_DWORD **)*(this + 43) + 7) - 1), v6);\n      v7 = (cocos2d::CCArray *)(*(__int64 (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)a2 + 480LL))(a2);\n      v8 = v7;\n      if ( v7 )\n      {\n        if ( (unsigned int)cocos2d::CCArray::count(v7) )\n        {\n          v9 = *((unsigned int **)v8 + 7);\n          v10 = *v9;\n          if ( (_DWORD)v10 )\n          {\n            v11 = *((struct cocos2d::CCSprite ***)v9 + 2);\n            for ( j = &v11[v10 - 1]; v11 <= j; ++v11 )\n            {\n              if ( !*v11 )\n                break;\n              cocos2d::CCSpriteBatchNode::removeSpriteFromAtlas((cocos2d::CCSpriteBatchNode *)this, *v11);\n            }\n          }\n        }\n      }\n    }\n  }\n}", "assembly": "; \n; cocos2d::CCSpriteBatchNode::removeSpriteFromAtlas from 0x180092080 to 0x1800921ed (365 bytes)\n; \n; 9 xrefs:\n; > cocos2d::CCSprite::removeAllChildrenWithCleanup @ 0x18008f268\n; > cocos2d::CCSprite::removeChild @ 0x18008f2d5\n; > cocos2d::CCSpriteBatchNode::removeChild @ 0x18009204e\n; > cocos2d::CCSpriteBatchNode::removeSpriteFromAtlas @ 0x18009216b\n; > cocos2d::CCSpriteBatchNode::removeSpriteFromAtlas @ 0x1800921cf\n; > <???> @ 0x180146a9c\n; > <???> @ 0x180146aac\n; > <???> @ 0x18014cf68\n; > <???> @ 0x1801c0390\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_8], rbx                                               ; +0x0, 0x180092080\nmov     [rsp+arg_10], rsi                                              ; +0x5, 0x180092085\npush    rdi                                                            ; +0xa, 0x18009208a\nsub     rsp, 20h                                                       ; +0xb, 0x18009208b\ncmp     byte ptr [rdx+22Fh], 0                                         ; +0xf, 0x18009208f\nmov     rbx, rdx                                                       ; +0x16, 0x180092096\nmov     rdi, rcx                                                       ; +0x19, 0x180092099\njnz     loc_180092189                                                  ; +0x1c, 0x18009209c\nmov     esi, [rdx+28h]                                                 ; +0x22, 0x1800920a2\ncmp     esi, 0FFFFFFFFh                                                ; +0x25, 0x1800920a5\njz      loc_1800921DD                                                  ; +0x28, 0x1800920a8\nmov     rcx, [rcx+158h]; this                                          ; +0x2e, 0x1800920ae\nmov     [rsp+28h+arg_0], rbp                                           ; +0x35, 0x1800920b5\ncall    ?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x3a, 0x1800920ba\nlea     ebp, [rax-1]                                                   ; +0x3f, 0x1800920bf\ncmp     esi, ebp                                                       ; +0x42, 0x1800920c2\njnb     short loc_1800920D3                                            ; +0x44, 0x1800920c4\nmov     r8d, ebp; int                                                  ; +0x46, 0x1800920c6\nmov     edx, esi; int                                                  ; +0x49, 0x1800920c9\nmov     rcx, rdi; this                                                 ; +0x4b, 0x1800920cb\ncall    ?swap@CCSpriteBatchNode@cocos2d@@AEAAXHH@Z; cocos2d::CCSpriteBatchNode::swap(int,int) ; +0x4e, 0x1800920ce\nmov     rcx, [rdi+148h]; this                                          ; +0x53, 0x1800920d3\nmov     edx, ebp; unsigned int                                         ; +0x5a, 0x1800920da\ncall    ?removeQuadAtIndex@CCTextureAtlas@cocos2d@@QEAAXI@Z; cocos2d::CCTextureAtlas::removeQuadAtIndex(uint) ; +0x5c, 0x1800920dc\nmov     byte ptr [rdi+120h], 1                                         ; +0x61, 0x1800920e1\nxor     edx, edx                                                       ; +0x68, 0x1800920e8\nmov     rax, [rbx]                                                     ; +0x6a, 0x1800920ea\nmov     rcx, rbx                                                       ; +0x6d, 0x1800920ed\ncall    qword ptr [rax+3C8h]                                           ; +0x70, 0x1800920f0\nmov     rax, [rdi+158h]                                                ; +0x76, 0x1800920f6\nmov     r8b, 1                                                         ; +0x7d, 0x1800920fd\nmov     rcx, [rax+38h]                                                 ; +0x80, 0x180092100\nmov     edx, [rcx]                                                     ; +0x84, 0x180092104\ndec     edx                                                            ; +0x86, 0x180092106\ncall    sub_1800A1BE0                                                  ; +0x88, 0x180092108\nmov     rax, [rbx]                                                     ; +0x8d, 0x18009210d\nmov     rcx, rbx                                                       ; +0x90, 0x180092110\ncall    qword ptr [rax+1E0h]                                           ; +0x93, 0x180092113\nmov     rbp, [rsp+28h+arg_0]                                           ; +0x99, 0x180092119\nmov     rbx, rax                                                       ; +0x9e, 0x18009211e\ntest    rax, rax                                                       ; +0xa1, 0x180092121\njz      loc_1800921DD                                                  ; +0xa4, 0x180092124\nmov     rcx, rax; this                                                 ; +0xaa, 0x18009212a\ncall    ?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0xad, 0x18009212d\ntest    eax, eax                                                       ; +0xb2, 0x180092132\njz      loc_1800921DD                                                  ; +0xb4, 0x180092134\nmov     rbx, [rbx+38h]                                                 ; +0xba, 0x18009213a\nmov     eax, [rbx]                                                     ; +0xbe, 0x18009213e\ntest    eax, eax                                                       ; +0xc0, 0x180092140\njz      loc_1800921DD                                                  ; +0xc2, 0x180092142\nmov     rbx, [rbx+10h]                                                 ; +0xc8, 0x180092148\nlea     rsi, [rax-1]                                                   ; +0xcc, 0x18009214c\nlea     rsi, [rbx+rsi*8]                                               ; +0xd0, 0x180092150\ncmp     rbx, rsi                                                       ; +0xd4, 0x180092154\nja      loc_1800921DD                                                  ; +0xd7, 0x180092157\nnop     dword ptr [rax]                                                ; +0xdd, 0x18009215d\nmov     rdx, [rbx]; struct cocos2d::CCSprite *                         ; +0xe0, 0x180092160\ntest    rdx, rdx                                                       ; +0xe3, 0x180092163\njz      short loc_1800921DD                                            ; +0xe6, 0x180092166\nmov     rcx, rdi; this                                                 ; +0xe8, 0x180092168\ncall    ?removeSpriteFromAtlas@CCSpriteBatchNode@cocos2d@@QEAAXPEAVCCSprite@2@@Z; cocos2d::CCSpriteBatchNode::removeSpriteFromAtlas(cocos2d::CCSprite *) ; +0xeb, 0x18009216b\nadd     rbx, 8                                                         ; +0xf0, 0x180092170\ncmp     rbx, rsi                                                       ; +0xf4, 0x180092174\njbe     short loc_180092160                                            ; +0xf7, 0x180092177\nmov     rbx, [rsp+28h+arg_8]                                           ; +0xf9, 0x180092179\nmov     rsi, [rsp+28h+arg_10]                                          ; +0xfe, 0x18009217e\nadd     rsp, 20h                                                       ; +0x103, 0x180092183\npop     rdi                                                            ; +0x107, 0x180092187\nretn                                                                   ; +0x108, 0x180092188\nmov     rax, [rdx]                                                     ; +0x109, 0x180092189\nmov     rcx, rbx                                                       ; +0x10c, 0x18009218c\ncall    qword ptr [rax+1E0h]                                           ; +0x10f, 0x18009218f\nmov     rbx, rax                                                       ; +0x115, 0x180092195\ntest    rax, rax                                                       ; +0x118, 0x180092198\njz      short loc_1800921DD                                            ; +0x11b, 0x18009219b\nmov     rcx, rax; this                                                 ; +0x11d, 0x18009219d\ncall    ?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x120, 0x1800921a0\ntest    eax, eax                                                       ; +0x125, 0x1800921a5\njz      short loc_1800921DD                                            ; +0x127, 0x1800921a7\nmov     rbx, [rbx+38h]                                                 ; +0x129, 0x1800921a9\nmov     eax, [rbx]                                                     ; +0x12d, 0x1800921ad\ntest    eax, eax                                                       ; +0x12f, 0x1800921af\njz      short loc_1800921DD                                            ; +0x131, 0x1800921b1\nmov     rbx, [rbx+10h]                                                 ; +0x133, 0x1800921b3\nlea     rsi, [rax-1]                                                   ; +0x137, 0x1800921b7\nlea     rsi, [rbx+rsi*8]                                               ; +0x13b, 0x1800921bb\ncmp     rbx, rsi                                                       ; +0x13f, 0x1800921bf\nja      short loc_1800921DD                                            ; +0x142, 0x1800921c2\nmov     rdx, [rbx]; struct cocos2d::CCSprite *                         ; +0x144, 0x1800921c4\ntest    rdx, rdx                                                       ; +0x147, 0x1800921c7\njz      short loc_1800921DD                                            ; +0x14a, 0x1800921ca\nmov     rcx, rdi; this                                                 ; +0x14c, 0x1800921cc\ncall    ?removeSpriteFromAtlas@CCSpriteBatchNode@cocos2d@@QEAAXPEAVCCSprite@2@@Z; cocos2d::CCSpriteBatchNode::removeSpriteFromAtlas(cocos2d::CCSprite *) ; +0x14f, 0x1800921cf\nadd     rbx, 8                                                         ; +0x154, 0x1800921d4\ncmp     rbx, rsi                                                       ; +0x158, 0x1800921d8\njbe     short loc_1800921C4                                            ; +0x15b, 0x1800921db\nmov     rbx, [rsp+28h+arg_8]                                           ; +0x15d, 0x1800921dd\nmov     rsi, [rsp+28h+arg_10]                                          ; +0x162, 0x1800921e2\nadd     rsp, 20h                                                       ; +0x167, 0x1800921e7\npop     rdi                                                            ; +0x16b, 0x1800921eb\nretn                                                                   ; +0x16c, 0x1800921ec", "xrefs": ["cocos2d::CCSprite::removeAllChildrenWithCleanup @ 0x18008f268", "cocos2d::CCSprite::removeChild @ 0x18008f2d5", "cocos2d::CCSpriteBatchNode::removeChild @ 0x18009204e", "cocos2d::CCSpriteBatchNode::removeSpriteFromAtlas @ 0x18009216b", "cocos2d::CCSpriteBatchNode::removeSpriteFromAtlas @ 0x1800921cf", "<???> @ 0x180146a9c", "<???> @ 0x180146aac", "<???> @ 0x18014cf68", "<???> @ 0x1801c0390"], "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"}