//
// GJEffectManager::colorForGroupID from 0x8bf868 to 0x8bfa18 (432 bytes)
//
// 6 xrefs:
// > GameObject::groupColor @ 0x64a698
// > LevelEditorLayer::updateObjectColors @ 0x65f8a0
// > LevelEditorLayer::updateObjectColors @ 0x65fa90
// > LevelEditorLayer::updateVisibility @ 0x662f24
// > LevelEditorLayer::updateVisibility @ 0x66344c
// > ??> @ 0x2b500
//
// 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
//
cocos2d::ccColor3B GJEffectManager::colorForGroupID(GJEffectManager *a1, int a2, const cocos2d::ccColor3B *a3, bool a4)
{
unsigned int v4; // w22
int v6; // w19
unsigned __int64 v7; // x3
GLubyte v8; // w0
std::uintptr_t *m_bitptr; // x1
std::_Hashtable>, std::allocator>>, std::__detail::_Select1st, std::equal_to, std::hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits>::size_type M_bucket_count; // x1
GLubyte b; // w5
__int64 *v13; // x0
__int64 v14; // x0
PulseEffectAction *v15; // x19
PulseEffectAction *v16; // x24
_BOOL4 m_detailOnly; // w0
int v18[3]; // [xsp+4Ch] [xbp+4Ch] BYREF
cocos2d::ccColor3B v19; // [xsp+58h] [xbp+58h] BYREF
cocos2d::ccColor3B v20; // [xsp+60h] [xbp+60h]
v4 = a4;
v18[0] = a2;
v6 = a2;
if ( a2 <= 9998 )
{
if ( a2 < 0 )
v6 = 0;
v18[0] = v6;
v7 = v6;
if ( ((1LL << (v6 & 0x3F)) & a1->m_unkVector2f0.m_start.m_bitptr[(unsigned __int64)v6 >> 6]) == 0 )
goto LABEL_5;
goto LABEL_8;
}
m_bitptr = a1->m_unkVector2f0.m_start.m_bitptr;
v7 = 9999;
v18[0] = 9999;
if ( (m_bitptr[156] & 0x8000) != 0 )
{
LABEL_8:
M_bucket_count = a1->m_pulseEffectMap._M_h._M_bucket_count;
b = a3->b;
*(_WORD *)&v19.r = *(_WORD *)&a3->r;
v19.b = b;
v13 = sub_8A2B20(&a1->m_pulseEffectMap._M_h._M_buckets, v7 % M_bucket_count, v18);
if ( !v13
|| (v14 = *v13) == 0
|| (v15 = *(PulseEffectAction **)(v14 + 16), v16 = *(PulseEffectAction **)(v14 + 24), v16 == v15) )
{
LABEL_20:
v20 = v19;
return (cocos2d::ccColor3B)(v20.r | (unsigned __int16)(v20.g << 8) | (v20.b << 16));
}
while ( 1 )
{
if ( v15->m_mainOnly )
{
if ( v4 )
goto LABEL_15;
m_detailOnly = v15->m_detailOnly;
}
else
{
m_detailOnly = v15->m_detailOnly;
if ( !v15->m_detailOnly )
{
LABEL_15:
v19 = GJEffectManager::colorForPulseEffect(a1, &v19, v15);
goto LABEL_16;
}
}
if ( v4 < m_detailOnly )
goto LABEL_15;
LABEL_16:
if ( v16 == ++v15 )
goto LABEL_20;
}
}
LABEL_5:
v8 = a3->b;
*(_WORD *)&v20.r = *(_WORD *)&a3->r;
v20.b = v8;
return (cocos2d::ccColor3B)(v20.r | (unsigned __int16)(v20.g << 8) | (v20.b << 16));
}