//
// sub_6CA18 from 0x6ca18 to 0x6ca50 (56 bytes)
//
// 3 xrefs:
// > sub_6C16C @ 0x6c1a0
// > sub_6C1C0 @ 0x6c1e8
// > sub_6C2A8 @ 0x6c2cc
//
// 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_6CA18(int a1, _DWORD **a2, int *a3, _DWORD *a4)
{
_DWORD *v4; // r4
int v5; // r2
int v6; // r4
int v7; // r6
int v8; // r5
int v9; // r4
v4 = *a2;
v5 = *a3;
while ( 1 )
{
v6 = *v4;
if ( v6 == -1 )
return 74;
v7 = *(_DWORD *)(a1 + 12);
v8 = 3 * v6;
v9 = v7 + 12 * v6;
if ( *(_DWORD *)(v7 + 4 * v8) == v5 )
break;
v4 = (_DWORD *)(v9 + 4);
*a2 = v4;
}
*a4 = v9;
return 0;
}