//
// RetryLevelLayer::setupLastProgress from 0x7edacc to 0x7ede5c (912 bytes)
//
// 2 xrefs:
// > RetryLevelLayer::customSetup @ 0x7edf6c
// > ??> @ 0xc1cc8
//
// 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; // x0
const char *v3; // x1
cocos2d::CCNode *v4; // x19
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x24
const char *v6; // x1
float *v7; // x20
float v8; // s9
void (__fastcall *v9)(float *, cocos2d::CCRect *); // x25
void (__fastcall *v10)(float *, cocos2d::CCRect *); // x25
__int64 v11; // x0
float v12; // s8
float v13; // s2
void (__fastcall *v14)(float *, cocos2d::CCRect *); // x25
GameManager *v15; // x0
cocos2d::CCString *v16; // x0
cocos2d::CCLabelBMFont *v17; // x20
void (__fastcall *v18)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x26
__int64 v19; // x0
GameManager *v20; // x0
cocos2d::CCString *v21; // x0
cocos2d::CCLabelBMFont *v22; // x20
cocos2d::CCNode *v23; // x0
const cocos2d::CCPoint *(__fastcall *getPosition)(cocos2d::CCNode *__hidden); // x1
void (__fastcall *v25)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x19
__int64 v26; // x23
float v27; // s8
_BYTE v28[8]; // [xsp+70h] [xbp+70h] BYREF
float v29; // [xsp+78h] [xbp+78h]
float v30; // [xsp+7Ch] [xbp+7Ch]
cocos2d::CCPoint v31; // [xsp+80h] [xbp+80h] BYREF
cocos2d::CCRect v32; // [xsp+88h] [xbp+88h] BYREF
v2 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(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 *, __int64))v4->__vftable[1].~CCNode_0)(v4, 125);
v4->setScale(v4, 1.0);
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v4, 3);
setPosition = v4->setPosition;
cocos2d::CCPoint::CCPoint(&v32.origin, v29 * 0.5, (float)((float)(v30 * 0.5) + 25.0) - 15.0);
setPosition(v4, &v32.origin);
v7 = (float *)cocos2d::CCSprite::create((cocos2d::CCSprite *)"GJ_progressBar_001.png", v6);
(*(void (__fastcall **)(float *, float))(*(_QWORD *)v7 + 128LL))(v7, 0.992);
(*(void (__fastcall **)(float *, float))(*(_QWORD *)v7 + 144LL))(v7, 0.86);
(*(void (__fastcall **)(float *, void *))(*(_QWORD *)v7 + 944LL))(v7, &unk_ED4790);
v8 = v7[108] - (float)(v7[108] * 0.992);
v4->addChild_0(v4, (cocos2d::CCNode *)v7, 1);
v9 = *(void (__fastcall **)(float *, cocos2d::CCRect *))(*(_QWORD *)v7 + 280LL);
cocos2d::CCPoint::CCPoint(&v32.origin, 0.0, 0.5);
v9(v7, &v32);
v10 = *(void (__fastcall **)(float *, cocos2d::CCRect *))(*(_QWORD *)v7 + 184LL);
v11 = (__int64)v4->getContentSize(v4);
cocos2d::CCPoint::CCPoint(&v32.origin, v8 * 0.5, *(float *)(v11 + 4) * 0.5);
v10(v7, &v32);
v12 = v7[108];
if ( v12 > (float)(v12 * (float)((float)GameManager::sharedState()->m_playLayer->m_lastAttemptPercent / 100.0)) )
{
v27 = v7[108];
v13 = v27 * (float)((float)GameManager::sharedState()->m_playLayer->m_lastAttemptPercent / 100.0);
}
else
{
v13 = v7[108];
}
v14 = *(void (__fastcall **)(float *, cocos2d::CCRect *))(*(_QWORD *)v7 + 1120LL);
cocos2d::CCRect::CCRect(&v32, 0.0, 0.0, v13, v7[109]);
v14(v7, &v32);
v15 = GameManager::sharedState();
v16 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i%%",
(const char *)(unsigned int)v15->m_playLayer->m_lastAttemptPercent);
cocos2d::CCString::getCString(v16);
v17 = cocos2d::CCLabelBMFont::create();
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v17, 4);
v18 = v17->setPosition;
v19 = (__int64)v4->getPosition(v4);
v18(v17, (const cocos2d::CCPoint *)v19);
v17->setScale(v17, 0.5);
v20 = GameManager::sharedState();
v21 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Attempt %i",
(const char *)(unsigned int)v20->m_playLayer->m_attempts);
cocos2d::CCString::getCString(v21);
v22 = cocos2d::CCLabelBMFont::create();
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v22, 4);
v23 = v4;
getPosition = v4->getPosition;
v25 = v22->setPosition;
v26 = (__int64)getPosition(v23);
cocos2d::CCPoint::CCPoint(&v31, 0.0, 23.0);
cocos2d::CCPoint::operator+(&v32, v26, &v31);
v25(v22, &v32.origin);
v22->setScale(v22, 0.5);
}