//
// RetryLevelLayer::setupLastProgress from 0x140561150 to 0x14056140d (701 bytes)
//
// 2 xrefs:
// > RetryLevelLayer::customSetup @ 0x140560aee
// > ??> @ 0x14092c438
//
// 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:34:15 +0000
//
// Hidden C++ exception states: #wind=3
__int64 __fastcall RetryLevelLayer::setupLastProgress(__int64 a1)
{
__int64 v2; // rax
__int64 v3; // rcx
__int64 v4; // rdx
struct cocos2d::CCSprite *ProgressBar; // rsi
__int64 v6; // rbx
__int64 v7; // rax
__int64 v8; // rdx
cocos2d::CCString *v9; // rax
const char *CString; // rax
struct cocos2d::CCLabelBMFont *v11; // rdi
__int64 v12; // rbx
__int64 v13; // rax
__int64 v14; // rdx
cocos2d::CCString *v15; // rax
const char *v16; // rax
struct cocos2d::CCLabelBMFont *v17; // rdi
__int64 v18; // rax
__int64 v19; // rbx
__int64 v20; // rax
void *v22; // [rsp+50h] [rbp+8h] BYREF
float v23; // [rsp+58h] [rbp+10h] BYREF
float v24; // [rsp+5Ch] [rbp+14h]
void *v25; // [rsp+60h] [rbp+18h] BYREF
v2 = cocos2d::CCDirector::sharedDirector(a1);
cocos2d::CCDirector::getWinSize(v2, &v23);
LOWORD(v22) = -256;
BYTE2(v22) = 0;
v4 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v25 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v25);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v4 = qword_14090BFD0;
}
ProgressBar = GameToolbox::createProgressBar(v3, *(_DWORD *)(*(_QWORD *)(v4 + 560) + 15320LL), (__int16 *)&v22);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCSprite *, __int64))(**(_QWORD **)(a1 + 576) + 456LL))(
*(_QWORD *)(a1 + 576),
ProgressBar,
3);
v6 = *(_QWORD *)ProgressBar;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v22, v23 * 0.5, (float)((float)(v24 * 0.5) + 25.0) - 15.0);
(*(void (__fastcall **)(struct cocos2d::CCSprite *, __int64))(v6 + 184))(ProgressBar, v7);
v8 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v25 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v25);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v8 = qword_14090BFD0;
}
v9 = cocos2d::CCString::createWithFormat("%i%%", *(_DWORD *)(*(_QWORD *)(v8 + 560) + 15320LL));
CString = cocos2d::CCString::getCString(v9);
v11 = cocos2d::CCLabelBMFont::create(CString, (const char *)&qword_140704F78);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *, __int64))(**(_QWORD **)(a1 + 576) + 456LL))(
*(_QWORD *)(a1 + 576),
v11,
4);
v12 = *(_QWORD *)v11;
v13 = (*(__int64 (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)ProgressBar + 200LL))(ProgressBar);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v12 + 184))(v11, v13);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v11 + 160LL))(v11);
v14 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v22 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v22);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v14 = qword_14090BFD0;
}
v15 = cocos2d::CCString::createWithFormat("Attempt %i", *(_DWORD *)(*(_QWORD *)(v14 + 560) + 12644LL));
v16 = cocos2d::CCString::getCString(v15);
v17 = cocos2d::CCLabelBMFont::create(v16, (const char *)&qword_140704F78);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *, __int64))(**(_QWORD **)(a1 + 576) + 456LL))(
*(_QWORD *)(a1 + 576),
v17,
4);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v25, 0.0, 23.0);
v19 = v18;
v20 = (*(__int64 (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)ProgressBar + 200LL))(ProgressBar);
cocos2d::CCPoint::operator+(v20, &v22, v19);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, void **))(*(_QWORD *)v17 + 184LL))(v17, &v22);
return (*(__int64 (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v17 + 160LL))(v17);
}