//
// GJBaseGameLayer::controlTriggersWithControlID from 0x898e64 to 0x8990e0 (636 bytes)
//
// 2 xrefs:
// > TriggerControlGameObject::triggerObject @ 0x74b364
// > ??> @ 0x65478
//
// 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; // x4
std::__detail::_Hash_node_base *M_nxt; // x3
std::__detail::_Hash_node_base *j; // x0
std::__detail::_Hash_node_base *v9; // x1
cocos2d::CCDictionary *m_gradientLayers; // x0
cocos2d::CCDictElement *m_pElements; // x0
cocos2d::CCDictElement *next; // x23
char *v13; // x25
char *v14; // x20
char *v15; // x26
cocos2d::CCObject *m_pObject; // x24
__int64 v17; // x0
GradientTriggerObject **v18; // x19
__int64 v19; // x20
unsigned __int64 v20; // x28
unsigned __int64 v21; // x1
unsigned __int64 v22; // x25
char *v23; // x27
size_t v24; // x2
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; M_nxt != j; LOBYTE(v9[234]._M_nxt) = a3 != Resume )
{
while ( 1 )
{
v9 = j->_M_nxt;
if ( a2 == LODWORD(j->_M_nxt[207]._M_nxt) )
break;
if ( M_nxt == ++j )
goto LABEL_7;
}
++j;
}
LABEL_7:
;
}
m_gradientLayers = a1->m_gradientLayers;
if ( !m_gradientLayers )
return;
m_pElements = m_gradientLayers->m_pElements;
if ( !m_pElements )
return;
next = (cocos2d::CCDictElement *)m_pElements->hh.next;
v13 = nullptr;
v14 = nullptr;
v15 = nullptr;
while ( 1 )
{
m_pObject = m_pElements->m_pObject;
v17 = *(_QWORD *)&m_pObject[10].m_uAutoReleaseCount;
if ( v17 )
{
if ( a2 == *(_DWORD *)(v17 + 1656) )
break;
}
LABEL_13:
if ( !next )
goto LABEL_19;
LABEL_14:
m_pElements = next;
next = (cocos2d::CCDictElement *)next->hh.next;
}
if ( v14 == v13 )
{
v19 = v14 - v15;
v20 = v19 >> 3;
if ( v19 >> 3 )
{
v21 = 2 * v20;
v22 = -8;
if ( v20 <= 2 * v20 && v21 <= 0x1FFFFFFFFFFFFFFFLL )
{
v22 = 16 * v20;
v23 = nullptr;
if ( !v21 )
{
LABEL_27:
if ( &v23[v19] )
*(_QWORD *)&v23[v19] = v17;
if ( v20 )
{
v24 = v19;
v14 = &v23[v19 + 8];
memmove(v23, v15, v24);
}
else
{
v14 = &v23[v19 + 8];
if ( !v15 )
{
LABEL_32:
v13 = &v23[v22];
v15 = v23;
goto LABEL_13;
}
}
operator delete(v15);
goto LABEL_32;
}
}
}
else
{
v22 = 8;
}
v23 = (char *)operator new(v22);
v17 = *(_QWORD *)&m_pObject[10].m_uAutoReleaseCount;
goto LABEL_27;
}
if ( v14 )
*(_QWORD *)v14 = v17;
v14 += 8;
if ( next )
goto LABEL_14;
LABEL_19:
if ( v14 != v15 )
{
v18 = (GradientTriggerObject **)v15;
do
GJBaseGameLayer::controlGradientTrigger(a1, *v18++, a3);
while ( v14 != (char *)v18 );
}
if ( v15 )
operator delete(v15);
}