//
// sub_8E8E84 from 0x8e8e84 to 0x8e8fb0 (300 bytes)
//
// 3 xrefs:
// > sub_8EB950 @ 0x8ebb18
// > sub_8EB950 @ 0x8ebb1c
// > ??> @ 0x8ebbc0
//
// 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 12:04:11 +0000
//
int __fastcall sub_8E8E84(double a1, int a2)
{
__int16 v2; // r3
char v3; // r3
__int16 *v7; // [sp+10h] [bp-14h]
char *i; // [sp+14h] [bp-10h]
v7 = *(__int16 **)(LODWORD(a1) + 12);
for ( i = (char *)HIDWORD(a1); a2-- > 0; ++i )
{
v2 = *v7++;
a1 = COERCE_DOUBLE(LogL16toY(v2));
if ( a1 > 0.0 )
{
if ( a1 < 1.0 )
v3 = (int)(sqrt(a1) * 256.0);
else
v3 = -1;
}
else
{
v3 = 0;
}
*i = v3;
}
return LODWORD(a1);
}