//
// sub_6E628 from 0x6e628 to 0x6e6f0 (200 bytes)
//
// 0 xrefs:
//
// 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_6E628(int a1, int a2, int a3, int a4, int a5)
{
int i; // r6
int v10; // r8
int result; // r0
int v13; // [sp+18h] [bp-20h] BYREF
sub_4C6EA(*(_DWORD *)(a1 + 8), &v13, a4, a3);
memset((void *)(*(_DWORD *)(a1 + 36) + 4 * *(_DWORD *)(a1 + 8)), 0, 4 * *(_DWORD *)(a1 + 8));
for ( i = 0; i < *(_DWORD *)(a1 + 12); ++i )
{
v10 = *(_DWORD *)(a1 + 8);
if ( a5 < v10 )
v10 = a5;
sub_8E77C(*(_DWORD *)(a1 + 36), a2 + v13 * i, 5, a3, v10, 1, a4, 1.0, 1);
memset((void *)(*(_DWORD *)(a1 + 36) + 4 * v10), 0, 4 * (*(_DWORD *)(a1 + 28) - v10));
result = sub_5D838(*(_DWORD **)(a1 + 48), *(_DWORD *)(a1 + 36), *(_DWORD *)(a1 + 72), 0, 1);
if ( result )
return result;
qmemcpy(
(void *)(*(_DWORD *)(a1 + 76) + 8 * (*(_DWORD *)(a1 + 8) + 1) * i),
*(const void **)(a1 + 72),
8 * (*(_DWORD *)(a1 + 8) + 1));
a5 -= v10;
}
memset(*(void **)(a1 + 36), 0, 4 * *(_DWORD *)(a1 + 8));
memset(*(void **)(a1 + 72), 0, 8 * *(_DWORD *)(a1 + 28));
return 0;
}