//
// sub_E8BE0 from 0xe8be0 to 0xe8d3c (348 bytes)
//
// 1 xrefs:
// > sub_E8E78 @ 0xe8ed4
//
// 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
//
__int64 __fastcall sub_E8BE0(__int64 *a1, __int64 a2)
{
__int64 v2; // x22
__int64 result; // x0
__int64 *v6; // x0
__int64 *v7; // x20
int v8; // w24
int v9; // w8
int v10; // w10
int v11; // w8
void *v12; // x0
int v13; // w8
int v14; // [xsp+4h] [xbp-3Ch] BYREF
__int64 v15; // [xsp+8h] [xbp-38h] BYREF
v2 = *a1;
if ( *(_QWORD *)(*a1 + 8888) )
return 68;
v6 = (__int64 *)sub_E2AC4(
*(__int64 *)((char *)&qword_1B0 + (_QWORD)off_114000),
48,
(__int64)"../android/src/fmod_output_aaudio.cpp",
1142,
0);
if ( !v6 )
return 38;
v7 = v6;
result = sub_E817C(a1, v6, 1, *(_DWORD *)a2);
if ( !(_DWORD)result )
{
v15 = 0;
sub_E7908(result, *v7, (_DWORD *)(a2 + 28), (int *)(a2 + 24), (_DWORD *)(a2 + 32), (_DWORD *)&v15 + 1, &v15);
if ( (unsigned int)v15 <= 0x800 )
v8 = 2048;
else
v8 = v15;
sub_5C4BC(*(_DWORD *)(a2 + 24), &v14);
v9 = v14;
v10 = *(_DWORD *)(a2 + 32);
*((_DWORD *)v7 + 2) = 0;
*((_DWORD *)v7 + 3) = v8;
v11 = v9 / 8 * v10;
*((_BYTE *)v7 + 32) = 0;
*((_DWORD *)v7 + 4) = v11;
v7[5] = (__int64)a1;
v12 = sub_E2AC4(
*(__int64 *)((char *)&qword_1B0 + (_QWORD)off_114000),
v11 * v8,
(__int64)"../android/src/fmod_output_aaudio.cpp",
1172,
0);
v7[3] = (__int64)v12;
if ( !v12 )
sub_E75E8(*v7);
v13 = *((_DWORD *)v7 + 3);
*(_QWORD *)(a2 + 40) = v7;
*(_DWORD *)(a2 + 36) = v13;
result = so_AAudioStream_requestStart(*v7);
if ( (_DWORD)result )
return 28;
else
*(_QWORD *)(v2 + 8888) = a2;
}
return result;
}