{"type": "func", "start": 6442823984, "end": 6442824140, "name": "sub_18005B130", "pseudocode": "// \n// sub_18005B130 from 0x18005b130 to 0x18005b1cc (156 bytes)\n// \n// 2 xrefs:\n// > cocos2d::CCMenu::alignItemsInRowsWithArray @ 0x18005a7ec\n// > <???> @ 0x1801bcd48\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:21:48 +0000\n// \n\n// Hidden C++ exception states: #wind=1\n__int64 __fastcall sub_18005B130(__int64 a1, __int64 a2)\n{\n  unsigned int *v3; // rdi\n  __int64 v4; // rax\n  unsigned __int64 v5; // rdi\n  unsigned __int64 i; // rsi\n  int v7; // ecx\n  _BYTE *v8; // rdx\n  int v10; // [rsp+48h] [rbp+10h] BYREF\n\n  *(_QWORD *)a1 = 0;\n  *(_QWORD *)(a1 + 8) = 0;\n  *(_QWORD *)(a1 + 16) = 0;\n  if ( a2 )\n  {\n    v3 = *(unsigned int **)(a2 + 56);\n    v4 = *v3;\n    if ( (_DWORD)v4 )\n    {\n      v5 = *((_QWORD *)v3 + 2);\n      for ( i = v5 + 8 * (v4 - 1); v5 <= i; v5 += 8LL )\n      {\n        if ( !*(_QWORD *)v5 )\n          break;\n        v7 = *(_DWORD *)(*(_QWORD *)v5 + 56LL);\n        v10 = v7;\n        v8 = *(_BYTE **)(a1 + 8);\n        if ( v8 == *(_BYTE **)(a1 + 16) )\n        {\n          sub_180030E20((const void **)a1, v8, &v10);\n        }\n        else\n        {\n          *(_DWORD *)v8 = v7;\n          *(_QWORD *)(a1 + 8) += 4LL;\n        }\n      }\n    }\n  }\n  return a1;\n}", "assembly": "; \n; sub_18005B130 from 0x18005b130 to 0x18005b1cc (156 bytes)\n; \n; 2 xrefs:\n; > cocos2d::CCMenu::alignItemsInRowsWithArray @ 0x18005a7ec\n; > <???> @ 0x1801bcd48\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:21:48 +0000\n; \nmov     [rsp+arg_10], rbx                                              ; +0x0, 0x18005b130\nmov     [rsp+arg_18], rsi                                              ; +0x5, 0x18005b135\nmov     [rsp+arg_0], rcx                                               ; +0xa, 0x18005b13a\npush    rdi                                                            ; +0xf, 0x18005b13f\nsub     rsp, 30h                                                       ; +0x10, 0x18005b140\nmov     rbx, rcx                                                       ; +0x14, 0x18005b144\nxor     eax, eax                                                       ; +0x17, 0x18005b147\nmov     [rsp+38h+var_18], eax                                          ; +0x19, 0x18005b149\nmov     [rcx], rax                                                     ; +0x1d, 0x18005b14d\nmov     [rcx+8], rax                                                   ; +0x20, 0x18005b150\nmov     [rcx+10h], rax                                                 ; +0x24, 0x18005b154\nmov     [rsp+38h+var_18], 1                                            ; +0x28, 0x18005b158\ntest    rdx, rdx                                                       ; +0x30, 0x18005b160\njz      short loc_18005B1B8                                            ; +0x33, 0x18005b163\nmov     rdi, [rdx+38h]                                                 ; +0x35, 0x18005b165\nmov     eax, [rdi]                                                     ; +0x39, 0x18005b169\ntest    eax, eax                                                       ; +0x3b, 0x18005b16b\njz      short loc_18005B1B8                                            ; +0x3d, 0x18005b16d\nmov     rdi, [rdi+10h]                                                 ; +0x3f, 0x18005b16f\nlea     rsi, [rax-1]                                                   ; +0x43, 0x18005b173\nlea     rsi, [rdi+rsi*8]                                               ; +0x47, 0x18005b177\ncmp     rdi, rsi                                                       ; +0x4b, 0x18005b17b\nja      short loc_18005B1B8                                            ; +0x4e, 0x18005b17e\nmov     rax, [rdi]                                                     ; +0x50, 0x18005b180\ntest    rax, rax                                                       ; +0x53, 0x18005b183\njz      short loc_18005B1B8                                            ; +0x56, 0x18005b186\nmov     ecx, [rax+38h]                                                 ; +0x58, 0x18005b188\nmov     [rsp+38h+arg_8], ecx                                           ; +0x5b, 0x18005b18b\nmov     rdx, [rbx+8]                                                   ; +0x5f, 0x18005b18f\ncmp     rdx, [rbx+10h]                                                 ; +0x63, 0x18005b193\njz      short loc_18005B1A2                                            ; +0x67, 0x18005b197\nmov     [rdx], ecx                                                     ; +0x69, 0x18005b199\nadd     qword ptr [rbx+8], 4                                           ; +0x6b, 0x18005b19b\njmp     short loc_18005B1AF                                            ; +0x70, 0x18005b1a0\nlea     r8, [rsp+38h+arg_8]                                            ; +0x72, 0x18005b1a2\nmov     rcx, rbx                                                       ; +0x77, 0x18005b1a7\ncall    sub_180030E20                                                  ; +0x7a, 0x18005b1aa\nadd     rdi, 8                                                         ; +0x7f, 0x18005b1af\ncmp     rdi, rsi                                                       ; +0x83, 0x18005b1b3\njbe     short loc_18005B180                                            ; +0x86, 0x18005b1b6\nmov     rax, rbx                                                       ; +0x88, 0x18005b1b8\nmov     rbx, [rsp+38h+arg_10]                                          ; +0x8b, 0x18005b1bb\nmov     rsi, [rsp+38h+arg_18]                                          ; +0x90, 0x18005b1c0\nadd     rsp, 30h                                                       ; +0x95, 0x18005b1c5\npop     rdi                                                            ; +0x99, 0x18005b1c9\nretn                                                                   ; +0x9a, 0x18005b1ca\ndb 0CCh                                                                ; +0x9b, 0x18005b1cb", "xrefs": ["cocos2d::CCMenu::alignItemsInRowsWithArray @ 0x18005a7ec", "<???> @ 0x1801bcd48"], "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"}