//
// GameToolbox::getTimeString from 0x140065e50 to 0x140066067 (535 bytes)
//
// 7 xrefs:
// > ChallengesPage::updateTimers @ 0x1400865eb
// > DailyLevelPage::getDailyTimeString @ 0x1400d1594
// > GameLevelManager::onUploadCommentCompleted @ 0x14015e8ee
// > LevelInfoLayer::updateLabelValues @ 0x1402ff506
// > RewardsPage::updateTimers @ 0x1403cda9e
// > RewardsPage::updateTimers @ 0x1403cdafe
// > ??> @ 0x1406c5de4
//
// 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
//
_QWORD *__fastcall GameToolbox::getTimeString(_QWORD *a1, int a2, char a3)
{
float v5; // xmm7_4
int v6; // edi
float v7; // xmm7_4
int v8; // esi
float v9; // xmm7_4
int v10; // ecx
int v11; // r8d
cocos2d::CCString *v12; // rax
const char *CString; // rax
size_t v14; // r8
cocos2d::CCString *v15; // rax
cocos2d::CCString *v16; // rax
cocos2d::CCString *v17; // rax
cocos2d::CCString *v18; // rax
v5 = (float)a2;
v6 = (int)floorf((float)a2 / 86400.0);
v7 = v5 - (float)((float)v6 * 86400.0);
v8 = (int)floorf(v7 / 3600.0);
v9 = v7 - (float)(3600 * v8);
v10 = (int)floorf(v9 / 60.0);
v11 = (int)(float)(v9 - (float)(60 * v10));
if ( v6 + v10 + v8 > 0 )
{
if ( v8 + v6 > 0 )
{
if ( v6 > 0 )
{
v18 = cocos2d::CCString::createWithFormat("%idays %ih", v6, v8);
CString = cocos2d::CCString::getCString(v18);
v14 = -1;
*(_OWORD *)a1 = 0;
a1[2] = 0;
a1[3] = 0;
do
++v14;
while ( CString[v14] );
}
else
{
v17 = cocos2d::CCString::createWithFormat("%ih %imin", v8, v10);
CString = cocos2d::CCString::getCString(v17);
v14 = -1;
*(_OWORD *)a1 = 0;
a1[2] = 0;
a1[3] = 0;
do
++v14;
while ( CString[v14] );
}
}
else if ( a3 )
{
v15 = cocos2d::CCString::createWithFormat("%imin", v10);
CString = cocos2d::CCString::getCString(v15);
v14 = -1;
*(_OWORD *)a1 = 0;
a1[2] = 0;
a1[3] = 0;
do
++v14;
while ( CString[v14] );
}
else
{
v16 = cocos2d::CCString::createWithFormat("%imin %02dsec", v10, v11);
CString = cocos2d::CCString::getCString(v16);
v14 = -1;
*(_OWORD *)a1 = 0;
a1[2] = 0;
a1[3] = 0;
do
++v14;
while ( CString[v14] );
}
}
else
{
v12 = cocos2d::CCString::createWithFormat("%isec", v11);
CString = cocos2d::CCString::getCString(v12);
v14 = -1;
*(_OWORD *)a1 = 0;
a1[2] = 0;
a1[3] = 0;
do
++v14;
while ( CString[v14] );
}
sub_14003A930(a1, CString, v14);
return a1;
}