//
// FMOD::Sound::setMusicChannelVolume from 0x1800a9eb0 to 0x1800aa022 (370 bytes)
//
// 5 xrefs:
// > FMOD_Sound_SetMusicChannelVolume @ 0x1800c67d9
// > ??> @ 0x18018768c
// > ??> @ 0x1801876c0
// > ??> @ 0x180194348
// > ??> @ 0x1801fbdfc
//
// 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:55 +0000
//
__int64 __fastcall FMOD::Sound::setMusicChannelVolume(__int64 a1, unsigned int a2)
{
int v3; // ebp
unsigned int v4; // esi
int v5; // ebx
int v6; // eax
_DWORD *v8; // [rsp+30h] [rbp-148h] BYREF
__int64 v9; // [rsp+38h] [rbp-140h] BYREF
_BYTE v10[256]; // [rsp+40h] [rbp-138h] BYREF
v9 = 0;
v3 = a1;
v4 = sub_1800E1460(a1, &v8, &v9);
if ( !v4 )
{
if ( !v8[68] || v8[68] == 7 || v8[68] == 5 )
{
v4 = (*(__int64 (__fastcall **)(_DWORD *, _QWORD))(*(_QWORD *)v8 + 336LL))(v8, a2);
if ( !v4 )
goto LABEL_9;
}
else
{
v4 = 46;
}
}
if ( *((char *)off_1801AED20 + 16) < 0 )
{
v5 = sub_1800F2EC0(v10, 256, a2);
v6 = sub_1800F2F70(&v10[v5]);
sub_1800F2F20(&v10[v6 + v5], (unsigned int)(256 - (v6 + v5)));
sub_1800B20E0(v4, 5, v3, (unsigned int)"Sound::setMusicChannelVolume", (__int64)v10);
}
LABEL_9:
if ( v9 )
sub_180102300(v9, 12);
return v4;
}