//
// sub_CD3128 from 0xcd3128 to 0xcd3258 (304 bytes)
//
// 2 xrefs:
// > sub_CD3258 @ 0xcd3258
// > sub_CD325C @ 0xcd325c
//
// 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_CD3128(unsigned __int64 *a1, _BYTE *a2)
{
_QWORD *v4; // x0
char *v5; // x1
char v6; // w2
int v8; // w0
char v9; // [xsp+38h] [xbp+38h] BYREF
sub_CD14C0(&v9, a1, 0);
if ( !v9 )
return a1;
v4 = *(_QWORD **)((char *)a1 + *(_QWORD *)(*a1 - 24) + 232);
v5 = (char *)v4[2];
if ( (unsigned __int64)v5 < v4[3] )
{
v6 = *v5;
v4[2] = v5 + 1;
LABEL_4:
*a2 = v6;
return a1;
}
v8 = (*(__int64 (__fastcall **)(_QWORD *))(*v4 + 80LL))(v4);
v6 = v8;
if ( v8 != -1 )
goto LABEL_4;
sub_CCE830((__int64)a1 + *(_QWORD *)(*a1 - 24), *(_DWORD *)((char *)a1 + *(_QWORD *)(*a1 - 24) + 32) | 6);
return a1;
}