//
// sub_C9C64C from 0xc9c64c to 0xc9c798 (332 bytes)
//
// 6 xrefs:
// > sub_C9C798 @ 0xc9c7c0
// > sub_C9CA84 @ 0xc9cad0
// > sub_C9CA84 @ 0xc9cc48
// > sub_C9CCB0 @ 0xc9cefc
// > sub_C9CCB0 @ 0xc9d070
// > sub_C9CCB0 @ 0xc9d1a4
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 13:05:57 +0000
//
__int64 __fastcall sub_C9C64C(int *a1, int *a2, int *a3, __int64 a4)
{
int v4; // w9
int v5; // w8
__int64 v6; // x6
__int64 v7; // x5
int v8; // w7
unsigned int v9; // w5
int v10; // w6
v4 = *a2;
v5 = *a1;
v6 = *(_QWORD *)(*(_QWORD *)a4 + 320LL);
v7 = 80LL * *a1;
v8 = *(_DWORD *)(v6 + 80LL * *a2 + 16);
if ( v8 <= *(_DWORD *)(v6 + v7 + 16) )
{
v9 = 0;
if ( v8 >= *(_DWORD *)(v6 + 80LL * *a3 + 16) )
return v9;
*a2 = *a3;
*a3 = v4;
v10 = *a1;
if ( *(_DWORD *)(*(_QWORD *)(*(_QWORD *)a4 + 320LL) + 80LL * *a2 + 16) > *(_DWORD *)(*(_QWORD *)(*(_QWORD *)a4 + 320LL)
+ 80LL * *a1
+ 16) )
{
*a1 = *a2;
v9 = 2;
*a2 = v10;
return v9;
}
return 1;
}
if ( v8 >= *(_DWORD *)(v6 + 80LL * *a3 + 16) )
{
*a1 = v4;
*a2 = v5;
if ( *(_DWORD *)(*(_QWORD *)(*(_QWORD *)a4 + 320LL) + 80LL * *a3 + 16) > *(_DWORD *)(*(_QWORD *)(*(_QWORD *)a4 + 320LL)
+ v7
+ 16) )
{
*a2 = *a3;
*a3 = v5;
return 2;
}
return 1;
}
*a1 = *a3;
*a3 = v5;
return 1;
}