{"type": "func", "start": 6443112512, "end": 6443112736, "name": "sub_1800A1840", "pseudocode": "// \n// sub_1800A1840 from 0x1800a1840 to 0x1800a1920 (224 bytes)\n// \n// 2 xrefs:\n// > cocos2d::CCSpriteBatchNode::insertChild @ 0x180091ad1\n// > <???> @ 0x1801c1728\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:13 +0000\n// \n\n__int64 __fastcall sub_1800A1840(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  *((_DWORD *)a2 + 10) = v5;\n  ++*a1;\n  return result;\n}", "assembly": "; \n; sub_1800A1840 from 0x1800a1840 to 0x1800a1920 (224 bytes)\n; \n; 2 xrefs:\n; > cocos2d::CCSpriteBatchNode::insertChild @ 0x180091ad1\n; > <???> @ 0x1801c1728\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:13 +0000\n; \nmov     [rsp+arg_0], rbx                                               ; +0x0, 0x1800a1840\nmov     [rsp+arg_8], rbp                                               ; +0x5, 0x1800a1845\nmov     [rsp+arg_10], rsi                                              ; +0xa, 0x1800a184a\npush    rdi                                                            ; +0xf, 0x1800a184f\nsub     rsp, 20h                                                       ; +0x10, 0x1800a1850\nmov     r9d, [rcx]                                                     ; +0x14, 0x1800a1854\nmov     rbp, rdx                                                       ; +0x17, 0x1800a1857\nmov     esi, r8d                                                       ; +0x1a, 0x1800a185a\nmov     rbx, rcx                                                       ; +0x1d, 0x1800a185d\nmov     r8d, [rcx+4]                                                   ; +0x20, 0x1800a1860\nlea     eax, [r9+1]                                                    ; +0x24, 0x1800a1864\ncmp     r8d, eax                                                       ; +0x28, 0x1800a1868\njnb     short loc_1800A18A0                                            ; +0x2b, 0x1800a186b\nnop     dword ptr [rax]                                                ; +0x2d, 0x1800a186d\nmov     rcx, [rbx+10h]; Block                                          ; +0x30, 0x1800a1870\nlea     eax, [r8+r8]                                                   ; +0x34, 0x1800a1874\nmov     edx, eax                                                       ; +0x38, 0x1800a1878\nshl     rdx, 3; Size                                                   ; +0x3a, 0x1800a187a\nmov     [rbx+4], eax                                                   ; +0x3e, 0x1800a187e\ncall    cs:realloc                                                     ; +0x41, 0x1800a1881\nmov     [rbx+10h], rax                                                 ; +0x47, 0x1800a1887\nmov     r10, rax                                                       ; +0x4b, 0x1800a188b\nmov     r9d, [rbx]                                                     ; +0x4e, 0x1800a188e\nmov     r8d, [rbx+4]                                                   ; +0x51, 0x1800a1891\nlea     ecx, [r9+1]                                                    ; +0x55, 0x1800a1895\ncmp     r8d, ecx                                                       ; +0x59, 0x1800a1899\njb      short loc_1800A1870                                            ; +0x5c, 0x1800a189c\njmp     short loc_1800A18A4                                            ; +0x5e, 0x1800a189e\nmov     r10, [rcx+10h]                                                 ; +0x60, 0x1800a18a0\nsub     r9d, esi                                                       ; +0x64, 0x1800a18a4\njz      short loc_1800A18F6                                            ; +0x67, 0x1800a18a7\nmov     r8d, r9d                                                       ; +0x69, 0x1800a18a9\nlea     eax, [rsi+1]                                                   ; +0x6c, 0x1800a18ac\nshl     r8, 3; Size                                                    ; +0x6f, 0x1800a18af\nlea     rcx, [r10+rax*8]; void *                                       ; +0x73, 0x1800a18b3\nlea     rdx, [r10+rsi*8]; Src                                          ; +0x77, 0x1800a18b7\ncall    memmove                                                        ; +0x7b, 0x1800a18bb\nmov     eax, esi                                                       ; +0x80, 0x1800a18c0\ncmp     esi, [rbx]                                                     ; +0x82, 0x1800a18c2\njnb     short loc_1800A18F6                                            ; +0x84, 0x1800a18c4\nmovsxd  rcx, esi                                                       ; +0x86, 0x1800a18c6\nlea     r8, ds:0[rcx*8]                                                ; +0x89, 0x1800a18c9\nnop     dword ptr [rax+00h]                                            ; +0x91, 0x1800a18d1\nnop     word ptr [rax+rax+00000000h]                                   ; +0x95, 0x1800a18d5\nmov     rcx, [rbx+10h]                                                 ; +0xa0, 0x1800a18e0\nlea     r8, [r8+8]                                                     ; +0xa4, 0x1800a18e4\nmov     rdx, [rcx+r8-8]                                                ; +0xa8, 0x1800a18e8\nmov     [rdx+28h], eax                                                 ; +0xad, 0x1800a18ed\ninc     eax                                                            ; +0xb0, 0x1800a18f0\ncmp     eax, [rbx]                                                     ; +0xb2, 0x1800a18f2\njb      short loc_1800A18E0                                            ; +0xb4, 0x1800a18f4\nmov     rcx, rbp; this                                                 ; +0xb6, 0x1800a18f6\ncall    ?retain@CCObject@cocos2d@@QEAAXXZ; cocos2d::CCObject::retain(void) ; +0xb9, 0x1800a18f9\nmov     rax, [rbx+10h]                                                 ; +0xbe, 0x1800a18fe\nmov     [rax+rsi*8], rbp                                               ; +0xc2, 0x1800a1902\nmov     [rbp+28h], esi                                                 ; +0xc6, 0x1800a1906\ninc     dword ptr [rbx]                                                ; +0xc9, 0x1800a1909\nmov     rbx, [rsp+28h+arg_0]                                           ; +0xcb, 0x1800a190b\nmov     rbp, [rsp+28h+arg_8]                                           ; +0xd0, 0x1800a1910\nmov     rsi, [rsp+28h+arg_10]                                          ; +0xd5, 0x1800a1915\nadd     rsp, 20h                                                       ; +0xda, 0x1800a191a\npop     rdi                                                            ; +0xde, 0x1800a191e\nretn                                                                   ; +0xdf, 0x1800a191f", "xrefs": ["cocos2d::CCSpriteBatchNode::insertChild @ 0x180091ad1", "<???> @ 0x1801c1728"], "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"}