//
// RandTriggerGameObject::customObjectSetup from 0x1404b43b0 to 0x1404b45af (511 bytes)
//
// 2 xrefs:
// > ??> @ 0x140618f90
// > ??> @ 0x1406dcb6c
//
// 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=3
void RandTriggerGameObject::customObjectSetup(
RandTriggerGameObject *a1,
std::vector *a2,
std::vector *a3)
{
int v6; // eax
std::_Vector_val>::pointer m_bigStorage; // rcx
__int64 v8; // rax
char v9; // bl
void *v10; // rcx
cocos2d::CCArray *v11; // rbp
unsigned int v12; // ebx
std::vector *p_m_chanceObjects; // rdi
cocos2d::CCString *v14; // rax
int v15; // esi
cocos2d::CCString *v16; // rax
int v17; // eax
std::_Vector_val>::pointer Mylast; // rdx
int v19; // [rsp+20h] [rbp-98h] BYREF
int v20; // [rsp+24h] [rbp-94h] BYREF
void *Block[2]; // [rsp+28h] [rbp-90h] BYREF
__int64 v22; // [rsp+38h] [rbp-80h]
unsigned __int64 v23; // [rsp+40h] [rbp-78h]
__int128 v24; // [rsp+48h] [rbp-70h] BYREF
__int128 v25; // [rsp+58h] [rbp-60h]
_BYTE v26[32]; // [rsp+68h] [rbp-50h] BYREF
v19 = 0;
EffectGameObject::customObjectSetup(a1, a2, a3);
if ( *((_QWORD *)a3->_Mypair._Myval2._Myfirst + 56) )
{
m_bigStorage = a2->_Mypair._Myval2._Myfirst + 56;
if ( a2->_Mypair._Myval2._Myfirst[56].m_data.m_capacity > 0xF )
m_bigStorage = (std::_Vector_val>::pointer)m_bigStorage->m_data.m_bigStorage;
v6 = atoi(m_bigStorage->m_data.m_smallStorage._Elems);
}
else
{
v6 = 0;
}
a1->m_activateGroup = v6 != 0;
if ( *((_QWORD *)a3->_Mypair._Myval2._Myfirst + 152) )
{
v8 = sub_14003BDB0((__int64)v26, (__int64)&a2->_Mypair._Myval2._Myfirst[152]);
v9 = 2;
}
else
{
*(_OWORD *)Block = 0;
v22 = 0;
v23 = 15;
LOBYTE(Block[0]) = 0;
v8 = (__int64)Block;
v9 = 1;
}
v24 = 0;
v25 = 0;
v24 = *(_OWORD *)v8;
v25 = *(_OWORD *)(v8 + 16);
*(_QWORD *)(v8 + 16) = 0;
*(_QWORD *)(v8 + 24) = 15;
*(_BYTE *)v8 = 0;
if ( (v9 & 2) != 0 )
{
v9 &= ~2u;
sub_14003A830((__int64)v26);
}
if ( (v9 & 1) != 0 && v23 > 0xF )
{
v10 = Block[0];
if ( v23 + 1 >= 0x1000 )
{
v10 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v10 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v10);
}
v11 = (cocos2d::CCArray *)sub_140495350((__int64 *)&v24);
v12 = 0;
if ( cocos2d::CCArray::count(v11) )
{
p_m_chanceObjects = &a1->m_chanceObjects;
do
{
v14 = cocos2d::CCArray::stringAtIndex(v11, v12);
v15 = cocos2d::CCString::intValue(v14);
v19 = v15;
v16 = cocos2d::CCArray::stringAtIndex(v11, v12 + 1);
v17 = cocos2d::CCString::intValue(v16);
v20 = v17;
Mylast = p_m_chanceObjects->_Mypair._Myval2._Mylast;
if ( Mylast == p_m_chanceObjects->_Mypair._Myval2._Myend )
{
sub_14043F020((const void **)&p_m_chanceObjects->_Mypair._Myval2._Myfirst, Mylast, &v19, &v20);
}
else
{
Mylast->m_groupID = v15;
Mylast->m_oldGroupID = v15;
Mylast->m_chance = v17;
Mylast->m_unk00c = 0;
++p_m_chanceObjects->_Mypair._Myval2._Mylast;
}
v12 += 2;
}
while ( v12 < cocos2d::CCArray::count(v11) );
}
sub_14003A830((__int64)&v24);
}