//
// sub_8E228 from 0x8e228 to 0x8e2ba (146 bytes)
//
// 1 xrefs:
// > sub_61B58 @ 0x61d76
//
// 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_8E228(int a1, int a2, int a3, __int16 a4, __int16 a5)
{
int v6; // r1
int v10; // r1
__int16 v11; // r0
__int16 v12; // r1
int v13; // r0
int v14; // r1
int v15; // r2
float *v16; // r3
float *v17; // r6
v6 = *(_DWORD *)(a1 + 32);
if ( v6 )
sub_BD7AC(*(_DWORD *)a1 + 67072, v6, &unk_2191F, 0, 1);
*(_DWORD *)(a1 + 32) = a2;
*(_WORD *)(a1 + 30) = a5;
*(_WORD *)(a1 + 28) = a4;
v10 = *(_DWORD *)(a1 + 40);
if ( v10 )
{
sub_BD7AC(*(_DWORD *)a1 + 67072, v10, &unk_2191F, 0, 1);
v11 = *(_WORD *)(a1 + 30);
v12 = *(_WORD *)(a1 + 28);
}
else
{
v11 = a5;
v12 = a4;
}
v13 = v11 * v12;
v14 = 0;
v15 = 0;
*(_DWORD *)(a1 + 40) = a3;
*(_WORD *)(a1 + 38) = a5;
*(_WORD *)(a1 + 36) = a4;
while ( v15 < v13 )
{
v16 = (float *)(a3 + v14);
++v15;
v17 = (float *)(*(_DWORD *)(a1 + 32) + v14);
v14 += 4;
*v16 = *(float *)(a1 + 76) * *v17;
}
return 0;
}