//
// SetupRandAdvTriggerPopup::addChanceToObject from 0x65b3cc to 0x65b424 (88 bytes)
//
// 2 xrefs:
// > SetupRandAdvTriggerPopup::addChance @ 0x65cc0c
// > SetupRandAdvTriggerPopup::addChance @ 0x65cc34
//
// 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:55:33 +0000
//
void __fastcall SetupRandAdvTriggerPopup::addChanceToObject(
SetupRandAdvTriggerPopup *this,
RandTriggerGameObject *a2,
int a3,
int a4)
{
_DWORD *v4; // r4
_DWORD *v5; // r3
_DWORD *v6; // r0
int v7; // t1
int v8; // r0
int v9; // [sp+0h] [bp-Ch] BYREF
int v10[2]; // [sp+4h] [bp-8h] BYREF
v10[0] = (int)a2;
v10[1] = a3;
v9 = a4;
v4 = *((_DWORD **)a2 + 413);
v5 = *((_DWORD **)a2 + 412);
v10[0] = a3;
while ( 1 )
{
v6 = v5;
if ( v5 == v4 )
break;
v7 = *v5;
v5 += 4;
if ( v7 == a3 )
{
v6[2] += v9;
return;
}
}
if ( (unsigned int)v5 >= *((_DWORD *)a2 + 414) )
{
std::vector::__emplace_back_slow_path((int *)a2 + 412, v10, &v9);
}
else
{
v8 = v9;
if ( v5 )
{
*v5 = a3;
v5[1] = a3;
v5[2] = v8;
v5[3] = 0;
}
*((_DWORD *)a2 + 413) += 16;
}
}