//
// sub_7A1478 from 0x7a1478 to 0x7a1544 (204 bytes)
//
// 2 xrefs:
// > GameStatsManager::tryFixPathBug @ 0x7b6ae4
// > GameStatsManager::tryFixPathBug @ 0x7b6f5c
//
// 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
//
__int64 __fastcall sub_7A1478(__int64 result, _DWORD *a2)
{
char *v2; // x19
char *v4; // x20
_DWORD *v5; // x21
int v6; // w3
_BOOL4 v7; // w3
int v8; // w1
__int64 v9; // x3
_DWORD *v10; // x2
int v11; // w4
_DWORD *v12; // x3
if ( (_DWORD *)result != a2 )
{
v2 = (char *)(result + 8);
if ( a2 != (_DWORD *)(result + 8) )
{
v4 = (char *)result;
v5 = (_DWORD *)(result + 16);
do
{
result = *((unsigned int *)v2 + 1);
v6 = *((_DWORD *)v4 + 1);
if ( (_DWORD)result == v6 )
v7 = *(_DWORD *)v2 < *(_DWORD *)v4;
else
v7 = (int)result > v6;
if ( v7 )
{
v8 = *(_DWORD *)v2;
v9 = (v2 - v4) >> 3;
v10 = v5;
if ( v9 > 0 )
{
do
{
v10 -= 2;
v11 = *(v10 - 1);
--v9;
*v10 = *(v10 - 2);
v10[1] = v11;
}
while ( v9 );
}
*(_DWORD *)v4 = v8;
v12 = v5;
*((_DWORD *)v4 + 1) = result;
}
else
{
result = sub_7A13D0(v2);
v12 = v5;
}
v2 += 8;
v5 += 2;
}
while ( a2 != v12 );
}
}
return result;
}