//
// sub_14046BE30 from 0x14046be30 to 0x14046bf1e (238 bytes)
//
// 8 xrefs:
// > SetupItemEditTriggerPopup::updateOpButton @ 0x14046c232
// > SetupItemEditTriggerPopup::updateFormulaLabel @ 0x14046ca29
// > SetupItemEditTriggerPopup::updateFormulaLabel @ 0x14046cce1
// > SetupItemEditTriggerPopup::updateFormulaLabel @ 0x14046cee9
// > SetupItemCompareTriggerPopup::updateOpButton @ 0x14046e860
// > SetupItemCompareTriggerPopup::updateFormulaLabel @ 0x14046f04c
// > SetupItemCompareTriggerPopup::updateFormulaLabel @ 0x14046f389
// > ??> @ 0x1406db1d4
//
// 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
//
__int64 __fastcall sub_14046BE30(__int64 a1, int a2)
{
int v2; // edx
int v3; // edx
int v4; // edx
__int64 result; // rax
*(_OWORD *)a1 = 0;
if ( a2 )
{
v2 = a2 - 1;
if ( v2 )
{
v3 = v2 - 1;
if ( v3 )
{
v4 = v3 - 1;
if ( v4 )
{
result = a1;
if ( v4 == 1 )
{
*(_QWORD *)(a1 + 16) = 1;
*(_QWORD *)(a1 + 24) = 15;
*(_WORD *)a1 = 47;
}
else
{
*(_QWORD *)(a1 + 16) = 2;
*(_QWORD *)(a1 + 24) = 15;
strcpy((char *)a1, "NA");
}
}
else
{
*(_QWORD *)(a1 + 16) = 3;
*(_QWORD *)(a1 + 24) = 15;
*(_WORD *)a1 = -32542;
*(_BYTE *)(a1 + 2) = -94;
*(_BYTE *)(a1 + 3) = 0;
return a1;
}
}
else
{
*(_QWORD *)(a1 + 16) = 1;
*(_QWORD *)(a1 + 24) = 15;
*(_WORD *)a1 = 45;
return a1;
}
}
else
{
*(_QWORD *)(a1 + 16) = 1;
*(_QWORD *)(a1 + 24) = 15;
*(_WORD *)a1 = 43;
return a1;
}
}
else
{
*(_QWORD *)(a1 + 16) = 1;
*(_QWORD *)(a1 + 24) = 15;
*(_WORD *)a1 = 61;
return a1;
}
return result;
}