//
// cocos2d::CCMenu::alignItemsInColumnsWithArray from 0x7dc53c to 0x7dc77c (576 bytes)
//
// 1 xrefs:
// > cocos2d::CCMenu::alignItemsInColumns @ 0x7dc7dc
//
// 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
//
char **__fastcall cocos2d::CCMenu::alignItemsInColumnsWithArray(cocos2d::CCMenu *this, cocos2d::CCArray *a2)
{
float *v3; // r0
unsigned int v4; // r4
int v5; // r5
int v6; // r0
cocos2d::CCArray *v7; // r0
int v8; // r3
_DWORD *v9; // r2
float v10; // s19
int v11; // s15
const void **v12; // r8
const void **v13; // r7
unsigned int v14; // r5
unsigned int v15; // s16
int v16; // r11
float v17; // s17
float v18; // s18
unsigned int *v20; // r3
float **v21; // r7
unsigned int v22; // r5
unsigned int v23; // s16
int v24; // r9
float **v25; // r11
float *v26; // t1
float v27; // s16
float v28; // s17
unsigned int v29; // r3
const void *v30; // r0
const void *v31; // t1
void *v32; // r0
void *v33; // r9
int v34; // r0
float v35; // s16
float v36; // s20
float v37; // s20
int v38; // r0
struct __class_type_info *lpstype; // [sp+4h] [bp-30h]
void (__fastcall *v40)(void *, float *); // [sp+8h] [bp-2Ch]
float v41[2]; // [sp+10h] [bp-24h] BYREF
float v42[2]; // [sp+18h] [bp-1Ch] BYREF
char *v43[3]; // [sp+20h] [bp-14h] BYREF
sub_7DC4C8(v43, (int)a2);
v3 = *((float **)this + 48);
if ( !v3 || (v3 = (float *)cocos2d::CCArray::count((cocos2d::CCArray *)v3)) == nullptr )
{
v4 = 0;
LABEL_4:
v5 = -5;
goto LABEL_5;
}
v4 = *((_DWORD *)this + 48);
if ( !v4 )
goto LABEL_4;
v20 = *(unsigned int **)(v4 + 52);
v4 = *v20;
if ( !*v20 )
goto LABEL_4;
v21 = (float **)v20[3];
v22 = v4 + 0x3FFFFFFF;
v4 = 0;
v23 = 0;
v24 = 0;
v25 = &v21[v22];
v5 = -5;
while ( v21 <= v25 )
{
v26 = *v21++;
v3 = v26;
if ( !v26 )
break;
v3 = (float *)_dynamic_cast(
v3,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCNode,
0);
if ( v3 )
{
lpstype = *(struct __class_type_info **)&v43[0][4 * v24];
v3 = (float *)(*(int (__fastcall **)(float *))(*(_DWORD *)v3 + 164))(v3);
v27 = (float)v23;
v28 = v3[1];
if ( v27 >= v28 || (v3 = (float *)_isnanf(v3[1])) != nullptr )
v23 = (unsigned int)v27;
else
v23 = (unsigned int)v28;
if ( ++v4 >= (unsigned int)lpstype )
{
++v24;
v29 = v23;
v23 = 0;
v4 = 0;
v5 += 5 + v29;
}
}
}
LABEL_5:
v6 = cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)v3);
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)v41, v6);
v7 = *((cocos2d::CCArray **)this + 48);
if ( v7 )
{
if ( cocos2d::CCArray::count(v7) )
{
v8 = *((_DWORD *)this + 48);
if ( v8 )
{
v9 = *(_DWORD **)(v8 + 52);
if ( *v9 )
{
v10 = 0.0;
v11 = v5 / 2;
v12 = (const void **)v9[3];
v13 = &v12[*v9] + 0x3FFFFFFF;
v14 = 0;
v15 = 0;
v16 = 0;
v17 = (float)v11;
v18 = 0.0;
while ( v12 <= v13 )
{
v31 = *v12++;
v30 = v31;
if ( !v31 )
break;
v32 = _dynamic_cast(
v30,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCNode,
0);
v33 = v32;
if ( v32 )
{
if ( !v14 )
{
v14 = *(_DWORD *)&v43[0][4 * v16];
v18 = v41[0] / (float)(v14 + 1);
v10 = v18;
}
v34 = (*(int (__fastcall **)(void *))(*(_DWORD *)v32 + 164))(v32);
v35 = (float)v15;
v36 = *(float *)(v34 + 4);
if ( v35 >= v36 || _isnanf(*(float *)(v34 + 4)) )
v15 = (unsigned int)v35;
else
v15 = (unsigned int)v36;
++v4;
v40 = *(void (__fastcall **)(void *, float *))(*(_DWORD *)v33 + 92);
v37 = v10 - (float)(v41[0] * 0.5);
v38 = (*(int (__fastcall **)(void *))(*(_DWORD *)v33 + 164))(v33);
cocos2d::CCPoint::CCPoint(v42, v37, v17 - (float)(*(float *)(v38 + 4) * 0.5));
v40(v33, v42);
v10 = v10 + v18;
if ( v4 >= v14 )
{
v14 = 0;
++v16;
v4 = 0;
v17 = v17 - (float)(v15 + 5);
v15 = 0;
}
}
}
}
}
}
}
return std::__vector_base::~__vector_base(v43);
}