//
// PlayLayer::updateProgressbar from 0x140510e50 to 0x140510fde (398 bytes)
//
// 5 xrefs:
// > PlayLayer::setupHasCompleted @ 0x1405056be
// > PlayLayer::toggleProgressbar @ 0x14051136e
// > PlayLayer::postUpdate @ 0x140513ceb
// > PlayLayer::resetLevel @ 0x140519979
// > ??> @ 0x14092ab6c
//
// This function is hookable on this platform (idp: pc, 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:33:31 +0000
//
// Hidden C++ exception states: #wind=1
void __fastcall PlayLayer::updateProgressbar(__int64 a1)
{
double CurrentPercent; // xmm0_8
float v3; // xmm6_4
__int64 *v4; // rdi
__int64 v5; // rbx
__int64 v6; // rax
__int64 v7; // rdi
void (__fastcall *v8)(__int64, const char *); // rbx
cocos2d::CCString *v9; // rax
const char *CString; // rax
signed int v11; // edx
_QWORD *v12; // rdx
_QWORD Src[4]; // [rsp+30h] [rbp-68h] BYREF
if ( !*(_BYTE *)(a1 + 12670) )
{
CurrentPercent = PlayLayer::getCurrentPercent();
v3 = *(float *)&CurrentPercent;
v4 = *(__int64 **)(a1 + 15016);
v5 = *v4;
cocos2d::CCRect::CCRect(
(cocos2d::CCRect *)Src,
0.0,
0.0,
fminf(
*(float *)(a1 + 15024),
(float)(fmaxf(0.0099999998, *(float *)&CurrentPercent) / 100.0) * *(float *)(a1 + 15024)),
*(float *)(a1 + 15028));
(*(void (__fastcall **)(__int64 *, __int64))(v5 + 992))(v4, v6);
if ( *(_BYTE *)(a1 + 15000) )
{
v7 = *(_QWORD *)(a1 + 14992);
v8 = **(void (__fastcall ***)(__int64, const char *))(v7 + 360);
v9 = cocos2d::CCString::createWithFormat("%.2f%%", fminf(100.0, fmaxf(v3, 0.0)));
CString = cocos2d::CCString::getCString(v9);
v8(v7 + 360, CString);
}
else
{
v11 = 0;
if ( (int)v3 > 0 )
v11 = (int)v3;
if ( v11 > 100 )
v11 = 100;
GameToolbox::intToString(Src, v11);
sub_140044D80(Src, &unk_14072EE90, 1u);
v12 = Src;
if ( Src[3] > 0xFu )
v12 = (_QWORD *)Src[0];
(**(void (__fastcall ***)(__int64, _QWORD *))(*(_QWORD *)(a1 + 14992) + 360LL))(
*(_QWORD *)(a1 + 14992) + 360LL,
v12);
sub_14003D310((__int64)Src);
}
}
}