//
// PlayLayer::updateTimeLabel from 0x5c9aa4 to 0x5c9d1c (632 bytes)
//
// 2 xrefs:
// > ??> @ 0x38658
// > ??> @ 0x1148b00
//
// 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
//
// local variable allocation has failed, the output may be wrong!
void PlayLayer::updateTimeLabel(PlayLayer *a1, int a2, int a3, bool a4)
{
_BOOL4 v4; // w22
size_t v6; // x0
char *v7; // x0
cocos2d::CCDirector *v8; // x0
cocos2d::CCLabelBMFont *m_percentageLabel; // x22
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x23
float v11; // s8
__int64 v12; // x0
unsigned __int8 *v13; // x0
unsigned int *v14; // x1
int v15; // w2
cocos2d::CCString *v16; // x0
size_t v17; // x0
unsigned int *v18; // x1
int v19; // w2
GameToolbox *v20; // [xsp+40h] [xbp+40h]
__int64 v21; // [xsp+48h] [xbp+48h]
char *v22; // [xsp+48h] [xbp+48h]
const char *CString; // [xsp+48h] [xbp+48h]
const unsigned __int8 *v24; // [xsp+60h] [xbp+60h] BYREF
float v25; // [xsp+68h] [xbp+68h]
char *v26; // [xsp+70h] [xbp+70h] BYREF
v4 = a4;
v20 = *(GameToolbox **)&a2;
v21 = *(_QWORD *)&a3;
if ( a1->m_percentageLabel->isVisible(a1->m_percentageLabel) && a1->m_isPlatformer )
{
v24 = (const unsigned __int8 *)&byte_124B6C8;
if ( v4 )
{
v16 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i.%02d",
(const char *)v20,
v21);
CString = cocos2d::CCString::getCString(v16);
v17 = strlen(CString);
sub_D1798C(&v24, CString, v17);
}
else
{
GameToolbox::intToString((__int64 *)&v26, (GameToolbox *)(unsigned int)v20);
v22 = v26;
v6 = strlen(v26);
sub_D1798C(&v24, v22, v6);
v7 = v26 - 24;
if ( v26 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v18 = (unsigned int *)(v26 - 8);
do
v19 = __ldaxr(v18);
while ( __stlxr(v19 - 1, v18) );
}
else
{
v19 = *((_DWORD *)v26 - 2);
*((_DWORD *)v26 - 2) = v19 - 1;
}
if ( v19 <= 0 )
operator delete(v7);
}
}
a1->m_percentageLabel->setString(a1->m_percentageLabel, v24);
v8 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v8);
m_percentageLabel = a1->m_percentageLabel;
setPosition = m_percentageLabel->setPosition;
v11 = -(float)((float)(unsigned __int64)(5LL * *((_QWORD *)v24 - 3)) - (float)(v25 * 0.5));
v12 = (__int64)m_percentageLabel->getPosition(m_percentageLabel);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v26, v11, *(float *)(v12 + 4));
setPosition(m_percentageLabel, (const cocos2d::CCPoint *)&v26);
v13 = (unsigned __int8 *)(v24 - 24);
if ( v24 - 24 != (const unsigned __int8 *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v14 = (unsigned int *)(v24 - 8);
do
v15 = __ldaxr(v14);
while ( __stlxr(v15 - 1, v14) );
}
else
{
v15 = *((_DWORD *)v24 - 2);
*((_DWORD *)v24 - 2) = v15 - 1;
}
if ( v15 <= 0 )
operator delete(v13);
}
}
}