//
// cocos2d::CCMenu::alignItemsHorizontallyWithPadding from 0x180059fb0 to 0x18005a1d8 (552 bytes)
//
// 3 xrefs:
// > cocos2d::CCMenu::alignItemsHorizontally @ 0x180059fa8
// > ??> @ 0x18014cf68
// > ??> @ 0x1801bccb8
//
// 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
//
void __fastcall cocos2d::CCMenu::alignItemsHorizontallyWithPadding(cocos2d::CCMenu *this, float a2)
{
cocos2d::CCArray *v3; // rcx
float v4; // xmm7_4
__int64 v5; // rax
unsigned int *v6; // rbx
__int64 v7; // rax
_QWORD *v8; // rbx
_QWORD *i; // rsi
__int64 v10; // rax
__int64 v11; // rdi
float v12; // xmm6_4
cocos2d::CCArray *v13; // rcx
float v14; // xmm7_4
__int64 v15; // rax
unsigned int *v16; // rdi
__int64 v17; // rax
_QWORD *v18; // rdi
_QWORD *j; // rbp
__int64 v20; // rax
__int64 v21; // rsi
float *v22; // rax
__int64 v23; // rbx
float v24; // xmm6_4
double v25; // xmm0_8
float *v26; // rax
float v27; // xmm6_4
float v28; // [rsp+90h] [rbp+8h] BYREF
v3 = *((cocos2d::CCArray **)this + 26);
v4 = -a2;
if ( v3 )
{
if ( (unsigned int)cocos2d::CCArray::count(v3) )
{
v5 = *((_QWORD *)this + 26);
if ( v5 )
{
v6 = *(unsigned int **)(v5 + 56);
v7 = *v6;
if ( (_DWORD)v7 )
{
v8 = *((_QWORD **)v6 + 2);
for ( i = &v8[v7 - 1]; v8 <= i; ++v8 )
{
if ( !*v8 )
break;
v10 = _RTDynamicCast(
*v8,
0,
&cocos2d::CCObject `RTTI Type Descriptor',
&cocos2d::CCNode `RTTI Type Descriptor',
0);
v11 = v10;
if ( v10 )
{
v12 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v10 + 320LL))(v10);
v4 = v4 + (float)((float)((*(float (__fastcall **)(__int64))(*(_QWORD *)v11 + 128LL))(v11) * v12) + a2);
}
}
}
}
}
}
v13 = *((cocos2d::CCArray **)this + 26);
v14 = (float)-v4 * 0.5;
if ( v13 )
{
if ( (unsigned int)cocos2d::CCArray::count(v13) )
{
v15 = *((_QWORD *)this + 26);
if ( v15 )
{
v16 = *(unsigned int **)(v15 + 56);
v17 = *v16;
if ( (_DWORD)v17 )
{
v18 = *((_QWORD **)v16 + 2);
for ( j = &v18[v17 - 1]; v18 <= j; ++v18 )
{
if ( !*v18 )
break;
v20 = _RTDynamicCast(
*v18,
0,
&cocos2d::CCObject `RTTI Type Descriptor',
&cocos2d::CCNode `RTTI Type Descriptor',
0);
v21 = v20;
if ( v20 )
{
v22 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v20 + 320LL))(v20);
v23 = *(_QWORD *)v21;
v24 = *v22;
v25 = (*(double (__fastcall **)(__int64))(*(_QWORD *)v21 + 128LL))(v21);
v26 = kmVec2Fill(&v28, (float)((float)(*(float *)&v25 * v24) * 0.5) + v14, 0.0);
(*(void (__fastcall **)(__int64, float *))(v23 + 184))(v21, v26);
v27 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v21 + 320LL))(v21);
v14 = v14 + (float)((float)((*(float (__fastcall **)(__int64))(*(_QWORD *)v21 + 128LL))(v21) * v27) + a2);
}
}
}
}
}
}
}