//
// PauseLayer::setupSessionProgressBar from 0x1404d9d60 to 0x1404da1d2 (1138 bytes)
//
// 2 xrefs:
// > PauseLayer::customSetup @ 0x1404d6c65
// > ??> @ 0x140929960
//
// 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:33:04 +0000
//
// Hidden C++ exception states: #wind=4
void __fastcall PauseLayer::setupSessionProgressBar(__int64 a1)
{
__int64 v2; // rax
_DWORD *v3; // r14
__int64 v4; // rax
__int64 v5; // rax
char v6; // r12
signed int v7; // r15d
float CurrentPercent; // xmm0_4
__int64 v9; // rcx
int v10; // edx
__int64 v11; // rax
float v12; // xmm0_4
int v13; // eax
float v14; // xmm7_4
struct cocos2d::CCSprite *ProgressBar; // rsi
__int64 v16; // rbx
__int64 v17; // rax
cocos2d::CCString *v18; // rax
const char *CString; // rax
struct cocos2d::CCLabelBMFont *v20; // rdi
__int64 v21; // rax
__int64 v22; // rbx
__int64 v23; // rax
__int64 v24; // rax
__int64 v25; // rbx
__int64 v26; // rax
const char *v27; // rcx
struct cocos2d::CCLabelBMFont *v28; // rbx
cocos2d::CCString *v29; // rax
const char *v30; // rax
struct cocos2d::CCLabelBMFont *v31; // rbx
float v32; // xmm2_4
__int64 v33; // rax
float v34[2]; // [rsp+20h] [rbp-38h] BYREF
_BYTE v35[8]; // [rsp+28h] [rbp-30h] BYREF
void *v36; // [rsp+A0h] [rbp+48h] BYREF
__int16 v37; // [rsp+A8h] [rbp+50h] BYREF
_BYTE v38[3]; // [rsp+B0h] [rbp+58h] BYREF
int v39; // [rsp+B8h] [rbp+60h]
v2 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v36 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v36);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v2 = qword_14090BFD0;
}
v3 = *(_DWORD **)(*(_QWORD *)(v2 + 560) + 2168LL);
v4 = cocos2d::CCDirector::sharedDirector(a1);
cocos2d::CCDirector::getWinSize(v4, v34);
v5 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v36 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v36);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v5 = qword_14090BFD0;
}
v6 = *(_BYTE *)(*(_QWORD *)(v5 + 560) + 13024LL);
if ( v6 )
v7 = v3[240];
else
v7 = v3[233] - v3[232];
CurrentPercent = PlayLayer::getCurrentPercent();
v39 = (int)floorf(CurrentPercent);
v10 = v3[243];
if ( v10 != 5 )
goto LABEL_13;
v11 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v36 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v36);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v10 = v3[243];
v11 = qword_14090BFD0;
}
if ( *(_BYTE *)(*(_QWORD *)(v11 + 560) + 2152LL) )
LOBYTE(v9) = 1;
else
LABEL_13:
LOBYTE(v9) = 0;
v12 = 0.0;
if ( v10 == 5 )
{
v13 = 17;
if ( (_BYTE)v9 )
v13 = 28;
v12 = (float)v13;
}
v14 = (float)((float)(v34[1] * 0.5) + 55.0) - v12;
LOWORD(v36) = -256;
if ( v6 )
BYTE2(v36) = -1;
else
BYTE2(v36) = 0;
v37 = 10280;
memset(v38, 40, sizeof(v38));
ProgressBar = GameToolbox::createProgressBar(v9, v7, (__int16 *)v38);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCSprite *, __int64))(**(_QWORD **)(a1 + 632) + 456LL))(
*(_QWORD *)(a1 + 632),
ProgressBar,
3);
v16 = *(_QWORD *)ProgressBar;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v37, v34[0] * 0.5, v14);
(*(void (__fastcall **)(struct cocos2d::CCSprite *, __int64))(v16 + 184))(ProgressBar, v17);
*(_WORD *)v38 = (_WORD)v36;
v38[2] = BYTE2(v36);
GameToolbox::addProgressBarFill((__int64)ProgressBar, v39, (__int64)v38, 2u);
v18 = cocos2d::CCString::createWithFormat("%i%%", v39);
CString = cocos2d::CCString::getCString(v18);
v20 = cocos2d::CCLabelBMFont::create(CString, (const char *)&qword_140704F78);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *, __int64))(**(_QWORD **)(a1 + 632) + 456LL))(
*(_QWORD *)(a1 + 632),
v20,
4);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v37, 0.0, 1.0);
v22 = v21;
v23 = (*(__int64 (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)ProgressBar + 200LL))(ProgressBar);
cocos2d::CCPoint::operator+(v23, &v36, v22);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, void **))(*(_QWORD *)v20 + 184LL))(v20, &v36);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v20 + 160LL))(v20);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v36, 0.0, 21.0);
v25 = v24;
v26 = (*(__int64 (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)ProgressBar + 200LL))(ProgressBar);
cocos2d::CCPoint::operator+(v26, v35, v25);
if ( v3[243] != 5 )
{
v27 = "Normal Mode";
if ( v6 )
v27 = "Practice Mode";
v28 = cocos2d::CCLabelBMFont::create(v27, (const char *)&qword_140704F78);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *, __int64))(**(_QWORD **)(a1 + 632) + 456LL))(
*(_QWORD *)(a1 + 632),
v28,
4);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, _BYTE *))(*(_QWORD *)v28 + 184LL))(v28, v35);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v28 + 160LL))(v28);
}
if ( v7 > 0 )
{
v29 = cocos2d::CCString::createWithFormat("Best: %i%%", v7);
v30 = cocos2d::CCString::getCString(v29);
v31 = cocos2d::CCLabelBMFont::create(v30, "goldFont.fnt");
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *, __int64))(**(_QWORD **)(a1 + 632) + 456LL))(
*(_QWORD *)(a1 + 632),
v31,
4);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v31 + 160LL))(v31);
if ( v3[243] == 5 )
v32 = 0.0;
else
v32 = 18.0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v37, 0.0, v32);
cocos2d::CCPoint::operator+(v35, &v36, v33);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, void **))(*(_QWORD *)v31 + 184LL))(v31, &v36);
}
}