//
// EmotePickerPopup::onBuildWindowContent from 0x7796a4 to 0x7798ee (586 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:59:22 +0000
//
int __fastcall EmotePickerPopup::onBuildWindowContent(EmotePickerPopup *this)
{
int v2; // r2
int v3; // r3
int v4; // r0
int v5; // r8
int v6; // r5
int v7; // r3
int v8; // r2
unsigned __int8 *v9; // r3
unsigned __int8 *v10; // r1
unsigned __int8 *v11; // r4
int v12; // r7
int v13; // r4
int v14; // r8
unsigned int v15; // r7
int v16; // r3
size_t v17; // r2
unsigned int v18; // r3
std::logic_error *exception; // r4
int v20; // r1
size_t v21; // r3
const void *v22; // r1
int v23; // r3
int v24; // r3
unsigned int v25; // r3
int v26; // r2
unsigned __int8 *v27; // r1
unsigned __int8 *v28; // r3
unsigned __int8 *v29; // r4
int v30; // r0
int v31; // r1
int v32; // r2
unsigned int i; // r4
EmoteSprite *v34; // r0
unsigned int v35; // r3
int v36; // r0
int v37; // r8
int v38; // r0
cocos2d::CCSprite *v39; // r0
cocos2d::CCSprite **v40; // r3
int j; // r4
int v42; // r1
cocos2d::CCSprite *v44; // [sp+0h] [bp-24h] BYREF
EmoteSprite *v45; // [sp+4h] [bp-20h] BYREF
int *v46; // [sp+8h] [bp-1Ch]
int *v47; // [sp+Ch] [bp-18h]
int v48; // [sp+10h] [bp-14h] BYREF
int v49; // [sp+14h] [bp-10h]
int v50; // [sp+18h] [bp-Ch]
v2 = *((_DWORD *)this + 219);
while ( 1 )
{
v3 = *((_DWORD *)this + 220);
if ( v2 == v3 )
break;
*((_DWORD *)this + 220) = v3 - 4;
}
v45 = nullptr;
v46 = nullptr;
v47 = nullptr;
v4 = GameManager::sharedState(this);
v5 = *(unsigned __int8 *)(v4 + 1280);
v6 = v4;
if ( (v5 & 1) == 0 )
{
v7 = v5 >> 1;
if ( !(v5 >> 1) )
{
v13 = -1;
goto LABEL_19;
}
v8 = 1281;
LABEL_9:
v9 = (unsigned __int8 *)(v7 + v8);
v10 = (unsigned __int8 *)v8;
while ( 1 )
{
v11 = v10;
if ( v10 == v9 )
break;
v12 = *v10++;
if ( v12 == 44 )
{
v13 = (int)&v11[-v8];
goto LABEL_14;
}
}
v13 = -1;
LABEL_14:
if ( (v5 & 1) != 0 )
goto LABEL_17;
LABEL_19:
v14 = v5 >> 1;
goto LABEL_20;
}
v7 = *(_DWORD *)(v4 + 1284);
v8 = *(_DWORD *)(v4 + 1288);
if ( v7 )
goto LABEL_9;
v13 = -1;
LABEL_17:
v14 = *(_DWORD *)(v4 + 1284);
LABEL_20:
v15 = 0;
while ( 1 )
{
v16 = *(unsigned __int8 *)(v6 + 1280);
v17 = v13 - v15;
v48 = 0;
v49 = 0;
v50 = 0;
if ( (v16 & 1) != 0 )
{
v18 = *(_DWORD *)(v6 + 1284);
if ( v15 > v18 )
goto LABEL_25;
v20 = *(_DWORD *)(v6 + 1288);
}
else
{
v18 = v16 >> 1;
if ( v15 > v18 )
{
LABEL_25:
exception = (std::logic_error *)_cxa_allocate_exception(8u);
std::logic_error::logic_error(exception, "basic_string");
*(_DWORD *)exception = &off_D1548C;
_cxa_throw(
exception,
(struct type_info *)&`typeinfo for'std::out_of_range,
(void (*)(void *))std::length_error::~length_error);
}
v20 = v6 + 1281;
}
v21 = v18 - v15;
v22 = (const void *)(v20 + v15);
if ( v17 >= v21 )
v17 = v21;
std::string::__init(&v48, v22, v17);
if ( (v48 & 1) != 0 )
v23 = v49;
else
v23 = (int)(unsigned __int8)v48 >> 1;
if ( v23 || v15 != v14 )
{
if ( v46 == v47 )
{
std::vector::__push_back_slow_path((int *)&v45, (int)&v48);
}
else
{
if ( v46 )
std::string::basic_string(v46, (int)&v48);
v46 += 3;
}
}
if ( v13 == -1 )
break;
v24 = *(unsigned __int8 *)(v6 + 1280);
v15 = v13 + 1;
if ( (v24 & 1) != 0 )
{
v25 = *(_DWORD *)(v6 + 1284);
v26 = *(_DWORD *)(v6 + 1288);
}
else
{
v25 = v24 >> 1;
v26 = v6 + 1281;
}
if ( v15 < v25 )
{
v27 = (unsigned __int8 *)(v26 + v15);
v28 = (unsigned __int8 *)(v25 + v26);
while ( 1 )
{
v29 = v27;
if ( v27 == v28 )
break;
v30 = *v27++;
if ( v30 == 44 )
{
v13 = (int)&v29[-v26];
goto LABEL_49;
}
}
}
v13 = -1;
LABEL_49:
std::string::~string((int)&v48);
}
std::string::~string((int)&v48);
for ( i = 0; ; ++i )
{
v34 = v45;
v35 = -1431655765 * (((char *)v46 - (char *)v45) >> 2);
if ( i >= v35 )
break;
v36 = EmoteSprite::defForName((int)v45 + 12 * i, v31, v32, v35);
v37 = v36;
if ( v36 )
{
if ( !*(_BYTE *)(v36 + 23) )
{
v38 = EmoteSprite::defAtIndex(0, v31);
v39 = EmotePickerPopup::addCell((int)this, v37, ((v37 - v38) >> 5) + 100000);
v44 = v39;
if ( v39 )
{
v40 = *((cocos2d::CCSprite ***)this + 220);
v32 = *((_DWORD *)this + 221);
if ( v40 == (cocos2d::CCSprite **)v32 )
{
std::vector::__push_back_slow_path((int)this + 876, &v44);
}
else
{
if ( v40 )
*v40 = v39;
*((_DWORD *)this + 220) += 4;
}
}
}
}
}
for ( j = 0; j < EmoteSprite::defCount(v34); ++j )
{
v34 = (EmoteSprite *)EmoteSprite::defAtIndex(j, v42);
if ( *(_DWORD *)v34 && !*((_BYTE *)v34 + 23) )
v34 = EmotePickerPopup::addCell((int)this, (int)v34, j);
}
EmotePickerPopup::layoutEmoteGrid(this);
return std::__vector_base::~__vector_base((int)&v45);
}