//
// PlayLayer::updateProgressbar from 0x700150 to 0x700334 (484 bytes)
//
// 5 xrefs:
// > PlayLayer::toggleProgressbar @ 0x70046c
// > PlayLayer::setupHasCompleted @ 0x70800c
// > PlayLayer::postUpdate @ 0x708ea4
// > PlayLayer::resetLevel @ 0x711728
// > ??> @ 0x5bb10
//
// 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 12:52:02 +0000
//
__int64 __fastcall PlayLayer::updateProgressbar(PlayLayer *this)
{
float CurrentPercent; // s0
float v4; // s8
float v5; // s2
float v6; // s0
__int64 v7; // x21
void (__fastcall *v8)(__int64, _BYTE *); // x22
double v9; // d0
const char **v10; // x20
void (__fastcall *v11)(const char **, __int64); // x21
cocos2d::CCString *v12; // x0
__int64 CString; // x0
int v14; // w1
unsigned __int64 v15; // x0
char *v16; // x1
_BYTE v17[16]; // [xsp+50h] [xbp+50h] BYREF
unsigned __int64 v18[2]; // [xsp+60h] [xbp+60h] BYREF
void *v19; // [xsp+70h] [xbp+70h]
if ( *((_BYTE *)this + 12238) )
return _stack_chk_guard;
CurrentPercent = PlayLayer::getCurrentPercent(this);
v4 = CurrentPercent;
v5 = *((float *)this + 3592);
if ( CurrentPercent > 0.01 )
{
v6 = v5 * (float)(CurrentPercent / 100.0);
if ( v5 <= v6 )
goto LABEL_6;
goto LABEL_5;
}
v6 = v5 * 0.0001;
if ( v5 > (float)(v5 * 0.0001) )
{
if ( v4 <= 0.01 )
{
LABEL_5:
v5 = v6;
goto LABEL_6;
}
v5 = (float)(v4 / 100.0) * v5;
}
LABEL_6:
v7 = *((_QWORD *)this + 1795);
v8 = *(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v7 + 1136LL);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v17, 0.0, 0.0, v5, *((float *)this + 3593));
v8(v7, v17);
if ( *((_BYTE *)this + 14344) )
{
if ( v4 < 0.0 )
{
v9 = 0.0;
}
else if ( v4 >= 100.0 )
{
v9 = 100.0;
}
else
{
v9 = 0.0;
if ( v4 >= 0.0 )
v9 = v4;
}
v10 = *((const char ***)this + 1792);
v11 = *((void (__fastcall **)(const char **, __int64))*v10 + 116);
v12 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%.2f%%", *v10, v9);
CString = cocos2d::CCString::getCString(v12);
v11(v10, CString);
}
else
{
v14 = (int)v4;
v15 = 100;
if ( (int)v4 <= 99 )
{
if ( v14 < 0 )
v15 = 0;
else
v15 = (unsigned int)v14;
}
GameToolbox::intToString(v18, (GameToolbox *)v15);
std::string::append((__int64)v18, "%", 1u);
v16 = (char *)v18 + 1;
if ( (v18[0] & 1) != 0 )
v16 = (char *)v19;
(*(void (__fastcall **)(_QWORD, char *))(**((_QWORD **)this + 1792) + 928LL))(*((_QWORD *)this + 1792), v16);
if ( (v18[0] & 1) != 0 )
operator delete(v19);
}
return _stack_chk_guard;
}