//
// EmoteSprite::defForName from 0x14007efa0 to 0x14007f0d6 (310 bytes)
//
// 26 xrefs:
// > EmoteSprite::createWithName @ 0x14007f1e4
// > EmoteSprite::parseTokens @ 0x14007fad0
// > ThreadViewPopup::init @ 0x1400d9f32
// > ThreadViewPopup::layoutTitleRow @ 0x1400e30a3
// > ThreadViewPopup::layoutTitleRow @ 0x1400e315c
// > NewThreadPopup::init @ 0x1400f03af
// > NewThreadPopup::refreshIconSlot @ 0x1400f0975
// > InvitesPopup::buildRows @ 0x1400f7f49
// > InvitesPopup::buildRows @ 0x1400f7ff8
// > ThreadDescPopup::buildUI @ 0x1400fd11c
// > ThreadDescPopup::refreshIconSlot @ 0x1400fd7f5
// > ThreadRequestPopup::init @ 0x1400fed9f
// > ThreadRequestPopup::init @ 0x1400fee51
// > EmotePickerPopup::onBuildWindowContent @ 0x140123d39
// > GJThreadCell::loadFromThread @ 0x1401599c0
// > GJThreadCell::loadFromThread @ 0x140159a7a
// > GJNotificationCell::loadFromNotification @ 0x14015b770
// > GJNotificationCell::loadFromNotification @ 0x14015b7ce
// > EditLevelLayer::init @ 0x140178f41
// > EditorSoundConfigCell::loadFromConfig @ 0x1401908a8
// > EditorSoundConfigCell::loadFromConfig @ 0x14019097b
// > SoundPackDescPopup::init @ 0x140199a15
// > SoundPackDescPopup::refreshIconSlot @ 0x140199ece
// > SetTextPopup::init @ 0x1403a7aa1
// > ShareCommentLayer::init @ 0x14062f05b
// > ??> @ 0x140911eac
//
// 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 11:25:54 +0000
//
__int64 __fastcall EmoteSprite::defForName(__int64 a1, __int64 a2, __int64 a3, double a4)
{
unsigned __int64 v5; // r9
__int64 v6; // rbp
unsigned __int64 v7; // rax
unsigned __int64 v8; // rdx
char *v9; // r8
char *v10; // rcx
char *v11; // rcx
char *v12; // rcx
__int64 v13; // rsi
__int64 v14; // rbx
__int64 v15; // rdi
unsigned int v16; // eax
__int64 v17; // rcx
__int64 *v18; // rcx
_QWORD Buf2[2]; // [rsp+20h] [rbp-38h] BYREF
unsigned __int64 v21; // [rsp+30h] [rbp-28h]
unsigned __int64 v22; // [rsp+38h] [rbp-20h]
ensureEmotesAreLoaded(a1, a2, a3, a4);
sub_14003F4F0((__int64)Buf2, a1);
v5 = v21;
v6 = 0;
v7 = 0;
if ( v21 )
{
v8 = v22;
v9 = (char *)Buf2[0];
do
{
v10 = (char *)Buf2;
if ( v8 > 0xF )
v10 = v9;
if ( v10[v7] >= 65 )
{
v11 = (char *)Buf2;
if ( v8 > 0xF )
v11 = v9;
if ( v11[v7] <= 90 )
{
v12 = (char *)Buf2;
if ( v8 > 0xF )
v12 = v9;
v12[v7] += 32;
v8 = v22;
v5 = v21;
v9 = (char *)Buf2[0];
}
}
++v7;
}
while ( v7 < v5 );
}
v13 = qword_140909D40;
v14 = qword_140909D40;
v15 = *(_QWORD *)(qword_140909D40 + 8);
if ( !*(_BYTE *)(v15 + 25) )
{
do
{
v16 = (unsigned int)sub_14003D160((_QWORD *)(v15 + 32), Buf2) >> 31;
v17 = v15;
if ( (_BYTE)v16 )
v17 = v14;
v14 = v17;
v18 = (__int64 *)(v15 + 16);
if ( !(_BYTE)v16 )
v18 = (__int64 *)v15;
v15 = *v18;
}
while ( !*(_BYTE *)(*v18 + 25) );
}
if ( *(_BYTE *)(v14 + 25) || sub_14003D160(Buf2, (_QWORD *)(v14 + 32)) < 0 )
v14 = v13;
if ( v14 != v13 )
v6 = *(_QWORD *)(v14 + 64);
sub_14003D310((__int64)Buf2);
return v6;
}