{"type": "func", "start": 6443045664, "end": 6443046001, "name": "cocos2d::CCSpriteBatchNode::atlasIndexForChild", "pseudocode": "// \n// cocos2d::CCSpriteBatchNode::atlasIndexForChild from 0x180091320 to 0x180091471 (337 bytes)\n// \n// 4 xrefs:\n// > cocos2d::CCSpriteBatchNode::insertChild @ 0x180091b8e\n// > cocos2d::CCSpriteBatchNode::insertChild @ 0x180091c3a\n// > <???> @ 0x18014cf68\n// > <???> @ 0x1801c0240\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\n__int64 __fastcall cocos2d::CCSpriteBatchNode::atlasIndexForChild(\n        cocos2d::CCSpriteBatchNode *this,\n        struct cocos2d::CCSprite *a2,\n        int a3)\n{\n  __int64 v6; // rax\n  cocos2d::CCArray *v7; // r15\n  int v8; // r14d\n  struct cocos2d::CCString *v9; // rbx\n  cocos2d::CCSpriteBatchNode *v10; // r12\n  __int64 result; // rax\n  unsigned int v12; // eax\n  unsigned int v13; // ecx\n  cocos2d::CCArray *v14; // rax\n  cocos2d::CCArray *v15; // rdi\n  struct cocos2d::CCSprite *Object; // rax\n\n  v6 = (*(__int64 (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)a2 + 504LL))(a2);\n  v7 = (cocos2d::CCArray *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v6 + 480LL))(v6);\n  v8 = cocos2d::CCArray::indexOfObject(v7, a2);\n  v9 = nullptr;\n  v10 = (cocos2d::CCSpriteBatchNode *)(*(__int64 (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)a2 + 504LL))(a2);\n  if ( (unsigned int)(v8 - 1) <= 0xFFFFFFFD )\n    v9 = cocos2d::CCArray::stringAtIndex(v7, v8 - 1);\n  if ( v10 == this )\n  {\n    if ( !v8 )\n      return 0;\n    v12 = cocos2d::CCSpriteBatchNode::highestAtlasIndexInChild(this, v9);\n    return v12 + 1;\n  }\n  if ( v8 )\n  {\n    if ( ((*(int (__fastcall **)(struct cocos2d::CCString *))(*(_QWORD *)v9 + 96LL))(v9) >= 0 || a3 >= 0)\n      && ((*(int (__fastcall **)(struct cocos2d::CCString *))(*(_QWORD *)v9 + 96LL))(v9) < 0 || a3 < 0) )\n    {\n      v12 = *(_DWORD *)((*(__int64 (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)a2 + 504LL))(a2) + 360);\n      return v12 + 1;\n    }\n    v14 = (cocos2d::CCArray *)(*(__int64 (__fastcall **)(struct cocos2d::CCString *))(*(_QWORD *)v9 + 480LL))(v9);\n    v15 = v14;\n    if ( v14 && (unsigned int)cocos2d::CCArray::count(v14) )\n    {\n      Object = cocos2d::CCArray::lastObject(v15);\n      return cocos2d::CCSpriteBatchNode::highestAtlasIndexInChild(this, Object) + 1;\n    }\n    else\n    {\n      return (unsigned int)(*((_DWORD *)v9 + 90) + 1);\n    }\n  }\n  else\n  {\n    v13 = *(_DWORD *)((*(__int64 (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)a2 + 504LL))(a2) + 360);\n    result = v13 + 1;\n    if ( a3 < 0 )\n      return v13;\n  }\n  return result;\n}", "assembly": "; \n; cocos2d::CCSpriteBatchNode::atlasIndexForChild from 0x180091320 to 0x180091471 (337 bytes)\n; \n; 4 xrefs:\n; > cocos2d::CCSpriteBatchNode::insertChild @ 0x180091b8e\n; > cocos2d::CCSpriteBatchNode::insertChild @ 0x180091c3a\n; > <???> @ 0x18014cf68\n; > <???> @ 0x1801c0240\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_0], rbx                                               ; +0x0, 0x180091320\nmov     [rsp+arg_8], rbp                                               ; +0x5, 0x180091325\nmov     [rsp+arg_10], rsi                                              ; +0xa, 0x18009132a\nmov     [rsp+arg_18], rdi                                              ; +0xf, 0x18009132f\npush    r12                                                            ; +0x14, 0x180091334\npush    r14                                                            ; +0x16, 0x180091336\npush    r15                                                            ; +0x18, 0x180091338\nsub     rsp, 20h                                                       ; +0x1a, 0x18009133a\nmov     rax, [rdx]                                                     ; +0x1e, 0x18009133e\nmov     rbp, rcx                                                       ; +0x21, 0x180091341\nmov     rcx, rdx                                                       ; +0x24, 0x180091344\nmov     esi, r8d                                                       ; +0x27, 0x180091347\nmov     rdi, rdx                                                       ; +0x2a, 0x18009134a\ncall    qword ptr [rax+1F8h]                                           ; +0x2d, 0x18009134d\nmov     rcx, rax                                                       ; +0x33, 0x180091353\nmov     r9, [rax]                                                      ; +0x36, 0x180091356\ncall    qword ptr [r9+1E0h]                                            ; +0x39, 0x180091359\nmov     rcx, rax; this                                                 ; +0x40, 0x180091360\nmov     rdx, rdi; struct cocos2d::CCObject *                           ; +0x43, 0x180091363\nmov     r15, rax                                                       ; +0x46, 0x180091366\ncall    ?indexOfObject@CCArray@cocos2d@@QEBAIPEAVCCObject@2@@Z; cocos2d::CCArray::indexOfObject(cocos2d::CCObject *) ; +0x49, 0x180091369\nmov     rcx, [rdi]                                                     ; +0x4e, 0x18009136e\nmov     r14d, eax                                                      ; +0x51, 0x180091371\nmov     rdx, [rcx+1F8h]                                                ; +0x54, 0x180091374\nmov     rcx, rdi                                                       ; +0x5b, 0x18009137b\ncall    rdx                                                            ; +0x5e, 0x18009137e\nlea     edx, [r14-1]; unsigned int                                     ; +0x60, 0x180091380\nxor     ebx, ebx                                                       ; +0x64, 0x180091384\nmov     r12, rax                                                       ; +0x66, 0x180091386\ncmp     edx, 0FFFFFFFDh                                                ; +0x69, 0x180091389\nja      short loc_180091399                                            ; +0x6c, 0x18009138c\nmov     rcx, r15; this                                                 ; +0x6e, 0x18009138e\ncall    ?stringAtIndex@CCArray@cocos2d@@QEAAPEAVCCString@2@I@Z; cocos2d::CCArray::stringAtIndex(uint) ; +0x71, 0x180091391\nmov     rbx, rax                                                       ; +0x76, 0x180091396\ncmp     r12, rbp                                                       ; +0x79, 0x180091399\njnz     short loc_1800913BA                                            ; +0x7c, 0x18009139c\ntest    r14d, r14d                                                     ; +0x7e, 0x18009139e\njnz     short loc_1800913AA                                            ; +0x81, 0x1800913a1\nxor     eax, eax                                                       ; +0x83, 0x1800913a3\njmp     loc_180091452                                                  ; +0x85, 0x1800913a5\nmov     rdx, rbx; struct cocos2d::CCSprite *                           ; +0x8a, 0x1800913aa\nmov     rcx, rbp; this                                                 ; +0x8d, 0x1800913ad\ncall    ?highestAtlasIndexInChild@CCSpriteBatchNode@cocos2d@@QEAAIPEAVCCSprite@2@@Z; cocos2d::CCSpriteBatchNode::highestAtlasIndexInChild(cocos2d::CCSprite *) ; +0x90, 0x1800913b0\njmp     loc_180091450                                                  ; +0x95, 0x1800913b5\ntest    r14d, r14d                                                     ; +0x9a, 0x1800913ba\njnz     short loc_1800913DB                                            ; +0x9d, 0x1800913bd\nmov     rax, [rdi]                                                     ; +0x9f, 0x1800913bf\nmov     rcx, rdi                                                       ; +0xa2, 0x1800913c2\ncall    qword ptr [rax+1F8h]                                           ; +0xa5, 0x1800913c5\ntest    esi, esi                                                       ; +0xab, 0x1800913cb\nmov     ecx, [rax+168h]                                                ; +0xad, 0x1800913cd\nlea     eax, [rcx+1]                                                   ; +0xb3, 0x1800913d3\ncmovs   eax, ecx                                                       ; +0xb6, 0x1800913d6\njmp     short loc_180091452                                            ; +0xb9, 0x1800913d9\nmov     rax, [rbx]                                                     ; +0xbb, 0x1800913db\nmov     rcx, rbx                                                       ; +0xbe, 0x1800913de\ncall    qword ptr [rax+60h]                                            ; +0xc1, 0x1800913e1\ntest    eax, eax                                                       ; +0xc4, 0x1800913e4\njns     short loc_1800913EC                                            ; +0xc6, 0x1800913e6\ntest    esi, esi                                                       ; +0xc8, 0x1800913e8\njs      short loc_1800913FD                                            ; +0xca, 0x1800913ea\nmov     rax, [rbx]                                                     ; +0xcc, 0x1800913ec\nmov     rcx, rbx                                                       ; +0xcf, 0x1800913ef\ncall    qword ptr [rax+60h]                                            ; +0xd2, 0x1800913f2\ntest    eax, eax                                                       ; +0xd5, 0x1800913f5\njs      short loc_18009143E                                            ; +0xd7, 0x1800913f7\ntest    esi, esi                                                       ; +0xd9, 0x1800913f9\njs      short loc_18009143E                                            ; +0xdb, 0x1800913fb\nmov     rax, [rbx]                                                     ; +0xdd, 0x1800913fd\nmov     rcx, rbx                                                       ; +0xe0, 0x180091400\ncall    qword ptr [rax+1E0h]                                           ; +0xe3, 0x180091403\nmov     rdi, rax                                                       ; +0xe9, 0x180091409\ntest    rax, rax                                                       ; +0xec, 0x18009140c\njz      short loc_180091434                                            ; +0xef, 0x18009140f\nmov     rcx, rax; this                                                 ; +0xf1, 0x180091411\ncall    ?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0xf4, 0x180091414\ntest    eax, eax                                                       ; +0xf9, 0x180091419\njz      short loc_180091434                                            ; +0xfb, 0x18009141b\nmov     rcx, rdi; this                                                 ; +0xfd, 0x18009141d\ncall    ?lastObject@CCArray@cocos2d@@QEAAPEAVCCObject@2@XZ; cocos2d::CCArray::lastObject(void) ; +0x100, 0x180091420\nmov     rdx, rax; struct cocos2d::CCSprite *                           ; +0x105, 0x180091425\nmov     rcx, rbp; this                                                 ; +0x108, 0x180091428\ncall    ?highestAtlasIndexInChild@CCSpriteBatchNode@cocos2d@@QEAAIPEAVCCSprite@2@@Z; cocos2d::CCSpriteBatchNode::highestAtlasIndexInChild(cocos2d::CCSprite *) ; +0x10b, 0x18009142b\ninc     eax                                                            ; +0x110, 0x180091430\njmp     short loc_180091452                                            ; +0x112, 0x180091432\nmov     eax, [rbx+168h]                                                ; +0x114, 0x180091434\ninc     eax                                                            ; +0x11a, 0x18009143a\njmp     short loc_180091452                                            ; +0x11c, 0x18009143c\nmov     rax, [rdi]                                                     ; +0x11e, 0x18009143e\nmov     rcx, rdi                                                       ; +0x121, 0x180091441\ncall    qword ptr [rax+1F8h]                                           ; +0x124, 0x180091444\nmov     eax, [rax+168h]                                                ; +0x12a, 0x18009144a\ninc     eax                                                            ; +0x130, 0x180091450\nmov     rbx, [rsp+38h+arg_0]                                           ; +0x132, 0x180091452\nmov     rbp, [rsp+38h+arg_8]                                           ; +0x137, 0x180091457\nmov     rsi, [rsp+38h+arg_10]                                          ; +0x13c, 0x18009145c\nmov     rdi, [rsp+38h+arg_18]                                          ; +0x141, 0x180091461\nadd     rsp, 20h                                                       ; +0x146, 0x180091466\npop     r15                                                            ; +0x14a, 0x18009146a\npop     r14                                                            ; +0x14c, 0x18009146c\npop     r12                                                            ; +0x14e, 0x18009146e\nretn                                                                   ; +0x150, 0x180091470", "xrefs": ["cocos2d::CCSpriteBatchNode::insertChild @ 0x180091b8e", "cocos2d::CCSpriteBatchNode::insertChild @ 0x180091c3a", "<???> @ 0x18014cf68", "<???> @ 0x1801c0240"], "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"}