//
// EditorSFXManager::hasSoundsForAction from 0x1008e2640 to 0x1008e2795 (341 bytes)
//
// 10 xrefs:
// > EditorUI::playSoundForCreatedObject @ 0x1000119dd
// > EditorSFXManager::playAction @ 0x1008e2612
// > PlayLayer::tryShowDeathMarkers @ 0x10096206a
// > PlayLayer::tryShowDeathMarkers @ 0x100962080
// > PlayLayer::tryShowDeathMarkers @ 0x100962131
// > PlayLayer::tryShowDeathMarkers @ 0x100962147
// > PlayLayer::tryShowDeathMarkers @ 0x1009623bf
// > PlayLayer::tryShowDeathMarkers @ 0x10096240b
// > PlayLayer::tryShowDeathMarkers @ 0x100962427
// > PlayLayer::tryShowDeathMarkers @ 0x100962461
//
// This function is hookable on this platform (idp: pc, 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:37:46 +0000
//
bool __fastcall EditorSFXManager::hasSoundsForAction(_QWORD *a1, int a2)
{
unsigned __int64 v2; // r9
unsigned __int64 v3; // r10
unsigned __int64 v4; // r8
__int64 **v6; // rax
__int64 *v7; // rdi
unsigned __int64 v8; // r9
__int64 v9; // rax
unsigned __int64 v10; // rax
__int64 *v11; // rax
v2 = a1[1];
if ( !v2 )
return 0;
v3 = (0x101010101010101LL
* ((((v2 - ((v2 >> 1) & 0x5555555555555555LL)) & 0x3333333333333333LL)
+ (((v2 - ((v2 >> 1) & 0x5555555555555555LL)) >> 2) & 0x3333333333333333LL)
+ ((((v2 - ((v2 >> 1) & 0x5555555555555555LL)) & 0x3333333333333333LL)
+ (((v2 - ((v2 >> 1) & 0x5555555555555555LL)) >> 2) & 0x3333333333333333LL)) >> 4))
& 0xF0F0F0F0F0F0F0FLL)) >> 56;
if ( v3 > 1 )
{
v4 = a2;
if ( v2 <= a2 )
{
if ( (v2 | a2) >> 32 )
v4 = a2 % v2;
else
v4 = a2 % (unsigned int)v2;
}
}
else
{
v4 = a2 & (v2 - 1);
}
v6 = *(__int64 ***)(*a1 + 8 * v4);
if ( !v6 )
return 0;
v7 = *v6;
if ( !*v6 )
return 0;
if ( (unsigned int)v3 < 2 )
{
v8 = v2 - 1;
while ( 1 )
{
v9 = v7[1];
if ( v9 == a2 )
{
if ( *((_DWORD *)v7 + 4) == a2 )
goto LABEL_28;
}
else if ( (v8 & v9) != v4 )
{
return 0;
}
v7 = (__int64 *)*v7;
if ( !v7 )
return 0;
}
}
while ( 1 )
{
v10 = v7[1];
if ( v10 == a2 )
break;
if ( v10 < v2 )
goto LABEL_24;
if ( (v2 | v10) >> 32 )
{
v10 %= v2;
LABEL_24:
if ( v10 != v4 )
return 0;
goto LABEL_19;
}
if ( (unsigned int)v10 % (unsigned int)v2 != v4 )
return 0;
LABEL_19:
v7 = (__int64 *)*v7;
if ( !v7 )
return 0;
}
if ( *((_DWORD *)v7 + 4) != a2 )
goto LABEL_19;
LABEL_28:
v11 = (__int64 *)v7[3];
if ( v11 && *v11 )
return (unsigned int)sub_1007FEF90(*v11) != 0;
return 0;
}