//
// sub_18005B130 from 0x18005b130 to 0x18005b1cc (156 bytes)
//
// 2 xrefs:
// > cocos2d::CCMenu::alignItemsInRowsWithArray @ 0x18005a7ec
// > ??> @ 0x1801bcd48
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:21:48 +0000
//
// Hidden C++ exception states: #wind=1
__int64 __fastcall sub_18005B130(__int64 a1, __int64 a2)
{
unsigned int *v3; // rdi
__int64 v4; // rax
unsigned __int64 v5; // rdi
unsigned __int64 i; // rsi
int v7; // ecx
_BYTE *v8; // rdx
int v10; // [rsp+48h] [rbp+10h] BYREF
*(_QWORD *)a1 = 0;
*(_QWORD *)(a1 + 8) = 0;
*(_QWORD *)(a1 + 16) = 0;
if ( a2 )
{
v3 = *(unsigned int **)(a2 + 56);
v4 = *v3;
if ( (_DWORD)v4 )
{
v5 = *((_QWORD *)v3 + 2);
for ( i = v5 + 8 * (v4 - 1); v5 <= i; v5 += 8LL )
{
if ( !*(_QWORD *)v5 )
break;
v7 = *(_DWORD *)(*(_QWORD *)v5 + 56LL);
v10 = v7;
v8 = *(_BYTE **)(a1 + 8);
if ( v8 == *(_BYTE **)(a1 + 16) )
{
sub_180030E20((const void **)a1, v8, &v10);
}
else
{
*(_DWORD *)v8 = v7;
*(_QWORD *)(a1 + 8) += 4LL;
}
}
}
}
return a1;
}