//
// cocos2d::CCMenu::alignItemsVerticallyWithPadding from 0x180058d50 to 0x180058f64 (532 bytes)
//
// 3 xrefs:
// > cocos2d::CCMenu::alignItemsVertically @ 0x180058d48
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b2a78
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void __fastcall cocos2d::CCMenu::alignItemsVerticallyWithPadding(cocos2d::CCMenu *this, float a2)
{
cocos2d::CCArray *m_pChildren; // rcx
float v4; // xmm6_4
cocos2d::CCArray *v5; // rax
cocos2d::ccArray *data; // rdi
__int64 num; // rax
cocos2d::CCObject **arr; // rdi
cocos2d::CCObject **i; // rbp
__int64 v10; // rax
__int64 v11; // rsi
__int64 v12; // rbx
cocos2d::CCArray *v13; // rcx
float v14; // xmm6_4
cocos2d::CCArray *v15; // rax
cocos2d::ccArray *v16; // rsi
__int64 v17; // rax
cocos2d::CCObject **v18; // rsi
cocos2d::CCObject **j; // rbp
__int64 v20; // rax
__int64 v21; // r14
__int64 v22; // rdi
__int64 v23; // rbx
float v24; // xmm0_4
float *v25; // rax
__int64 v26; // rbx
float v27; // [rsp+80h] [rbp+8h] BYREF
m_pChildren = this->m_pChildren;
v4 = -a2;
if ( m_pChildren )
{
if ( (unsigned int)cocos2d::CCArray::count(m_pChildren) )
{
v5 = this->m_pChildren;
if ( v5 )
{
data = v5->data;
num = data->num;
if ( (_DWORD)num )
{
arr = data->arr;
for ( i = &arr[num - 1]; arr <= i; ++arr )
{
if ( !*arr )
break;
v10 = _RTDynamicCast(
*arr,
0,
&cocos2d::CCObject `RTTI Type Descriptor',
&cocos2d::CCNode `RTTI Type Descriptor',
0);
v11 = v10;
if ( v10 )
{
v12 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v10 + 304LL))(v10);
v4 = v4
+ (float)((float)((*(float (__fastcall **)(__int64))(*(_QWORD *)v11 + 144LL))(v11) * *(float *)(v12 + 4))
+ a2);
}
}
}
}
}
}
v13 = this->m_pChildren;
v14 = v4 * 0.5;
if ( v13 )
{
if ( (unsigned int)cocos2d::CCArray::count(v13) )
{
v15 = this->m_pChildren;
if ( v15 )
{
v16 = v15->data;
v17 = v16->num;
if ( (_DWORD)v17 )
{
v18 = v16->arr;
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 = *(_QWORD *)v20;
v23 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v20 + 304LL))(v20);
v24 = (*(float (__fastcall **)(__int64))(*(_QWORD *)v21 + 144LL))(v21);
v25 = kmVec2Fill(&v27, 0.0, v14 - (float)((float)(v24 * *(float *)(v23 + 4)) * 0.5));
(*(void (__fastcall **)(__int64, float *))(v22 + 184))(v21, v25);
v26 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v21 + 304LL))(v21);
v14 = v14
- (float)((float)((*(float (__fastcall **)(__int64))(*(_QWORD *)v21 + 144LL))(v21)
* *(float *)(v26 + 4))
+ a2);
}
}
}
}
}
}
}