//
// sub_100223420 from 0x100223420 to 0x1002234d9 (185 bytes)
//
// 0 xrefs:
//
// 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:27:04 +0000
//
__int64 __fastcall sub_100223420(__int64 a1, int a2)
{
_QWORD *v2; // rax
_QWORD *v3; // r12
_QWORD *v4; // r14
_QWORD *v5; // r13
__int64 v6; // rax
v2 = *(_QWORD **)(a1 + 864);
if ( v2 )
{
while ( 1 )
{
while ( 1 )
{
v4 = v2;
if ( *((_DWORD *)v2 + 7) <= a2 )
break;
v2 = (_QWORD *)*v2;
v3 = v4;
if ( !*v4 )
goto LABEL_8;
}
if ( *((_DWORD *)v2 + 7) >= a2 )
break;
v2 = (_QWORD *)v2[1];
if ( !v2 )
{
v3 = v4 + 1;
goto LABEL_8;
}
}
}
else
{
v3 = (_QWORD *)(a1 + 864);
v4 = (_QWORD *)(a1 + 864);
LABEL_8:
v5 = v4;
v4 = operator new(0x28u);
*((_DWORD *)v4 + 7) = a2;
*((_BYTE *)v4 + 32) = 0;
*(_OWORD *)v4 = 0;
v4[2] = v5;
*v3 = v4;
v6 = **(_QWORD **)(a1 + 856);
if ( v6 )
*(_QWORD *)(a1 + 856) = v6;
sub_10001B680(*(__int64 **)(a1 + 864), v4);
++*(_QWORD *)(a1 + 872);
}
return *((unsigned __int8 *)v4 + 32);
}