//
// UploadPopup::levelUploadFinished from 0x6e3af4 to 0x6e3d44 (592 bytes)
//
// 3 xrefs:
// > `non-virtual thunk to'UploadPopup::levelUploadFinished @ 0x6e3d4c
// > ??> @ 0x86508
// > ??> @ 0x115cc70
//
// 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 UploadPopup::levelUploadFinished(UploadPopup *a1, GJGameLevel *a2)
{
cocos2d::CCSprite *v3; // x22
void (__fastcall *setPosition)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x23
const cocos2d::CCPoint *v5; // x0
TextArea *m_textArea; // x22
char *v7; // x0
cocos2d::CCDirector *v8; // x0
const char *v9; // x1
__int64 v10; // x2
__int64 v11; // x3
bool v12; // w4
__int64 v13; // x5
const char *v14; // x6
cocos2d::CCNode *v15; // x0
CCMenuItemSpriteExtra *v16; // x22
cocos2d::CCMenu *m_buttonMenu; // x25
void (__fastcall *v18)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x24
unsigned int *v19; // x2
int v20; // w1
float v21; // [xsp+50h] [xbp+50h]
float v22; // [xsp+54h] [xbp+54h]
cocos2d::CCPoint v23; // [xsp+58h] [xbp+58h] BYREF
_DWORD *v24; // [xsp+60h] [xbp+60h] BYREF
cocos2d::CCPoint v25; // 0:kr08_8.8
cocos2d::SEL_MenuHandler v26; // 0:x2.16
v3 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_completesIcon_001.png");
v3->setScale(v3, 1.5);
setPosition = v3->setPosition;
v5 = a1->m_loadingCircle->m_sprite->getPosition(a1->m_loadingCircle->m_sprite);
setPosition(v3, v5);
a1->m_mainLayer->addChild(a1->m_mainLayer, v3);
LoadingCircle::fadeAndRemove(a1->m_loadingCircle);
m_textArea = a1->m_textArea;
sub_D153B8((int)&v24, "Upload Complete");
TextArea::setString((__int64)m_textArea, (const void **)&v24);
v7 = (char *)(v24 - 6);
if ( v24 - 6 != (_DWORD *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v19 = v24 - 2;
do
v20 = __ldaxr(v19);
while ( __stlxr(v20 - 1, v19) );
}
else
{
v20 = *(v24 - 2);
*(v24 - 2) = v20 - 1;
}
if ( v20 <= 0 )
operator delete(v7);
}
v8 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v8);
v15 = (cocos2d::CCNode *)ButtonSprite::create((ButtonSprite *)"Back", v9, v10, v11, v12, v13, v14);
v26.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v26.adj = (size_t)UploadPopup::onReturnToLevel;
v16 = CCMenuItemSpriteExtra::create(v15, nullptr, v26);
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v16);
m_buttonMenu = a1->m_buttonMenu;
v18 = v16->setPosition;
cocos2d::CCPoint::CCPoint(&v23, v21 * 0.5, (float)((float)(v22 * 0.5) + -150.0) + 25.0);
v25 = cocos2d::CCNode::convertToNodeSpace(m_buttonMenu, &v23);
((void (__fastcall *)(CCMenuItemSpriteExtra *, _DWORD **, float, float))v18)(v16, &v24, v25.x, v25.y);
a1->m_backButton->setVisible(a1->m_backButton, 0);
a1->m_backButton->setEnabled(a1->m_backButton, 0);
}