//
// UploadPopup::init from 0x140632090 to 0x14063263a (1450 bytes)
//
// 2 xrefs:
// > ShareLevelLayer::onShare @ 0x140632011
// > ??> @ 0x140930b3c
//
// This function is hookable on this platform (idp: pc, 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 11:35:29 +0000
//
// Hidden C++ exception states: #wind=4
bool __fastcall UploadPopup::init(__int64 a1, cocos2d::CCObject *a2)
{
bool result; // al
__int64 v5; // rdx
__int64 v6; // rdx
__int64 v7; // rcx
__int64 v8; // rax
__int64 v9; // rax
__int64 v10; // rax
__int64 *v11; // rdi
__int64 v12; // rdx
void (__fastcall *v13)(__int64 *, __int64); // r8
__int64 v14; // rbx
__int64 v15; // rax
__int64 v16; // rbx
__int64 v17; // rax
const char *v18; // rcx
struct cocos2d::CCLabelBMFont *v19; // rdi
__int64 v20; // rbx
__int64 v21; // rax
__int64 v22; // rcx
__int64 v23; // rax
const struct cocos2d::CCPoint *v24; // rax
char *v25; // rax
__int64 v26; // rdi
__int64 v27; // rbx
__int64 v28; // rax
cocos2d::CCLayerColor *v29; // rax
__int64 *v30; // rdi
__int64 v31; // rbx
__int64 v32; // rax
void (__fastcall ***v33)(__int64); // rbx
__int64 v34; // rcx
int v35; // eax
cocos2d::CCObject *v36; // rax
__int64 v37; // rsi
__int64 v38; // rcx
cocos2d::CCDirector *v39; // rax
float v40; // xmm7_4
__int64 v41; // rcx
cocos2d::CCDirector *v42; // rax
float v43; // xmm0_4
__int64 v44; // rbx
__int64 v45; // rdi
__int64 v46; // rax
__int64 v47; // rax
__int128 *v48; // [rsp+48h] [rbp-29h] BYREF
float v49; // [rsp+50h] [rbp-21h] BYREF
float v50; // [rsp+54h] [rbp-1Dh]
_BYTE v51[16]; // [rsp+58h] [rbp-19h] BYREF
__int128 v52; // [rsp+68h] [rbp-9h] BYREF
__int64 v53; // [rsp+78h] [rbp+7h]
unsigned __int64 v54; // [rsp+80h] [rbp+Fh]
LODWORD(v48) = -1778384896;
result = cocos2d::CCLayerColor::initWithColor((cocos2d::CCLayerColor *)a1, (const struct cocos2d::_ccColor4B *)&v48);
if ( result )
{
FLAlertLayer::incrementForcePrio((struct cocos2d::CCObject *)a1);
*(_QWORD *)(a1 + 672) = a2;
cocos2d::CCObject::retain(a2);
LOBYTE(v5) = 1;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 920LL))(a1, v5);
LOBYTE(v6) = 1;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 992LL))(a1, v6);
v8 = cocos2d::CCDirector::sharedDirector(v7);
cocos2d::CCDirector::getWinSize(v8, &v49);
v9 = cocos2d::CCLayer::create();
*(_QWORD *)(a1 + 584) = v9;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 464LL))(a1, v9);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v51, 0.0, 0.0, 80.0, 80.0);
v11 = (__int64 *)cocos2d::extension::CCScale9Sprite::create("square04_001.png", v10);
v12 = v11[40];
v13 = *(void (__fastcall **)(__int64 *, __int64))(v12 + 40);
LOBYTE(v12) = -1;
v13(v11 + 40, v12);
(*(void (__fastcall **)(__int64 *, void *))v11[40])(v11 + 40, &unk_1407046C4);
v14 = *v11;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v48, 420.0, 300.0);
(*(void (__fastcall **)(__int64 *, __int64))(v14 + 312))(v11, v15);
(*(void (__fastcall **)(_QWORD, __int64 *, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(
*(_QWORD *)(a1 + 584),
v11,
0xFFFFFFFFLL);
v16 = *v11;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v48, v49 * 0.5, v50 * 0.5);
(*(void (__fastcall **)(__int64 *, __int64))(v16 + 184))(v11, v17);
sub_14003F4F0((__int64)&v52, *(_QWORD *)(a1 + 672) + 344LL);
v18 = (const char *)&v52;
if ( v54 > 0xF )
v18 = (const char *)v52;
v19 = cocos2d::CCLabelBMFont::create(v18, "goldFont.fnt");
sub_14003D310((__int64)&v52);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
v19);
v20 = *(_QWORD *)v19;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v48, v49 * 0.5, (float)((float)(v50 * 0.5) + 150.0) - 25.0);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v20 + 184))(v19, v21);
v23 = cocos2d::CCMenu::create(v22);
*(_QWORD *)(a1 + 552) = v23;
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(*(_QWORD *)(a1 + 584), v23, 10);
v48 = &v52;
v52 = 0;
v53 = 0;
v54 = 0;
*(_QWORD *)&v52 = sub_14003D460(0x20u);
v53 = 31;
v54 = 31;
strcpy((char *)v52, "Please wait, uploading level...");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v51, 0.5, 1.0);
v25 = TextArea::create((__int64)&v52, "chatFont.fnt", 1.0, 400.0, v24, 1101004800, 0, 0);
*(_QWORD *)(a1 + 680) = v25;
(*(void (__fastcall **)(_QWORD, char *))(**(_QWORD **)(a1 + 584) + 464LL))(*(_QWORD *)(a1 + 584), v25);
v26 = **(_QWORD **)(a1 + 680);
v27 = *(_QWORD *)(a1 + 680);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v51, v49 * 0.5, (float)(v50 * 0.5) - 30.0);
(*(void (__fastcall **)(__int64, __int64))(v26 + 184))(v27, v28);
*(_DWORD *)(a1 + 640) = -1;
v29 = LoadingCircle::create();
*(_QWORD *)(a1 + 688) = v29;
*((_QWORD *)v29 + 69) = *(_QWORD *)(a1 + 584);
*(_BYTE *)(*(_QWORD *)(a1 + 688) + 560LL) = 0;
LoadingCircle::show(*(_QWORD *)(a1 + 688));
v30 = *(__int64 **)(*(_QWORD *)(a1 + 688) + 544LL);
v31 = *v30;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v51, v49 * 0.5, (float)(v50 * 0.5) + 20.0);
(*(void (__fastcall **)(__int64 *, __int64))(v31 + 184))(v30, v32);
v33 = (void (__fastcall ***)(__int64))(a1 + 664);
if ( *(_BYTE *)(*(_QWORD *)(a1 + 672) + 857LL) )
{
(**v33)(a1 + 664);
v52 = 0;
v53 = 0;
v54 = 0;
*(_QWORD *)&v52 = sub_14003D460(0x20u);
v53 = 22;
v54 = 31;
strcpy((char *)v52, "Level already uploaded");
TextArea::setString(*(__int64 **)(a1 + 680), (__int64)&v52);
}
else
{
v34 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v48 = (__int128 *)operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager((__int64)v48);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v34 = *(_QWORD *)&qword_14090BFB0;
}
*(_QWORD *)(v34 + 1400) = v33;
GameLevelManager::uploadLevel(v34, *(_QWORD *)(a1 + 672));
}
v35 = (unsigned int)cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
v36 = CCMenuItemSpriteExtra::create(v35, 0, a1, (__int64)UploadPopup::onBack);
*(_QWORD *)(a1 + 696) = v36;
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v36);
v37 = **(_QWORD **)(a1 + 696);
v39 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v38);
v40 = cocos2d::CCDirector::getScreenTop(v39) - 40.0;
v42 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v41);
v43 = cocos2d::CCDirector::getScreenLeft(v42) + 40.0;
v44 = *(_QWORD *)(a1 + 552);
v45 = *(_QWORD *)(a1 + 696);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v51, v43, v40);
cocos2d::CCNode::convertToNodeSpace(v44, &v48, v46);
(*(void (__fastcall **)(__int64, __int64))(v37 + 184))(v45, v47);
return 1;
}
return result;
}