//
// GameToolbox::alignItemsHorisontally from 0x1004e9150 to 0x1004e947d (813 bytes)
//
// 59 xrefs:
// > EditLevelLayer::setupLevelInfo @ 0x1001defa9
// > EditLevelLayer::setupLevelInfo @ 0x1001deff1
// > EditLevelLayer::setupLevelInfo @ 0x1001df037
// > EditLevelLayer::setupLevelInfo @ 0x1001df0b4
// > NewgroundsInfoLayer::init @ 0x1001fb29e
// > NCSInfoLayer::init @ 0x1001fbbb0
// > LevelCell::loadCustomLevelCell @ 0x100237bac
// > StartPosLayer::addModeButtons @ 0x10025d5b8
// > StartPosLayer::addSpeedButtons @ 0x10025d74e
// > ShareLevelLayer::init @ 0x10026d264
// > ShareLevelLayer::setupStars @ 0x10026d74d
// > ShareLevelLayer::setupStars @ 0x10026d788
// > RateDemonLayer::init @ 0x100270c27
// > RateDemonLayer::init @ 0x100270d17
// > RateStarsLayer::init @ 0x100277503
// > RateStarsLayer::init @ 0x100277571
// > RateStarsLayer::init @ 0x100277776
// > GJAccountSettingsLayer::init @ 0x10028b83e
// > GJMessagePopup::loadFromGJMessage @ 0x100294375
// > GJWriteMessagePopup::init @ 0x100295983
// > UIPOptionsLayer::init @ 0x1002a55eb
// > SetupShaderEffectPopup::setupShaderTrigger @ 0x1002bc995
// > SetupShaderEffectPopup::setupShaderTrigger @ 0x1002bc9f1
// > SetGroupIDLayer::init @ 0x1002fdede
// > PurchaseItemPopup::init @ 0x1003138f1
// > ShareListLayer::init @ 0x10034e08b
// > WorldLevelPage::init @ 0x1003af8a4
// > PauseLayer::customSetup @ 0x1003c085c
// > CreateStartPosPopup::init @ 0x1003c4998
// > AccountRegisterLayer::init @ 0x10048c839
// > AccountLoginLayer::init @ 0x10049140b
// > EndLevelLayer::customSetup @ 0x1004ba6f3
// > UILayer::init @ 0x1004c23fa
// > LevelFeatureLayer::init @ 0x100503ce7
// > GJRateLevelLayer::init @ 0x100504cfc
// > GJRateLevelLayer::init @ 0x100504d61
// > GJRateLevelLayer::init @ 0x100505078
// > sub_1005070C0 @ 0x100507e32
// > GJRateEditorSoundLayer::init @ 0x1005094d6
// > RateLevelLayer::init @ 0x100595143
// > RateLevelLayer::init @ 0x100595233
// > GauntletSelectLayer::setupGauntlets @ 0x10059f792
// > GameSettingsLayer::setupTabs @ 0x1005fe850
// > sub_10063F6F0 @ 0x10063f98a
// > ShareCommentLayer::init @ 0x1006b1e4c
// > sub_1006C4830 @ 0x1006c58f0
// > sub_1006C4830 @ 0x1006c594d
// > sub_1006D9240 @ 0x1006d9355
// > LevelSearchLayer::init @ 0x100706162
// > LevelSearchLayer::init @ 0x100706559
// > DemonFilterSelectLayer::init @ 0x10070c48e
// > ProfilePage::loadPageFromUserInfo @ 0x1008a1863
// > ProfilePage::setupAccountButtons @ 0x1008a2174
// > DemonInfoPopup::init @ 0x1008a8131
// > MyStuffPopup::init @ 0x1008a9def
// > RateStarsModLayer::init @ 0x100963156
// > RateStarsModLayer::init @ 0x1009631c4
// > RateStarsModLayer::init @ 0x100963678
// > RateStarsModLayer::init @ 0x10096376c
//
// 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:31:21 +0000
//
void __fastcall GameToolbox::alignItemsHorisontally(__int64 a1, unsigned __int64 *a2, int a3, __m128 a4)
{
unsigned int *v4; // rax
__int64 v5; // rcx
_QWORD *v6; // rbx
unsigned __int64 v7; // r15
__int64 v8; // r14
float v9; // xmm0_4
__m128 v10; // xmm1
__int64 v11; // r13
_QWORD *v12; // rsi
float v13; // xmm0_4
__m128 v14; // xmm1
unsigned int *v15; // rax
__int64 v16; // rcx
__m128 v17; // xmm0
_QWORD *v18; // r14
unsigned __int64 v19; // rbx
__int64 v20; // r13
float v21; // xmm0_4
unsigned __int64 *v22; // rax
float v23; // xmm0_4
__m128 v24; // xmm1
__int64 v25; // r12
_QWORD *v26; // rsi
float v27; // xmm0_4
unsigned __int64 *v28; // rax
float v29; // xmm0_4
__m128 v30; // xmm1
double v31; // [rsp+8h] [rbp-88h] BYREF
__int64 v32; // [rsp+10h] [rbp-80h]
unsigned __int64 *v33; // [rsp+18h] [rbp-78h]
__m128 v34; // [rsp+20h] [rbp-70h]
int v35; // [rsp+3Ch] [rbp-54h]
__m128 v36; // [rsp+40h] [rbp-50h]
__int64 v37; // [rsp+5Ch] [rbp-34h] BYREF
float v38; // [rsp+64h] [rbp-2Ch]
v33 = a2;
v34 = a4;
if ( a1 )
{
v4 = *(unsigned int **)(a1 + 56);
v5 = *v4;
if ( *v4 )
{
v32 = a1;
v36 = _mm_xor_ps((__m128)xmmword_100A035F0, v34);
v6 = *((_QWORD **)v4 + 2);
v7 = (unsigned __int64)&v6[v5 - 1];
v35 = a3;
if ( (_BYTE)a3 )
{
do
{
v8 = *v6;
if ( !*v6 )
break;
sub_100278630(&v37, &qword_100BE46D8);
v38 = *(float *)&v37;
v9 = (*(float (__fastcall **)(__int64))(*(_QWORD *)v8 + 136LL))(v8);
v10 = v36;
v10.f32[0] = v36.f32[0] + (float)((float)(v9 * v38) + v34.f32[0]);
v36 = v10;
++v6;
}
while ( (unsigned __int64)v6 <= v7 );
}
else
{
do
{
v11 = *v6;
if ( !*v6 )
break;
v12 = (_QWORD *)(*(__int64 (__fastcall **)(_QWORD))(*(_QWORD *)v11 + 328LL))(*v6);
sub_100278630(&v37, v12);
v38 = *(float *)&v37;
v13 = (*(float (__fastcall **)(__int64))(*(_QWORD *)v11 + 136LL))(v11);
v14 = v36;
v14.f32[0] = v36.f32[0] + (float)((float)(v13 * v38) + v34.f32[0]);
v36 = v14;
++v6;
}
while ( (unsigned __int64)v6 <= v7 );
}
v15 = *(unsigned int **)(v32 + 56);
v16 = *v15;
if ( *v15 )
{
v17 = v36;
v17.f32[0] = v36.f32[0] * -0.5;
v36 = v17;
v18 = *((_QWORD **)v15 + 2);
v19 = (unsigned __int64)&v18[v16 - 1];
if ( (_BYTE)v35 )
{
do
{
v20 = *v18;
if ( !*v18 )
break;
sub_100278630(&v37, &qword_100BE46D8);
v38 = *(float *)&v37;
v21 = (*(float (__fastcall **)(__int64))(*(_QWORD *)v20 + 136LL))(v20);
sub_100278250((float *)&v31, (float)((float)(v21 * v38) * 0.5) + v36.f32[0], 0.0);
(*(void (__fastcall **)(__int64, double *))(*(_QWORD *)v20 + 184LL))(v20, &v31);
v22 = (unsigned __int64 *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v20 + 192LL))(v20);
sub_100278350(&v31, v33, v22);
(*(void (__fastcall **)(__int64, double *))(*(_QWORD *)v20 + 184LL))(v20, &v31);
v38 = *(float *)&v37;
v23 = (*(float (__fastcall **)(__int64))(*(_QWORD *)v20 + 136LL))(v20);
v24 = v36;
v24.f32[0] = v36.f32[0] + (float)((float)(v23 * v38) + v34.f32[0]);
v36 = v24;
++v18;
}
while ( (unsigned __int64)v18 <= v19 );
}
else
{
do
{
v25 = *v18;
if ( !*v18 )
break;
v26 = (_QWORD *)(*(__int64 (__fastcall **)(_QWORD))(*(_QWORD *)v25 + 328LL))(*v18);
sub_100278630(&v37, v26);
v38 = *(float *)&v37;
v27 = (*(float (__fastcall **)(__int64))(*(_QWORD *)v25 + 136LL))(v25);
sub_100278250((float *)&v31, (float)((float)(v27 * v38) * 0.5) + v36.f32[0], 0.0);
(*(void (__fastcall **)(__int64, double *))(*(_QWORD *)v25 + 184LL))(v25, &v31);
v28 = (unsigned __int64 *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v25 + 192LL))(v25);
sub_100278350(&v31, v33, v28);
(*(void (__fastcall **)(__int64, double *))(*(_QWORD *)v25 + 184LL))(v25, &v31);
v38 = *(float *)&v37;
v29 = (*(float (__fastcall **)(__int64))(*(_QWORD *)v25 + 136LL))(v25);
v30 = v36;
v30.f32[0] = v36.f32[0] + (float)((float)(v29 * v38) + v34.f32[0]);
v36 = v30;
++v18;
}
while ( (unsigned __int64)v18 <= v19 );
}
}
}
}
}