//
// sub_86C14 from 0x86c14 to 0x86c60 (76 bytes)
//
// 3 xrefs:
// > sub_86DAC @ 0x86f68
// > sub_874A4 @ 0x87a52
// > sub_874A4 @ 0x87a60
//
// 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
//
int __fastcall sub_86C14(int a1, int a2, int a3, _DWORD *a4)
{
int v4; // r0
int v5; // r1
int v6; // r0
v4 = dword_E8124[a2];
*a4 = v4;
if ( a2 && a3 <= -1 )
{
v5 = (v4 - dword_E8124[a2 - 1]) * a3;
v6 = v4 - ((int)(((unsigned int)(-v5 >> 31) >> 25) - v5) >> 7);
}
else
{
v6 = v4 + (dword_E8124[a2 + 1] - v4) * a3 / 128;
}
*a4 = v6;
return 0;
}