//
// FMOD::System::setSpeakerPosition from 0x1800b1af0 to 0x1800b1cbd (461 bytes)
//
// 5 xrefs:
// > FMOD_System_SetSpeakerPosition @ 0x1800c6f65
// > ??> @ 0x180188334
// > ??> @ 0x180188368
// > ??> @ 0x180194348
// > ??> @ 0x1801fcc24
//
// This function is hookable on this platform (idp: pc, 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 10:53:57 +0000
//
__int64 __fastcall FMOD::System::setSpeakerPosition(__int64 a1, unsigned int a2, __int64 a3, __int64 a4, char a5)
{
int v6; // r14d
unsigned int v7; // esi
int v8; // r8d
int v9; // r9d
int v10; // ebx
int v11; // ebx
int v12; // ebx
int v13; // ebx
int v14; // ebx
int v15; // eax
__int64 v17; // [rsp+30h] [rbp-168h] BYREF
__int64 v18; // [rsp+38h] [rbp-160h] BYREF
_BYTE v19[256]; // [rsp+40h] [rbp-158h] BYREF
v6 = a1;
v17 = 0;
v7 = FMOD::SystemI::validate(a1, &v18, &v17);
if ( (v7 || (v7 = sub_1800E7970(v18, a2, v8, v9, a5)) != 0) && *((char *)off_1801AED20 + 16) < 0 )
{
v10 = sub_1800F2EC0(v19, 256, a2);
v11 = sub_1800F2F70(&v19[v10]) + v10;
v12 = sub_1800F2F20(&v19[v11], (unsigned int)(256 - v11)) + v11;
v13 = sub_1800F2F70(&v19[v12]) + v12;
v14 = sub_1800F2F20(&v19[v13], (unsigned int)(256 - v13)) + v13;
v15 = sub_1800F2F70(&v19[v14]);
sub_1800F3320(&v19[v15 + v14]);
sub_1800B20E0(v7, 1, v6, (unsigned int)"System::setSpeakerPosition", (__int64)v19);
}
if ( v17 )
sub_180102320(v17);
return v7;
}