//
// sub_66861C from 0x66861c to 0x668686 (106 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_66861C(_DWORD *a1, int a2)
{
int v4; // r7
int v5; // r3
_BYTE *v6; // r7
int v7; // r8
int v8; // r6
int v9; // r4
__int16 *v10; // t1
v4 = a1[106];
if ( a1[59] )
{
v5 = *(_DWORD *)(v4 + 68);
if ( !v5 )
{
sub_667F7C(a1, *(_DWORD *)(v4 + 72));
v5 = a1[59];
*(_DWORD *)(v4 + 72) = ((unsigned __int8)*(_DWORD *)(v4 + 72) + 1) & 7;
}
*(_DWORD *)(v4 + 68) = v5 - 1;
}
v6 = (_BYTE *)(v4 + 204);
v7 = a1[94];
if ( (int)a1[80] > 0 )
{
v8 = a2 - 4;
v9 = 0;
do
{
v10 = *(__int16 **)(v8 + 4);
v8 += 4;
++v9;
sub_667374((int)a1, v6, (*v10 >> v7) & 1);
}
while ( a1[80] > v9 );
}
return 1;
}