//
// PauseLayer::setupSessionProgressBar from 0x1001c08b8 to 0x1001c0c0c (852 bytes)
//
// 1 xrefs:
// > PauseLayer::setupProgressBars @ 0x1001bf674
//
// This function is hookable on this platform (idp: arm, 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:00:15 +0000
//
__int64 __fastcall PauseLayer::setupSessionProgressBar(__int64 a1)
{
__int64 v2; // x0
__int64 v3; // x19
__int64 v4; // x0
_QWORD *WinSize; // x0
__int64 NormalPercent; // x0
int v7; // w25
__int64 v8; // x21
__int64 v9; // x0
unsigned int v10; // w23
_BOOL8 isPlatformer; // x0
float v12; // s8
_BOOL4 v13; // w0
float v14; // s0
float v15; // s8
int v16; // w24
__int64 ProgressBar; // x22
__int64 v18; // x0
__int64 CString; // x0
__int64 v20; // x23
float32x2_t *v21; // x24
double v22; // d0
float32x2_t *v23; // x22
__int64 result; // x0
const char *v25; // x0
__int64 v26; // x22
__int64 v27; // x0
__int64 v28; // x0
__int64 v29; // x21
_BOOL4 v30; // w0
float v31; // s1
double v32; // d0
float32x2_t v33; // [xsp+10h] [xbp-70h] BYREF
float32x2_t v34; // [xsp+18h] [xbp-68h] BYREF
float32x2_t v35; // [xsp+20h] [xbp-60h] BYREF
__int64 v36; // [xsp+28h] [xbp-58h] BYREF
v2 = GameManager::sharedState(a1);
v3 = *(_QWORD *)(*(_QWORD *)(v2 + 544) + 1936LL);
v4 = cocos2d::CCDirector::sharedDirector(v2);
WinSize = cocos2d::CCDirector::getWinSize(&v36, v4);
NormalPercent = GameManager::sharedState(WinSize);
v7 = *(unsigned __int8 *)(*(_QWORD *)(NormalPercent + 544) + 12544LL);
if ( v7 == 1 )
{
v8 = *(unsigned int *)(v3 + 888);
}
else
{
NormalPercent = GJGameLevel::getNormalPercent(v3);
v8 = NormalPercent;
}
v9 = GameManager::sharedState(NormalPercent);
v10 = sub_100147A10(*(_QWORD *)(v9 + 544));
isPlatformer = GJGameLevel::isPlatformer(v3);
v12 = 17.0;
if ( isPlatformer )
{
if ( *(_BYTE *)(*(_QWORD *)(GameManager::sharedState(isPlatformer) + 544) + 1920LL) )
v12 = 28.0;
else
v12 = 17.0;
}
v13 = GJGameLevel::isPlatformer(v3);
v14 = 0.0;
if ( v13 )
v14 = v12;
v15 = (float)((float)(*((float *)&v36 + 1) * 0.5) + 55.0) - v14;
if ( v7 )
v16 = 16776960;
else
v16 = 65280;
ProgressBar = GameToolbox::createProgressBar(v8, 2631720, 1.0);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 632) + 464LL))(
*(_QWORD *)(a1 + 632),
ProgressBar,
3);
sub_1000262BC((float *)&v35, *(float *)&v36 * 0.5, v15);
(*(void (__fastcall **)(__int64, float32x2_t *))(*(_QWORD *)ProgressBar + 184LL))(ProgressBar, &v35);
sub_10004A06C(ProgressBar, v10, v16, 2);
v18 = sub_1003065B0("%i%%", v10);
CString = cocos2d::CCString::getCString(v18);
v20 = cocos2d::CCLabelBMFont::create_1(CString, "bigFont.fnt");
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 632) + 464LL))(*(_QWORD *)(a1 + 632), v20, 4);
v21 = (float32x2_t *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)ProgressBar + 192LL))(ProgressBar);
sub_1000262BC((float *)&v34, 0.0, 1.0);
*(float32x2_t *)&v22 = sub_100026318(v21, &v34, &v35);
(*(void (__fastcall **)(__int64, float32x2_t *, double))(*(_QWORD *)v20 + 184LL))(v20, &v35, v22);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v20 + 160LL))(v20, 0.5);
v23 = (float32x2_t *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)ProgressBar + 192LL))(ProgressBar);
sub_1000262BC((float *)&v34, 0.0, 21.0);
sub_100026318(v23, &v34, &v35);
result = GJGameLevel::isPlatformer(v3);
if ( (result & 1) == 0 )
{
if ( v7 )
v25 = "Practice Mode";
else
v25 = "Normal Mode";
v26 = cocos2d::CCLabelBMFont::create_1(v25, "bigFont.fnt");
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 632) + 464LL))(*(_QWORD *)(a1 + 632), v26, 4);
(*(void (__fastcall **)(__int64, float32x2_t *))(*(_QWORD *)v26 + 184LL))(v26, &v35);
result = (*(__int64 (__fastcall **)(__int64, float))(*(_QWORD *)v26 + 160LL))(v26, 0.5);
}
if ( (int)v8 >= 1 )
{
v27 = sub_1003065B0("Best: %i%%", v8);
v28 = cocos2d::CCString::getCString(v27);
v29 = cocos2d::CCLabelBMFont::create_1(v28, "goldFont.fnt");
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 632) + 464LL))(*(_QWORD *)(a1 + 632), v29, 4);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v29 + 160LL))(v29, 0.48);
v30 = GJGameLevel::isPlatformer(v3);
v31 = 0.0;
if ( !v30 )
v31 = 18.0;
sub_1000262BC((float *)&v33, 0.0, v31);
*(float32x2_t *)&v32 = sub_100026318(&v35, &v33, &v34);
return (*(__int64 (__fastcall **)(__int64, float32x2_t *, double))(*(_QWORD *)v29 + 184LL))(v29, &v34, v32);
}
return result;
}