//
// GJBaseGameLayer::removeCustomEnterEffects from 0x10011e9f0 to 0x10011ecb1 (705 bytes)
//
// 1 xrefs:
// > GJBaseGameLayer::stopCustomEnterEffect @ 0x10011efad
//
// 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
//
void __fastcall GJBaseGameLayer::removeCustomEnterEffects(GJBaseGameLayer *a1, int a2, bool a3)
{
unsigned __int64 v3; // r9
std::unordered_map> *p_m_exitEffectInstanceVectors; // rdi
unsigned __int64 v5; // rdx
__int64 v6; // rbx
unsigned __int64 value; // r9
unsigned __int64 v8; // rdx
__int64 v9; // rbx
std::__hash_node_base>, void *> *> *v10; // rax
std::__hash_node_base>, void *> *>::__next_pointer next; // rcx
unsigned __int64 v12; // r9
unsigned __int64 v13; // rax
std::__hash_node_base>, void *> *>::__next_pointer v14; // rax
std::__hash_node_base>, void *> *> *v15; // rax
unsigned __int64 v16; // r9
unsigned __int64 v17; // rax
std::__hash_node_base>, void *> *>::__next_pointer v18; // rax
if ( (unsigned int)a2 > 0x64 )
return;
if ( !a3 )
{
value = a1->m_gameState.m_exitEffectInstanceVectors.__table_.__bucket_list_.__ptr_.__value_.__data_.__value_;
if ( !value )
return;
p_m_exitEffectInstanceVectors = &a1->m_gameState.m_exitEffectInstanceVectors;
v8 = (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 ( v8 > 1 )
{
v9 = (unsigned int)a2;
if ( value <= (unsigned int)a2 )
v9 = (unsigned __int8)((unsigned __int8)a2 % (unsigned __int8)value);
}
else
{
v9 = ((_DWORD)value + 127) & (unsigned int)a2;
}
v15 = p_m_exitEffectInstanceVectors->__table_.__bucket_list_.__ptr_.__value_[v9];
if ( !v15 )
return;
next = v15->__next_;
if ( !v15->__next_ )
return;
if ( (unsigned int)v8 < 2 )
{
v16 = value - 1;
while ( 1 )
{
v18 = next[1].__next_;
if ( v18 == (std::__hash_node_base>, void *> *>::__next_pointer)(unsigned int)a2 )
{
if ( LODWORD(next[2].__next_) == a2 )
goto LABEL_52;
}
else if ( (v16 & (unsigned __int64)v18) != v9 )
{
return;
}
next = next->__next_;
if ( !next )
return;
}
}
while ( 1 )
{
v17 = (unsigned __int64)next[1].__next_;
if ( v17 == a2 )
{
if ( LODWORD(next[2].__next_) == a2 )
{
LABEL_52:
sub_100167AA0(p_m_exitEffectInstanceVectors, next);
return;
}
}
else
{
if ( v17 < value )
goto LABEL_43;
if ( (value | v17) >> 32 )
{
v17 %= value;
LABEL_43:
if ( v17 != v9 )
return;
goto LABEL_38;
}
if ( (unsigned int)v17 % (unsigned int)value != v9 )
return;
}
LABEL_38:
next = next->__next_;
if ( !next )
return;
}
}
v3 = a1->m_gameState.m_enterEffectInstanceVectors.__table_.__bucket_list_.__ptr_.__value_.__data_.__value_;
if ( v3 )
{
p_m_exitEffectInstanceVectors = &a1->m_gameState.m_enterEffectInstanceVectors;
v5 = (0x101010101010101LL
* ((((v3 - ((v3 >> 1) & 0x5555555555555555LL)) & 0x3333333333333333LL)
+ (((v3 - ((v3 >> 1) & 0x5555555555555555LL)) >> 2) & 0x3333333333333333LL)
+ ((((v3 - ((v3 >> 1) & 0x5555555555555555LL)) & 0x3333333333333333LL)
+ (((v3 - ((v3 >> 1) & 0x5555555555555555LL)) >> 2) & 0x3333333333333333LL)) >> 4))
& 0xF0F0F0F0F0F0F0FLL)) >> 56;
if ( v5 > 1 )
{
v6 = (unsigned int)a2;
if ( v3 <= (unsigned int)a2 )
v6 = (unsigned __int8)((unsigned __int8)a2 % (unsigned __int8)v3);
}
else
{
v6 = ((_DWORD)v3 + 127) & (unsigned int)a2;
}
v10 = p_m_exitEffectInstanceVectors->__table_.__bucket_list_.__ptr_.__value_[v6];
if ( v10 )
{
next = v10->__next_;
if ( v10->__next_ )
{
if ( (unsigned int)v5 < 2 )
{
v12 = v3 - 1;
while ( 1 )
{
v14 = next[1].__next_;
if ( v14 == (std::__hash_node_base>, void *> *>::__next_pointer)(unsigned int)a2 )
{
if ( LODWORD(next[2].__next_) == a2 )
goto LABEL_52;
}
else if ( (v12 & (unsigned __int64)v14) != v6 )
{
return;
}
next = next->__next_;
if ( !next )
return;
}
}
while ( 1 )
{
v13 = (unsigned __int64)next[1].__next_;
if ( v13 == a2 )
{
if ( LODWORD(next[2].__next_) == a2 )
goto LABEL_52;
goto LABEL_17;
}
if ( v13 < v3 )
goto LABEL_22;
if ( (v3 | v13) >> 32 )
break;
if ( (unsigned int)v13 % (unsigned int)v3 != v6 )
return;
LABEL_17:
next = next->__next_;
if ( !next )
return;
}
v13 %= v3;
LABEL_22:
if ( v13 != v6 )
return;
goto LABEL_17;
}
}
}
}