//
// sub_CD22E4 from 0xcd22e4 to 0xcd2414 (304 bytes)
//
// 1 xrefs:
// > sub_D1E534 @ 0xd1e6f8
//
// 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
//
unsigned __int64 *__fastcall sub_CD22E4(unsigned __int64 *a1)
{
_QWORD *v2; // x0
unsigned __int64 v3; // x1
char v5; // [xsp+38h] [xbp+38h] BYREF
a1[1] = 0;
sub_CD14C0(&v5, a1, 1);
if ( !v5 )
return a1;
v2 = *(_QWORD **)((char *)a1 + *(_QWORD *)(*a1 - 24) + 232);
v3 = v2[2];
if ( v3 < v2[3] )
{
v2[2] = v3 + 1;
LABEL_4:
a1[1] = 1;
return a1;
}
if ( (*(unsigned int (__fastcall **)(_QWORD *))(*v2 + 80LL))(v2) != -1 )
goto LABEL_4;
sub_CCE830((__int64)a1 + *(_QWORD *)(*a1 - 24), *(_DWORD *)((char *)a1 + *(_QWORD *)(*a1 - 24) + 32) | 2);
return a1;
}