//
// LevelBadgePopup::init from 0xc76f24 to 0xc7714c (552 bytes)
//
// 2 xrefs:
// > LevelBadgePopup::create @ 0xc772ac
// > ??> @ 0x4cd38
//
// This function is hookable on this platform (idp: arm, 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 13:05:33 +0000
//
__int64 __fastcall LevelBadgePopup::init(LevelBadgePopup *this, int a2, char a3)
{
unsigned __int8 v6; // w0
unsigned int v7; // w21
cocos2d::CCLayer *v9; // x0
__int64 v10; // x0
cocos2d::CCMenu *v11; // x0
__int64 v12; // x0
__int64 v13; // x0
cocos2d::CCString *v14; // x0
const char *CString; // x0
size_t v16; // x0
GJSearchObject *v17; // x22
char *Key; // x0
__int64 *v19; // x0
GameLevelManager *v20; // x0
unsigned int v21; // w19
GameLevelManager *v22; // x0
char *v23; // [xsp+48h] [xbp+48h]
_BYTE v24[8]; // [xsp+58h] [xbp+58h] BYREF
__int64 v25[2]; // [xsp+60h] [xbp+60h] BYREF
void *v26; // [xsp+70h] [xbp+70h]
if ( a2 > 0
&& (v24[0] = 0,
v24[1] = 0,
v24[2] = 0,
v24[3] = 0,
v6 = cocos2d::CCLayerColor::initWithColor(this, v24),
(v7 = v6) != 0) )
{
*((_DWORD *)this + 168) = a2;
*((_BYTE *)this + 676) = a3;
FLAlertLayer::incrementForcePrio(this);
*((_BYTE *)this + 596) = 1;
(*(void (__fastcall **)(LevelBadgePopup *, __int64))(*(_QWORD *)this + 1000LL))(this, 1);
v9 = (cocos2d::CCLayer *)(*(__int64 (__fastcall **)(LevelBadgePopup *, __int64))(*(_QWORD *)this + 1072LL))(this, 1);
v10 = cocos2d::CCLayer::create(v9);
*((_QWORD *)this + 73) = v10;
v11 = (cocos2d::CCMenu *)(*(__int64 (__fastcall **)(LevelBadgePopup *, __int64))(*(_QWORD *)this + 456LL))(
this,
v10);
v12 = cocos2d::CCMenu::create(v11);
*((_QWORD *)this + 69) = v12;
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**((_QWORD **)this + 73) + 464LL))(
*((_QWORD *)this + 73),
v12,
10);
(*(void (__fastcall **)(_QWORD, void *))(**((_QWORD **)this + 69) + 184LL))(*((_QWORD *)this + 69), &unk_155EE20);
*((_DWORD *)this + 160) = -1;
v13 = LoadingCircle::create((LoadingCircle *)0xFFFFFFFFLL);
*((_QWORD *)this + 90) = v13;
*(_QWORD *)(v13 + 552) = *((_QWORD *)this + 73);
*(_BYTE *)(*((_QWORD *)this + 90) + 560LL) = 0;
LoadingCircle::show(*((cocos2d::CCNode ***)this + 90));
v14 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i",
(const char *)*((unsigned int *)this + 168));
CString = (const char *)cocos2d::CCString::getCString(v14);
v25[0] = 0;
v23 = (char *)CString;
v25[1] = 0;
v26 = nullptr;
v16 = strlen(CString);
std::string::__init(v25, v23, v16);
v17 = (GJSearchObject *)GJSearchObject::create(0, (char *)v25);
if ( (v25[0] & 1) != 0 )
operator delete(v26);
if ( *((_BYTE *)this + 676) )
*((_DWORD *)v17 + 108) = 1;
Key = (char *)GJSearchObject::getKey(v17);
v19 = std::string::assign((__int64 *)this + 87, Key);
v20 = (GameLevelManager *)GameLevelManager::sharedState((GameLevelManager *)v19);
*((_QWORD *)v20 + 153) = (char *)this + 664;
v21 = *((unsigned __int8 *)this + 676);
v22 = (GameLevelManager *)GameLevelManager::sharedState(v20);
if ( v21 )
{
v7 = v21;
GameLevelManager::getLevelLists(v22, v17);
}
else
{
GameLevelManager::getOnlineLevels(v22, v17);
}
}
else
{
return 0;
}
return v7;
}