//
// sub_6C940 from 0x6c940 to 0x6c998 (88 bytes)
//
// 2 xrefs:
// > sub_6BB6C @ 0x6bb8a
// > sub_6BBB8 @ 0x6bbcc
//
// 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_6C940(int *a1, int *a2, int *a3)
{
bool v3; // zf
int v4; // r3
int v5; // r3
int v6; // r5
int v7; // r0
v3 = *a3 == -1;
if ( *a3 != -1 )
{
v4 = *(_DWORD *)(a1[3] + 12 * *a3 + 4);
*a3 = v4;
v3 = v4 == -1;
}
if ( v3 )
{
v5 = *a2 + 1;
if ( *a2 == -1 )
v5 = 0;
while ( 1 )
{
if ( a1[1] == v5 )
{
v7 = -1;
*a2 = -1;
goto LABEL_12;
}
v6 = *a1;
if ( *(_DWORD *)(*a1 + 4 * v5) != -1 )
break;
++v5;
}
*a2 = v5;
v7 = *(_DWORD *)(v6 + 4 * v5);
LABEL_12:
*a3 = v7;
}
return 0;
}