//
// PauseLayer::setupProgressBars from 0x14037d6f0 to 0x14037e128 (2616 bytes)
//
// 2 xrefs:
// > PauseLayer::customSetup @ 0x14037cb20
// > ??> @ 0x1406d5d5c
//
// 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
//
// Hidden C++ exception states: #wind=8
void PauseLayer::setupProgressBars(PauseLayer *a1)
{
__int64 v2; // rax
_DWORD *v3; // r15
cocos2d::CCDirector *v4; // rax
struct cocos2d::CCSprite *v5; // rsi
__int64 v6; // rdx
float v7; // xmm0_4
cocos2d::CCSprite_vtbl *v8; // rbx
const cocos2d::CCPoint *v9; // rax
struct cocos2d::CCSprite *v10; // rdi
float v11; // xmm6_4
float v12; // xmm0_4
cocos2d::CCSprite_vtbl *v13; // rbx
double v14; // xmm0_8
const cocos2d::CCPoint *v15; // rax
cocos2d::CCSprite_vtbl *v16; // rbx
const cocos2d::CCPoint *v17; // rax
float v18; // xmm1_4
float width; // xmm3_4
cocos2d::CCSprite_vtbl *v20; // rbx
const cocos2d::CCRect *v21; // rax
struct cocos2d::CCSprite *v22; // r13
__int64 v23; // rdx
float v24; // xmm0_4
__int64 v25; // rax
struct cocos2d::CCSprite *v26; // r12
float v27; // xmm0_4
cocos2d::CCSprite_vtbl *v28; // rbx
const cocos2d::CCPoint *v29; // rax
cocos2d::CCSprite_vtbl *v30; // rbx
__int64 v31; // rax
float v32; // xmm1_4
float v33; // xmm3_4
cocos2d::CCSprite_vtbl *v34; // rbx
const cocos2d::CCRect *v35; // rax
cocos2d::CCString *v36; // rax
const char *v37; // rax
struct cocos2d::CCLabelBMFont *v38; // rdi
cocos2d::CCLabelBMFont_vtbl *v39; // rbx
__int64 v40; // rax
cocos2d::CCString *v41; // rax
const char *v42; // rax
struct cocos2d::CCLabelBMFont *v43; // rdi
cocos2d::CCLabelBMFont_vtbl *v44; // rbx
__int64 v45; // rax
struct cocos2d::CCLabelBMFont *v46; // rdi
float v47; // xmm0_4
__int64 v48; // rax
struct cocos2d::CCLabelBMFont *v49; // rdi
float v50; // xmm0_4
__int64 v51; // rax
__int64 v52; // rax
int v53; // r9d
int v54; // r8d
int v55; // r9d
int v56; // r11d
int v57; // r10d
cocos2d::CCString *v58; // rax
char *CString; // rax
size_t v60; // r8
cocos2d::CCString *v61; // rax
cocos2d::CCString *v62; // rax
const char *v63; // rdx
cocos2d::CCString *v64; // rax
const char *v65; // rax
struct cocos2d::CCLabelBMFont *v66; // rsi
float v67; // xmm0_4
cocos2d::CCLabelBMFont_vtbl *v68; // rbx
const cocos2d::CCPoint *v69; // rax
__int64 v70; // rax
__int64 v71; // rdx
char **v72; // rax
__int64 v73; // rdx
char **v74; // rax
void **v75; // rcx
cocos2d::CCLabelBMFont *v76; // rdi
float v77; // xmm0_4
__int64 v78; // rax
void *v79; // rcx
void *v80; // [rsp+38h] [rbp-89h] BYREF
__int16 v81; // [rsp+40h] [rbp-81h] BYREF
char v82; // [rsp+42h] [rbp-7Fh]
float v83; // [rsp+48h] [rbp-79h]
cocos2d::CCRect v84; // [rsp+50h] [rbp-71h] BYREF
__int128 v85; // [rsp+60h] [rbp-61h] BYREF
__int64 v86; // [rsp+70h] [rbp-51h]
unsigned __int64 v87; // [rsp+78h] [rbp-49h]
void *Block[2]; // [rsp+80h] [rbp-41h] BYREF
__int128 v89; // [rsp+90h] [rbp-31h]
__m128i v90[2]; // [rsp+A0h] [rbp-21h] BYREF
v2 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v80 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v80);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v2 = qword_1406C2ED8;
}
v3 = *(_DWORD **)(*(_QWORD *)(v2 + 520) + 2168LL);
v4 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(a1);
cocos2d::CCDirector::getWinSize(v4);
v81 = 0;
v82 = 0;
if ( v3[214] == 5 )
{
v52 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v84.origin = (cocos2d::CCPoint)operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(*(_QWORD *)&v84.origin);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v52 = qword_1406C2ED8;
}
v53 = (int)(*(double *)(*(_QWORD *)(v52 + 520) + 13664LL) * 1000.0);
v54 = v53 / 1000;
v55 = v53 % 1000;
v56 = v54 % 60;
v57 = v54 / 60 % 60;
v85 = 0;
v86 = 0;
v87 = 15;
LOBYTE(v85) = 0;
if ( v54 / 3600 )
{
v62 = cocos2d::CCString::createWithFormat("%02d:%02d:%02d.%03d", v54 / 3600, v57, v56, v55);
CString = (char *)cocos2d::CCString::getCString(v62);
v60 = -1;
do
++v60;
while ( CString[v60] );
}
else if ( v57 )
{
v61 = cocos2d::CCString::createWithFormat("%02d:%02d.%03d", v57, v56, v55);
CString = (char *)cocos2d::CCString::getCString(v61);
v60 = -1;
do
++v60;
while ( CString[v60] );
}
else
{
v58 = cocos2d::CCString::createWithFormat("%i.%03d", v56, v55);
CString = (char *)cocos2d::CCString::getCString(v58);
v60 = -1;
do
++v60;
while ( CString[v60] );
}
sub_14003CCE0((void **)&v85, CString, v60);
v63 = (const char *)&v85;
if ( v87 > 0xF )
v63 = (const char *)v85;
v64 = cocos2d::CCString::createWithFormat("Time: %s", v63);
v65 = cocos2d::CCString::getCString(v64);
v66 = cocos2d::CCLabelBMFont::create(v65, "goldFont.fnt");
v67 = ((float (__fastcall *)(PauseLayer *, struct cocos2d::CCLabelBMFont *, __int64))a1->addChild_0)(a1, v66, 3);
v68 = v66->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v67, v83 * 0.5);
v68->setPosition_0(v66, v69);
cocos2d::CCLabelBMFont::limitLabelWidth(v66, 150.0, 0.80000001, 0.0);
v70 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v84.origin = (cocos2d::CCPoint)operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(*(_QWORD *)&v84.origin);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v70 = qword_1406C2ED8;
}
v71 = *(_QWORD *)(v70 + 520);
if ( *(_BYTE *)(v71 + 2152) )
{
v72 = (char **)GameToolbox::pointsToString(v90, *(_DWORD *)(v71 + 2148));
v74 = sub_140137610(v72, v73, "Points: ", 8u);
*(_OWORD *)Block = 0;
v89 = 0u;
*(_OWORD *)Block = *(_OWORD *)v74;
v89 = *((_OWORD *)v74 + 1);
v74[2] = nullptr;
v74[3] = (char *)15;
*(_BYTE *)v74 = 0;
sub_14003A830((__int64)v90);
v75 = Block;
if ( *((_QWORD *)&v89 + 1) > 0xFu )
v75 = (void **)Block[0];
v76 = cocos2d::CCLabelBMFont::create((const char *)v75, "goldFont.fnt");
v77 = ((float (__fastcall *)(PauseLayer *, cocos2d::CCLabelBMFont *, __int64))a1->addChild_0)(a1, v76, 3);
cocos2d::CCPoint::CCPoint(v77, 0.0);
v78 = (__int64)v66->getPosition_0(v66);
cocos2d::CCPoint::operator+(v78, &v80);
v76->setPosition_0(v76, (const cocos2d::CCPoint *)&v80);
cocos2d::CCLabelBMFont::limitLabelWidth(v76, 150.0, 0.80000001, 0.0);
if ( *((_QWORD *)&v89 + 1) > 0xFu )
{
v79 = Block[0];
if ( (unsigned __int64)(*((_QWORD *)&v89 + 1) + 1LL) >= 0x1000 )
{
v79 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v79 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v79);
}
}
sub_14003A830((__int64)&v85);
}
else
{
v5 = cocos2d::CCSprite::create("GJ_progressBar_001.png");
v5->setColor(&v5->cocos2d::CCRGBAProtocol, (const cocos2d::ccColor3B *)&v81);
LOBYTE(v6) = 125;
v5->setOpacity(&v5->cocos2d::CCRGBAProtocol, v6);
((void (__fastcall *)(struct cocos2d::CCSprite *))v5->setScale_0)(v5);
v7 = ((float (__fastcall *)(PauseLayer *, struct cocos2d::CCSprite *, __int64))a1->addChild_0)(a1, v5, 3);
v8 = v5->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v7, v83 * 0.5);
v8->setPosition_0(v5, v9);
v10 = cocos2d::CCSprite::create("GJ_progressBar_001.png");
((void (__fastcall *)(struct cocos2d::CCSprite *))v10->setScaleX)(v10);
((void (__fastcall *)(struct cocos2d::CCSprite *))v10->setScaleY)(v10);
v10->setColor(&v10->cocos2d::CCRGBAProtocol, (const cocos2d::ccColor3B *)&unk_140529B9C);
v11 = v10->m_obRect.size.width - (float)(v10->m_obRect.size.width * 0.99199998);
v12 = ((float (__fastcall *)(struct cocos2d::CCSprite *, struct cocos2d::CCSprite *, __int64))v5->addChild_0)(
v5,
v10,
1);
v13 = v10->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v14 = cocos2d::CCPoint::CCPoint(v12, 0.0);
v13->setAnchorPoint(v10, v15);
v16 = v10->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v5->getContentSize(v5);
cocos2d::CCPoint::CCPoint(*(float *)&v14, v11 * 0.5);
v16->setPosition_0(v10, v17);
v18 = (float)(v3[204] - v3[203]) / 100.0;
width = v10->m_obRect.size.width;
if ( (float)(width * v18) <= width )
width = v18 * width;
v20 = v10->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCRect::CCRect(&v84, 0.0, 0.0, width, v10->m_obRect.size.height);
v20->setTextureRect_0(v10, v21);
v22 = cocos2d::CCSprite::create("GJ_progressBar_001.png");
v22->setColor(&v22->cocos2d::CCRGBAProtocol, (const cocos2d::ccColor3B *)&v81);
LOBYTE(v23) = 125;
v22->setOpacity(&v22->cocos2d::CCRGBAProtocol, v23);
((void (__fastcall *)(struct cocos2d::CCSprite *))v22->setScale_0)(v22);
v24 = ((float (__fastcall *)(PauseLayer *, struct cocos2d::CCSprite *, __int64))a1->addChild_0)(a1, v22, 3);
cocos2d::CCPoint::CCPoint(v24, 0.0);
v25 = (__int64)v5->getPosition_0(v5);
cocos2d::CCPoint::operator+(v25, &v80);
v22->setPosition_0(v22, (const cocos2d::CCPoint *)&v80);
v26 = cocos2d::CCSprite::create("GJ_progressBar_001.png");
((void (__fastcall *)(struct cocos2d::CCSprite *))v26->setScaleX)(v26);
((void (__fastcall *)(struct cocos2d::CCSprite *))v26->setScaleY)(v26);
LOWORD(v80) = -256;
BYTE2(v80) = -1;
v26->setColor(&v26->cocos2d::CCRGBAProtocol, (const cocos2d::ccColor3B *)&v80);
v27 = ((float (__fastcall *)(struct cocos2d::CCSprite *, struct cocos2d::CCSprite *, __int64))v22->addChild_0)(
v22,
v26,
1);
v28 = v26->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v27, 0.0);
v28->setAnchorPoint(v26, v29);
v30 = v26->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v31 = (__int64)v10->getPosition_0(v10);
v30->setPosition_0(v26, (const cocos2d::CCPoint *)v31);
v32 = (float)(int)v3[211] / 100.0;
v33 = v26->m_obRect.size.width;
if ( (float)(v33 * v32) <= v33 )
v33 = v33 * v32;
v34 = v26->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCRect::CCRect(&v84, 0.0, 0.0, v33, v26->m_obRect.size.height);
v34->setTextureRect_0(v26, v35);
v36 = cocos2d::CCString::createWithFormat("%i%%", v3[204] - v3[203]);
v37 = cocos2d::CCString::getCString(v36);
v38 = cocos2d::CCLabelBMFont::create(v37, (const char *)&qword_14052A4D8);
a1->addChild_0(a1, v38, 4);
v39 = v38->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v40 = (__int64)v5->getPosition_0(v5);
v39->setPosition_0(v38, (const cocos2d::CCPoint *)v40);
((void (__fastcall *)(struct cocos2d::CCLabelBMFont *))v38->setScale_0)(v38);
v41 = cocos2d::CCString::createWithFormat("%i%%", v3[211]);
v42 = cocos2d::CCString::getCString(v41);
v43 = cocos2d::CCLabelBMFont::create(v42, (const char *)&qword_14052A4D8);
a1->addChild_0(a1, v43, 4);
v44 = v43->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v45 = (__int64)v22->getPosition_0(v22);
v44->setPosition_0(v43, (const cocos2d::CCPoint *)v45);
((void (__fastcall *)(struct cocos2d::CCLabelBMFont *))v43->setScale_0)(v43);
v46 = cocos2d::CCLabelBMFont::create("Normal Mode", (const char *)&qword_14052A4D8);
v47 = ((float (__fastcall *)(PauseLayer *, struct cocos2d::CCLabelBMFont *, __int64))a1->addChild_0)(a1, v46, 4);
cocos2d::CCPoint::CCPoint(v47, 0.0);
v48 = (__int64)v5->getPosition_0(v5);
cocos2d::CCPoint::operator+(v48, &v80);
v46->setPosition_0(v46, (const cocos2d::CCPoint *)&v80);
((void (__fastcall *)(struct cocos2d::CCLabelBMFont *))v46->setScale_0)(v46);
v49 = cocos2d::CCLabelBMFont::create("Practice Mode", (const char *)&qword_14052A4D8);
v50 = ((float (__fastcall *)(PauseLayer *, struct cocos2d::CCLabelBMFont *, __int64))a1->addChild_0)(a1, v49, 4);
cocos2d::CCPoint::CCPoint(v50, 0.0);
v51 = (__int64)v22->getPosition_0(v22);
cocos2d::CCPoint::operator+(v51, &v80);
v49->setPosition_0(v49, (const cocos2d::CCPoint *)&v80);
((void (__fastcall *)(struct cocos2d::CCLabelBMFont *))v49->setScale_0)(v49);
}
}