//
// cocos2d::CCMenu::alignItemsVerticallyWithPadding from 0x1001d85b8 to 0x1001d8798 (480 bytes)
//
// 2 xrefs:
// > InfoLayer::init @ 0x100350e1c
// > EditorPauseLayer::customSetup @ 0x10039c380
//
// 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 *a1, float a2)
{
cocos2d::CCArray *m_pChildren; // x0
float v5; // s9
int v6; // w8
cocos2d::CCArray *v7; // x0
cocos2d::ccArray *data; // x9
__int64 num; // x8
const void **arr; // x23
unsigned __int64 v11; // x24
void *v12; // x0
void *v13; // x22
float v14; // s10
float v15; // s9
cocos2d::CCArray *v16; // x8
cocos2d::ccArray *v17; // x9
__int64 v18; // x8
const void **v19; // x22
unsigned __int64 v20; // x23
void *v21; // x0
void *v22; // x21
float v23; // s11
__n128 v24; // q0
__n128 v25; // q1
float v26; // s11
int v27; // [xsp+8h] [xbp-58h] BYREF
m_pChildren = a1->m_pChildren;
if ( !m_pChildren )
return;
v5 = -a2;
v6 = sub_10024A36C(m_pChildren);
v7 = a1->m_pChildren;
if ( !v6 )
goto LABEL_11;
if ( !v7 )
return;
data = v7->data;
num = data->num;
if ( (_DWORD)num )
{
arr = (const void **)data->arr;
v11 = (unsigned __int64)&arr[num - 1];
do
{
if ( !*arr )
break;
v12 = __dynamic_cast(
*arr,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCNode,
0);
if ( v12 )
{
v13 = v12;
v14 = *(float *)((*(__int64 (__fastcall **)(void *))(*(_QWORD *)v12 + 312LL))(v12) + 4);
v5 = v5 + (float)(a2 + (float)(v14 * (*(float (__fastcall **)(void *))(*(_QWORD *)v13 + 152LL))(v13)));
}
++arr;
}
while ( (unsigned __int64)arr <= v11 );
v7 = a1->m_pChildren;
LABEL_11:
if ( !v7 )
return;
v15 = v5 * 0.5;
goto LABEL_14;
}
v15 = a2 * -0.5;
LABEL_14:
if ( (unsigned int)sub_10024A36C(v7) )
{
v16 = a1->m_pChildren;
if ( v16 )
{
v17 = v16->data;
v18 = v17->num;
if ( (_DWORD)v18 )
{
v19 = (const void **)v17->arr;
v20 = (unsigned __int64)&v19[v18 - 1];
do
{
if ( !*v19 )
break;
v21 = __dynamic_cast(
*v19,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCNode,
0);
if ( v21 )
{
v22 = v21;
v23 = *(float *)((*(__int64 (__fastcall **)(void *))(*(_QWORD *)v21 + 312LL))(v21) + 4);
v24.n128_f64[0] = (*(double (__fastcall **)(void *))(*(_QWORD *)v22 + 152LL))(v22);
v25.n128_f32[0] = v15 + (float)((float)(v23 * v24.n128_f32[0]) * -0.5);
v24.n128_u32[0] = 0;
sub_100022980(v24, v25, &v27);
(*(void (__fastcall **)(void *, int *))(*(_QWORD *)v22 + 184LL))(v22, &v27);
v26 = *(float *)((*(__int64 (__fastcall **)(void *))(*(_QWORD *)v22 + 312LL))(v22) + 4);
v15 = v15 - (float)(a2 + (float)(v26 * (*(float (__fastcall **)(void *))(*(_QWORD *)v22 + 152LL))(v22)));
}
++v19;
}
while ( (unsigned __int64)v19 <= v20 );
}
}
}
}