//
// sub_1800D1500 from 0x1800d1500 to 0x1800d158b (139 bytes)
//
// 2 xrefs:
// > sub_1800107D0 @ 0x180010974
// > ??> @ 0x1801feba4
//
// 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_1800D1500(__int64 a1, __int64 a2)
{
__int64 result; // rax
__int64 v5; // [rsp+30h] [rbp+8h] BYREF
__int64 v6; // [rsp+40h] [rbp+18h] BYREF
if ( !*(_QWORD *)(a1 + 336) )
return 0;
if ( (unsigned int)FMOD::ChannelI::validate(a2, &v5, nullptr) )
{
if ( (unsigned int)sub_1800CCA80(a2, &v6, nullptr) )
return 0;
result = v6 + 520;
}
else
{
result = *(_QWORD *)(a1 + 336) + ((__int64)*(int *)(v5 + 464) << 6);
}
if ( *(_DWORD *)(result + 24) == 1 )
{
*(_DWORD *)(result + 24) = 2;
return result;
}
return 0;
}