//
// UploadPopup::init from 0x7f4ba8 to 0x7f50c0 (1304 bytes)
//
// 2 xrefs:
// > UploadPopup::create @ 0x7f521c
// > ??> @ 0xa4038
//
// 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 12:54:37 +0000
//
__int64 __fastcall UploadPopup::init(UploadPopup *this, GJGameLevel *a2)
{
unsigned __int8 v4; // w0
unsigned int v5; // w23
cocos2d::CCDirector *v7; // x0
cocos2d::CCDirector *v8; // x0
cocos2d::CCLayer *WinSize; // x0
__int64 v10; // x0
__int64 v11; // x22
void (__fastcall *v12)(__int64, __int64 *); // x25
void (__fastcall *v13)(__int64, __int64 *); // x25
__int64 v14; // x0
const char *v15; // x2
__int64 v16; // x1
cocos2d::CCLabelBMFont *v17; // x0
__int64 v18; // x22
__int64 (__fastcall *v19)(__int64, __int64 *); // x25
cocos2d::CCMenu *v20; // x0
__int64 v21; // x0
__int64 v22; // x0
char v23; // w1
__int64 v24; // x22
void (__fastcall *v25)(__int64, __int64 *); // x25
__int64 v26; // x0
__int64 v27; // x22
void (__fastcall *v28)(__int64, __int64 *); // x25
__int64 v29; // x1
__int64 *v30; // x22
const char *v31; // x1
GameLevelManager *v32; // x0
GameLevelManager *v33; // x0
__int64 v34; // x0
__int64 v35; // x0
cocos2d::CCDirector **v36; // x24
cocos2d::CCNode *v37; // x25
void (__fastcall *v38)(cocos2d::CCDirector **, __int64 *); // x19
cocos2d::CCDirector *v39; // x0
cocos2d::CCDirector *ScreenLeft; // x0
float v41; // s0
float v42; // s8
cocos2d::CCDirector *v43; // x0
float v44; // s0
__int64 v45; // [xsp+60h] [xbp+60h] BYREF
_BYTE v46[8]; // [xsp+68h] [xbp+68h] BYREF
__int64 v47[2]; // [xsp+70h] [xbp+70h] BYREF
__int64 v48; // [xsp+80h] [xbp+80h] BYREF
__int64 v49; // [xsp+88h] [xbp+88h]
void *v50; // [xsp+90h] [xbp+90h]
LODWORD(v47[0]) = -1778384896;
v4 = cocos2d::CCLayerColor::initWithColor(this, v47);
v5 = v4;
if ( v4 )
{
FLAlertLayer::incrementForcePrio(this);
*((_QWORD *)this + 84) = a2;
cocos2d::CCObject::retain(a2);
(*(void (__fastcall **)(UploadPopup *, __int64))(*(_QWORD *)this + 1000LL))(this, 1);
v7 = (cocos2d::CCDirector *)(*(__int64 (__fastcall **)(UploadPopup *, __int64))(*(_QWORD *)this + 1072LL))(this, 1);
v8 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v7);
WinSize = (cocos2d::CCLayer *)cocos2d::CCDirector::getWinSize(&v45, v8);
v10 = cocos2d::CCLayer::create(WinSize);
*((_QWORD *)this + 73) = v10;
(*(void (__fastcall **)(UploadPopup *, __int64))(*(_QWORD *)this + 456LL))(this, v10);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v47, 0.0, 0.0, 80.0, 80.0);
v11 = cocos2d::extension::CCScale9Sprite::create("square04_001.png", v47);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v11 + 912LL))(v11, 0xFFFFFFFFLL);
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)v11 + 960LL))(v11, &unk_11455D0);
v12 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v11 + 320LL);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v47, 420.0, 300.0);
v12(v11, v47);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**((_QWORD **)this + 73) + 464LL))(
*((_QWORD *)this + 73),
v11,
0xFFFFFFFFLL);
v13 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v11 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v47, *(float *)&v45 * 0.5, *((float *)&v45 + 1) * 0.5);
v13(v11, v47);
v48 = 0;
v14 = *((_QWORD *)this + 84);
v49 = 0;
v50 = nullptr;
v15 = (const char *)(v14 + 344);
if ( (*(_BYTE *)(v14 + 344) & 1) != 0 )
{
std::string::__init(&v48, *(void **)(v14 + 360), *(_QWORD *)(v14 + 352));
}
else
{
v16 = *(_QWORD *)(v14 + 352);
v48 = *(_QWORD *)v15;
v49 = v16;
v50 = *(void **)(v14 + 360);
}
v17 = (cocos2d::CCLabelBMFont *)((char *)&v48 + 1);
if ( (v48 & 1) != 0 )
v17 = (cocos2d::CCLabelBMFont *)v50;
v18 = cocos2d::CCLabelBMFont::create(v17, "goldFont.fnt", v15);
if ( (v48 & 1) != 0 )
operator delete(v50);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 73) + 456LL))(*((_QWORD *)this + 73), v18);
v19 = *(__int64 (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v18 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v47,
*(float *)&v45 * 0.5,
(float)((float)(*((float *)&v45 + 1) * 0.5) + 150.0) - 25.0);
v20 = (cocos2d::CCMenu *)v19(v18, v47);
v21 = cocos2d::CCMenu::create(v20);
*((_QWORD *)this + 69) = v21;
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**((_QWORD **)this + 73) + 464LL))(
*((_QWORD *)this + 73),
v21,
10);
v48 = 0;
v49 = 0;
v50 = nullptr;
std::string::__init(&v48, "Please wait, uploading level...", 0x1Fu);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v47, 0.5, 1.0);
v22 = TextArea::create((char *)&v48, "chatFont.fnt", (const cocos2d::CCPoint *)v47, 0, 0, 1.0, 400.0, 20.0);
v23 = v48;
*((_QWORD *)this + 85) = v22;
if ( (v23 & 1) != 0 )
{
operator delete(v50);
v22 = *((_QWORD *)this + 85);
}
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 73) + 456LL))(*((_QWORD *)this + 73), v22);
v24 = *((_QWORD *)this + 85);
v25 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v24 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v47,
*(float *)&v45 * 0.5,
(float)(*((float *)&v45 + 1) * 0.5) + -30.0);
v25(v24, v47);
*((_DWORD *)this + 160) = -1;
v26 = LoadingCircle::create((LoadingCircle *)0xFFFFFFFFLL);
*((_QWORD *)this + 86) = v26;
*(_QWORD *)(v26 + 552) = *((_QWORD *)this + 73);
*(_BYTE *)(*((_QWORD *)this + 86) + 560LL) = 0;
LoadingCircle::show(*((cocos2d::CCNode ***)this + 86));
v27 = *(_QWORD *)(*((_QWORD *)this + 86) + 544LL);
v28 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v27 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v47, *(float *)&v45 * 0.5, (float)(*((float *)&v45 + 1) * 0.5) + 20.0);
v28(v27, v47);
v29 = *((_QWORD *)this + 84);
if ( *(_BYTE *)(v29 + 785) )
{
(*(void (__fastcall **)(UploadPopup *))(*(_QWORD *)this + 1344LL))(this);
v30 = *((__int64 **)this + 85);
v48 = 0;
v49 = 0;
v50 = nullptr;
std::string::__init(&v48, "Level already uploaded", 0x16u);
TextArea::setString(v30, (char *)&v48);
if ( (v48 & 1) != 0 )
operator delete(v50);
}
else
{
v32 = (GameLevelManager *)GameLevelManager::sharedState((GameLevelManager *)*(unsigned __int8 *)(v29 + 785));
*((_QWORD *)v32 + 159) = (char *)this + 664;
v33 = (GameLevelManager *)GameLevelManager::sharedState(v32);
GameLevelManager::uploadLevel(v33, *((GJGameLevel **)this + 84));
}
v34 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_arrow_01_001.png", v31);
v35 = CCMenuItemSpriteExtra::create(v34, 0, (__int64)this, (__int64)UploadPopup::onBack, 0);
*((_QWORD *)this + 87) = v35;
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 69) + 456LL))(*((_QWORD *)this + 69), v35);
v36 = *((cocos2d::CCDirector ***)this + 87);
v37 = *((cocos2d::CCNode **)this + 69);
v38 = *((void (__fastcall **)(cocos2d::CCDirector **, __int64 *))*v36 + 23);
v39 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(*v36);
ScreenLeft = (cocos2d::CCDirector *)cocos2d::CCDirector::getScreenLeft(v39);
v42 = v41;
v43 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(ScreenLeft);
cocos2d::CCDirector::getScreenTop(v43);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v46, v42 + 40.0, v44 - 40.0);
cocos2d::CCNode::convertToNodeSpace(v47, v37, (const cocos2d::CCPoint *)v46);
v38(v36, v47);
}
return v5;
}