//
// sub_100905BB0 from 0x100905bb0 to 0x100905d36 (390 bytes)
//
// 1 xrefs:
// > ensureEmotesAreLoaded @ 0x1009041fe
//
// 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 12:38:04 +0000
//
__int64 *__fastcall sub_100905BB0(__int64 **a1, unsigned __int8 *a2, __int64 a3, __int64 *a4)
{
__int64 *v4; // rax
unsigned int v5; // edi
size_t v6; // rdi
const void *v7; // rbx
__int64 *v8; // r14
__int64 *v9; // rcx
unsigned int v10; // r12d
size_t v11; // r12
const void *v12; // r13
size_t v13; // r14
int v14; // eax
bool v15; // cl
int v16; // eax
bool v17; // cl
__int64 *v18; // rbx
_QWORD *v19; // r15
__int64 v20; // rax
__int64 *v21; // rax
__int64 *v25; // [rsp+10h] [rbp-30h]
v4 = a1[1];
if ( v4 )
{
v5 = *a2;
if ( (v5 & 1) != 0 )
{
v6 = *((_QWORD *)a2 + 1);
v7 = *((const void **)a2 + 2);
}
else
{
v6 = v5 >> 1;
v7 = a2 + 1;
}
while ( 1 )
{
while ( 1 )
{
v10 = *((unsigned __int8 *)v4 + 32);
v25 = v4;
if ( (v10 & 1) != 0 )
{
v11 = v4[5];
v12 = (const void *)v4[6];
}
else
{
v11 = v10 >> 1;
v12 = (char *)v4 + 33;
}
v13 = v6;
if ( v11 < v6 )
v13 = v11;
v14 = memcmp(v7, v12, v13);
v15 = v6 < v11;
if ( v14 )
v15 = v14 < 0;
if ( !v15 )
break;
v9 = v25;
v4 = (__int64 *)*v25;
v8 = v25;
if ( !*v25 )
goto LABEL_20;
}
v16 = memcmp(v12, v7, v13);
v17 = v11 < v6;
if ( v16 )
v17 = v16 < 0;
if ( !v17 )
return v25;
v9 = v25;
v4 = (__int64 *)v25[1];
if ( !v4 )
{
v8 = v25 + 1;
goto LABEL_20;
}
}
}
else
{
v8 = (__int64 *)(a1 + 1);
v9 = (__int64 *)(a1 + 1);
LABEL_20:
v18 = v9;
v19 = operator new(0x40u);
v20 = *a4;
v19[6] = *(_QWORD *)(*a4 + 16);
*((_OWORD *)v19 + 2) = *(_OWORD *)v20;
*(_OWORD *)v20 = 0;
*(_QWORD *)(v20 + 16) = 0;
v19[7] = 0;
*(_OWORD *)v19 = 0;
v19[2] = v18;
*v8 = (__int64)v19;
v21 = (__int64 *)**a1;
if ( v21 )
*a1 = v21;
sub_10001B680(a1[1], v19);
a1[2] = (__int64 *)((char *)a1[2] + 1);
}
return v19;
}