//
// getItemVarName from 0xa4911c to 0xa49304 (488 bytes)
//
// 6 xrefs:
// > SetupItemEditTriggerPopup::updateFormulaLabel @ 0xa498b0
// > SetupItemEditTriggerPopup::updateFormulaLabel @ 0xa498d4
// > SetupItemEditTriggerPopup::updateFormulaLabel @ 0xa498e8
// > SetupItemCompareTriggerPopup::updateFormulaLabel @ 0xa4c1a4
// > SetupItemCompareTriggerPopup::updateFormulaLabel @ 0xa4c1b4
// > ??> @ 0x99618
//
// 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 __usercall getItemVarName@(int a1@, unsigned int a2@, __int64 a3@)
{
void *v7; // x0
unsigned int *v8; // x2
int v9; // w1
__int64 v10; // [xsp+50h] [xbp+50h] BYREF
sub_D153B8(a3, &byte_F288A0);
switch ( a1 )
{
case 1:
case 2:
if ( a1 == 1 )
sub_D1798C(a3, "I", 1);
else
sub_D1798C(a3, "T", 1);
GameToolbox::intToString(&v10, (GameToolbox *)a2);
sub_D15E14(a3, &v10);
v7 = (void *)(v10 - 24);
if ( (__int64 *)(v10 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v8 = (unsigned int *)(v10 - 8);
do
v9 = __ldaxr(v8);
while ( __stlxr(v9 - 1, v8) );
}
else
{
v9 = *(_DWORD *)(v10 - 8);
*(_DWORD *)(v10 - 8) = v9 - 1;
}
if ( v9 <= 0 )
operator delete(v7);
}
break;
case 3:
sub_D1798C(a3, "Points", 6);
break;
case 4:
sub_D1798C(a3, "MainTime", 8);
break;
case 5:
sub_D1798C(a3, "Attempts", 8);
break;
default:
sub_D1798C(a3, "NA", 2);
break;
}
return a3;
}