//
// cocos2d::CCMenu::alignItemsInColumnsWithArray from 0x1008746e0 to 0x100874a52 (882 bytes)
//
// 1 xrefs:
// > cocos2d::CCMenu::alignItemsInColumns @ 0x1008746c5
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// 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:36:52 +0000
//
void __fastcall cocos2d::CCMenu::alignItemsInColumnsWithArray(__int64 a1)
{
__int64 v1; // rbx
__int64 v2; // rdi
int v3; // r13d
__int64 v4; // rax
unsigned int *v5; // rax
__int64 v6; // rcx
const void **v7; // r14
int v8; // r12d
int v9; // ebx
void *v10; // rax
unsigned int v11; // r15d
__m128 v12; // xmm0
__m128 v13; // xmm1
__m128 v14; // xmm2
float v15; // xmm3_4
__m128 v16; // xmm1
__int64 v17; // rax
__int64 v18; // rdi
__int64 v19; // rax
unsigned int *v20; // rax
const void **v21; // rbx
int v22; // r14d
unsigned int v23; // r15d
void *v24; // rax
void *v25; // r12
__int64 v26; // rax
__m128 v27; // xmm0
__m128 v28; // xmm1
__m128 v29; // xmm3
void *__p; // [rsp+0h] [rbp-A0h] BYREF
float v31; // [rsp+18h] [rbp-88h] BYREF
unsigned __int64 v32; // [rsp+20h] [rbp-80h]
_DWORD *v33; // [rsp+28h] [rbp-78h]
__m128 v34; // [rsp+30h] [rbp-70h]
__int64 v35; // [rsp+48h] [rbp-58h] BYREF
_DWORD *v36; // [rsp+50h] [rbp-50h]
__int64 v37; // [rsp+58h] [rbp-48h]
float v38; // [rsp+64h] [rbp-3Ch]
unsigned __int64 v39; // [rsp+68h] [rbp-38h]
__int64 v40; // [rsp+70h] [rbp-30h]
v1 = a1;
sub_100874A80(&__p);
v2 = *(_QWORD *)(a1 + 208);
LODWORD(v40) = -1073741824;
v3 = 0;
if ( v2 )
{
if ( (unsigned int)sub_1007FEF90(v2) )
{
v4 = *(_QWORD *)(v1 + 208);
if ( v4 )
{
v5 = *(unsigned int **)(v4 + 56);
v6 = *v5;
if ( *v5 )
{
v34.i64[0] = v1;
v7 = *((const void ***)v5 + 2);
v39 = (unsigned __int64)&v7[v6 - 1];
v8 = 0;
v40 = 4294967291LL;
v36 = __p;
v9 = 0;
v3 = 0;
do
{
if ( !*v7 )
break;
v10 = __dynamic_cast(
*v7,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCNode,
0);
if ( v10 )
{
v11 = v36[v8];
v12 = 0;
v12.f32[0] = (float)v9;
v13 = (__m128)*(unsigned int *)((*(__int64 (__fastcall **)(void *))(*(_QWORD *)v10 + 328LL))(v10) + 4);
v14 = _mm_cmpunord_ss(v13, v13);
v15 = _mm_andnot_ps(v14, v13).f32[0];
v16 = _mm_cmpgt_ss(v13, v12);
v9 = (int)COERCE_FLOAT(
_mm_andnot_ps(v16, v12).u32[0]
| (v14.i32[0] & COERCE_UNSIGNED_INT((float)v9) | LODWORD(v15)) & v16.i32[0]);
if ( ++v3 >= v11 )
{
v40 = (unsigned int)(v9 + v40 + 5);
++v8;
v3 = 0;
v9 = 0;
}
}
++v7;
}
while ( (unsigned __int64)v7 <= v39 );
*(float *)&v40 = (float)((int)v40 / 2);
v1 = v34.i64[0];
}
}
}
}
v17 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v35, v17);
v18 = *(_QWORD *)(v1 + 208);
if ( v18 )
{
if ( (unsigned int)sub_1007FEF90(v18) )
{
v19 = *(_QWORD *)(v1 + 208);
if ( v19 )
{
v20 = *(unsigned int **)(v19 + 56);
if ( *v20 )
{
v21 = *((const void ***)v20 + 2);
v32 = (unsigned __int64)&v21[*v20 - 1];
LODWORD(v39) = 0;
v37 = 0;
v33 = __p;
v22 = 0;
v38 = 0.0;
v23 = 0;
do
{
if ( !*v21 )
break;
v24 = __dynamic_cast(
*v21,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCNode,
0);
if ( v24 )
{
v25 = v24;
if ( !v23 )
{
v23 = v33[(unsigned int)v37];
v38 = *(float *)&v35 / (float)(int)(v23 + 1);
*(float *)&v39 = v38;
}
v34 = (__m128)*(unsigned int *)((*(__int64 (__fastcall **)(void *))(*(_QWORD *)v24 + 328LL))(v24) + 4);
LODWORD(v36) = v35;
v26 = (*(__int64 (__fastcall **)(void *))(*(_QWORD *)v25 + 328LL))(v25);
sub_100278250(
&v31,
*(float *)&v39 - (float)(*(float *)&v36 * 0.5),
*(float *)&v40 - (float)(*(float *)(v26 + 4) * 0.5));
(*(void (__fastcall **)(void *, float *))(*(_QWORD *)v25 + 184LL))(v25, &v31);
v27 = 0;
v27.f32[0] = (float)v22;
v28 = _mm_cmpunord_ss(v34, v34);
v29 = _mm_cmpgt_ss(v34, v27);
v22 = (int)COERCE_FLOAT(
_mm_andnot_ps(v29, v27).u32[0]
| (v28.i32[0] & COERCE_UNSIGNED_INT((float)v22) | _mm_andnot_ps(v28, v34).u32[0]) & v29.i32[0]);
*(float *)&v39 = *(float *)&v39 + v38;
if ( ++v3 >= v23 )
{
*(float *)&v40 = *(float *)&v40 - (float)(v22 + 5);
v37 = (unsigned int)(v37 + 1);
v23 = 0;
v3 = 0;
v22 = 0;
}
}
++v21;
}
while ( (unsigned __int64)v21 <= v32 );
}
}
}
}
if ( __p )
operator delete(__p);
}