//
// FMODAudioEngine::channelForChannelID from 0x6d3180 to 0x6d3224 (164 bytes)
//
// 24 xrefs:
// > FMODAudioEngine::stop @ 0x6d32d0
// > FMODAudioEngine::resumeSuspendedAudio @ 0x6d33f8
// > FMODAudioEngine::stopAllMusic @ 0x6d360c
// > FMODAudioEngine::pauseAllMusic @ 0x6d3798
// > FMODAudioEngine::resumeAllMusic @ 0x6d37e8
// > FMODAudioEngine::channelForUniqueID @ 0x6d3e5c
// > FMODAudioEngine::startMusic @ 0x6d6138
// > FMODAudioEngine::setMusicTimeMS @ 0x6d69a8
// > FMODAudioEngine::getMusicTimeMS @ 0x6d6a68
// > FMODAudioEngine::getMusicLengthMS @ 0x6d6b04
// > FMODAudioEngine::setChannelVolume @ 0x6d6c10
// > FMODAudioEngine::setChannelVolume @ 0x6d6c90
// > FMODAudioEngine::setChannelVolumeMod @ 0x6d6f74
// > FMODAudioEngine::setChannelVolumeMod @ 0x6d6ff4
// > FMODAudioEngine::setChannelPitch @ 0x6d72b8
// > FMODAudioEngine::setChannelPitch @ 0x6d72f8
// > FMODAudioEngine::getActiveMusicChannel @ 0x6d79f4
// > FMODAudioEngine::stopAndRemoveMusic @ 0x6d8038
// > FMODAudioEngine::loadMusic @ 0x6d8814
// > FMODAudioEngine::saveAudioState @ 0x6d9b40
// > FMODAudioEngine::playEffectAdvanced @ 0x6da67c
// > FMODAudioEngine::loadAudioState @ 0x6db194
// > GJBaseGameLayer::processActivatedAudioTriggers @ 0x9e2bc0
// > ??> @ 0xf3598
//
// This function is hookable on this platform (idp: arm, 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 12:51:28 +0000
//
__int64 __fastcall FMODAudioEngine::channelForChannelID(FMODAudioEngine *this, int a2)
{
unsigned __int64 v2; // x5
unsigned __int64 v3; // x8
unsigned __int64 v4; // x6
__int64 *v5; // x2
unsigned __int64 v6; // x3
unsigned __int64 v7; // x3
int v9; // [xsp+1Ch] [xbp+1Ch] BYREF
v2 = *((_QWORD *)this + 158);
v9 = a2;
if ( v2 )
{
v3 = v2 - 1;
v4 = ((v2 - 1) & v2) != 0 ? a2 % v2 : v3 & a2;
v5 = *(__int64 **)(*((_QWORD *)this + 157) + 8 * v4);
if ( v5 )
{
while ( 1 )
{
v5 = (__int64 *)*v5;
if ( !v5 )
break;
v6 = v5[1];
v7 = ((v2 - 1) & v2) != 0 ? v6 % v2 : v3 & v6;
if ( v4 != v7 )
break;
if ( a2 == *((_DWORD *)v5 + 4) )
return *(_QWORD *)std::unordered_map::operator[]((__int64)this + 1256, &v9);
}
}
}
return 0;
}