//
// SetupRandAdvTriggerPopup::onAddChance from 0x100379320 to 0x1003793e8 (200 bytes)
//
// 1 xrefs:
// > SetupRandAdvTriggerPopup::init @ 0x100378e43
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// 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 12:29:05 +0000
//
char __fastcall SetupRandAdvTriggerPopup::onAddChance(__int64 a1)
{
int v1; // r14d
char *v2; // r15
int v3; // r15d
char *v4; // r12
char result; // al
__int64 v6; // rsi
char *v7[2]; // [rsp+8h] [rbp-38h] BYREF
char *v8; // [rsp+18h] [rbp-28h]
CCTextInputNode::getString(v7, *(_QWORD *)(a1 + 1024));
if ( ((__int64)v7[0] & 1) != 0 )
{
v2 = v8;
v1 = atoi(v8);
operator delete(v2);
}
else
{
v1 = atoi((const char *)v7 + 1);
}
CCTextInputNode::getString(v7, *(_QWORD *)(a1 + 1032));
if ( ((__int64)v7[0] & 1) != 0 )
{
v4 = v8;
v3 = atoi(v8);
operator delete(v4);
}
else
{
v3 = atoi((const char *)v7 + 1);
}
result = v1 <= 0;
if ( v1 > 0 && v3 > 0 )
{
v6 = 9999;
if ( (unsigned int)v1 < 0x270F )
v6 = (unsigned int)v1;
SetupRandAdvTriggerPopup::addChance(a1, v6, (unsigned int)v3);
return SetupRandAdvTriggerPopup::updateGroupIDButtons(a1);
}
return result;
}