//
// GameToolbox::alignItemsHorisontally from 0x57f384 to 0x57f5a0 (540 bytes)
//
// 45 xrefs:
// > UILayer::init @ 0x5c8218
// > DemonFilterSelectLayer::init @ 0x6cdff8
// > LevelSearchLayer::init @ 0x6d2734
// > LevelSearchLayer::init @ 0x6d2ac4
// > EditLevelLayer::setupLevelInfo @ 0x6df760
// > EditLevelLayer::setupLevelInfo @ 0x6df7a0
// > EditLevelLayer::setupLevelInfo @ 0x6df7e0
// > EditLevelLayer::setupLevelInfo @ 0x6df848
// > ShareLevelLayer::setupStars @ 0x6e3f70
// > ShareLevelLayer::setupStars @ 0x6e3fa4
// > ShareLevelLayer::init @ 0x6e49b0
// > RateLevelLayer::init @ 0x79ae14
// > RateLevelLayer::init @ 0x79af00
// > EndLevelLayer::customSetup @ 0x7d6344
// > SongInfoLayer::init @ 0x7dfc08
// > ShareCommentLayer::init @ 0x7e6df0
// > LevelFeatureLayer::init @ 0x821280
// > GJRateLevelLayer::init @ 0x822e04
// > GJRateLevelLayer::init @ 0x822e4c
// > GJRateLevelLayer::init @ 0x8232bc
// > RateStarsLayer::init @ 0x824d98
// > RateStarsLayer::init @ 0x824dec
// > RateStarsLayer::init @ 0x824fa4
// > NewgroundsInfoLayer::init @ 0x83b7bc
// > NCSInfoLayer::init @ 0x83e7a4
// > AccountRegisterLayer::init @ 0x84e5f0
// > AccountLoginLayer::init @ 0x8510bc
// > UIPOptionsLayer::init @ 0x8c62d8
// > GJWriteMessagePopup::init @ 0x8d0038
// > GJAccountSettingsLayer::init @ 0x8dfb7c
// > ProfilePage::loadPageFromUserInfo @ 0x8fa7d8
// > ProfilePage::loadPageFromUserInfo @ 0x8fbdec
// > DemonInfoPopup::init @ 0x8ffac0
// > GauntletSelectLayer::setupGauntlets @ 0x91c3a8
// > PurchaseItemPopup::init @ 0x9301e0
// > RateDemonLayer::init @ 0x934368
// > RateDemonLayer::init @ 0x934454
// > WorldLevelPage::init @ 0x962448
// > SetGroupIDLayer::init @ 0x978bd0
// > SetupGradientPopup::init @ 0x9fb0a4
// > SetupGradientPopup::init @ 0x9fb0e8
// > SetupShaderEffectPopup::setupShaderTrigger @ 0x9fc7d0
// > SetupShaderEffectPopup::setupShaderTrigger @ 0x9fc814
// > ShareListLayer::init @ 0xa79b6c
// > ??> @ 0x92190
//
// 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 GameToolbox::alignItemsHorisontally(cocos2d::CCArray *a1, float a2, cocos2d::CCPoint a3, bool a4)
{
unsigned __int8 v4; // w2
_BOOL8 v6; // x24
int v7; // w23
cocos2d::ccArray *data; // x0
unsigned int num; // w20
cocos2d::CCObject **arr; // x26
float v12; // s8
cocos2d::CCObject **v13; // x19
cocos2d::CCObject *v14; // x27
const cocos2d::CCSize *v15; // x1
float x; // s9
cocos2d::CCObject **v17; // x27
cocos2d::CCObject **v18; // x22
cocos2d::CCObject *v19; // x19
float v20; // s8
const cocos2d::CCSize *v21; // x1
float width; // s9
bool (__fastcall *isEqual)(cocos2d::CCObject *__hidden, const cocos2d::CCObject *); // x28
float v24; // s0
bool (__fastcall *v25)(cocos2d::CCObject *__hidden, const cocos2d::CCObject *); // x28
__int64 v26; // x0
float v27; // s9
cocos2d::CCSize v28; // [xsp+88h] [xbp+88h] BYREF
cocos2d::CCPoint v29; // [xsp+90h] [xbp+90h] BYREF
v6 = a4;
v7 = v4;
if ( a1 )
{
data = a1->data;
num = data->num;
if ( data->num )
{
arr = data->arr;
v12 = -a2;
v13 = &arr[num - 1];
if ( arr > v13 )
goto LABEL_10;
v14 = *arr;
if ( !*arr )
goto LABEL_10;
do
{
if ( v7 )
v15 = &stru_1241810;
else
v15 = (const cocos2d::CCSize *)((__int64 (__fastcall *)(cocos2d::CCObject *))v14->__vftable[3].setTag)(v14);
++arr;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v29, v15);
x = v29.x;
v12 = v12
+ (float)(a2 + (float)(x * ((float (__fastcall *)(cocos2d::CCObject *))v14->__vftable[1].canEncode)(v14)));
if ( v13 < arr )
break;
v14 = *arr;
}
while ( *arr );
data = a1->data;
num = data->num;
if ( data->num )
{
LABEL_10:
v17 = data->arr;
v18 = &v17[num - 1];
if ( v17 <= v18 )
{
v19 = *v17;
if ( *v17 )
{
v20 = (float)-v12 * 0.5;
do
{
if ( v7 )
v21 = &stru_1241810;
else
v21 = (const cocos2d::CCSize *)((__int64 (__fastcall *)(cocos2d::CCObject *))v19->__vftable[3].setTag)(v19);
++v17;
cocos2d::CCSize::CCSize(&v28, v21);
width = v28.width;
isEqual = v19->__vftable[2].isEqual;
v24 = ((float (__fastcall *)(cocos2d::CCObject *))v19->__vftable[1].canEncode)(v19);
cocos2d::CCPoint::CCPoint(&v29, v20 + (float)((float)(width * v24) * 0.5), 0.0);
isEqual(v19, (const cocos2d::CCObject *)&v29);
v25 = v19->__vftable[2].isEqual;
v26 = ((__int64 (__fastcall *)(cocos2d::CCObject *))v19->__vftable[2].acceptVisitor)(v19);
cocos2d::CCPoint::operator+(&v29, v6, v26);
v25(v19, (const cocos2d::CCObject *)&v29);
v27 = v28.width;
v20 = v20
+ (float)(a2
+ (float)(v27 * ((float (__fastcall *)(cocos2d::CCObject *))v19->__vftable[1].canEncode)(v19)));
if ( v18 < v17 )
break;
v19 = *v17;
}
while ( *v17 );
}
}
}
}
}
}