//
// sub_100642AF0 from 0x100642af0 to 0x100642cc8 (472 bytes)
//
// 5 xrefs:
// > sub_100642DF0 @ 0x100642e13
// > sub_100642E20 @ 0x100642e49
// > sub_100642E60 @ 0x100642ec5
// > sub_100642F00 @ 0x100642f65
// > sub_100642FA0 @ 0x100642fd6
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
__int64 __fastcall sub_100642AF0(unsigned __int64 *a1, __int64 a2, const char *a3, unsigned int a4, unsigned int a5)
{
unsigned int v8; // eax
int v9; // eax
unsigned __int8 v10; // cf
__int64 i; // rax
int v12; // ecx
__int64 v13; // rdx
__int64 v14; // rax
__int64 v15; // rdx
__int16 v17; // [rsp+8h] [rbp-2848h] BYREF
char v18; // [rsp+Ah] [rbp-2846h]
__int64 v19; // [rsp+2808h] [rbp-48h]
__int64 v20; // [rsp+2810h] [rbp-40h]
unsigned int v21; // [rsp+2818h] [rbp-38h]
v19 = a2;
v20 = 0;
v8 = a5;
if ( a5 <= 8 )
{
v9 = 401;
v10 = _bittest(&v9, a5);
v8 = a5;
if ( v10 )
v8 = dword_100822B28[a5];
}
v21 = v8;
if ( (a4 & 2) != 0 && a5 != 9 )
{
v17 = -17425;
v18 = -65;
v20 = 3;
}
if ( (a4 & 8) == 0 )
{
if ( *a1 )
{
for ( i = *(_QWORD *)(*a1 + 32); i; i = *(_QWORD *)(i + 48) )
{
v12 = *(_DWORD *)i & 7;
if ( v12 == 1 )
break;
if ( v12 == 6 )
goto LABEL_20;
}
}
sub_10064BA00(&v17, "