//
// GJBaseGameLayer::controlTriggersWithControlID from 0x495c64 to 0x495dd8 (372 bytes)
//
// 1 xrefs:
// > TriggerControlGameObject::triggerObject @ 0x3e51c4
//
// 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 GJBaseGameLayer::controlTriggersWithControlID(GJBaseGameLayer *a1, int a2, GJActionCommand a3)
{
std::__detail::_Hash_node_base *i; // r3
std::__detail::_Hash_node_base *M_nxt; // r0
std::__detail::_Hash_node_base *j; // r2
std::__detail::_Hash_node_base *v9; // r1
std::__detail::_Hash_node_base *v10; // t1
cocos2d::CCDictionary *m_gradientLayers; // r2
cocos2d::CCDictElement *m_pElements; // r2
cocos2d::CCDictElement *next; // r10
char *v14; // r5
char *v15; // r4
_BYTE *v16; // r6
int m_nLuaID; // r3
cocos2d::CCDictElement *v18; // r3
GradientTriggerObject **k; // r5
GradientTriggerObject *v20; // r1
signed int v21; // r4
int v22; // r3
int v23; // r5
bool v24; // cf
unsigned int v25; // r5
char *v26; // r11
cocos2d::CCObject *m_pObject; // [sp+4h] [bp-8h]
GJEffectManager::controlActionsForControlID(a1->m_effectManager, a2, a3);
GJBaseGameLayer::controlAreaEffectWithID(a1, -1, a2, a3);
GJBaseGameLayer::controlAdvancedFollowCommand(a1, nullptr, a2, a3);
GJBaseGameLayer::controlEventLink(a1, -1, a2, a3);
GJBaseGameLayer::controlDynamicMoveCommand(a1, nullptr, a2, a3);
GJBaseGameLayer::controlDynamicRotateCommand(a1, nullptr, a2, a3);
GJGameState::controlTweenAction(&a1->m_gameState, -1, a2, a3);
for ( i = a1->m_labelObjects._M_h._M_before_begin._M_nxt; i; i = i->_M_nxt )
{
M_nxt = i[3]._M_nxt;
for ( j = i[2]._M_nxt; j != M_nxt; ++j )
{
v10 = j->_M_nxt;
v9 = v10;
if ( v10[371]._M_nxt == (std::__detail::_Hash_node_base *)a2 )
LOBYTE(v9[418]._M_nxt) = a3 != Resume;
}
}
m_gradientLayers = a1->m_gradientLayers;
if ( m_gradientLayers )
{
m_pElements = m_gradientLayers->m_pElements;
if ( m_pElements )
next = (cocos2d::CCDictElement *)m_pElements->hh.next;
else
next = nullptr;
v14 = nullptr;
v15 = nullptr;
v16 = nullptr;
while ( 1 )
{
if ( !m_pElements )
goto LABEL_25;
m_pObject = m_pElements->m_pObject;
m_nLuaID = m_pObject[9].m_nLuaID;
if ( m_nLuaID )
{
if ( *(_DWORD *)(m_nLuaID + 1484) == a2 )
break;
}
LABEL_20:
if ( next )
v18 = (cocos2d::CCDictElement *)next->hh.next;
else
v18 = nullptr;
m_pElements = next;
next = v18;
}
if ( v15 != v14 )
{
if ( v15 )
*(_DWORD *)v15 = m_nLuaID;
v15 += 4;
goto LABEL_20;
}
v21 = v15 - v16;
v22 = v21 >> 2;
if ( v21 >> 2 )
v23 = v21 >> 2;
else
v23 = 1;
v24 = __CFADD__(v23, v22);
v25 = v23 + v22;
if ( v24 || v25 >= 0x40000000 )
{
v25 = 0x3FFFFFFF;
}
else if ( !v25 )
{
v26 = nullptr;
goto LABEL_37;
}
v26 = (char *)operator new(4 * v25);
LABEL_37:
if ( &v26[v21] )
*(_DWORD *)&v26[v21] = m_pObject[9].m_nLuaID;
if ( v21 >> 2 )
memmove(v26, v16, v21);
v15 = &v26[v21 + 4];
if ( v16 )
operator delete(v16);
v14 = &v26[4 * v25];
v16 = v26;
goto LABEL_20;
}
v15 = nullptr;
v16 = nullptr;
LABEL_25:
for ( k = (GradientTriggerObject **)v16; k != (GradientTriggerObject **)v15; ++k )
{
v20 = *k;
GJBaseGameLayer::controlGradientTrigger(a1, v20, a3);
}
if ( v16 )
operator delete(v16);
}