//
// PauseLayer::setupSessionProgressBar from 0x1003c2870 to 0x1003c2be6 (886 bytes)
//
// 1 xrefs:
// > PauseLayer::setupProgressBars @ 0x1003c0ff9
//
// 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 12:29:33 +0000
//
__int64 __fastcall PauseLayer::setupSessionProgressBar(__int64 a1, __int64 a2, __m128 a3)
{
__int64 v3; // rbx
__int64 v4; // rax
unsigned int NormalPercent; // r14d
__int64 v6; // rax
unsigned int CurrentPercentInt; // r12d
__int64 v8; // xmm0_8
char isPlatformer; // al
float v10; // xmm0_4
__int64 ProgressBar; // r13
__int64 v12; // rax
__int64 CString; // rax
__int64 v14; // r12
unsigned __int64 *v15; // r14
unsigned __int64 *v16; // rbx
__int64 result; // rax
const char *v18; // rdi
__int64 v19; // rbx
__int64 v20; // rax
__int64 v21; // rax
__int64 v22; // r15
double v23; // xmm0_8
float v24; // xmm1_4
char v25; // [rsp+0h] [rbp-70h]
char v26; // [rsp+0h] [rbp-70h]
unsigned __int64 v27; // [rsp+8h] [rbp-68h] BYREF
__int64 v28; // [rsp+10h] [rbp-60h]
float v29[2]; // [rsp+1Ch] [rbp-54h] BYREF
unsigned __int64 v30; // [rsp+24h] [rbp-4Ch] BYREF
int v31; // [rsp+2Ch] [rbp-44h]
unsigned __int64 v32; // [rsp+30h] [rbp-40h] BYREF
float v33[3]; // [rsp+38h] [rbp-38h]
char v34; // [rsp+47h] [rbp-29h]
v3 = *(_QWORD *)(*(_QWORD *)(GameManager::sharedState() + 544) + 1936LL);
v4 = cocos2d::CCDirector::sharedDirector(a1, a2);
cocos2d::CCDirector::getWinSize(v29, v4);
v34 = *(_BYTE *)(*(_QWORD *)(GameManager::sharedState() + 544) + 12544LL);
if ( v34 == 1 )
NormalPercent = *(_DWORD *)(v3 + 888);
else
NormalPercent = GJGameLevel::getNormalPercent(v3);
v6 = GameManager::sharedState();
CurrentPercentInt = PlayLayer::getCurrentPercentInt(*(_QWORD *)(v6 + 544), a3);
if ( (unsigned __int8)GJGameLevel::isPlatformer(v3, *(double *)a3.i64)
&& *(_BYTE *)(*(_QWORD *)(GameManager::sharedState() + 544) + 1920LL) )
{
v8 = 1105199104;
}
else
{
v8 = 1099431936;
}
LODWORD(v33[0]) = v8;
v28 = v3;
isPlatformer = GJGameLevel::isPlatformer(v3, *(double *)&v8);
v10 = v33[0];
if ( !isPlatformer )
v10 = 0.0;
v33[0] = (float)((float)(v29[1] * 0.5) + 55.0) - v10;
v31 = NormalPercent;
ProgressBar = GameToolbox::createProgressBar(NormalPercent, 2631720, 1.0);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 632) + 464LL))(
*(_QWORD *)(a1 + 632),
ProgressBar,
3);
sub_100278250((float *)&v32, v29[0] * 0.5, v33[0]);
(*(void (__fastcall **)(__int64, unsigned __int64 *))(*(_QWORD *)ProgressBar + 184LL))(ProgressBar, &v32);
GameToolbox::addProgressBarFill(ProgressBar, CurrentPercentInt, ((unsigned __int8)(v34 ^ 1) << 16) - 256, 2);
v12 = sub_10088E820("%i%%", v25);
CString = cocos2d::CCString::getCString(v12);
v14 = cocos2d::CCLabelBMFont::create_3(CString, "bigFont.fnt");
*(_QWORD *)v33 = a1;
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 632) + 464LL))(*(_QWORD *)(a1 + 632), v14, 4);
v15 = (unsigned __int64 *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)ProgressBar + 192LL))(ProgressBar);
sub_100278250((float *)&v30, 0.0, 1.0);
sub_100278350((double *)&v32, v15, &v30);
(*(void (__fastcall **)(__int64, unsigned __int64 *))(*(_QWORD *)v14 + 184LL))(v14, &v32);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v14 + 160LL))(v14, 0.5);
v16 = (unsigned __int64 *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)ProgressBar + 192LL))(ProgressBar);
sub_100278250((float *)&v30, 0.0, 21.0);
sub_100278350((double *)&v32, v16, &v30);
result = GJGameLevel::isPlatformer(v28, 0.0);
if ( !(_BYTE)result )
{
v18 = "Normal Mode";
if ( v34 )
v18 = "Practice Mode";
v19 = cocos2d::CCLabelBMFont::create_3(v18, "bigFont.fnt");
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(*(_QWORD *)v33 + 632LL) + 464LL))(
*(_QWORD *)(*(_QWORD *)v33 + 632LL),
v19,
4);
(*(void (__fastcall **)(__int64, unsigned __int64 *))(*(_QWORD *)v19 + 184LL))(v19, &v32);
result = (*(__int64 (__fastcall **)(__int64, float))(*(_QWORD *)v19 + 160LL))(v19, 0.5);
}
if ( v31 > 0 )
{
v20 = sub_10088E820("Best: %i%%", v26);
v21 = cocos2d::CCString::getCString(v20);
v22 = cocos2d::CCLabelBMFont::create_3(v21, "goldFont.fnt");
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(*(_QWORD *)v33 + 632LL) + 464LL))(
*(_QWORD *)(*(_QWORD *)v33 + 632LL),
v22,
4);
v23 = (*(double (__fastcall **)(__int64, float))(*(_QWORD *)v22 + 160LL))(v22, 0.47999999);
v24 = 0.0;
if ( !(unsigned __int8)GJGameLevel::isPlatformer(v28, v23) )
v24 = 18.0;
sub_100278250((float *)&v27, 0.0, v24);
sub_100278350((double *)&v30, &v32, &v27);
return (*(__int64 (__fastcall **)(__int64, unsigned __int64 *))(*(_QWORD *)v22 + 184LL))(v22, &v30);
}
return result;
}