//
// sub_140602330 from 0x140602330 to 0x1406023ef (191 bytes)
//
// 8 xrefs:
// > SetupItemEditTriggerPopup::updateOpButton @ 0x14060271e
// > SetupItemEditTriggerPopup::updateFormulaLabel @ 0x140602f2f
// > SetupItemEditTriggerPopup::updateFormulaLabel @ 0x140603257
// > SetupItemEditTriggerPopup::updateFormulaLabel @ 0x140603477
// > SetupItemCompareTriggerPopup::updateOpButton @ 0x140604f5a
// > SetupItemCompareTriggerPopup::updateFormulaLabel @ 0x14060574f
// > SetupItemCompareTriggerPopup::updateFormulaLabel @ 0x140605bd5
// > ??> @ 0x14092f8b8
//
// 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:35:11 +0000
//
__int64 __fastcall sub_140602330(__int64 a1, int a2)
{
int v2; // edx
int v3; // edx
int v4; // edx
__int64 result; // rax
*(_OWORD *)a1 = 0;
*(_QWORD *)(a1 + 24) = 15;
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;
*(_WORD *)a1 = 47;
}
else
{
*(_QWORD *)(a1 + 16) = 2;
strcpy((char *)a1, "NA");
}
}
else
{
*(_QWORD *)(a1 + 16) = 3;
*(_WORD *)a1 = -32542;
*(_BYTE *)(a1 + 2) = -94;
*(_BYTE *)(a1 + 3) = 0;
return a1;
}
}
else
{
*(_QWORD *)(a1 + 16) = 1;
*(_WORD *)a1 = 45;
return a1;
}
}
else
{
*(_QWORD *)(a1 + 16) = 1;
*(_WORD *)a1 = 43;
return a1;
}
}
else
{
*(_QWORD *)(a1 + 16) = 1;
*(_WORD *)a1 = 61;
return a1;
}
return result;
}