//
// sub_5D1CC from 0x5d1cc to 0x5d26c (160 bytes)
//
// 1 xrefs:
// > sub_54DB0 @ 0x54f08
//
// 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_5D1CC(__int64 a1, __int64 a2)
{
__int64 result; // x0
__int64 v5; // [xsp+0h] [xbp-20h] BYREF
__int64 v6; // [xsp+8h] [xbp-18h] BYREF
if ( *(_QWORD *)(a1 + 336) )
{
if ( (unsigned int)FMOD::ChannelI::validate(a2, &v6, 0) )
{
if ( !(unsigned int)sub_579DC(a2, &v5, nullptr) && *(_DWORD *)(v5 + 544) == 1 )
{
result = v5 + 520;
*(_DWORD *)(v5 + 544) = 2;
return result;
}
}
else
{
result = *(_QWORD *)(a1 + 336) + ((__int64)*(int *)(v6 + 464) << 6);
if ( *(_DWORD *)(result + 24) == 1 )
{
*(_DWORD *)(result + 24) = 2;
return result;
}
}
}
return 0;
}