{"type": "func", "start": 6442815808, "end": 6442815964, "name": "sub_180059140", "pseudocode": "// \n// sub_180059140 from 0x180059140 to 0x1800591dc (156 bytes)\n// \n// 2 xrefs:\n// > cocos2d::CCMenu::alignItemsInRowsWithArray @ 0x18005887a\n// > <???> @ 0x1801b2ab4\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// Hidden C++ exception states: #wind=1\n__int64 __fastcall sub_180059140(__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_180030780((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_180059140 from 0x180059140 to 0x1800591dc (156 bytes)\n; \n; 2 xrefs:\n; > cocos2d::CCMenu::alignItemsInRowsWithArray @ 0x18005887a\n; > <???> @ 0x1801b2ab4\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_10], rbx                                              ; +0x0, 0x180059140\nmov     [rsp+arg_18], rsi                                              ; +0x5, 0x180059145\nmov     [rsp+arg_0], rcx                                               ; +0xa, 0x18005914a\npush    rdi                                                            ; +0xf, 0x18005914f\nsub     rsp, 30h                                                       ; +0x10, 0x180059150\nmov     rbx, rcx                                                       ; +0x14, 0x180059154\nxor     eax, eax                                                       ; +0x17, 0x180059157\nmov     [rsp+38h+var_18], eax                                          ; +0x19, 0x180059159\nmov     [rcx], rax                                                     ; +0x1d, 0x18005915d\nmov     [rcx+8], rax                                                   ; +0x20, 0x180059160\nmov     [rcx+10h], rax                                                 ; +0x24, 0x180059164\nmov     [rsp+38h+var_18], 1                                            ; +0x28, 0x180059168\ntest    rdx, rdx                                                       ; +0x30, 0x180059170\njz      short loc_1800591C8                                            ; +0x33, 0x180059173\nmov     rdi, [rdx+38h]                                                 ; +0x35, 0x180059175\nmov     eax, [rdi]                                                     ; +0x39, 0x180059179\ntest    eax, eax                                                       ; +0x3b, 0x18005917b\njz      short loc_1800591C8                                            ; +0x3d, 0x18005917d\nmov     rdi, [rdi+10h]                                                 ; +0x3f, 0x18005917f\nlea     rsi, [rax-1]                                                   ; +0x43, 0x180059183\nlea     rsi, [rdi+rsi*8]                                               ; +0x47, 0x180059187\ncmp     rdi, rsi                                                       ; +0x4b, 0x18005918b\nja      short loc_1800591C8                                            ; +0x4e, 0x18005918e\nmov     rax, [rdi]                                                     ; +0x50, 0x180059190\ntest    rax, rax                                                       ; +0x53, 0x180059193\njz      short loc_1800591C8                                            ; +0x56, 0x180059196\nmov     ecx, [rax+38h]                                                 ; +0x58, 0x180059198\nmov     [rsp+38h+arg_8], ecx                                           ; +0x5b, 0x18005919b\nmov     rdx, [rbx+8]                                                   ; +0x5f, 0x18005919f\ncmp     rdx, [rbx+10h]                                                 ; +0x63, 0x1800591a3\njz      short loc_1800591B2                                            ; +0x67, 0x1800591a7\nmov     [rdx], ecx                                                     ; +0x69, 0x1800591a9\nadd     qword ptr [rbx+8], 4                                           ; +0x6b, 0x1800591ab\njmp     short loc_1800591BF                                            ; +0x70, 0x1800591b0\nlea     r8, [rsp+38h+arg_8]                                            ; +0x72, 0x1800591b2\nmov     rcx, rbx                                                       ; +0x77, 0x1800591b7\ncall    sub_180030780                                                  ; +0x7a, 0x1800591ba\nadd     rdi, 8                                                         ; +0x7f, 0x1800591bf\ncmp     rdi, rsi                                                       ; +0x83, 0x1800591c3\njbe     short loc_180059190                                            ; +0x86, 0x1800591c6\nmov     rax, rbx                                                       ; +0x88, 0x1800591c8\nmov     rbx, [rsp+38h+arg_10]                                          ; +0x8b, 0x1800591cb\nmov     rsi, [rsp+38h+arg_18]                                          ; +0x90, 0x1800591d0\nadd     rsp, 30h                                                       ; +0x95, 0x1800591d5\npop     rdi                                                            ; +0x99, 0x1800591d9\nretn                                                                   ; +0x9a, 0x1800591da\ndb 0CCh                                                                ; +0x9b, 0x1800591db", "xrefs": ["cocos2d::CCMenu::alignItemsInRowsWithArray @ 0x18005887a", "<???> @ 0x1801b2ab4"], "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"}