//
// cocos2d::CCMenu::alignItemsVerticallyWithPadding from 0x7dbe0c to 0x7dbf82 (374 bytes)
//
// 3 xrefs:
// > EditorPauseLayer::customSetup @ 0x5084ae
// > InfoLayer::init @ 0x53fe74
// > cocos2d::CCMenu::alignItemsVertically @ 0x7dbf96
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 12:00:45 +0000
//
float __fastcall cocos2d::CCMenu::alignItemsVerticallyWithPadding(cocos2d::CCMenu *this, float a2)
{
cocos2d::CCArray *v4; // r0
float v5; // s16
int v6; // r3
_DWORD *v7; // r3
const void **v8; // r4
const void **v9; // r5
float result; // r0
const void *v11; // r0
const void *v12; // t1
void *v13; // r0
void *v14; // r9
float v15; // s17
int v16; // r3
_DWORD *v17; // r3
int v18; // r4
float *v19; // r3
unsigned int v20; // r5
float *v21; // r8
float v22; // s16
float v23; // t1
float v24; // r4
void (__fastcall *v25)(_DWORD, float *); // r10
float v26; // s19
float v27; // r0
float v28; // s19
float v29[2]; // [sp+Ch] [bp-Ch] BYREF
v4 = *((cocos2d::CCArray **)this + 48);
v5 = -a2;
if ( v4 )
{
if ( cocos2d::CCArray::count(v4) )
{
v6 = *((_DWORD *)this + 48);
if ( v6 )
{
v7 = *(_DWORD **)(v6 + 52);
if ( *v7 )
{
v8 = (const void **)v7[3];
v9 = &v8[*v7] + 0x3FFFFFFF;
while ( v8 <= v9 )
{
v12 = *v8++;
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 + 164))(v13) + 4);
v5 = v5 + (float)(a2 + (float)(v15 * (*(float (__fastcall **)(void *))(*(_DWORD *)v14 + 76))(v14)));
}
}
}
}
}
}
result = *((float *)this + 48);
if ( result != 0.0 )
{
result = COERCE_FLOAT(cocos2d::CCArray::count((cocos2d::CCArray *)LODWORD(result)));
if ( result != 0.0 )
{
v16 = *((_DWORD *)this + 48);
if ( v16 )
{
v17 = *(_DWORD **)(v16 + 52);
if ( *v17 )
{
v18 = *v17 + 0x40000000;
v19 = (float *)v17[3];
v20 = (unsigned int)&v19[v18 - 1];
v21 = v19;
v22 = v5 * 0.5;
while ( (unsigned int)v21 <= v20 )
{
v23 = *v21++;
result = v23;
if ( v23 == 0.0 )
break;
result = COERCE_FLOAT(
_dynamic_cast(
(const void *)LODWORD(result),
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCNode,
0));
v24 = result;
if ( result != 0.0 )
{
v25 = *(void (__fastcall **)(_DWORD, float *))(*(_DWORD *)LODWORD(result) + 92);
v26 = *(float *)((*(int (__fastcall **)(float))(*(_DWORD *)LODWORD(result) + 164))(COERCE_FLOAT(LODWORD(result)))
+ 4);
v27 = (*(float (__fastcall **)(float))(*(_DWORD *)LODWORD(v24) + 76))(COERCE_FLOAT(LODWORD(v24)));
cocos2d::CCPoint::CCPoint(v29, 0.0, v22 - (float)((float)(v26 * v27) * 0.5));
v25(LODWORD(v24), v29);
v28 = *(float *)((*(int (__fastcall **)(float))(*(_DWORD *)LODWORD(v24) + 164))(COERCE_FLOAT(LODWORD(v24)))
+ 4);
result = (*(float (__fastcall **)(float))(*(_DWORD *)LODWORD(v24) + 76))(COERCE_FLOAT(LODWORD(v24)));
v22 = v22 - (float)(a2 + (float)(v28 * result));
}
}
}
}
}
}
return result;
}