//
// EditLevelLayer::onLevelInfo from 0x6dedbc to 0x6df074 (696 bytes)
//
// 3 xrefs:
// > ??> @ 0x72d20
// > EditLevelLayer::init @ 0x6e111c
// > ??> @ 0x122bcd0
//
// 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 EditLevelLayer::onLevelInfo(EditLevelLayer *a1, cocos2d::CCObject *a2)
{
double v3; // d0
GJGameLevel *m_level; // x5
cocos2d::CCString *v5; // x0
char *CString; // x0
char *v7; // x0
FLAlertLayer *v8; // x22
char *v9; // x0
char *v10; // x0
unsigned int *v11; // x1
int v12; // w2
unsigned int *v13; // x1
int v14; // w2
unsigned int *v15; // x1
int v16; // w2
char *v17; // [xsp+58h] [xbp+58h] BYREF
char *v18; // [xsp+60h] [xbp+60h] BYREF
*(_QWORD *)&v3 = sub_D18D28(&v18, &a1->m_level->m_levelName).n128_u64[0];
m_level = a1->m_level;
v5 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%s\n"
"Total Attempts: %i\n"
"Total Jumps: %i\n"
"Objects: %i",
v18,
(unsigned int)(m_level->m_attempts.random - m_level->m_attempts.seed),
(unsigned int)(m_level->m_jumps.random - m_level->m_jumps.seed),
(unsigned int)(m_level->m_objectCount.random - m_level->m_objectCount.seed),
v3);
CString = (char *)cocos2d::CCString::getCString(v5);
sub_D153B8((int)&v17, CString);
v7 = v18 - 24;
if ( v18 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v11 = (unsigned int *)(v18 - 8);
do
v12 = __ldaxr(v11);
while ( __stlxr(v12 - 1, v11) );
}
else
{
v12 = *((_DWORD *)v18 - 2);
*((_DWORD *)v18 - 2) = v12 - 1;
}
if ( v12 <= 0 )
operator delete(v7);
}
if ( a1->m_level->m_objectCount.random - a1->m_level->m_objectCount.seed > 40000 )
sub_D15FD4(&v17, " (high)", 15);
sub_D153B8((int)&v18, v17);
v8 = FLAlertLayer::create(0, (__int64)"Level Stats", (__int64)&v18);
v9 = v18 - 24;
if ( v18 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v13 = (unsigned int *)(v18 - 8);
do
v14 = __ldaxr(v13);
while ( __stlxr(v14 - 1, v13) );
}
else
{
v14 = *((_DWORD *)v18 - 2);
*((_DWORD *)v18 - 2) = v14 - 1;
}
if ( v14 <= 0 )
operator delete(v9);
}
v8->show(v8);
v10 = v17 - 24;
if ( v17 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v15 = (unsigned int *)(v17 - 8);
do
v16 = __ldaxr(v15);
while ( __stlxr(v16 - 1, v15) );
}
else
{
v16 = *((_DWORD *)v17 - 2);
*((_DWORD *)v17 - 2) = v16 - 1;
}
if ( v16 <= 0 )
operator delete(v10);
}
}