//
// SetupItemCompareTriggerPopup::updateFormulaLabel from 0xa4c034 to 0xa4ca3c (2568 bytes)
//
// 6 xrefs:
// > SetupItemCompareTriggerPopup::onCustomToggleTriggerValue @ 0xa4cb38
// > SetupItemCompareTriggerPopup::onCustomToggleTriggerValue @ 0xa4cbc4
// > SetupItemCompareTriggerPopup::valueDidChange @ 0xa4cc0c
// > SetupItemCompareTriggerPopup::init @ 0xa4dac4
// > SetupItemCompareTriggerPopup::onOpButton @ 0xa4e4d4
// > ??> @ 0xa1e08
//
// 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
//
void SetupItemCompareTriggerPopup::updateFormulaLabel(SetupItemCompareTriggerPopup *a1)
{
int v2; // w26
signed int v3; // w21
int v4; // w28
int v5; // w20
int v6; // w22
int v7; // w23
float v8; // s0
int v9; // w25
int v10; // w27
float v11; // s0
unsigned int v12; // w1
int v13; // w0
int v14; // w26
float v15; // s8
float v16; // s9
void *v17; // x0
void *v18; // x0
void *v19; // x0
const char *v20; // x1
void *v21; // x0
void *v22; // x0
unsigned __int8 *v23; // x0
void *v24; // x0
void *v25; // x20
void *v26; // x0
cocos2d::CCString *v27; // x0
size_t v28; // x0
void *v29; // x0
const char *v30; // x1
cocos2d::CCString *v31; // x0
size_t v32; // x0
unsigned int *v33; // x1
int v34; // w2
unsigned int *v35; // x1
int v36; // w2
unsigned int *v37; // x1
int v38; // w2
unsigned int *v39; // x1
int v40; // w2
unsigned int *v41; // x1
int v42; // w2
unsigned int *v43; // x19
int v44; // w0
unsigned int *v45; // x1
int v46; // w2
unsigned int *v47; // x1
int v48; // w2
unsigned int *v49; // x1
int v50; // w2
unsigned int *v51; // x1
int v52; // w2
const char *CString; // [xsp+78h] [xbp+78h]
int v54; // [xsp+88h] [xbp+88h]
_BOOL4 v55; // [xsp+8Ch] [xbp+8Ch]
int v56; // [xsp+98h] [xbp+98h]
const char *v57; // [xsp+98h] [xbp+98h]
__int64 v58; // [xsp+A8h] [xbp+A8h] BYREF
__int64 v59; // [xsp+B0h] [xbp+B0h] BYREF
const unsigned __int8 *v60; // [xsp+B8h] [xbp+B8h] BYREF
__int64 v61; // [xsp+C0h] [xbp+C0h] BYREF
__int64 v62; // [xsp+C8h] [xbp+C8h] BYREF
__int64 v63; // [xsp+D0h] [xbp+D0h] BYREF
__int64 v64; // [xsp+D8h] [xbp+D8h] BYREF
__int64 v65; // [xsp+E0h] [xbp+E0h] BYREF
__int64 v66; // [xsp+E8h] [xbp+E8h] BYREF
__int64 v67; // [xsp+F0h] [xbp+F0h] BYREF
v2 = (int)a1->getValue(a1, 80);
v3 = (int)a1->getValue(a1, 95);
v4 = (int)a1->getValue(a1, 476);
v5 = (int)a1->getValue(a1, 477);
v6 = (int)a1->getValue(a1, 480);
v7 = (int)a1->getValue(a1, 481);
v8 = a1->getValue(a1, 482);
if ( v6 <= 0 )
v6 = 3;
if ( v7 <= 0 )
v7 = 3;
v54 = (int)v8;
v9 = (int)a1->getValue(a1, 485);
v10 = (int)a1->getValue(a1, 486);
v56 = (int)a1->getValue(a1, 578);
a1->getValue(a1, 579);
v12 = v2;
if ( v4 <= 0 )
v13 = 1;
else
v13 = v4;
v14 = (int)v11;
getItemVarName(v13, v12, (__int64)&v58);
getItemVarName(v5, v3, (__int64)&v59);
if ( v5 )
{
v55 = 1;
if ( v3 <= 0 )
v55 = isSpecialItemType(v5);
}
else
{
v55 = 0;
}
v15 = a1->getValue(a1, 479);
v16 = a1->getValue(a1, 483);
sub_D153B8((int)&v60, &byte_F288A0);
if ( v56 > 0 )
{
signKeyToString(v56, 0, (__int64)&v61);
sub_D15E14(&v60, &v61);
v17 = (void *)(v61 - 24);
if ( (__int64 *)(v61 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v33 = (unsigned int *)(v61 - 8);
do
v34 = __ldaxr(v33);
while ( __stlxr(v34 - 1, v33) );
}
else
{
v34 = *(_DWORD *)(v61 - 8);
*(_DWORD *)(v61 - 8) = v34 - 1;
}
if ( v34 <= 0 )
operator delete(v17);
}
sub_D15FD4(&v60, "(", 1);
}
if ( v9 > 0 )
{
roundKeyToString(v9, 0, (__int64)&v62);
sub_D15E14(&v60, &v62);
v18 = (void *)(v62 - 24);
if ( (__int64 *)(v62 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v47 = (unsigned int *)(v62 - 8);
do
v48 = __ldaxr(v47);
while ( __stlxr(v48 - 1, v47) );
}
else
{
v48 = *(_DWORD *)(v62 - 8);
*(_DWORD *)(v62 - 8) = v48 - 1;
}
if ( v48 <= 0 )
operator delete(v18);
}
sub_D15FD4(&v60, "(", 1);
}
sub_D15E14(&v60, &v58);
if ( (unsigned __int8)isOpValid(v6, v15) )
{
sub_D15FD4(&v60, " ", 1);
opKeyToString(v6, (__int64)&v63);
sub_D15E14(&v60, &v63);
v29 = (void *)(v63 - 24);
if ( (__int64 *)(v63 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v49 = (unsigned int *)(v63 - 8);
do
v50 = __ldaxr(v49);
while ( __stlxr(v50 - 1, v49) );
}
else
{
v50 = *(_DWORD *)(v63 - 8);
*(_DWORD *)(v63 - 8) = v50 - 1;
}
if ( v50 <= 0 )
operator delete(v29);
}
sub_D15FD4(&v60, " ", 1);
v31 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%.03f", v30, v15);
CString = cocos2d::CCString::getCString(v31);
v32 = strlen(CString);
sub_D15FD4(&v60, CString, v32);
}
if ( v9 > 0 )
sub_D15FD4(&v60, ")", 1);
if ( v56 > 0 )
sub_D15FD4(&v60, ")", 1);
sub_D15FD4(&v60, " ", 1);
compKeyToString(v54, (__int64)&v64);
sub_D15E14(&v60, &v64);
v19 = (void *)(v64 - 24);
if ( (__int64 *)(v64 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v45 = (unsigned int *)(v64 - 8);
do
v46 = __ldaxr(v45);
while ( __stlxr(v46 - 1, v45) );
}
else
{
v46 = *(_DWORD *)(v64 - 8);
*(_DWORD *)(v64 - 8) = v46 - 1;
}
if ( v46 <= 0 )
operator delete(v19);
}
sub_D15FD4(&v60, " ", 1);
if ( v14 > 0 )
{
signKeyToString(v14, 0, (__int64)&v65);
sub_D15E14(&v60, &v65);
v21 = (void *)(v65 - 24);
if ( (__int64 *)(v65 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v35 = (unsigned int *)(v65 - 8);
do
v36 = __ldaxr(v35);
while ( __stlxr(v36 - 1, v35) );
}
else
{
v36 = *(_DWORD *)(v65 - 8);
*(_DWORD *)(v65 - 8) = v36 - 1;
}
if ( v36 <= 0 )
operator delete(v21);
}
sub_D15FD4(&v60, "(", 1);
}
if ( v10 > 0 )
{
roundKeyToString(v10, 0, (__int64)&v66);
sub_D15E14(&v60, &v66);
v22 = (void *)(v66 - 24);
if ( (__int64 *)(v66 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v37 = (unsigned int *)(v66 - 8);
do
v38 = __ldaxr(v37);
while ( __stlxr(v38 - 1, v37) );
}
else
{
v38 = *(_DWORD *)(v66 - 8);
*(_DWORD *)(v66 - 8) = v38 - 1;
}
if ( v38 <= 0 )
operator delete(v22);
}
sub_D15FD4(&v60, "(", 1);
}
if ( v55 )
{
sub_D15E14(&v60, &v59);
if ( !(unsigned __int8)isOpValid(v7, v16) )
goto LABEL_31;
sub_D15FD4(&v60, " ", 1);
opKeyToString(v7, (__int64)&v67);
sub_D15E14(&v60, &v67);
v26 = (void *)(v67 - 24);
if ( (__int64 *)(v67 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v51 = (unsigned int *)(v67 - 8);
do
v52 = __ldaxr(v51);
while ( __stlxr(v52 - 1, v51) );
}
else
{
v52 = *(_DWORD *)(v67 - 8);
*(_DWORD *)(v67 - 8) = v52 - 1;
}
if ( v52 <= 0 )
operator delete(v26);
}
sub_D15FD4(&v60, " ", 1);
}
v27 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%.03f", v20, v16);
v57 = cocos2d::CCString::getCString(v27);
v28 = strlen(v57);
sub_D15FD4(&v60, v57, v28);
LABEL_31:
if ( v10 > 0 )
sub_D15FD4(&v60, ")", 1);
if ( v14 > 0 )
sub_D15FD4(&v60, ")", 1);
a1->m_formulaLabel->setString(a1->m_formulaLabel, v60);
cocos2d::CCLabelBMFont::limitLabelWidth(a1->m_formulaLabel, 230.0, 0.7, 0.0);
v23 = (unsigned __int8 *)(v60 - 24);
if ( v60 - 24 != (const unsigned __int8 *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v39 = (unsigned int *)(v60 - 8);
do
v40 = __ldaxr(v39);
while ( __stlxr(v40 - 1, v39) );
}
else
{
v40 = *((_DWORD *)v60 - 2);
*((_DWORD *)v60 - 2) = v40 - 1;
}
if ( v40 <= 0 )
operator delete(v23);
}
v24 = (void *)(v59 - 24);
if ( (__int64 *)(v59 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v41 = (unsigned int *)(v59 - 8);
do
v42 = __ldaxr(v41);
while ( __stlxr(v42 - 1, v41) );
}
else
{
v42 = *(_DWORD *)(v59 - 8);
*(_DWORD *)(v59 - 8) = v42 - 1;
}
if ( v42 <= 0 )
operator delete(v24);
}
v25 = (void *)(v58 - 24);
if ( (__int64 *)(v58 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v43 = (unsigned int *)(v58 - 8);
do
v44 = __ldaxr(v43);
while ( __stlxr(v44 - 1, v43) );
}
else
{
v44 = *(_DWORD *)(v58 - 8);
*(_DWORD *)(v58 - 8) = v44 - 1;
}
if ( v44 <= 0 )
operator delete(v25);
}
}