//
// SpawnTriggerGameObject::customObjectSetup from 0x1001d3640 to 0x1001d3a46 (1030 bytes)
//
// 1 xrefs:
// > ??> @ 0x1008c75d0
//
// 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 __fastcall SpawnTriggerGameObject::customObjectSetup(
SpawnTriggerGameObject *a1,
std::vector *a2,
std::vector *a3)
{
std::__vector_base::pointer begin; // rbx
std::__vector_base::pointer v6; // rdi
const char *longStorage; // rdi
int v8; // eax
float v9; // xmm1_4
__int128 v10; // xmm0
std::__vector_base::pointer v11; // rdi
const char *elems; // rdi
std::__vector_base::pointer v13; // rdi
const char *v14; // rdi
std::__vector_base::pointer v15; // rdi
const char *v16; // rdi
unsigned int v17; // ecx
std::__vector_base::pointer v18; // rax
std::__vector_base::pointer v19; // rdi
const char *v20; // rdi
std::__vector_base::pointer v21; // rdi
const char *v22; // rdi
std::__vector_base::pointer v23; // rax
cocos2d::CCArray *v24; // rbx
unsigned int v25; // r15d
int v26; // ecx
__int64 v27; // r14
cocos2d::CCString *v28; // rax
unsigned int v29; // r15d
cocos2d::CCString *v30; // rax
int v31; // eax
__int64 v32; // r8
SpawnTriggerGameObject *v33; // r12
ChanceObject *end; // r14
ChanceObject *value; // rdi
std::__vector_base::pointer v36; // rsi
__int64 v37; // r14
unsigned __int64 v38; // rcx
__int64 v39; // rdi
unsigned __int64 v40; // r12
ChanceObject *v41; // rbx
int v42; // ecx
__int64 v43; // r13
size_t v44; // rdx
SpawnTriggerGameObject *v45; // [rsp+8h] [rbp-68h]
__int128 v46; // [rsp+10h] [rbp-60h] BYREF
void *__p; // [rsp+20h] [rbp-50h]
int v48; // [rsp+34h] [rbp-3Ch]
cocos2d::CCArray *v49; // [rsp+38h] [rbp-38h]
int v50; // [rsp+44h] [rbp-2Ch]
EffectGameObject::customObjectSetup(a1, a2, a3);
begin = a3->__begin_;
if ( begin[51] )
{
v6 = a2->__begin_;
if ( (a2->__begin_[51].m_data.m_short.sizex2 & 1) != 0 )
longStorage = v6[51].m_data.m_long.longStorage;
else
longStorage = v6[51].m_data.m_short.shortStorage.__elems_;
v8 = atoi(longStorage);
}
else
{
v8 = 0;
}
a1->m_targetGroupID = v8;
v9 = 0.0;
*(_QWORD *)&v10 = 0;
if ( begin[63] )
{
v11 = a2->__begin_;
if ( (a2->__begin_[63].m_data.m_short.sizex2 & 1) != 0 )
elems = v11[63].m_data.m_long.longStorage;
else
elems = v11[63].m_data.m_short.shortStorage.__elems_;
*(double *)&v10 = atof(elems);
*(float *)&v10 = *(double *)&v10;
v9 = 0.0;
}
LODWORD(a1->m_spawnDelay) = v10;
if ( begin[556] )
{
v13 = a2->__begin_;
if ( (a2->__begin_[556].m_data.m_short.sizex2 & 1) != 0 )
v14 = v13[556].m_data.m_long.longStorage;
else
v14 = v13[556].m_data.m_short.shortStorage.__elems_;
*(double *)&v10 = atof(v14);
v9 = *(double *)&v10;
}
a1->m_delayRange = v9;
if ( !begin[102] )
{
a1->m_previewDisable = 0;
if ( begin[441] )
goto LABEL_26;
LABEL_21:
a1->m_spawnOrdered = 0;
if ( begin[581] )
goto LABEL_30;
LABEL_22:
a1->m_resetRemap = 0;
if ( begin[442] )
goto LABEL_34;
LABEL_23:
LOWORD(v46) = 0;
v17 = 0;
v18 = nullptr;
goto LABEL_36;
}
v15 = a2->__begin_;
if ( (a2->__begin_[102].m_data.m_short.sizex2 & 1) != 0 )
v16 = v15[102].m_data.m_long.longStorage;
else
v16 = v15[102].m_data.m_short.shortStorage.__elems_;
a1->m_previewDisable = atoi(v16) != 0;
if ( !begin[441] )
goto LABEL_21;
LABEL_26:
v19 = a2->__begin_;
if ( (a2->__begin_[441].m_data.m_short.sizex2 & 1) != 0 )
v20 = v19[441].m_data.m_long.longStorage;
else
v20 = v19[441].m_data.m_short.shortStorage.__elems_;
a1->m_spawnOrdered = atoi(v20) != 0;
if ( !begin[581] )
goto LABEL_22;
LABEL_30:
v21 = a2->__begin_;
if ( (a2->__begin_[581].m_data.m_short.sizex2 & 1) != 0 )
v22 = v21[581].m_data.m_long.longStorage;
else
v22 = v21[581].m_data.m_short.shortStorage.__elems_;
a1->m_resetRemap = atoi(v22) != 0;
if ( !begin[442] )
goto LABEL_23;
LABEL_34:
v23 = a2->__begin_;
if ( (a2->__begin_[442].m_data.m_short.sizex2 & 1) != 0 )
{
a2 = (std::vector *)v23[442].m_data.m_long.longStorage;
sub_100006B70(&v46, a2, v23[442].m_data.m_long.size, *(double *)&v10);
v17 = (unsigned __int8)v46;
LOBYTE(v18) = v46 & 1;
if ( (v46 & 1) == 0 )
{
LABEL_36:
if ( !(v17 >> 1) )
goto LABEL_57;
goto LABEL_40;
}
}
else
{
v18 = v23 + 442;
__p = v18->m_data.m_long.longStorage;
v10 = *(_OWORD *)&v18->m_data.m_short.sizex2;
v46 = *(_OWORD *)&v18->m_data.m_short.sizex2;
v17 = (unsigned __int8)v46;
LOBYTE(v18) = v46 & 1;
if ( (v46 & 1) == 0 )
goto LABEL_36;
}
if ( !*((_QWORD *)&v46 + 1) )
goto LABEL_57;
LABEL_40:
v24 = (cocos2d::CCArray *)sub_1001C3800((unsigned __int8 *)&v46, (__int64)a2, *(double *)&v10);
v25 = 0;
v45 = a1;
v49 = v24;
while ( v25 < (unsigned int)sub_100720070(v24) )
{
v28 = cocos2d::CCArray::stringAtIndex(v24, v25);
v50 = cocos2d::CCString::intValue(v28);
v29 = v25 + 1;
v30 = cocos2d::CCArray::stringAtIndex(v24, v29);
v31 = cocos2d::CCString::intValue(v30);
v33 = v45;
end = v45->m_remapObjects.__end_;
value = v45->m_remapObjects.__end_cap_.__value_;
if ( end < value )
{
v26 = v50;
end->m_groupID = v50;
end->m_oldGroupID = v26;
end->m_chance = v31;
end->m_unk00c = 0;
v27 = (__int64)&end[1];
}
else
{
v36 = v45->m_remapObjects.__begin_;
v37 = (char *)end - (char *)v36;
v38 = (v37 >> 4) + 1;
if ( v38 > 0xFFFFFFFFFFFFFFFLL )
sub_1001F4810(value, v36, 0xFFFFFFFFFFFFFFFLL, v38, v32);
v39 = (char *)value - (char *)v36;
v40 = v39 >> 3;
if ( v39 >> 3 <= v38 )
v40 = (v37 >> 4) + 1;
if ( (unsigned __int64)v39 >= 0x7FFFFFFFFFFFFFF0LL )
v40 = 0xFFFFFFFFFFFFFFFLL;
if ( v40 )
{
v48 = v31;
if ( v40 > 0xFFFFFFFFFFFFFFFLL )
sub_100054850();
v41 = (ChanceObject *)operator new(16 * v40);
v31 = v48;
}
else
{
v41 = nullptr;
}
v42 = v50;
v43 = v37 >> 4;
v41[v43].m_groupID = v50;
v41[v43].m_oldGroupID = v42;
v41[v43].m_chance = v31;
v41[v43].m_unk00c = 0;
v44 = v37;
v27 = (__int64)&v41[v43 + 1];
memcpy(v41, v36, v44);
v45->m_remapObjects.__begin_ = v41;
v45->m_remapObjects.__end_ = (std::__vector_base::pointer)v27;
v45->m_remapObjects.__end_cap_.__value_ = &v41[v40];
v33 = v45;
if ( v36 )
operator delete(v36);
}
v24 = v49;
v33->m_remapObjects.__end_ = (std::__vector_base::pointer)v27;
v25 = v29 + 1;
}
LOBYTE(v18) = v46 & 1;
LABEL_57:
if ( (_BYTE)v18 )
operator delete(__p);
}