//
// sub_66DCC8 from 0x66dcc8 to 0x66dd2a (98 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
//
int __fastcall sub_66DCC8(_DWORD *a1)
{
int v1; // r3
_BYTE *v3; // r2
int v4; // r2
int v5; // r3
_BYTE *v6; // r2
int result; // r0
int v8; // r2
v1 = a1[6];
v3 = (_BYTE *)(*(_DWORD *)v1)++;
*v3 = -1;
v4 = *(_DWORD *)(v1 + 4) - 1;
*(_DWORD *)(v1 + 4) = v4;
if ( !v4 && !(*(int (**)(void))(v1 + 12))() )
{
*(_DWORD *)(*a1 + 20) = 25;
(*(void (__fastcall **)(_DWORD *))*a1)(a1);
}
v5 = a1[6];
v6 = *(_BYTE **)v5;
result = *(_DWORD *)v5 + 1;
*(_DWORD *)v5 = result;
*v6 = -39;
v8 = *(_DWORD *)(v5 + 4) - 1;
*(_DWORD *)(v5 + 4) = v8;
if ( !v8 )
{
result = (*(int (__fastcall **)(_DWORD *))(v5 + 12))(a1);
if ( !result )
{
*(_DWORD *)(*a1 + 20) = 25;
return (*(int (__fastcall **)(_DWORD *))*a1)(a1);
}
}
return result;
}