//
// EmotePickerPopup::layoutEmoteGrid from 0xcb9214 to 0xcb9484 (624 bytes)
//
// 3 xrefs:
// > EmotePickerPopup::onWindowResized @ 0xcb948c
// > EmotePickerPopup::onBuildWindowContent @ 0xcbaac8
// > ??> @ 0xe6fe0
//
// This function is hookable on this platform (idp: arm, 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 13:06:13 +0000
//
__int64 __fastcall EmotePickerPopup::layoutEmoteGrid(EmotePickerPopup *this)
{
float v2; // s0
int v3; // w21
float v4; // s9
__int64 v5; // x1
__int64 v6; // x0
float v7; // s9
unsigned __int64 v8; // x19
int v9; // w24
float v10; // s8
float v11; // s0
float v12; // s0
__int64 v13; // x25
void (__fastcall *v14)(__int64, _BYTE *); // x26
float v15; // s8
unsigned int v17; // w19
int v18; // w24
int v19; // w26
__int64 v20; // x25
float v21; // s0
float v22; // s0
__int64 (__fastcall *v23)(__int64, _BYTE *); // x27
_BYTE v24[8]; // [xsp+90h] [xbp+90h] BYREF
if ( !*((_QWORD *)this + 131) || !*((_QWORD *)this + 130) )
return _stack_chk_guard;
v2 = *((float *)this + 264);
v3 = (int)(float)((float)(v2 - 8.0) / 26.0);
if ( v3 <= 2 )
{
v4 = 78.0;
v3 = 3;
}
else
{
v4 = (float)v3 * 26.0;
}
v5 = *((_QWORD *)this + 152);
v6 = (*((_QWORD *)this + 153) - v5) >> 3;
v7 = (float)(v2 - v4) * 0.5;
if ( v6 )
{
v8 = 0;
v9 = 0;
v10 = -4.0;
do
{
if ( v3 > v9 )
{
v11 = (float)v9++;
v12 = (float)(v11 + 0.5) * 26.0;
}
else
{
v10 = v10 - 26.0;
v9 = 1;
v12 = 13.0;
}
v13 = *(_QWORD *)(v5 + 8 * v8++);
v14 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v13 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v24, v7 + v12, v10 - 13.0);
v14(v13, v24);
v5 = *((_QWORD *)this + 152);
v6 = *((_QWORD *)this + 153) - v5;
}
while ( v8 < v6 >> 3 );
v15 = v10 - 38.0;
}
else
{
v15 = -4.0;
}
v17 = 0;
v18 = 0;
v19 = 0;
while ( (int)v17 < (int)EmoteSprite::defCount((EmoteSprite *)v6) )
{
v6 = EmoteSprite::defAtIndex((EmoteSprite *)v17);
if ( *(_QWORD *)v6 )
{
v6 = *(unsigned __int8 *)(v6 + 27);
if ( (_DWORD)v6
|| (v6 = (*(__int64 (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)this + 131) + 480LL))(
*((_QWORD *)this + 131),
v17),
(v20 = v6) == 0) )
{
LABEL_21:
++v17;
}
else
{
if ( v3 <= v19 )
{
v15 = v15 - 26.0;
v19 = 1;
v22 = 13.0;
}
else
{
v21 = (float)v19++;
v22 = (float)(v21 + 0.5) * 26.0;
}
v18 = 1;
++v17;
v23 = *(__int64 (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v6 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v24, v7 + v22, v15 - 13.0);
v6 = v23(v20, v24);
}
}
else
{
if ( !v18 )
goto LABEL_21;
if ( v19 )
v15 = v15 - 26.0;
v15 = v15 - 12.0;
v19 = 0;
++v17;
}
}
if ( v19 )
v15 = v15 - 26.0;
ScrollableContentLayer::setContentHeight(*((ScrollableContentLayer **)this + 130), 5.0 - v15);
return _stack_chk_guard;
}