//
// GameToolbox::alignItemsHorisontally from 0x14006c740 to 0x14006c931 (497 bytes)
//
// 54 xrefs:
// > AccountRegisterLayer::init @ 0x14008cffe
// > AccountLoginLayer::init @ 0x140090e97
// > LevelCell::loadCustomLevelCell @ 0x14014a0f0
// > NewgroundsInfoLayer::init @ 0x140166efe
// > NCSInfoLayer::init @ 0x140167ae4
// > EditLevelLayer::setupLevelInfo @ 0x14017a2c3
// > EditLevelLayer::setupLevelInfo @ 0x14017a309
// > EditLevelLayer::setupLevelInfo @ 0x14017a34d
// > EditLevelLayer::setupLevelInfo @ 0x14017a3bf
// > EndLevelLayer::customSetup @ 0x140205435
// > GameSettingsLayer::setupTabs @ 0x1402c2dc1
// > GJAccountSettingsLayer::init @ 0x14039e439
// > GJMessagePopup::loadFromGJMessage @ 0x1403a444b
// > UIPOptionsLayer::init @ 0x1403abed7
// > PurchaseItemPopup::init @ 0x1403b5943
// > GJRateLevelLayer::init @ 0x140419b10
// > GJRateLevelLayer::init @ 0x140419b71
// > GJRateLevelLayer::init @ 0x140419f12
// > ShareListLayer::init @ 0x1404324f4
// > LevelSearchLayer::init @ 0x1404359e2
// > LevelSearchLayer::init @ 0x140435f2e
// > DemonFilterSelectLayer::init @ 0x14044108d
// > StartPosLayer::addModeButtons @ 0x14045f93b
// > StartPosLayer::addSpeedButtons @ 0x14045fc11
// > PauseLayer::customSetup @ 0x1404d8674
// > CreateStartPosPopup::init @ 0x1404dc757
// > ProfilePage::setupAccountButtons @ 0x140552b37
// > ProfilePage::loadPageFromUserInfo @ 0x1405557e0
// > DemonInfoPopup::init @ 0x14055b33a
// > MyStuffPopup::init @ 0x14055cda1
// > RateDemonLayer::init @ 0x14055d3c0
// > RateDemonLayer::init @ 0x14055d59e
// > RateLevelLayer::init @ 0x14055df4a
// > RateLevelLayer::init @ 0x14055e120
// > RateStarsLayer::init @ 0x14055e92c
// > RateStarsLayer::init @ 0x14055e98c
// > RateStarsLayer::init @ 0x14055ec60
// > RateStarsModLayer::init @ 0x14055f9cf
// > RateStarsModLayer::init @ 0x14055fa2a
// > RateStarsModLayer::init @ 0x14055fd62
// > RateStarsModLayer::init @ 0x14055ff2b
// > SetGroupIDLayer::init @ 0x14058f8f5
// > SetupGradientPopup::init @ 0x1405b7053
// > SetupGradientPopup::init @ 0x1405b70aa
// > SetupShaderEffectPopup::setupShaderTrigger @ 0x1405e0288
// > SetupShaderEffectPopup::setupShaderTrigger @ 0x1405e02d6
// > ShareCommentLayer::init @ 0x14062ebc7
// > ShareLevelLayer::init @ 0x140630ed2
// > ShareLevelLayer::setupStars @ 0x1406315da
// > ShareLevelLayer::setupStars @ 0x140631616
// > SongInfoLayer::addLinkRows @ 0x14063667c
// > TabbedPopupLayer::createTabButtons @ 0x14066c9a3
// > UILayer::init @ 0x14067053a
// > ??> @ 0x1409115c4
//
// 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 11:25:48 +0000
//
void __fastcall GameToolbox::alignItemsHorisontally(__int64 a1, float a2, __int64 a3, char a4)
{
float v6; // xmm6_4
unsigned int *v8; // rdi
__int64 v9; // rax
_QWORD *v10; // rdi
_QWORD *i; // rsi
__int64 v12; // rbx
const struct cocos2d::CCSize *v13; // rax
float v14; // xmm0_4
float v15; // xmm6_4
unsigned int *v16; // rsi
__int64 v17; // rax
__int64 **v18; // rsi
__int64 **j; // r14
__int64 *v20; // rdi
const struct cocos2d::CCSize *v21; // rax
__int64 v22; // rbx
double v23; // xmm0_8
__int64 v24; // rax
__int64 v25; // rax
float v26; // xmm0_4
_BYTE v27[8]; // [rsp+20h] [rbp-68h] BYREF
_BYTE v28[8]; // [rsp+28h] [rbp-60h] BYREF
float v29; // [rsp+90h] [rbp+8h] BYREF
v6 = -a2;
if ( a1 )
{
v8 = *(unsigned int **)(a1 + 56);
v9 = *v8;
if ( (_DWORD)v9 )
{
v10 = *((_QWORD **)v8 + 2);
for ( i = &v10[v9 - 1]; v10 <= i; v6 = v6 + (float)((float)(v14 * v29) + a2) )
{
v12 = *v10;
if ( !*v10 )
break;
v13 = a4
? (const struct cocos2d::CCSize *)&unk_140909BF8
: (const struct cocos2d::CCSize *)(*(__int64 (__fastcall **)(_QWORD))(*(_QWORD *)v12 + 320LL))(*v10);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v29, v13);
v14 = (*(float (__fastcall **)(__int64))(*(_QWORD *)v12 + 128LL))(v12);
++v10;
}
}
}
v15 = (float)-v6 * 0.5;
if ( a1 )
{
v16 = *(unsigned int **)(a1 + 56);
v17 = *v16;
if ( (_DWORD)v17 )
{
v18 = *((__int64 ***)v16 + 2);
for ( j = &v18[v17 - 1]; v18 <= j; v15 = v15 + (float)((float)(v26 * v29) + a2) )
{
v20 = *v18;
if ( !*v18 )
break;
v21 = a4
? (const struct cocos2d::CCSize *)&unk_140909BF8
: (const struct cocos2d::CCSize *)(*(__int64 (__fastcall **)(__int64 *))(*v20 + 320))(*v18);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v29, v21);
v22 = *v20;
v23 = (*(double (__fastcall **)(__int64 *))(*v20 + 128))(v20);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v28, (float)((float)(*(float *)&v23 * v29) * 0.5) + v15, 0.0);
(*(void (__fastcall **)(__int64 *, __int64))(v22 + 184))(v20, v24);
v25 = (*(__int64 (__fastcall **)(__int64 *))(*v20 + 200))(v20);
cocos2d::CCPoint::operator+(a3, v27, v25);
(*(void (__fastcall **)(__int64 *, _BYTE *))(*v20 + 184))(v20, v27);
v26 = (*(float (__fastcall **)(__int64 *))(*v20 + 128))(v20);
++v18;
}
}
}
}