{"type": "func", "start": 6443097008, "end": 6443097232, "name": "sub_18009DBB0", "pseudocode": "// \n// sub_18009DBB0 from 0x18009dbb0 to 0x18009dc90 (224 bytes)\n// \n// 2 xrefs:\n// > cocos2d::CCSpriteBatchNode::insertChild @ 0x18008e8a1\n// > <???> @ 0x1801b7488\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\n__int64 __fastcall sub_18009DBB0(unsigned int *a1, cocos2d::CCObject *a2, unsigned int a3)\n{\n  unsigned int v3; // r9d\n  __int64 v5; // rsi\n  unsigned int v7; // r8d\n  void *v8; // rcx\n  char *v9; // rax\n  char *v10; // r10\n  unsigned int v11; // r9d\n  unsigned int v12; // eax\n  __int64 v13; // r8\n  __int64 result; // rax\n\n  v3 = *a1;\n  v5 = a3;\n  v7 = a1[1];\n  if ( v7 >= *a1 + 1 )\n  {\n    v10 = *((char **)a1 + 2);\n  }\n  else\n  {\n    do\n    {\n      v8 = *((void **)a1 + 2);\n      a1[1] = 2 * v7;\n      v9 = (char *)realloc(v8, 16LL * v7);\n      *((_QWORD *)a1 + 2) = v9;\n      v10 = v9;\n      v3 = *a1;\n      v7 = a1[1];\n    }\n    while ( v7 < *a1 + 1 );\n  }\n  v11 = v3 - v5;\n  if ( v11 )\n  {\n    memmove(&v10[8 * (unsigned int)(v5 + 1)], &v10[8 * v5], 8LL * v11);\n    v12 = v5;\n    if ( (unsigned int)v5 < *a1 )\n    {\n      v13 = 8LL * (int)v5;\n      do\n      {\n        v13 += 8;\n        *(_DWORD *)(*(_QWORD *)(*((_QWORD *)a1 + 2) + v13 - 8) + 40LL) = v12++;\n      }\n      while ( v12 < *a1 );\n    }\n  }\n  cocos2d::CCObject::retain(a2);\n  result = *((_QWORD *)a1 + 2);\n  *(_QWORD *)(result + 8 * v5) = a2;\n  a2->m_unknown2 = v5;\n  ++*a1;\n  return result;\n}", "assembly": "; \n; sub_18009DBB0 from 0x18009dbb0 to 0x18009dc90 (224 bytes)\n; \n; 2 xrefs:\n; > cocos2d::CCSpriteBatchNode::insertChild @ 0x18008e8a1\n; > <???> @ 0x1801b7488\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\nmov     [rsp+arg_0], rbx                                               ; +0x0, 0x18009dbb0\nmov     [rsp+arg_8], rbp                                               ; +0x5, 0x18009dbb5\nmov     [rsp+arg_10], rsi                                              ; +0xa, 0x18009dbba\npush    rdi                                                            ; +0xf, 0x18009dbbf\nsub     rsp, 20h                                                       ; +0x10, 0x18009dbc0\nmov     r9d, [rcx]                                                     ; +0x14, 0x18009dbc4\nmov     rbp, rdx                                                       ; +0x17, 0x18009dbc7\nmov     esi, r8d                                                       ; +0x1a, 0x18009dbca\nmov     rbx, rcx                                                       ; +0x1d, 0x18009dbcd\nmov     r8d, [rcx+4]                                                   ; +0x20, 0x18009dbd0\nlea     eax, [r9+1]                                                    ; +0x24, 0x18009dbd4\ncmp     r8d, eax                                                       ; +0x28, 0x18009dbd8\njnb     short loc_18009DC10                                            ; +0x2b, 0x18009dbdb\nnop     dword ptr [rax]                                                ; +0x2d, 0x18009dbdd\nmov     rcx, [rbx+10h]; Block                                          ; +0x30, 0x18009dbe0\nlea     eax, [r8+r8]                                                   ; +0x34, 0x18009dbe4\nmov     edx, eax                                                       ; +0x38, 0x18009dbe8\nshl     rdx, 3; Size                                                   ; +0x3a, 0x18009dbea\nmov     [rbx+4], eax                                                   ; +0x3e, 0x18009dbee\ncall    cs:realloc                                                     ; +0x41, 0x18009dbf1\nmov     [rbx+10h], rax                                                 ; +0x47, 0x18009dbf7\nmov     r10, rax                                                       ; +0x4b, 0x18009dbfb\nmov     r9d, [rbx]                                                     ; +0x4e, 0x18009dbfe\nmov     r8d, [rbx+4]                                                   ; +0x51, 0x18009dc01\nlea     ecx, [r9+1]                                                    ; +0x55, 0x18009dc05\ncmp     r8d, ecx                                                       ; +0x59, 0x18009dc09\njb      short loc_18009DBE0                                            ; +0x5c, 0x18009dc0c\njmp     short loc_18009DC14                                            ; +0x5e, 0x18009dc0e\nmov     r10, [rcx+10h]                                                 ; +0x60, 0x18009dc10\nsub     r9d, esi                                                       ; +0x64, 0x18009dc14\njz      short loc_18009DC66                                            ; +0x67, 0x18009dc17\nmov     r8d, r9d                                                       ; +0x69, 0x18009dc19\nlea     eax, [rsi+1]                                                   ; +0x6c, 0x18009dc1c\nshl     r8, 3; Size                                                    ; +0x6f, 0x18009dc1f\nlea     rcx, [r10+rax*8]; void *                                       ; +0x73, 0x18009dc23\nlea     rdx, [r10+rsi*8]; Src                                          ; +0x77, 0x18009dc27\ncall    memmove                                                        ; +0x7b, 0x18009dc2b\nmov     eax, esi                                                       ; +0x80, 0x18009dc30\ncmp     esi, [rbx]                                                     ; +0x82, 0x18009dc32\njnb     short loc_18009DC66                                            ; +0x84, 0x18009dc34\nmovsxd  rcx, esi                                                       ; +0x86, 0x18009dc36\nlea     r8, ds:0[rcx*8]                                                ; +0x89, 0x18009dc39\nnop     dword ptr [rax+00h]                                            ; +0x91, 0x18009dc41\nnop     word ptr [rax+rax+00000000h]                                   ; +0x95, 0x18009dc45\nmov     rcx, [rbx+10h]                                                 ; +0xa0, 0x18009dc50\nlea     r8, [r8+8]                                                     ; +0xa4, 0x18009dc54\nmov     rdx, [rcx+r8-8]                                                ; +0xa8, 0x18009dc58\nmov     [rdx+28h], eax                                                 ; +0xad, 0x18009dc5d\ninc     eax                                                            ; +0xb0, 0x18009dc60\ncmp     eax, [rbx]                                                     ; +0xb2, 0x18009dc62\njb      short loc_18009DC50                                            ; +0xb4, 0x18009dc64\nmov     rcx, rbp; this                                                 ; +0xb6, 0x18009dc66\ncall    ?retain@CCObject@cocos2d@@QEAAXXZ; cocos2d::CCObject::retain(void) ; +0xb9, 0x18009dc69\nmov     rax, [rbx+10h]                                                 ; +0xbe, 0x18009dc6e\nmov     [rax+rsi*8], rbp                                               ; +0xc2, 0x18009dc72\nmov     [rbp+28h], esi                                                 ; +0xc6, 0x18009dc76\ninc     dword ptr [rbx]                                                ; +0xc9, 0x18009dc79\nmov     rbx, [rsp+28h+arg_0]                                           ; +0xcb, 0x18009dc7b\nmov     rbp, [rsp+28h+arg_8]                                           ; +0xd0, 0x18009dc80\nmov     rsi, [rsp+28h+arg_10]                                          ; +0xd5, 0x18009dc85\nadd     rsp, 20h                                                       ; +0xda, 0x18009dc8a\npop     rdi                                                            ; +0xde, 0x18009dc8e\nretn                                                                   ; +0xdf, 0x18009dc8f", "xrefs": ["cocos2d::CCSpriteBatchNode::insertChild @ 0x18008e8a1", "<???> @ 0x1801b7488"], "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"}