{"type": "func", "start": 6443112320, "end": 6443112510, "name": "sub_1800A1780", "pseudocode": "// \n// sub_1800A1780 from 0x1800a1780 to 0x1800a183e (190 bytes)\n// \n// 3 xrefs:\n// > cocos2d::CCArray::insertObject @ 0x1800071e4\n// > cocos2d::CCArray::replaceObjectAtIndex @ 0x1800073bc\n// > <???> @ 0x1801c171c\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_1800A1780(int *a1, cocos2d::CCObject *a2, unsigned int a3)\n{\n  int v3; // r9d\n  unsigned int v5; // r11d\n  __int64 v7; // r14\n  void *v8; // rcx\n  char *v9; // rax\n  char *v10; // r10\n  unsigned int v11; // r9d\n  __int64 result; // rax\n\n  v3 = *a1;\n  v5 = a1[1];\n  v7 = a3;\n  if ( v5 >= *a1 + 1 )\n  {\n    v10 = *((char **)a1 + 2);\n  }\n  else\n  {\n    do\n    {\n      v8 = *((void **)a1 + 2);\n      a1[1] = 2 * v5;\n      v9 = (char *)realloc(v8, 16LL * v5);\n      *((_QWORD *)a1 + 2) = v9;\n      v10 = v9;\n      v3 = *a1;\n      v5 = a1[1];\n    }\n    while ( v5 < *a1 + 1 );\n  }\n  v11 = v3 - v7;\n  if ( v11 )\n    memmove(&v10[8 * (unsigned int)(v7 + 1)], &v10[8 * v7], 8LL * v11);\n  cocos2d::CCObject::retain(a2);\n  result = *((_QWORD *)a1 + 2);\n  *(_QWORD *)(result + 8 * v7) = a2;\n  ++*a1;\n  return result;\n}", "assembly": "; \n; sub_1800A1780 from 0x1800a1780 to 0x1800a183e (190 bytes)\n; \n; 3 xrefs:\n; > cocos2d::CCArray::insertObject @ 0x1800071e4\n; > cocos2d::CCArray::replaceObjectAtIndex @ 0x1800073bc\n; > <???> @ 0x1801c171c\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, 0x1800a1780\nmov     [rsp+arg_8], rbp                                               ; +0x5, 0x1800a1785\nmov     [rsp+arg_10], rsi                                              ; +0xa, 0x1800a178a\nmov     [rsp+arg_18], rdi                                              ; +0xf, 0x1800a178f\npush    r14                                                            ; +0x14, 0x1800a1794\nsub     rsp, 20h                                                       ; +0x16, 0x1800a1796\nmov     r9d, [rcx]                                                     ; +0x1a, 0x1800a179a\nmov     rbp, rdx                                                       ; +0x1d, 0x1800a179d\nmov     r11d, [rcx+4]                                                  ; +0x20, 0x1800a17a0\nmov     rbx, rcx                                                       ; +0x24, 0x1800a17a4\nmov     r14d, r8d                                                      ; +0x27, 0x1800a17a7\nlea     eax, [r9+1]                                                    ; +0x2a, 0x1800a17aa\ncmp     r11d, eax                                                      ; +0x2e, 0x1800a17ae\njnb     short loc_1800A17F0                                            ; +0x31, 0x1800a17b1\nnop     dword ptr [rax+00h]                                            ; +0x33, 0x1800a17b3\nnop     word ptr [rax+rax+00000000h]                                   ; +0x37, 0x1800a17b7\nmov     rcx, [rbx+10h]; Block                                          ; +0x40, 0x1800a17c0\nlea     eax, [r11+r11]                                                 ; +0x44, 0x1800a17c4\nmov     edx, eax                                                       ; +0x48, 0x1800a17c8\nshl     rdx, 3; Size                                                   ; +0x4a, 0x1800a17ca\nmov     [rbx+4], eax                                                   ; +0x4e, 0x1800a17ce\ncall    cs:realloc                                                     ; +0x51, 0x1800a17d1\nmov     [rbx+10h], rax                                                 ; +0x57, 0x1800a17d7\nmov     r10, rax                                                       ; +0x5b, 0x1800a17db\nmov     r9d, [rbx]                                                     ; +0x5e, 0x1800a17de\nmov     r11d, [rbx+4]                                                  ; +0x61, 0x1800a17e1\nlea     ecx, [r9+1]                                                    ; +0x65, 0x1800a17e5\ncmp     r11d, ecx                                                      ; +0x69, 0x1800a17e9\njb      short loc_1800A17C0                                            ; +0x6c, 0x1800a17ec\njmp     short loc_1800A17F4                                            ; +0x6e, 0x1800a17ee\nmov     r10, [rcx+10h]                                                 ; +0x70, 0x1800a17f0\nsub     r9d, r14d                                                      ; +0x74, 0x1800a17f4\njz      short loc_1800A1811                                            ; +0x77, 0x1800a17f7\nmov     r8d, r9d                                                       ; +0x79, 0x1800a17f9\nlea     eax, [r14+1]                                                   ; +0x7c, 0x1800a17fc\nshl     r8, 3; Size                                                    ; +0x80, 0x1800a1800\nlea     rcx, [r10+rax*8]; void *                                       ; +0x84, 0x1800a1804\nlea     rdx, [r10+r14*8]; Src                                          ; +0x88, 0x1800a1808\ncall    memmove                                                        ; +0x8c, 0x1800a180c\nmov     rcx, rbp; this                                                 ; +0x91, 0x1800a1811\ncall    ?retain@CCObject@cocos2d@@QEAAXXZ; cocos2d::CCObject::retain(void) ; +0x94, 0x1800a1814\nmov     rax, [rbx+10h]                                                 ; +0x99, 0x1800a1819\nmov     rsi, [rsp+28h+arg_10]                                          ; +0x9d, 0x1800a181d\nmov     rdi, [rsp+28h+arg_18]                                          ; +0xa2, 0x1800a1822\nmov     [rax+r14*8], rbp                                               ; +0xa7, 0x1800a1827\ninc     dword ptr [rbx]                                                ; +0xab, 0x1800a182b\nmov     rbx, [rsp+28h+arg_0]                                           ; +0xad, 0x1800a182d\nmov     rbp, [rsp+28h+arg_8]                                           ; +0xb2, 0x1800a1832\nadd     rsp, 20h                                                       ; +0xb7, 0x1800a1837\npop     r14                                                            ; +0xbb, 0x1800a183b\nretn                                                                   ; +0xbd, 0x1800a183d", "xrefs": ["cocos2d::CCArray::insertObject @ 0x1800071e4", "cocos2d::CCArray::replaceObjectAtIndex @ 0x1800073bc", "<???> @ 0x1801c171c"], "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"}