//
// sub_C2DA8 from 0xc2da8 to 0xc2e2e (134 bytes)
//
// 1 xrefs:
// > sub_C2AA8 @ 0xc2ab0
//
// 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_C2DA8(int *a1, int a2, int a3, unsigned int *a4)
{
int v7; // r5
unsigned int v8; // r4
int v10; // [sp+8h] [bp-20h] BYREF
unsigned int v11; // [sp+Ch] [bp-1Ch] BYREF
v10 = 0;
v7 = sub_BFE7C((int)&v10);
if ( !v7 )
{
sub_71348(1u, &v11, a1[1]);
v8 = sub_C0E20(v10, a1[56], a1[59], a1[57]);
if ( v8 == -1 )
{
v7 = 16;
*a4 = 0;
}
else
{
*a4 = v8 / v11;
v7 = 0;
(*(void (__fastcall **)(int, int, _DWORD, unsigned int, int))(*(_DWORD *)v10 + 800))(v10, a1[57], 0, v8, a2);
}
}
return v7;
}