//
// sub_8C9728 from 0x8c9728 to 0x8c98d4 (428 bytes)
//
// 6 xrefs:
// > sub_8C98D4 @ 0x8c98f4
// > sub_8C9BBC @ 0x8c9bfc
// > sub_8C9BBC @ 0x8c9d0c
// > sub_8C9DD0 @ 0x8c9ff4
// > sub_8C9DD0 @ 0x8ca0d8
// > sub_8C9DD0 @ 0x8ca2c0
//
// 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 12:56:35 +0000
//
__int64 __fastcall sub_8C9728(int *a1, int *a2, int *a3)
{
int v3; // w3
int v4; // w4
_BOOL4 v5; // w4
int v6; // w4
_BOOL4 v7; // w4
unsigned int v8; // w3
int v9; // w3
int v10; // w3
int v11; // w3
int v12; // w2
int v13; // w2
int v14; // w2
int v16; // w4
int v17; // w3
int v18; // w3
int v19; // w0
int v20; // w0
int v21; // w0
int v22; // w1
int v23; // w1
v3 = a2[1];
v4 = a1[1];
if ( v3 == v4 )
v5 = *a2 < *a1;
else
v5 = v3 > v4;
if ( !v5 )
{
v6 = a3[1];
if ( v3 == v6 )
v7 = *a3 < *a2;
else
v7 = v3 < v6;
v8 = 0;
if ( !v7 )
return v8;
v9 = *a2;
*a2 = *a3;
*a3 = v9;
v10 = a2[1];
a2[1] = a3[1];
a3[1] = v10;
v11 = a2[1];
v12 = a1[1];
if ( v11 == v12 )
{
if ( *a2 < *a1 )
goto LABEL_9;
}
else if ( v11 > v12 )
{
LABEL_9:
v13 = *a1;
*a1 = *a2;
*a2 = v13;
v14 = a1[1];
a1[1] = a2[1];
a2[1] = v14;
return 2;
}
return 1;
}
v16 = a3[1];
if ( v3 == v16 )
{
if ( *a3 >= *a2 )
goto LABEL_12;
LABEL_20:
v22 = *a1;
*a1 = *a3;
*a3 = v22;
v23 = a1[1];
a1[1] = a3[1];
a3[1] = v23;
return 1;
}
if ( v3 < v16 )
goto LABEL_20;
LABEL_12:
v17 = *a1;
*a1 = *a2;
*a2 = v17;
v18 = a1[1];
a1[1] = a2[1];
a2[1] = v18;
v19 = a3[1];
if ( v18 == v19 )
{
if ( *a3 >= *a2 )
return 1;
}
else if ( v18 >= v19 )
{
return 1;
}
v20 = *a2;
*a2 = *a3;
*a3 = v20;
v21 = a2[1];
a2[1] = a3[1];
a3[1] = v21;
return 2;
}