//
// EventLinkTrigger::customObjectSetup from 0x1404b8d70 to 0x1404b9074 (772 bytes)
//
// 2 xrefs:
// > ??> @ 0x14061f428
// > ??> @ 0x1406dcc74
//
// 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
//
// Hidden C++ exception states: #wind=4
void EventLinkTrigger::customObjectSetup(EventLinkTrigger *a1, std::vector *a2, std::vector *a3)
{
__int64 v6; // rdx
int v7; // eax
std::_Vector_val>::pointer m_bigStorage; // rcx
int v9; // eax
std::_Vector_val>::pointer v10; // rcx
int v11; // eax
std::_Vector_val>::pointer v12; // rcx
int v13; // eax
std::_Vector_val>::pointer v14; // rcx
__int64 *p_m_eventIDs; // r14
_QWORD *v16; // rdi
_QWORD *v17; // rbx
void *v18; // rcx
__int64 v19; // rax
char v20; // bl
void *v21; // rcx
char *v22; // rsi
const char *v23; // rbx
const char *i; // rdi
const char *v25; // rcx
__int64 j; // rbx
char *v27; // rax
int v28; // [rsp+20h] [rbp-49h] BYREF
void *Block[2]; // [rsp+28h] [rbp-41h] BYREF
__int64 v30; // [rsp+38h] [rbp-31h]
unsigned __int64 v31; // [rsp+40h] [rbp-29h]
__int128 v32; // [rsp+48h] [rbp-21h] BYREF
__int128 v33; // [rsp+58h] [rbp-11h]
_BYTE v34[32]; // [rsp+68h] [rbp-1h] BYREF
v28 = 0;
EffectGameObject::customObjectSetup(a1, a2, a3);
if ( *((_QWORD *)a3->_Mypair._Myval2._Myfirst + 51) )
{
m_bigStorage = a2->_Mypair._Myval2._Myfirst + 51;
if ( a2->_Mypair._Myval2._Myfirst[51].m_data.m_capacity > 0xF )
m_bigStorage = (std::_Vector_val>::pointer)m_bigStorage->m_data.m_bigStorage;
v7 = atoi(m_bigStorage->m_data.m_smallStorage._Elems);
}
else
{
v7 = 0;
}
a1->m_targetGroupID = v7;
if ( *((_QWORD *)a3->_Mypair._Myval2._Myfirst + 447) )
{
v10 = a2->_Mypair._Myval2._Myfirst + 447;
if ( a2->_Mypair._Myval2._Myfirst[447].m_data.m_capacity > 0xF )
v10 = (std::_Vector_val>::pointer)v10->m_data.m_bigStorage;
v9 = atoi(v10->m_data.m_smallStorage._Elems);
}
else
{
v9 = 0;
}
a1->m_extraID = v9;
if ( *((_QWORD *)a3->_Mypair._Myval2._Myfirst + 525) )
{
v12 = a2->_Mypair._Myval2._Myfirst + 525;
if ( a2->_Mypair._Myval2._Myfirst[525].m_data.m_capacity > 0xF )
v12 = (std::_Vector_val>::pointer)v12->m_data.m_bigStorage;
v11 = atoi(v12->m_data.m_smallStorage._Elems);
}
else
{
v11 = 0;
}
a1->m_extraID2 = v11;
if ( *((_QWORD *)a3->_Mypair._Myval2._Myfirst + 431) )
{
v14 = a2->_Mypair._Myval2._Myfirst + 431;
if ( a2->_Mypair._Myval2._Myfirst[431].m_data.m_capacity > 0xF )
v14 = (std::_Vector_val>::pointer)v14->m_data.m_bigStorage;
v13 = atoi(v14->m_data.m_smallStorage._Elems);
}
else
{
v13 = 0;
}
a1->m_resetRemap = v13 != 0;
p_m_eventIDs = (__int64 *)&a1->m_eventIDs;
v16 = (_QWORD *)*p_m_eventIDs;
v17 = *(_QWORD **)(*p_m_eventIDs + 8);
while ( !*((_BYTE *)v17 + 25) )
{
sub_1400CE010((__int64)p_m_eventIDs, (__int64)p_m_eventIDs, v17[2]);
v18 = v17;
v17 = (_QWORD *)*v17;
j_j_free(v18);
}
v16[1] = v16;
*v16 = v16;
v16[2] = v16;
p_m_eventIDs[1] = 0;
if ( *((_QWORD *)a3->_Mypair._Myval2._Myfirst + 430) )
{
v19 = sub_14003BDB0((__int64)v34, (__int64)&a2->_Mypair._Myval2._Myfirst[430]);
v20 = 2;
}
else
{
*(_OWORD *)Block = 0;
v30 = 0;
v31 = 15;
LOBYTE(Block[0]) = 0;
v19 = (__int64)Block;
v20 = 1;
}
v32 = 0;
v33 = 0u;
v32 = *(_OWORD *)v19;
v33 = *(_OWORD *)(v19 + 16);
*(_QWORD *)(v19 + 16) = 0;
*(_QWORD *)(v19 + 24) = 15;
*(_BYTE *)v19 = 0;
if ( (v20 & 2) != 0 )
{
v20 &= ~2u;
sub_14003A830((__int64)v34);
}
if ( (v20 & 1) != 0 )
{
v6 = v31;
if ( v31 > 0xF )
{
v21 = Block[0];
if ( v31 + 1 >= 0x1000 )
{
v21 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v21 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v21);
}
}
if ( (_QWORD)v33 )
{
*(_OWORD *)Block = 0;
v30 = 0;
sub_1404950E0((__int64 *)&v32, v6, (__int64 *)Block);
v22 = (char *)Block[0];
v23 = (const char *)Block[0];
for ( i = (const char *)Block[1]; v23 != i; v23 += 32 )
{
v25 = v23;
if ( *((_QWORD *)v23 + 3) > 0xFu )
v25 = *(const char **)v23;
v28 = atoi(v25);
sub_1400CDF10(p_m_eventIDs, (__int64)v34, &v28);
}
if ( v22 )
{
for ( j = (__int64)v22; (const char *)j != i; j += 32 )
sub_14003A830(j);
v27 = v22;
if ( ((v30 - (_QWORD)v22) & 0xFFFFFFFFFFFFFFE0uLL) >= 0x1000 )
{
v22 = *((char **)v22 - 1);
if ( (unsigned __int64)(v27 - v22 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v22);
}
}
sub_14003A830((__int64)&v32);
}