//
// GJEffectManager::colorForGroupID from 0x140261b10 to 0x140261cae (414 bytes)
//
// 6 xrefs:
// > GameObject::colorForMode @ 0x1401a2021
// > LevelEditorLayer::updateVisibility @ 0x1402d962e
// > LevelEditorLayer::updateObjectColors @ 0x1402da149
// > ??> @ 0x1406850d4
// > ??> @ 0x140685108
// > ??> @ 0x1406d005c
//
// 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(
cocos2d::ccColor3B *__return_ptr retstr,
GJEffectManager *a2,
int a3,
const cocos2d::ccColor3B *a4,
bool a5)
{
__int64 v5; // rbx
int v7; // r10d
__int64 v9; // rax
__int16 v11; // r8
GLubyte b; // r9
__int64 v13; // rdx
__int64 *v14; // rcx
__int64 v15; // rax
__int64 v16; // rcx
PulseEffectAction *v17; // rbp
PulseEffectAction *v18; // rbx
bool v19; // di
cocos2d::ccColor3B *v20; // rax
cocos2d::ccColor3B v21; // [rsp+40h] [rbp+8h] BYREF
int v22; // [rsp+50h] [rbp+18h] BYREF
v5 = 0;
v7 = a3;
if ( a3 < 0 )
v7 = 0;
if ( v7 > 9999 )
v7 = 9999;
v9 = *(_QWORD *)&retstr[261].g;
v22 = v7;
LODWORD(v9) = *(_DWORD *)(v9 + 4 * ((unsigned __int64)v7 >> 5));
if ( !_bittest((const int *)&v9, v7 & 0x1F) )
{
*(cocos2d::ccColor3B *)&a2->__vftable = *a4;
return (cocos2d::ccColor3B *)a2;
}
v11 = *(_WORD *)&a4->r;
b = a4->b;
*(_WORD *)&v21.r = v11;
v21.b = b;
v13 = *(_QWORD *)&retstr[125].g;
v14 = (__int64 *)(*(_QWORD *)&retstr[130].b
+ 16
* ((0x100000001B3LL
* (HIBYTE(v22)
^ (0x100000001B3LL
* (BYTE2(v22)
^ (0x100000001B3LL
* (BYTE1(v22) ^ (0x100000001B3LL * ((unsigned __int8)v7 ^ 0xCBF29CE484222325uLL))))))))
& *(_QWORD *)&retstr[138].b));
v15 = v14[1];
if ( v15 != v13 )
{
v16 = *v14;
if ( v7 == *(_DWORD *)(v15 + 16) )
{
LABEL_11:
v5 = v15;
}
else
{
while ( v15 != v16 )
{
v15 = *(_QWORD *)(v15 + 8);
if ( v7 == *(_DWORD *)(v15 + 16) )
goto LABEL_11;
}
}
}
if ( v5 )
{
if ( v5 != v13 )
{
v17 = *(PulseEffectAction **)(v5 + 32);
v18 = *(PulseEffectAction **)(v5 + 24);
if ( v18 != v17 )
{
v19 = a5;
while ( v18->m_mainOnly )
{
if ( v19 )
goto LABEL_22;
if ( v18->m_detailOnly )
goto LABEL_21;
LABEL_23:
if ( ++v18 == v17 )
goto LABEL_24;
}
if ( !v18->m_detailOnly )
goto LABEL_22;
LABEL_21:
if ( !v19 )
{
LABEL_22:
v20 = GJEffectManager::colorForPulseEffect(retstr, (GJEffectManager *)&v22, &v21, v18);
v11 = *(_WORD *)&v20->r;
b = v20->b;
*(_WORD *)&v21.r = *(_WORD *)&v20->r;
v21.b = b;
goto LABEL_23;
}
goto LABEL_23;
}
}
}
LABEL_24:
LOWORD(a2->__vftable) = v11;
BYTE2(a2->__vftable) = b;
return (cocos2d::ccColor3B *)a2;
}