//
// GJGameState::processStateTriggers from 0x1402054f0 to 0x14020565c (364 bytes)
//
// 2 xrefs:
// > GJBaseGameLayer::update @ 0x140238990
// > ??> @ 0x1406ccc84
//
// 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 GJGameState::processStateTriggers(GJGameState *a1)
{
std::_Tree_val, int>>>::_Nodeptr Myhead; // rax
std::_Tree_simple_types, int>>::_Node *Left; // rbx
std::_Tree_node, int>, void *>::_Nodeptr Right; // rcx
std::_Tree_node, int>, void *>::_Nodeptr *p_Right; // r10
char Isnil; // r8
__int64 *v7; // rdx
std::_Tree_node, int>, void *>::_Nodeptr Parent; // rax
std::_Tree_node, int>, void *>::_Nodeptr *k; // rcx
std::_Tree_node, int>, void *>::_Nodeptr v10; // rcx
std::map,int> *p_m_activatedObjectIDs; // r9
__int64 *v12; // rax
std::_Tree_simple_types, int>>::_Node *m; // rcx
std::_Tree_node, int>, void *>::_Nodeptr n; // r8
__int64 *v15; // rax
std::_Tree_node, int>, void *>::_Nodeptr i; // rax
std::_Tree_simple_types, int>>::_Node *j; // rcx
Myhead = a1->m_activatedObjectIDs._Mypair._Myval2._Myval2._Myhead;
Left = Myhead->_Left;
if ( Myhead->_Left != Myhead )
{
do
{
Right = Left->_Right;
p_Right = &Left->_Right;
Isnil = Right->_Isnil;
if ( Left->_Myval.second >= (signed int)a1->m_commandIndex )
{
if ( Isnil )
{
for ( i = Left->_Parent; !i->_Isnil; i = i->_Parent )
{
if ( Left != i->_Right )
break;
Left = i;
}
Left = i;
}
else
{
Left = Left->_Right;
for ( j = Right->_Left; !j->_Isnil; j = j->_Left )
Left = j;
}
}
else
{
v7 = (__int64 *)Left;
if ( Isnil )
{
Parent = Left->_Parent;
for ( k = &Left->_Parent; !Parent->_Isnil; Parent = Parent->_Parent )
{
if ( Left != Parent->_Right )
break;
Left = Parent;
}
v10 = *k;
p_m_activatedObjectIDs = &a1->m_activatedObjectIDs;
Left = Parent;
if ( !v10->_Isnil )
{
p_m_activatedObjectIDs = &a1->m_activatedObjectIDs;
v12 = v7;
do
{
if ( v12 != (__int64 *)v10->_Right )
break;
v12 = (__int64 *)v10;
v10 = v10->_Parent;
}
while ( !v10->_Isnil );
}
}
else
{
Left = Left->_Right;
for ( m = Right->_Left; !m->_Isnil; m = m->_Left )
Left = m;
p_m_activatedObjectIDs = &a1->m_activatedObjectIDs;
for ( n = (*p_Right)->_Left; !n->_Isnil; n = n->_Left )
;
}
v15 = sub_14005F420(p_m_activatedObjectIDs, v7);
j_j_free(v15);
}
}
while ( Left != a1->m_activatedObjectIDs._Mypair._Myval2._Myval2._Myhead );
}
}