//
// PlayLayer::updateTimeLabel from 0x1000b97b0 to 0x1000b9936 (390 bytes)
//
// 1 xrefs:
// > ??> @ 0x1008b7428
//
// 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 __fastcall PlayLayer::updateTimeLabel(PlayLayer *a1, int a2, int a3, bool a4)
{
cocos2d::CCString *v6; // rax
const char *CString; // rax
const std::string::value_type *v8; // rsi
cocos2d::CCLabelBMFont *m_percentageLabel; // rdi
std::string::pointer data; // rsi
cocos2d::CCDirector *v11; // rsi
cocos2d::CCLabelBMFont *v12; // rbx
unsigned int v13; // r15d
std::string::size_type size; // r14
__int64 v15; // rax
unsigned __int64 v16; // rcx
float v17; // xmm1_4
char v18; // [rsp+0h] [rbp-70h]
_BYTE v19[8]; // [rsp+8h] [rbp-68h] BYREF
std::string::value_type __s[4]; // [rsp+10h] [rbp-60h] BYREF
void *__p; // [rsp+20h] [rbp-50h]
float v22; // [rsp+2Ch] [rbp-44h]
std::string v23; // [rsp+30h] [rbp-40h] BYREF
if ( ((unsigned __int8 (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_percentageLabel->isVisible)(a1->m_percentageLabel)
&& a1->m_isPlatformer )
{
memset(&v23, 0, sizeof(v23));
if ( a4 )
{
v6 = (cocos2d::CCString *)sub_1007AB580("%i.%02d", v18);
CString = cocos2d::CCString::getCString(v6);
std::string::assign(&v23, CString);
}
else
{
GameToolbox::intToString(__s, (unsigned int)a2);
if ( (__s[0] & 1) != 0 )
v8 = (const std::string::value_type *)__p;
else
v8 = &__s[1];
std::string::assign(&v23, v8);
if ( (__s[0] & 1) != 0 )
operator delete(__p);
}
m_percentageLabel = a1->m_percentageLabel;
if ( (*(_BYTE *)&v23.__r_.__value_.__s.0 & 1) != 0 )
data = v23.__r_.__value_.__l.__data_;
else
data = v23.__r_.__value_.__s.__data_;
((void (__fastcall *)(cocos2d::CCLabelBMFont *, std::string::pointer))m_percentageLabel->setString)(
m_percentageLabel,
data);
v11 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)__s);
v12 = a1->m_percentageLabel;
v22 = *(float *)__s;
v13 = (unsigned int)v23.__r_.__value_.__l.0;
size = v23.__r_.__value_.__l.__size_;
v15 = ((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *, cocos2d::CCDirector *))v12->getPosition)(v12, v11);
if ( (v13 & 1) == 0 )
size = v13 >> 1;
v16 = 5 * size;
if ( ((5 * size) & 0x8000000000000000LL) != 0LL )
v17 = (float)(int)((v16 >> 1) | v16 & 1) + (float)(int)((v16 >> 1) | v16 & 1);
else
v17 = (float)(int)v16;
sub_10028CBE0(v19, (float)(v22 * 0.5) - v17, *(float *)(v15 + 4));
((void (__fastcall *)(cocos2d::CCLabelBMFont *, _BYTE *))v12->setPosition)(v12, v19);
if ( (*(_BYTE *)&v23.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v23.__r_.__value_.__l.__data_);
}
}