//
// SetupSequenceTriggerPopup::onAddChance from 0x1405d9f10 to 0x1405da00f (255 bytes)
//
// 2 xrefs:
// > SetupSequenceTriggerPopup::init @ 0x1405d8b6a
// > ??> @ 0x14092eb68
//
// 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 11:34:58 +0000
//
void __fastcall SetupSequenceTriggerPopup::onAddChance(_QWORD *a1)
{
int v2; // ebx
float v3; // xmm0_4
__int64 v4; // rcx
int v5; // edi
int v6; // eax
__int64 v7; // r9
__int64 v8; // r8
int v9; // ecx
__int64 v10; // rbx
int v11; // [rsp+30h] [rbp+8h] BYREF
int v12; // [rsp+40h] [rbp+18h] BYREF
v2 = (int)(*(float (__fastcall **)(_QWORD *, __int64))(*a1 + 1168LL))(a1, 0xFFFFFFFFLL);
v3 = (*(float (__fastcall **)(_QWORD *, __int64))(*a1 + 1168LL))(a1, 4294967294LL);
v4 = a1[125];
v5 = (int)v3;
if ( v4 )
{
if ( !v5 )
return;
v6 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v4 + 56LL))(v4);
if ( v6 >= 0 )
{
v7 = a1[85];
v8 = *(_QWORD *)(v7 + 1856);
if ( v6 <= (unsigned __int64)(((*(_QWORD *)(v7 + 1864) - v8) >> 4) - 1) && v8 != *(_QWORD *)(v7 + 1864) )
{
v9 = v5 + *(_DWORD *)(v8 + 16LL * v6 + 8);
if ( v9 < 1 )
v9 = 1;
*(_DWORD *)(v8 + 16LL * v6 + 8) = v9;
*(_DWORD *)(v7 + 2024) = -1;
}
}
goto LABEL_12;
}
if ( v2 > 0 && v5 > 0 )
{
v12 = v2;
v10 = a1[85];
v11 = (int)v3;
sub_1405D4B60((const void **)(v10 + 1856), &v12, (unsigned int *)&v11);
*(_DWORD *)(v10 + 2024) = -1;
LABEL_12:
SetupSequenceTriggerPopup::updateGroupIDButtons((__int64)a1);
}
}