//
// EventLinkTrigger::customObjectSetup from 0x7718d8 to 0x771d18 (1088 bytes)
//
// 2 xrefs:
// > ??> @ 0x8c190
// > ??> @ 0x116e3a8
//
// 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 EventLinkTrigger::customObjectSetup(EventLinkTrigger *a1, std::vector *a2, std::vector *a3)
{
void **m_start; // x19
int v7; // w0
void *v8; // x1
int v9; // w0
void *v10; // x1
int v11; // w0
void *v12; // x1
bool v13; // w0
std::_Rb_tree_node_base::_Base_ptr M_parent; // x19
std::set *p_m_eventIDs; // x25
std::_Rb_tree_node_base::_Base_ptr v16; // x0
void *v17; // x0
__int64 v18; // x20
__int64 v19; // x3
unsigned __int64 v20; // x19
__int64 v21; // x27
char *v22; // x0
void *v23; // x0
unsigned int *v24; // x1
int v25; // w2
const char **v26; // x20
const char **v27; // x19
const char **v28; // x19
__int64 *v29; // x0
void *v30; // x1
void *v31; // x1
void *v32; // x1
__int64 v33; // [xsp+80h] [xbp+80h] BYREF
__int64 v34; // [xsp+88h] [xbp+88h] BYREF
void *v35; // [xsp+90h] [xbp+90h] BYREF
void *p; // [xsp+98h] [xbp+98h]
void *v37; // [xsp+A0h] [xbp+A0h]
EffectGameObject::customObjectSetup(a1, a2, a3);
m_start = a3->m_start;
if ( *((_QWORD *)a3->m_start + 51) )
{
v7 = atoi((const char *)a2->m_start[51].m_data.m_data);
v8 = m_start[447];
a1->m_targetGroupID = v7;
if ( v8 )
goto LABEL_3;
}
else
{
v30 = m_start[447];
a1->m_targetGroupID = 0;
if ( v30 )
{
LABEL_3:
v9 = atoi((const char *)a2->m_start[447].m_data.m_data);
v10 = m_start[525];
a1->m_extraID = v9;
if ( v10 )
goto LABEL_4;
LABEL_47:
v32 = m_start[431];
a1->m_extraID2 = 0;
if ( v32 )
goto LABEL_5;
LABEL_48:
v13 = 0;
goto LABEL_6;
}
}
v31 = m_start[525];
a1->m_extraID = 0;
if ( !v31 )
goto LABEL_47;
LABEL_4:
v11 = atoi((const char *)a2->m_start[525].m_data.m_data);
v12 = m_start[431];
a1->m_extraID2 = v11;
if ( !v12 )
goto LABEL_48;
LABEL_5:
v13 = atoi((const char *)a2->m_start[431].m_data.m_data) != 0;
LABEL_6:
M_parent = a1->m_eventIDs._M_t._M_impl._M_header._M_parent;
p_m_eventIDs = &a1->m_eventIDs;
a1->m_resetRemap = v13;
while ( M_parent )
{
std::_Rb_tree,std::less,std::allocator>::_M_erase(
(__int64)&a1->m_eventIDs,
M_parent->_M_right);
v16 = M_parent;
M_parent = M_parent->_M_left;
operator delete(v16);
}
a1->m_eventIDs._M_t._M_impl._M_header._M_parent = nullptr;
a1->m_eventIDs._M_t._M_impl._M_header._M_left = &a1->m_eventIDs._M_t._M_impl._M_header;
a1->m_eventIDs._M_t._M_impl._M_header._M_right = &a1->m_eventIDs._M_t._M_impl._M_header;
a1->m_eventIDs._M_t._M_impl._M_node_count = 0;
if ( *((_QWORD *)a3->m_start + 430) )
sub_D18D28(&v33);
else
sub_D153B8((int)&v33, &byte_F288A0);
if ( !*(_QWORD *)(v33 - 24) )
{
v17 = (void *)(v33 - 24);
if ( (__int64 *)(v33 - 24) != &qword_124B6B0 )
goto LABEL_42;
return;
}
v35 = nullptr;
p = nullptr;
v37 = nullptr;
v18 = sub_D168E0((int)&v33, &byte_EEFB80, 0, 1u);
v19 = v18;
v20 = 0;
v21 = *(_QWORD *)(v33 - 24);
while ( 1 )
{
sub_D14F84(&v34, &v33, v20, v19);
if ( v21 == v20 && !*(_QWORD *)(v34 - 24) )
goto LABEL_21;
v22 = (char *)p;
if ( p == v37 )
break;
if ( p )
{
sub_D18D28(p);
v22 = (char *)p;
}
p = v22 + 8;
LABEL_21:
if ( v18 == -1 )
goto LABEL_29;
LABEL_22:
v20 = v18 + 1;
v18 = sub_D168E0((int)&v33, &byte_EEFB80, (int)v18 + 1, 1u);
v23 = (void *)(v34 - 24);
if ( (__int64 *)(v34 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v24 = (unsigned int *)(v34 - 8);
do
v25 = __ldaxr(v24);
while ( __stlxr(v25 - 1, v24) );
}
else
{
v25 = *(_DWORD *)(v34 - 8);
*(_DWORD *)(v34 - 8) = v25 - 1;
}
if ( v25 <= 0 )
operator delete(v23);
}
v19 = v18 - v20;
if ( *(_QWORD *)(v33 - 24) < v20 )
sub_D13C5C(
"%s: __pos (which is %zu) > this->size() (which is %zu)",
"basic_string::substr",
v20,
*(_QWORD *)(v33 - 24));
}
std::vector::_M_emplace_back_aux((__int64)&v35, (__int64)&v34);
if ( v18 != -1 )
goto LABEL_22;
LABEL_29:
if ( (__int64 *)(v34 - 24) != &qword_124B6B0 )
sub_74B3A8((void *)(v34 - 24));
v26 = (const char **)p;
v27 = (const char **)v35;
if ( v35 != p )
{
do
{
LODWORD(v34) = atoi(*v27);
std::_Rb_tree,std::less,std::allocator>::_M_insert_unique(
p_m_eventIDs,
&v34);
++v27;
}
while ( v26 != v27 );
v28 = (const char **)v35;
v26 = (const char **)p;
if ( v35 != p )
{
do
{
while ( 1 )
{
v29 = (__int64 *)(*v28 - 24);
if ( v29 != &qword_124B6B0 )
break;
if ( v26 == ++v28 )
goto LABEL_38;
}
++v28;
sub_74B3A8(v29);
}
while ( v26 != v28 );
LABEL_38:
v26 = (const char **)v35;
}
}
if ( v26 )
operator delete(v26);
v17 = (void *)(v33 - 24);
if ( (__int64 *)(v33 - 24) != &qword_124B6B0 )
LABEL_42:
sub_74B3A8(v17);
}