//
// sub_CD1A94 from 0xcd1a94 to 0xcd1be8 (340 bytes)
//
// 0 xrefs:
//
// 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_CD1A94(unsigned __int64 *a1)
{
_QWORD *v2; // x2
unsigned __int8 *v3; // x1
__int64 result; // x0
int v5; // w1
char v6; // [xsp+38h] [xbp+38h] BYREF
a1[1] = 0;
sub_CD14C0(&v6, a1, 1);
if ( !v6 )
{
v5 = 4;
if ( a1[1] )
return 0xFFFFFFFFLL;
goto LABEL_10;
}
v2 = *(_QWORD **)((char *)a1 + *(_QWORD *)(*a1 - 24) + 232);
v3 = (unsigned __int8 *)v2[2];
if ( (unsigned __int64)v3 >= v2[3] )
{
result = (*(__int64 (__fastcall **)(_QWORD))(*v2 + 80LL))(*(unsigned __int64 *)((char *)a1
+ *(_QWORD *)(*a1 - 24)
+ 232));
if ( (_DWORD)result != -1 )
goto LABEL_4;
if ( a1[1] )
v5 = 2;
else
v5 = 6;
LABEL_10:
sub_CCE830((__int64)a1 + *(_QWORD *)(*a1 - 24), v5 | *(_DWORD *)((char *)a1 + *(_QWORD *)(*a1 - 24) + 32));
return 0xFFFFFFFFLL;
}
result = *v3;
v2[2] = v3 + 1;
LABEL_4:
a1[1] = 1;
return result;
}