//
// sub_40C5A0 from 0x40c5a0 to 0x40c5ea (74 bytes)
//
// 2 xrefs:
// > sub_40C612 @ 0x40c65a
// > GameStatsManager::tryFixPathBug @ 0x419e12
//
// 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
//
bool __fastcall sub_40C5A0(int *a1)
{
int v1; // r1
int *v2; // r4
_BOOL4 result; // r0
int v4; // r3
int v5; // [sp+4h] [bp-10h] BYREF
int v6; // [sp+8h] [bp-Ch]
v1 = a1[1];
v2 = a1 - 2;
v5 = *a1;
v6 = v1;
while ( 1 )
{
result = sub_40C45C(&v5, v2);
if ( !result )
break;
v4 = *v2;
v2 -= 2;
v2[4] = v4;
v2[5] = v2[3];
}
v2[2] = v5;
v2[3] = v6;
return result;
}