//
// sub_45EB22 from 0x45eb22 to 0x45eb78 (86 bytes)
//
// 3 xrefs:
// > sub_45EB78 @ 0x45eb88
// > sub_45EBFC @ 0x45ec50
// > sub_45ECE0 @ 0x45ed4a
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 11:48:51 +0000
//
int __fastcall sub_45EB22(int *a1, int *a2, int *a3, int *a4)
{
int result; // r0
int v9; // r3
int v10; // r2
int v11; // r3
int v12; // r3
int v13; // r3
int v14; // r3
int v15; // r3
result = sub_45EAB4(a1, a2, a3);
v9 = *a3;
if ( *a4 < *a3 )
{
*a3 = *a4;
v10 = a4[1];
*a4 = v9;
v11 = a3[1];
a3[1] = v10;
a4[1] = v11;
v12 = *a2;
if ( *a3 < *a2 )
{
*a2 = *a3;
*a3 = v12;
v13 = a2[1];
a2[1] = a3[1];
a3[1] = v13;
v14 = *a1;
if ( *a2 < *a1 )
{
*a1 = *a2;
*a2 = v14;
v15 = a1[1];
a1[1] = a2[1];
a2[1] = v15;
result += 3;
}
else
{
result += 2;
}
}
else
{
++result;
}
}
return result;
}