//
// sub_1005E0C08 from 0x1005e0c08 to 0x1005e0d00 (248 bytes)
//
// 1 xrefs:
// > sub_1005E0948 @ 0x1005e0ac4
//
// 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 11:09:40 +0000
//
__int64 __fastcall sub_1005E0C08(
__int64 a1,
AudioUnitRenderActionFlags *a2,
const AudioTimeStamp *a3,
UInt32 a4,
UInt32 a5)
{
UInt32 v7; // w8
int v9; // w9
int v10; // w8
void *v11; // x0
__int64 v12; // x21
unsigned int v13; // w10
int v14; // w22
UInt32 v15; // w23
int v16; // w8
const void *v17; // x1
size_t v18; // x2
AudioBufferList ioData; // [xsp+8h] [xbp-48h] BYREF
*(_QWORD *)&ioData.mNumberBuffers = 1;
v7 = *(_DWORD *)(a1 + 1464) * *(_DWORD *)(a1 + 1468);
ioData.mBuffers[0].mNumberChannels = *(_DWORD *)(a1 + 1480);
ioData.mBuffers[0].mDataByteSize = v7;
ioData.mBuffers[0].mData = *(void **)(a1 + 1456);
if ( AudioUnitRender(*(AudioUnit *)(a1 + 1440), a2, a3, a4, a5, &ioData) )
return 0xFFFFFFFFLL;
v9 = *(_DWORD *)(a1 + 1472);
v10 = *(_DWORD *)(a1 + 1464);
v11 = (void *)(*(_QWORD *)(a1 + 1448) + v10 * v9);
v12 = *(_QWORD *)(a1 + 1456);
v13 = *(_DWORD *)(a1 + 1476);
if ( v9 + a5 <= v13 )
{
v18 = v10 * a5;
v17 = *(const void **)(a1 + 1456);
}
else
{
v14 = v13 - v9;
v15 = a5 - (v13 - v9);
memcpy(v11, *(const void **)(a1 + 1456), (int)((v13 - v9) * v10));
v11 = *(void **)(a1 + 1448);
v16 = *(_DWORD *)(a1 + 1464);
v17 = (const void *)(v12 + v16 * v14);
v18 = (int)(v16 * v15);
}
memcpy(v11, v17, v18);
*(_DWORD *)(a1 + 1472) = (int)(*(_DWORD *)(a1 + 1472) + a5) % *(_DWORD *)(a1 + 1476);
return 0;
}