//
// FMODAudioEngine::isChannelStopping from 0x1003e4870 to 0x1003e49af (319 bytes)
//
// 0 xrefs:
//
// 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
//
bool __fastcall FMODAudioEngine::isChannelStopping(FMODAudioEngine *a1, int a2)
{
unsigned __int64 value; // r9
unsigned __int64 v3; // r10
unsigned __int64 v4; // r8
std::__hash_node_base *> *v6; // rax
std::__hash_node_base *>::__next_pointer next; // rdi
unsigned __int64 v8; // r9
std::__hash_node_base *>::__next_pointer v9; // rax
unsigned __int64 v10; // rax
value = a1->m_stoppedChannels.__table_.__bucket_list_.__ptr_.__value_.__data_.__value_;
if ( !value )
return 0;
v3 = (0x101010101010101LL
* ((((value - ((value >> 1) & 0x5555555555555555LL)) & 0x3333333333333333LL)
+ (((value - ((value >> 1) & 0x5555555555555555LL)) >> 2) & 0x3333333333333333LL)
+ ((((value - ((value >> 1) & 0x5555555555555555LL)) & 0x3333333333333333LL)
+ (((value - ((value >> 1) & 0x5555555555555555LL)) >> 2) & 0x3333333333333333LL)) >> 4))
& 0xF0F0F0F0F0F0F0FLL)) >> 56;
if ( v3 > 1 )
{
v4 = a2;
if ( value <= a2 )
{
if ( (value | a2) >> 32 )
v4 = a2 % value;
else
v4 = a2 % (unsigned int)value;
}
}
else
{
v4 = a2 & (value - 1);
}
v6 = a1->m_stoppedChannels.__table_.__bucket_list_.__ptr_.__value_[v4];
if ( v6 )
{
next = v6->__next_;
if ( v6->__next_ )
{
if ( (unsigned int)v3 < 2 )
{
v8 = value - 1;
while ( 1 )
{
v9 = next[1].__next_;
if ( v9 == (std::__hash_node_base *>::__next_pointer)a2 )
{
if ( LODWORD(next[2].__next_) == a2 )
return 1;
}
else if ( (v8 & (unsigned __int64)v9) != v4 )
{
return 0;
}
next = next->__next_;
if ( !next )
return 0;
}
}
do
{
v10 = (unsigned __int64)next[1].__next_;
if ( v10 == a2 )
{
if ( LODWORD(next[2].__next_) == a2 )
return 1;
}
else
{
if ( v10 >= value )
{
if ( (value | v10) >> 32 )
v10 %= value;
else
v10 = (unsigned int)v10 % (unsigned int)value;
}
if ( v10 != v4 )
return 0;
}
next = next->__next_;
}
while ( next );
}
}
return 0;
}