//
// RetryLevelLayer::setupLastProgress from 0x4358f4 to 0x435b84 (656 bytes)
//
// 1 xrefs:
// > RetryLevelLayer::customSetup @ 0x435c5e
//
// 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
//
void RetryLevelLayer::setupLastProgress(RetryLevelLayer *a1)
{
cocos2d::CCDirector *v2; // r0
const char *v3; // r1
cocos2d::CCNode *v4; // r4
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r9
const char *v6; // r1
float *v7; // r5
float v8; // s15
void (__fastcall *v9)(float *, cocos2d::CCRect *); // r9
void (__fastcall *v10)(float *, cocos2d::CCRect *); // r9
int v11; // r0
float v12; // s16
float v13; // s15
bool v14; // fzf
bool v15; // fnf
float v16; // s16
void (__fastcall *v17)(float *, cocos2d::CCRect *); // r9
GameManager *v18; // r0
cocos2d::CCString *v19; // r0
cocos2d::CCLabelBMFont *v20; // r5
void (__fastcall *v21)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r10
int v22; // r0
GameManager *v23; // r0
cocos2d::CCString *v24; // r0
cocos2d::CCLabelBMFont *v25; // r5
void (__fastcall *v26)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r7
int v27; // r9
_BYTE v28[4]; // [sp+8h] [bp-28h] BYREF
cocos2d::CCSize v29; // [sp+Ch] [bp-24h] BYREF
cocos2d::CCPoint v30; // [sp+14h] [bp-1Ch] BYREF
cocos2d::CCRect v31; // [sp+1Ch] [bp-14h] BYREF
v2 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v29, v2);
v28[0] = 0;
v28[1] = 0;
v28[2] = 0;
v4 = (cocos2d::CCNode *)cocos2d::CCSprite::create((cocos2d::CCSprite *)"GJ_progressBar_001.png", v3);
((void (__fastcall *)(cocos2d::CCNode *, _BYTE *))v4->__vftable[1].getTag)(v4, v28);
((void (__fastcall *)(cocos2d::CCNode *, int))v4->__vftable[1].~CCNode_0)(v4, 125);
((void (__fastcall *)(cocos2d::CCNode *, int))v4->setScale)(v4, 1065353216);
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v4, 3);
setPosition = v4->setPosition;
cocos2d::CCPoint::CCPoint(&v31.origin, v29.width * 0.5, (float)((float)(v29.height * 0.5) + 25.0) - 15.0);
setPosition(v4, &v31.origin);
v7 = (float *)cocos2d::CCSprite::create((cocos2d::CCSprite *)"GJ_progressBar_001.png", v6);
(*(void (__fastcall **)(float *, int))(*(_DWORD *)v7 + 64))(v7, 1065218998);
(*(void (__fastcall **)(float *, int))(*(_DWORD *)v7 + 72))(v7, 1063004406);
(*(void (__fastcall **)(float *, void *))(*(_DWORD *)v7 + 472))(v7, &unk_9AB6F8);
v8 = v7[86];
v4->addChild_0(v4, (cocos2d::CCNode *)v7, 1);
v9 = *(void (__fastcall **)(float *, cocos2d::CCRect *))(*(_DWORD *)v7 + 140);
cocos2d::CCPoint::CCPoint(&v31.origin, 0.0, 0.5);
v9(v7, &v31);
v10 = *(void (__fastcall **)(float *, cocos2d::CCRect *))(*(_DWORD *)v7 + 92);
v11 = (int)v4->getContentSize(v4);
cocos2d::CCPoint::CCPoint(&v31.origin, (float)(v8 - (float)(v8 * 0.992)) * 0.5, *(float *)(v11 + 4) * 0.5);
v10(v7, &v31);
v12 = v7[86];
v13 = v12 * (float)((float)GameManager::sharedState()->m_playLayer->m_lastAttemptPercent / 100.0);
v14 = v12 == v13;
v15 = v12 < v13;
v16 = v7[86];
if ( !v15 && !v14 )
v16 = v16 * (float)((float)GameManager::sharedState()->m_playLayer->m_lastAttemptPercent / 100.0);
v17 = *(void (__fastcall **)(float *, cocos2d::CCRect *))(*(_DWORD *)v7 + 560);
cocos2d::CCRect::CCRect(&v31, 0.0, 0.0, v16, v7[87]);
v17(v7, &v31);
v18 = GameManager::sharedState();
v19 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i%%",
(const char *)v18->m_playLayer->m_lastAttemptPercent);
cocos2d::CCString::getCString(v19);
v20 = cocos2d::CCLabelBMFont::create();
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v20, 4);
v21 = v20->setPosition;
v22 = (int)v4->getPosition(v4);
v21(v20, (const cocos2d::CCPoint *)v22);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))v20->setScale)(v20, 1056964608);
v23 = GameManager::sharedState();
v24 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Attempt %i",
(const char *)v23->m_playLayer->m_attempts);
cocos2d::CCString::getCString(v24);
v25 = cocos2d::CCLabelBMFont::create();
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v25, 4);
v26 = v25->setPosition;
v27 = (int)v4->getPosition(v4);
cocos2d::CCPoint::CCPoint(&v30, 0.0, 23.0);
cocos2d::CCPoint::operator+(&v31, v27, &v30);
v26(v25, &v31.origin);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))v25->setScale)(v25, 1056964608);
}