//
// cocos2d::CCMenu::alignItemsVerticallyWithPadding from 0x5d3c68 to 0x5d3dde (374 bytes)
//
// 3 xrefs:
// > EditorPauseLayer::customSetup @ 0x400042
// > InfoLayer::init @ 0x431092
// > cocos2d::CCMenu::alignItemsVertically @ 0x5d3df2
//
// 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 cocos2d::CCMenu::alignItemsVerticallyWithPadding(cocos2d::CCMenu *a1, float a2)
{
cocos2d::CCArray *m_pChildren; // r0
float v5; // s16
cocos2d::CCArray *v6; // r3
cocos2d::ccArray *data; // r3
const void **arr; // r4
const void **v9; // r5
cocos2d::CCArray *v10; // r0
const void *v11; // r0
const void *v12; // t1
void *v13; // r0
void *v14; // r9
float v15; // s17
cocos2d::CCArray *v16; // r3
cocos2d::ccArray *v17; // r3
int v18; // r4
cocos2d::CCObject **v19; // r3
unsigned int v20; // r5
const void **v21; // r8
float v22; // s16
const void *v23; // r0
const void *v24; // t1
void *v25; // r0
void *v26; // r4
void (__fastcall *v27)(void *, cocos2d::CCPoint *); // r10
float v28; // s19
float v29; // r0
float v30; // s19
cocos2d::CCPoint v31; // [sp+Ch] [bp-Ch] BYREF
m_pChildren = a1->m_pChildren;
v5 = -a2;
if ( m_pChildren )
{
if ( cocos2d::CCArray::count(m_pChildren) )
{
v6 = a1->m_pChildren;
if ( v6 )
{
data = v6->data;
if ( data->num )
{
arr = (const void **)data->arr;
v9 = &arr[data->num] + 0x3FFFFFFF;
while ( arr <= v9 )
{
v12 = *arr++;
v11 = v12;
if ( !v12 )
break;
v13 = _dynamic_cast(
v11,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCNode,
0);
v14 = v13;
if ( v13 )
{
v15 = *(float *)((*(int (__fastcall **)(void *))(*(_DWORD *)v13 + 156))(v13) + 4);
v5 = v5 + (float)(a2 + (float)(v15 * (*(float (__fastcall **)(void *))(*(_DWORD *)v14 + 76))(v14)));
}
}
}
}
}
}
v10 = a1->m_pChildren;
if ( v10 )
{
if ( cocos2d::CCArray::count(v10) )
{
v16 = a1->m_pChildren;
if ( v16 )
{
v17 = v16->data;
if ( v17->num )
{
v18 = v17->num + 0x40000000;
v19 = v17->arr;
v20 = (unsigned int)&v19[v18 - 1];
v21 = (const void **)v19;
v22 = v5 * 0.5;
while ( (unsigned int)v21 <= v20 )
{
v24 = *v21++;
v23 = v24;
if ( !v24 )
break;
v25 = _dynamic_cast(
v23,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCNode,
0);
v26 = v25;
if ( v25 )
{
v27 = *(void (__fastcall **)(void *, cocos2d::CCPoint *))(*(_DWORD *)v25 + 92);
v28 = *(float *)((*(int (__fastcall **)(void *))(*(_DWORD *)v25 + 156))(v25) + 4);
v29 = (*(float (__fastcall **)(void *))(*(_DWORD *)v26 + 76))(v26);
cocos2d::CCPoint::CCPoint(&v31, 0.0, v22 - (float)((float)(v28 * v29) * 0.5));
v27(v26, &v31);
v30 = *(float *)((*(int (__fastcall **)(void *))(*(_DWORD *)v26 + 156))(v26) + 4);
v22 = v22 - (float)(a2 + (float)(v30 * (*(float (__fastcall **)(void *))(*(_DWORD *)v26 + 76))(v26)));
}
}
}
}
}
}
}