//
// sub_E8B460 from 0xe8b460 to 0xe8b5c0 (352 bytes)
//
// 1 xrefs:
// > jinit_upsampler @ 0xe8bc68
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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 13:10:53 +0000
//
__int64 __fastcall sub_E8B460(__int64 a1, __int64 *a2, _DWORD *a3, __int64 a4, __int64 a5, _DWORD *a6, int a7)
{
_DWORD *v7; // x23
int v10; // w0
unsigned int v11; // w19
__int64 v13; // x2
_DWORD *v14; // x25
unsigned int v15; // w19
unsigned int v16; // w22
int v17; // w1
__int64 result; // x0
int v19; // w24
__int64 v20; // x21
int *v22; // x22
_DWORD *v23; // x19
int v24; // w27
int v25; // w2
int v26; // t1
__int64 v27; // x1
_DWORD *v28; // x3
__int64 v29; // t1
void (__fastcall *v30)(__int64, __int64, __int64, _DWORD *); // x5
v7 = *(_DWORD **)(a1 + 640);
v10 = *(_DWORD *)(a1 + 420);
v11 = v7[46];
if ( (int)v11 >= v10 )
{
v14 = v7 + 6;
v20 = *(_QWORD *)(a1 + 304);
if ( *(int *)(a1 + 56) > 0 )
{
v22 = v7 + 48;
v23 = v7 + 6;
v24 = 0;
do
{
v26 = *v22++;
v25 = v26;
v27 = v20;
v28 = v23;
v29 = *a2++;
v30 = *((void (__fastcall **)(__int64, __int64, __int64, _DWORD *))v23 + 10);
++v24;
v20 += 96;
v23 += 2;
v30(a1, v27, v29 + 8LL * (unsigned int)(v25 * *a3), v28);
}
while ( *(_DWORD *)(a1 + 56) > v24 );
v10 = *(_DWORD *)(a1 + 420);
}
v7[46] = 0;
v13 = 0;
v11 = 0;
}
else
{
v13 = v11;
v14 = v7 + 6;
}
v15 = v10 - v11;
v16 = a7 - *a6;
if ( v16 > v7[47] )
v16 = v7[47];
if ( v16 <= v15 )
v15 = v16;
(*(void (__fastcall **)(__int64, _DWORD *, __int64, __int64, _QWORD))(*(_QWORD *)(a1 + 648) + 8LL))(
a1,
v14,
v13,
a5 + 8LL * (unsigned int)*a6,
v15);
*a6 += v15;
v17 = *(_DWORD *)(a1 + 420);
result = (unsigned int)v7[47];
v19 = v15 + v7[46];
v7[46] = v19;
v7[47] = result - v15;
if ( v19 >= v17 )
{
result = (unsigned int)(*a3 + 1);
*a3 = result;
}
return result;
}