{"type": "func", "start": 6443047392, "end": 6443048052, "name": "cocos2d::CCSpriteBatchNode::insertChild", "pseudocode": "// \n// cocos2d::CCSpriteBatchNode::insertChild from 0x1800919e0 to 0x180091c74 (660 bytes)\n// \n// 4 xrefs:\n// > cocos2d::CCSpriteBatchNode::insertChild @ 0x180091b9c\n// > cocos2d::CCSpriteBatchNode::insertChild @ 0x180091c48\n// > <???> @ 0x18014cf68\n// > <???> @ 0x1801c02e8\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::insertChild(\n        cocos2d::CCTextureAtlas **this,\n        struct cocos2d::CCSprite *a2,\n        unsigned int a3)\n{\n  __int64 v6; // rax\n  __int64 v7; // rdx\n  __int64 v8; // rdi\n  int v9; // ebx\n  cocos2d::CCTextureAtlas *v10; // rcx\n  __int128 v11; // xmm1\n  __int128 v12; // xmm0\n  __int128 v13; // xmm1\n  __int128 v14; // xmm0\n  __int128 v15; // xmm1\n  __int64 v16; // rbx\n  __int64 j; // r8\n  __int64 v18; // rdx\n  struct cocos2d::CCSprite **v19; // rdi\n  __int64 v20; // rbx\n  unsigned __int64 k; // rsi\n  struct cocos2d::CCSprite *v22; // rbx\n  int v23; // eax\n  unsigned int v24; // eax\n  struct cocos2d::CCSprite **v25; // rdi\n  __int64 v26; // rbx\n  unsigned __int64 i; // rsi\n  struct cocos2d::CCSprite *v28; // rbx\n  int v29; // eax\n  unsigned int v30; // eax\n  _OWORD v31[6]; // [rsp+20h] [rbp-98h] BYREF\n\n  (*(void (__fastcall **)(struct cocos2d::CCSprite *, cocos2d::CCTextureAtlas **))(*(_QWORD *)a2 + 968LL))(a2, this);\n  v6 = *(_QWORD *)a2;\n  LOBYTE(v7) = 1;\n  *((_DWORD *)a2 + 90) = a3;\n  (*(void (__fastcall **)(struct cocos2d::CCSprite *, __int64))(v6 + 1048))(a2, v7);\n  if ( *((_BYTE *)a2 + 559) )\n  {\n    if ( (*(__int64 (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)a2 + 480LL))(a2) )\n    {\n      if ( **(_DWORD **)((*(__int64 (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)a2 + 480LL))(a2) + 56) )\n      {\n        v25 = *(struct cocos2d::CCSprite ***)(*(_QWORD *)((*(__int64 (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)a2 + 480LL))(a2)\n                                                        + 56)\n                                            + 16LL);\n        v26 = *(_QWORD *)(*(_QWORD *)((*(__int64 (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)a2 + 480LL))(a2)\n                                    + 56)\n                        + 16LL);\n        for ( i = v26\n                + 8\n                * (**(unsigned int **)((*(__int64 (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)a2 + 480LL))(a2)\n                                     + 56)\n                 - 1LL); (unsigned __int64)v25 <= i; ++v25 )\n        {\n          v28 = *v25;\n          if ( !*v25 )\n            break;\n          v29 = (*(__int64 (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v28 + 96LL))(*v25);\n          v30 = cocos2d::CCSpriteBatchNode::atlasIndexForChild((cocos2d::CCSpriteBatchNode *)this, v28, v29);\n          cocos2d::CCSpriteBatchNode::insertChild((cocos2d::CCSpriteBatchNode *)this, v28, v30);\n        }\n      }\n    }\n  }\n  else\n  {\n    v8 = (__int64)*(this + 41);\n    v9 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v8 + 72LL))(v8);\n    if ( v9 == (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)v8 + 80LL))(v8) )\n      cocos2d::CCSpriteBatchNode::increaseAtlasCapacity((cocos2d::CCSpriteBatchNode *)this);\n    v10 = *(this + 41);\n    v11 = *(_OWORD *)((char *)a2 + 476);\n    v31[0] = *(_OWORD *)((char *)a2 + 460);\n    v12 = *(_OWORD *)((char *)a2 + 492);\n    v31[1] = v11;\n    v13 = *(_OWORD *)((char *)a2 + 508);\n    v31[2] = v12;\n    v14 = *(_OWORD *)((char *)a2 + 524);\n    v31[3] = v13;\n    v15 = *(_OWORD *)((char *)a2 + 540);\n    v31[4] = v14;\n    v31[5] = v15;\n    cocos2d::CCTextureAtlas::insertQuad(v10, (struct cocos2d::_ccV3F_C4B_T2F_Quad *)v31, a3);\n    v16 = *((_QWORD *)*(this + 43) + 7);\n    sub_1800A1840(v16, a2, a3);\n    for ( j = a3 + 1; (unsigned int)j < *(_DWORD *)v16; ++*(_DWORD *)(v18 + 360) )\n    {\n      v18 = *(_QWORD *)(*(_QWORD *)(v16 + 16) + 8 * j);\n      j = (unsigned int)(j + 1);\n    }\n    if ( (*(__int64 (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)a2 + 480LL))(a2) )\n    {\n      if ( **(_DWORD **)((*(__int64 (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)a2 + 480LL))(a2) + 56) )\n      {\n        v19 = *(struct cocos2d::CCSprite ***)(*(_QWORD *)((*(__int64 (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)a2 + 480LL))(a2)\n                                                        + 56)\n                                            + 16LL);\n        v20 = *(_QWORD *)(*(_QWORD *)((*(__int64 (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)a2 + 480LL))(a2)\n                                    + 56)\n                        + 16LL);\n        for ( k = v20\n                + 8\n                * (**(unsigned int **)((*(__int64 (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)a2 + 480LL))(a2)\n                                     + 56)\n                 - 1LL); (unsigned __int64)v19 <= k; ++v19 )\n        {\n          v22 = *v19;\n          if ( !*v19 )\n            break;\n          v23 = (*(__int64 (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v22 + 96LL))(*v19);\n          v24 = cocos2d::CCSpriteBatchNode::atlasIndexForChild((cocos2d::CCSpriteBatchNode *)this, v22, v23);\n          cocos2d::CCSpriteBatchNode::insertChild((cocos2d::CCSpriteBatchNode *)this, v22, v24);\n        }\n      }\n    }\n  }\n}", "assembly": "; \n; cocos2d::CCSpriteBatchNode::insertChild from 0x1800919e0 to 0x180091c74 (660 bytes)\n; \n; 4 xrefs:\n; > cocos2d::CCSpriteBatchNode::insertChild @ 0x180091b9c\n; > cocos2d::CCSpriteBatchNode::insertChild @ 0x180091c48\n; > <???> @ 0x18014cf68\n; > <???> @ 0x1801c02e8\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; \npush    rbx                                                            ; +0x0, 0x1800919e0\npush    rbp                                                            ; +0x2, 0x1800919e2\npush    rsi                                                            ; +0x3, 0x1800919e3\npush    rdi                                                            ; +0x4, 0x1800919e4\npush    r14                                                            ; +0x5, 0x1800919e5\nsub     rsp, 90h                                                       ; +0x7, 0x1800919e7\nmov     rax, cs:__security_cookie                                      ; +0xe, 0x1800919ee\nxor     rax, rsp                                                       ; +0x15, 0x1800919f5\nmov     [rsp+0B8h+var_38], rax                                         ; +0x18, 0x1800919f8\nmov     rax, [rdx]                                                     ; +0x20, 0x180091a00\nmov     rsi, rdx                                                       ; +0x23, 0x180091a03\nmov     rbp, rcx                                                       ; +0x26, 0x180091a06\nmov     rdx, rcx                                                       ; +0x29, 0x180091a09\nmov     rcx, rsi                                                       ; +0x2c, 0x180091a0c\nmov     r14d, r8d                                                      ; +0x2f, 0x180091a0f\ncall    qword ptr [rax+3C8h]                                           ; +0x32, 0x180091a12\nmov     rax, [rsi]                                                     ; +0x38, 0x180091a18\nmov     dl, 1                                                          ; +0x3b, 0x180091a1b\nmov     rcx, rsi                                                       ; +0x3d, 0x180091a1d\nmov     [rsi+168h], r14d                                               ; +0x40, 0x180091a20\ncall    qword ptr [rax+418h]                                           ; +0x47, 0x180091a27\ncmp     byte ptr [rsi+22Fh], 0                                         ; +0x4d, 0x180091a2d\njnz     loc_180091BAF                                                  ; +0x54, 0x180091a34\nmov     rdi, [rbp+148h]                                                ; +0x5a, 0x180091a3a\nmov     rcx, rdi                                                       ; +0x61, 0x180091a41\nmov     rax, [rdi]                                                     ; +0x64, 0x180091a44\ncall    qword ptr [rax+48h]                                            ; +0x67, 0x180091a47\nmov     rdx, [rdi]                                                     ; +0x6a, 0x180091a4a\nmov     rcx, rdi                                                       ; +0x6d, 0x180091a4d\nmov     ebx, eax                                                       ; +0x70, 0x180091a50\ncall    qword ptr [rdx+50h]                                            ; +0x72, 0x180091a52\ncmp     ebx, eax                                                       ; +0x75, 0x180091a55\njnz     short loc_180091A61                                            ; +0x77, 0x180091a57\nmov     rcx, rbp; this                                                 ; +0x79, 0x180091a59\ncall    ?increaseAtlasCapacity@CCSpriteBatchNode@cocos2d@@QEAAXXZ; cocos2d::CCSpriteBatchNode::increaseAtlasCapacity(void) ; +0x7c, 0x180091a5c\nmovups  xmm0, xmmword ptr [rsi+1CCh]                                   ; +0x81, 0x180091a61\nmov     rcx, [rbp+148h]; this                                          ; +0x88, 0x180091a68\nmov     r8d, r14d; unsigned int                                        ; +0x8f, 0x180091a6f\nmovups  xmm1, xmmword ptr [rsi+1DCh]                                   ; +0x92, 0x180091a72\nlea     rdx, [rsp+0B8h+var_98]; struct cocos2d::_ccV3F_C4B_T2F_Quad *  ; +0x99, 0x180091a79\nmovaps  [rsp+0B8h+var_98], xmm0                                        ; +0x9e, 0x180091a7e\nmovups  xmm0, xmmword ptr [rsi+1ECh]                                   ; +0xa3, 0x180091a83\nmovaps  [rsp+0B8h+var_88], xmm1                                        ; +0xaa, 0x180091a8a\nmovups  xmm1, xmmword ptr [rsi+1FCh]                                   ; +0xaf, 0x180091a8f\nmovaps  [rsp+0B8h+var_78], xmm0                                        ; +0xb6, 0x180091a96\nmovups  xmm0, xmmword ptr [rsi+20Ch]                                   ; +0xbb, 0x180091a9b\nmovaps  [rsp+0B8h+var_68], xmm1                                        ; +0xc2, 0x180091aa2\nmovups  xmm1, xmmword ptr [rsi+21Ch]                                   ; +0xc7, 0x180091aa7\nmovaps  [rsp+0B8h+var_58], xmm0                                        ; +0xce, 0x180091aae\nmovaps  [rsp+0B8h+var_48], xmm1                                        ; +0xd3, 0x180091ab3\ncall    ?insertQuad@CCTextureAtlas@cocos2d@@QEAAXPEAU_ccV3F_C4B_T2F_Quad@2@I@Z; cocos2d::CCTextureAtlas::insertQuad(cocos2d::_ccV3F_C4B_T2F_Quad *,uint) ; +0xd8, 0x180091ab8\nmov     rax, [rbp+158h]                                                ; +0xdd, 0x180091abd\nmov     r8d, r14d                                                      ; +0xe4, 0x180091ac4\nmov     rdx, rsi                                                       ; +0xe7, 0x180091ac7\nmov     rbx, [rax+38h]                                                 ; +0xea, 0x180091aca\nmov     rcx, rbx                                                       ; +0xee, 0x180091ace\ncall    sub_1800A1840                                                  ; +0xf1, 0x180091ad1\nlea     r8d, [r14+1]                                                   ; +0xf6, 0x180091ad6\ncmp     r8d, [rbx]                                                     ; +0xfa, 0x180091ada\njnb     short loc_180091AF6                                            ; +0xfd, 0x180091add\nnop                                                                    ; +0xff, 0x180091adf\nmov     rax, [rbx+10h]                                                 ; +0x100, 0x180091ae0\nmov     rdx, [rax+r8*8]                                                ; +0x104, 0x180091ae4\ninc     r8d                                                            ; +0x108, 0x180091ae8\ninc     dword ptr [rdx+168h]                                           ; +0x10b, 0x180091aeb\ncmp     r8d, [rbx]                                                     ; +0x111, 0x180091af1\njb      short loc_180091AE0                                            ; +0x114, 0x180091af4\nmov     rax, [rsi]                                                     ; +0x116, 0x180091af6\nmov     rcx, rsi                                                       ; +0x119, 0x180091af9\ncall    qword ptr [rax+1E0h]                                           ; +0x11c, 0x180091afc\ntest    rax, rax                                                       ; +0x122, 0x180091b02\njz      loc_180091C56                                                  ; +0x125, 0x180091b05\nmov     rax, [rsi]                                                     ; +0x12b, 0x180091b0b\nmov     rcx, rsi                                                       ; +0x12e, 0x180091b0e\ncall    qword ptr [rax+1E0h]                                           ; +0x131, 0x180091b11\nmov     rcx, [rax+38h]                                                 ; +0x137, 0x180091b17\ncmp     dword ptr [rcx], 0                                             ; +0x13b, 0x180091b1b\njbe     loc_180091C56                                                  ; +0x13e, 0x180091b1e\nmov     rax, [rsi]                                                     ; +0x144, 0x180091b24\nmov     rcx, rsi                                                       ; +0x147, 0x180091b27\ncall    qword ptr [rax+1E0h]                                           ; +0x14a, 0x180091b2a\nmov     rcx, rsi                                                       ; +0x150, 0x180091b30\nmov     rdx, [rax+38h]                                                 ; +0x153, 0x180091b33\nmov     rax, [rsi]                                                     ; +0x157, 0x180091b37\nmov     rdi, [rdx+10h]                                                 ; +0x15a, 0x180091b3a\ncall    qword ptr [rax+1E0h]                                           ; +0x15e, 0x180091b3e\nmov     rcx, rsi                                                       ; +0x164, 0x180091b44\nmov     rdx, [rax+38h]                                                 ; +0x167, 0x180091b47\nmov     rax, [rsi]                                                     ; +0x16b, 0x180091b4b\nmov     rbx, [rdx+10h]                                                 ; +0x16e, 0x180091b4e\ncall    qword ptr [rax+1E0h]                                           ; +0x172, 0x180091b52\nmov     rcx, [rax+38h]                                                 ; +0x178, 0x180091b58\nmov     esi, [rcx]                                                     ; +0x17c, 0x180091b5c\ndec     rsi                                                            ; +0x17e, 0x180091b5e\nlea     rsi, [rbx+rsi*8]                                               ; +0x181, 0x180091b61\ncmp     rdi, rsi                                                       ; +0x185, 0x180091b65\nja      loc_180091C56                                                  ; +0x188, 0x180091b68\nxchg    ax, ax                                                         ; +0x18e, 0x180091b6e\nmov     rbx, [rdi]                                                     ; +0x190, 0x180091b70\ntest    rbx, rbx                                                       ; +0x193, 0x180091b73\njz      loc_180091C56                                                  ; +0x196, 0x180091b76\nmov     rax, [rbx]                                                     ; +0x19c, 0x180091b7c\nmov     rcx, rbx                                                       ; +0x19f, 0x180091b7f\ncall    qword ptr [rax+60h]                                            ; +0x1a2, 0x180091b82\nmov     rdx, rbx; struct cocos2d::CCSprite *                           ; +0x1a5, 0x180091b85\nmov     rcx, rbp; this                                                 ; +0x1a8, 0x180091b88\nmov     r8d, eax; int                                                  ; +0x1ab, 0x180091b8b\ncall    ?atlasIndexForChild@CCSpriteBatchNode@cocos2d@@QEAAIPEAVCCSprite@2@H@Z; cocos2d::CCSpriteBatchNode::atlasIndexForChild(cocos2d::CCSprite *,int) ; +0x1ae, 0x180091b8e\nmov     r8d, eax; unsigned int                                         ; +0x1b3, 0x180091b93\nmov     rdx, rbx; struct cocos2d::CCSprite *                           ; +0x1b6, 0x180091b96\nmov     rcx, rbp; this                                                 ; +0x1b9, 0x180091b99\ncall    ?insertChild@CCSpriteBatchNode@cocos2d@@QEAAXPEAVCCSprite@2@I@Z; cocos2d::CCSpriteBatchNode::insertChild(cocos2d::CCSprite *,uint) ; +0x1bc, 0x180091b9c\nadd     rdi, 8                                                         ; +0x1c1, 0x180091ba1\ncmp     rdi, rsi                                                       ; +0x1c5, 0x180091ba5\njbe     short loc_180091B70                                            ; +0x1c8, 0x180091ba8\njmp     loc_180091C56                                                  ; +0x1ca, 0x180091baa\nmov     rax, [rsi]                                                     ; +0x1cf, 0x180091baf\nmov     rcx, rsi                                                       ; +0x1d2, 0x180091bb2\ncall    qword ptr [rax+1E0h]                                           ; +0x1d5, 0x180091bb5\ntest    rax, rax                                                       ; +0x1db, 0x180091bbb\njz      loc_180091C56                                                  ; +0x1de, 0x180091bbe\nmov     rax, [rsi]                                                     ; +0x1e4, 0x180091bc4\nmov     rcx, rsi                                                       ; +0x1e7, 0x180091bc7\ncall    qword ptr [rax+1E0h]                                           ; +0x1ea, 0x180091bca\nmov     rcx, [rax+38h]                                                 ; +0x1f0, 0x180091bd0\ncmp     dword ptr [rcx], 0                                             ; +0x1f4, 0x180091bd4\njbe     short loc_180091C56                                            ; +0x1f7, 0x180091bd7\nmov     rax, [rsi]                                                     ; +0x1f9, 0x180091bd9\nmov     rcx, rsi                                                       ; +0x1fc, 0x180091bdc\ncall    qword ptr [rax+1E0h]                                           ; +0x1ff, 0x180091bdf\nmov     rcx, [rax+38h]                                                 ; +0x205, 0x180091be5\nmov     rax, [rsi]                                                     ; +0x209, 0x180091be9\nmov     rdi, [rcx+10h]                                                 ; +0x20c, 0x180091bec\nmov     rcx, rsi                                                       ; +0x210, 0x180091bf0\ncall    qword ptr [rax+1E0h]                                           ; +0x213, 0x180091bf3\nmov     rcx, [rax+38h]                                                 ; +0x219, 0x180091bf9\nmov     rax, [rsi]                                                     ; +0x21d, 0x180091bfd\nmov     rbx, [rcx+10h]                                                 ; +0x220, 0x180091c00\nmov     rcx, rsi                                                       ; +0x224, 0x180091c04\ncall    qword ptr [rax+1E0h]                                           ; +0x227, 0x180091c07\nmov     rcx, [rax+38h]                                                 ; +0x22d, 0x180091c0d\nmov     esi, [rcx]                                                     ; +0x231, 0x180091c11\ndec     rsi                                                            ; +0x233, 0x180091c13\nlea     rsi, [rbx+rsi*8]                                               ; +0x236, 0x180091c16\ncmp     rdi, rsi                                                       ; +0x23a, 0x180091c1a\nja      short loc_180091C56                                            ; +0x23d, 0x180091c1d\nnop                                                                    ; +0x23f, 0x180091c1f\nmov     rbx, [rdi]                                                     ; +0x240, 0x180091c20\ntest    rbx, rbx                                                       ; +0x243, 0x180091c23\njz      short loc_180091C56                                            ; +0x246, 0x180091c26\nmov     rax, [rbx]                                                     ; +0x248, 0x180091c28\nmov     rcx, rbx                                                       ; +0x24b, 0x180091c2b\ncall    qword ptr [rax+60h]                                            ; +0x24e, 0x180091c2e\nmov     rdx, rbx; struct cocos2d::CCSprite *                           ; +0x251, 0x180091c31\nmov     rcx, rbp; this                                                 ; +0x254, 0x180091c34\nmov     r8d, eax; int                                                  ; +0x257, 0x180091c37\ncall    ?atlasIndexForChild@CCSpriteBatchNode@cocos2d@@QEAAIPEAVCCSprite@2@H@Z; cocos2d::CCSpriteBatchNode::atlasIndexForChild(cocos2d::CCSprite *,int) ; +0x25a, 0x180091c3a\nmov     r8d, eax; unsigned int                                         ; +0x25f, 0x180091c3f\nmov     rdx, rbx; struct cocos2d::CCSprite *                           ; +0x262, 0x180091c42\nmov     rcx, rbp; this                                                 ; +0x265, 0x180091c45\ncall    ?insertChild@CCSpriteBatchNode@cocos2d@@QEAAXPEAVCCSprite@2@I@Z; cocos2d::CCSpriteBatchNode::insertChild(cocos2d::CCSprite *,uint) ; +0x268, 0x180091c48\nadd     rdi, 8                                                         ; +0x26d, 0x180091c4d\ncmp     rdi, rsi                                                       ; +0x271, 0x180091c51\njbe     short loc_180091C20                                            ; +0x274, 0x180091c54\nmov     rcx, [rsp+0B8h+var_38]                                         ; +0x276, 0x180091c56\nxor     rcx, rsp; StackCookie                                          ; +0x27e, 0x180091c5e\ncall    __security_check_cookie                                        ; +0x281, 0x180091c61\nadd     rsp, 90h                                                       ; +0x286, 0x180091c66\npop     r14                                                            ; +0x28d, 0x180091c6d\npop     rdi                                                            ; +0x28f, 0x180091c6f\npop     rsi                                                            ; +0x290, 0x180091c70\npop     rbp                                                            ; +0x291, 0x180091c71\npop     rbx                                                            ; +0x292, 0x180091c72\nretn                                                                   ; +0x293, 0x180091c73", "xrefs": ["cocos2d::CCSpriteBatchNode::insertChild @ 0x180091b9c", "cocos2d::CCSpriteBatchNode::insertChild @ 0x180091c48", "<???> @ 0x18014cf68", "<???> @ 0x1801c02e8"], "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"}