//
// ProfilePage::onStatInfo from 0x90188c to 0x901c2c (928 bytes)
//
// 3 xrefs:
// > ??> @ 0x5de28
// > ProfilePage::loadPageFromUserInfo @ 0x8fa434
// > ??> @ 0x122b098
//
// 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 ProfilePage::onStatInfo(ProfilePage *a1, cocos2d::CCObject *a2)
{
void *v4; // x0
__int64 v5; // x23
StarInfoPopup *v6; // x0
__int64 v7; // x1
void *v8; // x21
void *v9; // x0
unsigned int *v10; // x1
int v11; // w2
void *v12; // x0
__int64 v13; // x23
StarInfoPopup *v14; // x0
void *v15; // x0
__int64 v16; // x23
DemonInfoPopup *v17; // x0
unsigned int *v18; // x1
unsigned int *v19; // x1
int v20; // w2
unsigned int *v21; // x1
int v22; // w2
unsigned int *v23; // x1
int v24; // w2
unsigned int *v25; // x1
__int64 v26; // [xsp+50h] [xbp+50h] BYREF
if ( a2->getTag(a2) == 1 )
{
if ( !a1->m_score )
return;
sub_D18D28(&v26);
v12 = (void *)(v26 - 24);
v13 = *(_QWORD *)(v26 - 24);
if ( (__int64 *)(v26 - 24) == &qword_124B6B0 )
goto LABEL_15;
if ( &pthread_create )
{
v19 = (unsigned int *)(v26 - 8);
do
v20 = __ldaxr(v19);
while ( __stlxr(v20 - 1, v19) );
}
else
{
v20 = *(_DWORD *)(v26 - 8);
*(_DWORD *)(v26 - 8) = v20 - 1;
}
if ( v20 > 0 )
{
LABEL_15:
if ( !v13 )
return;
}
else
{
operator delete(v12);
if ( !v13 )
return;
}
sub_D18D28(&v26);
v14 = StarInfoPopup::createFromString(&v26);
v7 = v26;
v8 = v14;
v9 = (void *)(v26 - 24);
if ( (__int64 *)(v26 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v25 = (unsigned int *)(v26 - 8);
do
v11 = __ldaxr(v25);
while ( __stlxr(v11 - 1, v25) );
goto LABEL_25;
}
goto LABEL_48;
}
LABEL_17:
(*(void (__fastcall **)(void *))(*(_QWORD *)v8 + 1288LL))(v8);
return;
}
if ( a2->getTag(a2) == 2 )
{
if ( a1->m_score )
{
sub_D18D28(&v26);
v4 = (void *)(v26 - 24);
v5 = *(_QWORD *)(v26 - 24);
if ( (__int64 *)(v26 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v21 = (unsigned int *)(v26 - 8);
do
v22 = __ldaxr(v21);
while ( __stlxr(v22 - 1, v21) );
}
else
{
v22 = *(_DWORD *)(v26 - 8);
*(_DWORD *)(v26 - 8) = v22 - 1;
}
if ( v22 <= 0 )
operator delete(v4);
}
if ( v5 )
{
sub_D18D28(&v26);
v6 = StarInfoPopup::createFromStringMoons(&v26);
v7 = v26;
v8 = v6;
v9 = (void *)(v26 - 24);
if ( (__int64 *)(v26 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v10 = (unsigned int *)(v26 - 8);
do
v11 = __ldaxr(v10);
while ( __stlxr(v11 - 1, v10) );
goto LABEL_25;
}
goto LABEL_48;
}
goto LABEL_17;
}
}
}
else if ( a2->getTag(a2) == 3 && a1->m_score )
{
sub_D18D28(&v26);
v15 = (void *)(v26 - 24);
v16 = *(_QWORD *)(v26 - 24);
if ( (__int64 *)(v26 - 24) == &qword_124B6B0 )
goto LABEL_20;
if ( &pthread_create )
{
v23 = (unsigned int *)(v26 - 8);
do
v24 = __ldaxr(v23);
while ( __stlxr(v24 - 1, v23) );
}
else
{
v24 = *(_DWORD *)(v26 - 8);
*(_DWORD *)(v26 - 8) = v24 - 1;
}
if ( v24 > 0 )
{
LABEL_20:
if ( !v16 )
return;
}
else
{
operator delete(v15);
if ( !v16 )
return;
}
sub_D18D28(&v26);
v17 = DemonInfoPopup::createFromString(&v26);
v7 = v26;
v8 = v17;
v9 = (void *)(v26 - 24);
if ( (__int64 *)(v26 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v18 = (unsigned int *)(v26 - 8);
do
v11 = __ldaxr(v18);
while ( __stlxr(v11 - 1, v18) );
goto LABEL_25;
}
LABEL_48:
v11 = *(_DWORD *)(v7 - 8);
*(_DWORD *)(v7 - 8) = v11 - 1;
LABEL_25:
if ( v11 <= 0 )
operator delete(v9);
goto LABEL_17;
}
goto LABEL_17;
}
}