//
// SequenceTriggerGameObject::addTarget from 0x4f6d90 to 0x4f6e5c (204 bytes)
//
// 1 xrefs:
// > SetupSequenceTriggerPopup::onAddChance @ 0x6bc372
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:51:17 +0000
//
void __fastcall SequenceTriggerGameObject::addTarget(SequenceTriggerGameObject *this, int a2, int a3)
{
int v4; // r7
_DWORD *v5; // r2
unsigned int v7; // r0
int v8; // lr
int v9; // r2
unsigned int v10; // r1
unsigned int v11; // r0
unsigned int v12; // r0
_DWORD *v13; // r3
void *v14[2]; // [sp+0h] [bp-18h] BYREF
_DWORD *v15; // [sp+8h] [bp-10h]
if ( a3 < 1 )
a3 = 1;
v4 = a3;
v5 = *((_DWORD **)this + 413);
v7 = *((_DWORD *)this + 414);
if ( (unsigned int)v5 >= v7 )
{
v8 = *((_DWORD *)this + 412);
v9 = ((int)v5 - v8) >> 4;
v10 = v9 + 1;
if ( (unsigned int)(v9 + 1) >= 0x10000000 )
sub_388170();
v11 = (int)(v7 - v8) >> 4;
if ( v11 > 0x7FFFFFE )
{
v10 = 0xFFFFFFF;
}
else
{
v12 = 2 * v11;
if ( v10 < v12 )
v10 = v12;
}
std::__split_buffer::__split_buffer(v14, v10, v9, (int)this + 1656);
v13 = v15;
if ( v15 )
{
*v15 = a2;
v13[1] = a2;
v13[2] = v4;
v13[3] = 0;
}
v15 += 4;
std::vector::__swap_out_circular_buffer((int *)this + 412, v14);
v15 -= 4 * ((unsigned int)((char *)v15 - (char *)v14[1]) >> 4);
if ( v14[0] )
operator delete(v14[0]);
}
else
{
if ( v5 )
{
*v5 = a2;
v5[1] = a2;
v5[2] = v4;
v5[3] = 0;
}
*((_DWORD *)this + 413) += 16;
}
*((_DWORD *)this + 429) = -1;
}