//
// EmotePickerPopup::onBuildWindowContent from 0x1004db464 to 0x1004db6e0 (636 bytes)
//
// 1 xrefs:
// > ??> @ 0x10098c440
//
// 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 11:06:34 +0000
//
void __fastcall EmotePickerPopup::onBuildWindowContent(__int64 a1)
{
__int64 v2; // x0
__int64 v3; // x20
const std::string *v4; // x21
int v5; // w8
bool v6; // cc
__int64 v7; // x8
__int64 v8; // x23
_BYTE *v9; // x9
__int64 v10; // x11
_BYTE *v11; // x10
_BYTE *v12; // x8
__int64 v13; // x24
std::string::size_type v14; // x22
__int64 v15; // x0
std::string::size_type size; // x8
__int64 v17; // x25
bool v18; // zf
int v19; // w8
std::string::size_type v20; // x11
bool v21; // cc
const std::string *v22; // x8
_BYTE *v23; // x9
_BYTE *v24; // x10
std::string::size_type v25; // x11
_BYTE *v26; // x8
__int64 v27; // x8
__int64 v28; // x21
unsigned __int64 v29; // x22
__int64 v30; // x20
__int64 v31; // x0
__int64 i; // x20
__int64 v33; // [xsp+0h] [xbp-80h] BYREF
__int64 v34; // [xsp+8h] [xbp-78h]
__int64 v35; // [xsp+10h] [xbp-70h]
std::string v36; // [xsp+18h] [xbp-68h] BYREF
std::allocator __a; // [xsp+37h] [xbp-49h] BYREF
*(_QWORD *)(a1 + 1224) = *(_QWORD *)(a1 + 1216);
v33 = 0;
v34 = 0;
v35 = 0;
v2 = GameManager::sharedState();
v3 = v2;
v4 = (const std::string *)(v2 + 1664);
v5 = *(char *)(v2 + 1687);
v6 = v5 < 0;
if ( v5 >= 0 )
v7 = v2 + 1664;
else
v7 = *(_QWORD *)(v2 + 1664);
if ( v6 )
v8 = *(_QWORD *)(v2 + 1672);
else
v8 = *(unsigned __int8 *)(v2 + 1687);
if ( v8 )
{
v9 = (_BYTE *)(v7 + v8);
v10 = v8;
v11 = (_BYTE *)v7;
while ( *v11 != 44 )
{
++v11;
if ( !--v10 )
{
v11 = (_BYTE *)(v7 + v8);
break;
}
}
v12 = &v11[-v7];
if ( v11 == v9 )
v13 = -1;
else
v13 = (__int64)v12;
}
else
{
v13 = -1;
}
v14 = 0;
do
{
v15 = (__int64)std::string::basic_string(&v36, v4, v14, v13 - v14, &__a);
size = HIBYTE(v36.__r_.__value_.__r.__words[2]);
if ( (v36.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) != 0LL )
size = v36.__r_.__value_.__l.__size_;
if ( v14 != v8 || size )
v15 = sub_100017C70((__int64)&v33);
if ( v13 == -1 )
goto LABEL_23;
v14 = v13 + 1;
v19 = *(char *)(v3 + 1687);
v20 = *(_QWORD *)(v3 + 1672);
v21 = v19 < 0;
if ( v19 >= 0 )
v22 = v4;
else
v22 = *(const std::string **)(v3 + 1664);
if ( !v21 )
v20 = *(unsigned __int8 *)(v3 + 1687);
if ( v20 <= v14 )
{
LABEL_23:
v17 = -1;
}
else
{
v23 = (char *)v22 + v20;
v24 = (char *)v22 + v14;
v25 = ~v13 + v20;
while ( *v24 != 44 )
{
++v24;
if ( !--v25 )
{
v24 = v23;
break;
}
}
v26 = (_BYTE *)(v24 - (_BYTE *)v22);
if ( v24 == v23 )
v17 = -1;
else
v17 = (__int64)v26;
}
if ( SHIBYTE(v36.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v36.__r_.__value_.__l.__data_);
v18 = v13 == -1;
v13 = v17;
}
while ( !v18 );
v27 = v33;
if ( v34 != v33 )
{
v28 = 0;
v29 = 0;
do
{
v15 = EmoteSprite::defForName(v27 + v28);
v30 = v15;
if ( v15 )
{
if ( (*(_BYTE *)(v15 + 27) & 1) == 0 )
{
v31 = EmoteSprite::defAtIndex(0);
v15 = EmotePickerPopup::addCell(
a1,
v30,
100000 - 1431655765 * (unsigned int)((unsigned __int64)(v30 - v31) >> 4));
v36.__r_.__value_.__r.__words[0] = v15;
if ( v15 )
sub_100011A50(a1 + 1216, &v36);
}
}
++v29;
v27 = v33;
v28 += 24;
}
while ( v29 < 0xAAAAAAAAAAAAAAABLL * ((v34 - v33) >> 3) );
}
for ( i = 0; (int)i < (int)EmoteSprite::defCount(v15); i = (unsigned int)(i + 1) )
{
v15 = EmoteSprite::defAtIndex(i);
if ( *(_QWORD *)v15 )
{
if ( (*(_BYTE *)(v15 + 27) & 1) == 0 )
v15 = EmotePickerPopup::addCell(a1, v15, i);
}
}
EmotePickerPopup::layoutEmoteGrid(a1);
v36.__r_.__value_.__r.__words[0] = (std::string::size_type)&v33;
sub_100018250((void ***)&v36);
}