//
// sub_10045BAC0 from 0x10045bac0 to 0x10045bb80 (192 bytes)
//
// 10 xrefs:
// > FMOD::Channel::setFrequency @ 0x10045561c
// > sub_10045AAD8 @ 0x10045ab5c
// > sub_10045D66C @ 0x10045d7a8
// > sub_100463FD0 @ 0x100466024
// > sub_10046A0B0 @ 0x10046a39c
// > sub_10046D2DC @ 0x10046d814
// > sub_10046D964 @ 0x10046ddec
// > sub_10047BDAC @ 0x10047c4bc
// > sub_10047C600 @ 0x10047cc6c
// > sub_10048130C @ 0x1004814dc
//
// 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_10045BAC0(__int64 a1, float a2)
{
__int64 result; // x0
float *v4; // x0
float v5; // s8
if ( (~LODWORD(a2) & 0x7F800000) == 0 )
return 29;
v4 = *(float **)(a1 + 472);
if ( !v4 || !*(_QWORD *)(a1 + 32) )
return 30;
v5 = *(float *)(a1 + 556);
if ( v4[26] > a2 )
a2 = v4[26];
if ( a2 > v4[25] )
a2 = v4[25];
*(float *)(a1 + 556) = a2;
result = (*(__int64 (__fastcall **)(float *))(*(_QWORD *)v4 + 112LL))(v4);
if ( !(_DWORD)result )
{
if ( *(_QWORD *)(a1 + 496) && (v5 < 0.0 && *(float *)(a1 + 556) > 0.0 || v5 > 0.0 && *(float *)(a1 + 556) < 0.0) )
sub_10045DC60(a1, 1);
return 0;
}
return result;
}