//
// GameToolbox::alignItemsHorisontally from 0x100043c0c to 0x100043dd4 (456 bytes)
//
// 42 xrefs:
// > SetGroupIDLayer::init @ 0x10003bd64
// > UILayer::init @ 0x1000492f8
// > LevelSearchLayer::init @ 0x1000528a0
// > LevelSearchLayer::init @ 0x100052c38
// > DemonFilterSelectLayer::init @ 0x100057548
// > RateLevelLayer::init @ 0x10005e820
// > RateLevelLayer::init @ 0x10005e908
// > RateStarsLayer::init @ 0x100080478
// > RateStarsLayer::init @ 0x1000804d0
// > RateStarsLayer::init @ 0x1000806b8
// > AccountRegisterLayer::init @ 0x100081280
// > AccountLoginLayer::init @ 0x10008345c
// > EditLevelLayer::setupLevelInfo @ 0x1000eab00
// > EditLevelLayer::setupLevelInfo @ 0x1000eab44
// > EditLevelLayer::setupLevelInfo @ 0x1000eab88
// > EditLevelLayer::setupLevelInfo @ 0x1000eabf8
// > NewgroundsInfoLayer::init @ 0x100146198
// > NCSInfoLayer::init @ 0x100146bd0
// > PurchaseItemPopup::init @ 0x10014e1c0
// > SetupShaderEffectPopup::setupShaderTrigger @ 0x1001897d0
// > SetupShaderEffectPopup::setupShaderTrigger @ 0x100189818
// > ProfilePage::loadPageFromUserInfo @ 0x1001995dc
// > ProfilePage::loadPageFromUserInfo @ 0x100199aa8
// > DemonInfoPopup::init @ 0x10019d308
// > GJRateLevelLayer::init @ 0x1001b0fd8
// > GJRateLevelLayer::init @ 0x1001b1028
// > GJRateLevelLayer::init @ 0x1001b14a0
// > GauntletSelectLayer::setupGauntlets @ 0x1001bf594
// > ShareCommentLayer::init @ 0x1001d4e6c
// > ShareListLayer::init @ 0x1002487a8
// > ShareLevelLayer::init @ 0x100275898
// > ShareLevelLayer::setupStars @ 0x100275c78
// > ShareLevelLayer::setupStars @ 0x100275cb4
// > GJAccountSettingsLayer::init @ 0x1002d65f8
// > GJWriteMessagePopup::init @ 0x1002dc0f4
// > UIPOptionsLayer::init @ 0x1002e60b8
// > EndLevelLayer::customSetup @ 0x1002f69f8
// > SetupGradientPopup::init @ 0x100343158
// > SetupGradientPopup::init @ 0x1003431a4
// > SongInfoLayer::init @ 0x1003a8450
// > RateDemonLayer::init @ 0x1004265f8
// > RateDemonLayer::init @ 0x1004266e0
//
// 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
//
// local variable allocation has failed, the output may be wrong!
void __fastcall GameToolbox::alignItemsHorisontally(cocos2d::CCArray *a1, float a2, cocos2d::CCPoint a3, bool a4)
{
char v4; // w2
cocos2d::ccArray *data; // x9
__int64 num; // x8
char v8; // w19
_BOOL8 v9; // x20
float v11; // s9
cocos2d::CCObject **arr; // x23
unsigned __int64 v13; // x24
cocos2d::CCObject *v14; // x22
double *v15; // x1
double v16; // d0
float v17; // s10
cocos2d::ccArray *v18; // x9
__int64 v19; // x8
float v20; // s9
cocos2d::CCObject **v21; // x22
unsigned __int64 v22; // x23
cocos2d::CCObject *v23; // x21
double *v24; // x1
double v25; // d0
float v26; // s11
__n128 v27; // q0
__n128 v28; // q1
float32x2_t *v29; // x0
double v30; // d0
float v31; // s11
float32x2_t v32; // [xsp+0h] [xbp-70h] BYREF
__int64 v33; // [xsp+8h] [xbp-68h] BYREF
if ( a1 )
{
data = a1->data;
num = data->num;
if ( (_DWORD)num )
{
v8 = v4;
v9 = a4;
v11 = -a2;
arr = data->arr;
v13 = (unsigned __int64)&arr[num - 1];
do
{
v14 = *arr;
if ( !*arr )
break;
v15 = (double *)&unk_10086A7B8;
if ( (v8 & 1) == 0 )
v15 = (double *)((__int64 (__fastcall *)(cocos2d::CCObject *, void *))v14->__vftable[3].setTag)(
*arr,
&unk_10086A7B8);
v16 = sub_100022AFC(&v33, v15);
v17 = *(float *)&v33;
v11 = v11
+ (float)(a2
+ (float)(v17
* ((float (__fastcall *)(cocos2d::CCObject *, double))v14->__vftable[1].canEncode)(v14, v16)));
++arr;
}
while ( (unsigned __int64)arr <= v13 );
v18 = a1->data;
v19 = v18->num;
if ( (_DWORD)v19 )
{
v20 = v11 * -0.5;
v21 = v18->arr;
v22 = (unsigned __int64)&v21[v19 - 1];
do
{
v23 = *v21;
if ( !*v21 )
break;
v24 = (double *)&unk_10086A7B8;
if ( (v8 & 1) == 0 )
v24 = (double *)((__int64 (__fastcall *)(cocos2d::CCObject *, void *))v23->__vftable[3].setTag)(
*v21,
&unk_10086A7B8);
v25 = sub_100022AFC(&v33, v24);
v26 = *(float *)&v33;
v27.n128_f64[0] = ((double (__fastcall *)(cocos2d::CCObject *, double))v23->__vftable[1].canEncode)(v23, v25);
v27.n128_f32[0] = v20 + (float)((float)(v26 * v27.n128_f32[0]) * 0.5);
v28.n128_u32[0] = 0;
sub_100022980(v27, v28, &v32);
((void (__fastcall *)(cocos2d::CCObject *, float32x2_t *))v23->__vftable[2].isEqual)(v23, &v32);
v29 = (float32x2_t *)((__int64 (__fastcall *)(cocos2d::CCObject *))v23->__vftable[2].acceptVisitor)(v23);
*(float32x2_t *)&v30 = sub_1000229DC((float32x2_t *)v9, v29, &v32);
((void (__fastcall *)(cocos2d::CCObject *, float32x2_t *, double))v23->__vftable[2].isEqual)(v23, &v32, v30);
v31 = *(float *)&v33;
v20 = v20
+ (float)(a2 + (float)(v31 * ((float (__fastcall *)(cocos2d::CCObject *))v23->__vftable[1].canEncode)(v23)));
++v21;
}
while ( (unsigned __int64)v21 <= v22 );
}
}
}
}