//
// EmotePickerPopup::layoutEmoteGrid from 0x1009034d0 to 0x1009037b4 (740 bytes)
//
// 2 xrefs:
// > EmotePickerPopup::onBuildWindowContent @ 0x100903334
// > EmotePickerPopup::onWindowResized @ 0x100903935
//
// 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:38:03 +0000
//
void __fastcall EmotePickerPopup::layoutEmoteGrid(__int64 a1)
{
float v1; // xmm1_4
int v2; // ecx
__int64 v3; // rax
float v4; // xmm1_4
unsigned __int64 v5; // r13
int v6; // r15d
__int64 v7; // r15
int v8; // r12d
int v9; // r14d
unsigned int v10; // r15d
char v11; // r13
__int64 v12; // rax
__int64 v13; // rax
__int64 v14; // r12
float v15; // xmm1_4
float v16; // xmm0_4
bool v17; // cc
float v18; // xmm1_4
float v19; // [rsp-44h] [rbp-44h] BYREF
float v20; // [rsp-3Ch] [rbp-3Ch]
int v21; // [rsp-38h] [rbp-38h]
float v22; // [rsp-34h] [rbp-34h]
if ( *(_QWORD *)(a1 + 1048) && *(_QWORD *)(a1 + 1040) )
{
v1 = *(float *)(a1 + 1056);
v2 = 3;
if ( (int)(float)((float)(v1 + -8.0) / 26.0) >= 4 )
v2 = (int)(float)((float)(v1 + -8.0) / 26.0);
v21 = v2;
v20 = (float)(v1 - (float)((float)v2 * 26.0)) * 0.5;
v3 = *(_QWORD *)(a1 + 1216);
if ( *(_QWORD *)(a1 + 1224) == v3 )
{
v22 = -4.0;
v6 = 0;
if ( (int)EmoteSprite::defCount() <= 0 )
goto LABEL_31;
}
else
{
v4 = -4.0;
v5 = 0;
v6 = 0;
do
{
v8 = v6;
if ( v6 >= v21 )
{
v8 = 0;
v4 = v4 + -26.0;
}
v22 = v4;
v7 = *(_QWORD *)(v3 + 8 * v5);
sub_100278250(&v19, (float)((float)((float)v8 + 0.5) * 26.0) + v20, v4 + -13.0);
(*(void (__fastcall **)(__int64, float *))(*(_QWORD *)v7 + 184LL))(v7, &v19);
v4 = v22;
v6 = v8 + 1;
++v5;
v3 = *(_QWORD *)(a1 + 1216);
}
while ( v5 < (*(_QWORD *)(a1 + 1224) - v3) >> 3 );
if ( v8 >= 0 )
v4 = v22 + -38.0;
v22 = v4;
if ( (int)EmoteSprite::defCount() <= 0 )
goto LABEL_31;
}
v9 = v6 & (v6 >> 31);
v10 = 0;
v11 = 0;
do
{
v12 = EmoteSprite::defAtIndex(v10);
if ( *(_QWORD *)v12 )
{
if ( !*(_BYTE *)(v12 + 27) )
{
v13 = (*(__int64 (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 1048) + 480LL))(
*(_QWORD *)(a1 + 1048),
v10);
if ( v13 )
{
v14 = v13;
v15 = v22;
if ( v9 >= v21 )
{
v9 = 0;
v15 = v22 + -26.0;
}
v22 = v15;
sub_100278250(&v19, (float)((float)((float)v9 + 0.5) * 26.0) + v20, v15 + -13.0);
(*(void (__fastcall **)(__int64, float *))(*(_QWORD *)v14 + 184LL))(v14, &v19);
++v9;
v11 = 1;
}
}
}
else if ( (v11 & 1) != 0 )
{
v16 = v22 + -26.0;
v17 = v9 <= 0;
if ( v9 >= 0 )
v9 = 0;
if ( v17 )
v16 = v22;
v11 = 1;
v22 = v16 + -12.0;
}
else
{
v11 = 0;
}
++v10;
}
while ( (int)v10 < (int)EmoteSprite::defCount() );
if ( v9 > 0 )
{
v18 = v22 + -26.0;
goto LABEL_33;
}
LABEL_31:
v18 = v22;
LABEL_33:
ScrollableContentLayer::setContentHeight(*(_QWORD *)(a1 + 1040), 5.0 - v18);
}
}