//
// PlayLayer::updateTimeLabel from 0x1403b2560 to 0x1403b275d (509 bytes)
//
// 3 xrefs:
// > ??> @ 0x1405c9cd8
// > ??> @ 0x1406d6e3c
// > ??> @ 0x1406d6e48
//
// 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
//
// Hidden C++ exception states: #wind=2
void PlayLayer::updateTimeLabel(PlayLayer *a1, int a2, int a3, bool a4)
{
cocos2d::CCString *v8; // rax
char *CString; // rax
size_t v10; // r8
_QWORD *v11; // rax
size_t v12; // r8
void **v13; // rdx
__int64 v14; // rcx
cocos2d::CCDirector *v15; // rax
__int64 v16; // rbx
cocos2d::CCLabelBMFont *m_percentageLabel; // rcx
cocos2d::CCLabelBMFont_vtbl *v18; // rsi
unsigned __int64 v19; // rcx
float v20; // xmm0_4
const cocos2d::CCPoint *v21; // rax
void *v22; // rcx
float v23; // [rsp+20h] [rbp-78h]
void *Block[2]; // [rsp+30h] [rbp-68h] BYREF
__int64 v25; // [rsp+40h] [rbp-58h]
unsigned __int64 v26; // [rsp+48h] [rbp-50h]
_QWORD v27[4]; // [rsp+50h] [rbp-48h] BYREF
if ( a1->m_percentageLabel->isVisible(a1->m_percentageLabel) && a1->m_isPlatformer )
{
*(_OWORD *)Block = 0;
v25 = 0;
v26 = 15;
LOBYTE(Block[0]) = 0;
if ( a4 )
{
v8 = cocos2d::CCString::createWithFormat("%i.%02d", a2, a3);
CString = (char *)cocos2d::CCString::getCString(v8);
v10 = -1;
do
++v10;
while ( CString[v10] );
sub_14003CCE0(Block, CString, v10);
}
else
{
v11 = GameToolbox::intToString(v27, a2);
if ( v11[3] > 0xFu )
v11 = (_QWORD *)*v11;
v12 = -1;
do
++v12;
while ( *((_BYTE *)v11 + v12) );
sub_14003CCE0(Block, v11, v12);
sub_14003A830((__int64)v27);
}
v13 = Block;
if ( v26 > 0xF )
v13 = (void **)Block[0];
a1->m_percentageLabel->setString(&a1->m_percentageLabel->cocos2d::CCLabelProtocol, (const char *)v13);
v15 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v14);
cocos2d::CCDirector::getWinSize(v15);
v16 = v25;
m_percentageLabel = a1->m_percentageLabel;
v18 = m_percentageLabel->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
m_percentageLabel->getPosition_0(m_percentageLabel);
v19 = 5 * v16;
if ( 5 * v16 < 0 )
v20 = (float)(int)(v19 & 1 | (v19 >> 1)) + (float)(int)(v19 & 1 | (v19 >> 1));
else
v20 = (float)(int)v19;
cocos2d::CCPoint::CCPoint(v20, (float)(v23 * 0.5) - v20);
v18->setPosition_0(a1->m_percentageLabel, v21);
if ( v26 > 0xF )
{
v22 = Block[0];
if ( v26 + 1 >= 0x1000 )
{
v22 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v22 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v22);
}
}
}