//
// sub_1003B7D1C from 0x1003b7d1c to 0x1003b7eb0 (404 bytes)
//
// 1 xrefs:
// > EmotePickerPopup::onPickEmote @ 0x1004dba9c
//
// 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:03:57 +0000
//
void __fastcall sub_1003B7D1C(__int64 a1, char *a2)
{
__int64 v4; // x27
__int64 v5; // x28
__int64 v6; // x23
unsigned __int64 v7; // x24
int v8; // w26
_QWORD *v9; // x22
__int64 v10; // x19
size_t v11; // x0
int v12; // w10
const std::string::value_type *v13; // x1
std::string::size_type v14; // x2
bool v15; // cf
__int64 v17; // [xsp+8h] [xbp-88h]
std::string __str; // [xsp+10h] [xbp-80h] BYREF
__int64 v19; // [xsp+28h] [xbp-68h] BYREF
__int64 v20; // [xsp+30h] [xbp-60h]
__int64 v21; // [xsp+38h] [xbp-58h]
v19 = 0;
v20 = 0;
v21 = 0;
sub_1003B6B24((std::string *)(a1 + 1664), ",", (__int64)&v19);
v17 = a1;
sub_100009900(&__str, a2);
v5 = v19;
v4 = v20;
if ( v20 != v19 )
{
v6 = 0;
v7 = 1;
v8 = 1;
do
{
v9 = (_QWORD *)(v5 + v6);
v10 = *(char *)(v5 + v6 + 23);
if ( v10 < 0 )
{
if ( !v9[1] )
goto LABEL_21;
}
else if ( !*(_BYTE *)(v5 + v6 + 23) )
{
goto LABEL_21;
}
v11 = strlen(a2);
if ( (v10 & 0x80000000) != 0 )
{
if ( v11 != *(_QWORD *)(v5 + v6 + 8) )
goto LABEL_14;
if ( v11 == -1 )
sub_100050040();
v9 = (_QWORD *)*v9;
}
else if ( v11 != v10 )
{
goto LABEL_14;
}
if ( memcmp(v9, a2, v11) )
{
LABEL_14:
std::string::append(&__str, ",");
v12 = *(char *)(v19 + v6 + 23);
if ( v12 >= 0 )
v13 = (const std::string::value_type *)(v19 + v6);
else
v13 = *(const std::string::value_type **)(v19 + v6);
if ( v12 >= 0 )
v14 = *(unsigned __int8 *)(v19 + v6 + 23);
else
v14 = *(_QWORD *)(v19 + v6 + 8);
std::string::append(&__str, v13, v14);
++v8;
v5 = v19;
v4 = v20;
}
LABEL_21:
v15 = v7++ >= 0xAAAAAAAAAAAAAAABLL * ((v4 - v5) >> 3);
v6 += 24;
}
while ( !v15 && v8 < 16 );
}
std::string::operator=((std::string *)(v17 + 1664), &__str);
if ( SHIBYTE(__str.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__str.__r_.__value_.__l.__data_);
__str.__r_.__value_.__r.__words[0] = (std::string::size_type)&v19;
sub_100018250((void ***)&__str);
}