//
// EmoteSprite::defForName from 0x3f3e48 to 0x3f3f02 (186 bytes)
//
// 3 xrefs:
// > EmoteSprite::parseTokens @ 0x3f4002
// > EmoteSprite::createWithName @ 0x3f4466
// > EmotePickerPopup::onBuildWindowContent @ 0x779832
//
// 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:47:16 +0000
//
int __fastcall EmoteSprite::defForName(int a1, int a2, int a3, int a4)
{
unsigned int v5; // r1
char *v6; // r2
unsigned int i; // r3
char *v8; // r2
int v9; // r1
int *v10; // r2
int *v11; // r0
int v12; // r5
char *v14; // r2
int v15; // [sp+0h] [bp-10h] BYREF
unsigned int v16; // [sp+4h] [bp-Ch]
char *v17; // [sp+8h] [bp-8h]
int v18; // [sp+Ch] [bp-4h]
v18 = a4;
sub_3F3CB4();
v15 = 0;
v16 = 0;
v17 = nullptr;
if ( (*(_BYTE *)a1 & 1) != 0 )
{
std::string::__init(&v15, *(const void **)(a1 + 8), *(_DWORD *)(a1 + 4));
}
else
{
v5 = *(_DWORD *)(a1 + 4);
v6 = *(char **)(a1 + 8);
v15 = *(_DWORD *)a1;
v16 = v5;
v17 = v6;
}
for ( i = 0; ; ++i )
{
v9 = v15 & 1;
if ( !v9 )
break;
if ( i >= v16 )
goto LABEL_18;
v8 = v17;
LABEL_7:
if ( (unsigned __int8)v8[i] > 0x40u )
{
v10 = v9 ? (int *)v17 : (int *)((char *)&v15 + 1);
if ( *((unsigned __int8 *)v10 + i) <= 0x5Au )
{
if ( v9 )
v14 = v17;
else
v14 = (char *)&v15 + 1;
v14[i] += 32;
}
}
}
if ( i < (unsigned __int8)v15 >> 1 )
{
v8 = (char *)&v15 + 1;
goto LABEL_7;
}
LABEL_18:
v11 = std::__tree,std::__map_value_compare,std::less,true>,std::allocator>>::find(
(int)&dword_D2B53C,
(unsigned __int8 *)&v15);
if ( v11 == &dword_D2B540 )
v12 = 0;
else
v12 = v11[7];
std::string::~string((int)&v15);
return v12;
}