//
// GameLevelManager::getTimeLeft from 0x800854 to 0x8009c8 (372 bytes)
//
// 17 xrefs:
// > InfoLayer::onComment @ 0x9084bc
// > InfoLayer::onRefreshComments @ 0x90acf8
// > AccountLayer::onBackup @ 0x98ce88
// > AccountLayer::onSync @ 0x98cff4
// > MessagesProfilePage::onUpdate @ 0xa49b88
// > FRequestProfilePage::onUpdate @ 0xa4c4f0
// > FriendsProfilePage::onUpdate @ 0xa4fa4c
// > ProfilePage::onUpdate @ 0xa548c0
// > ProfilePage::onComment @ 0xa551ac
// > LevelLeaderboard::onUpdate @ 0xa81fdc
// > NotificationsPage::onUpdate @ 0xc5f8cc
// > ThreadViewPopup::onLoadEarlier @ 0xc6596c
// > ThreadViewPopup::onRefresh @ 0xc68aec
// > MessageThreadsPage::onRefresh @ 0xc78974
// > ThreadSearchPopup::onSearch @ 0xc78d70
// > LevelPickerPopup::doPageRequest @ 0xc849d0
// > ??> @ 0xe1f10
//
// This function is hookable on this platform (idp: arm, 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 12:54:43 +0000
//
__int64 __fastcall GameLevelManager::getTimeLeft(GameLevelManager *this, const char *a2, float a3)
{
__int64 v4; // x23
size_t v5; // x0
size_t v6; // x19
const char *v7; // x1
unsigned __int64 v8; // x0
__int64 v9; // x22
char *v10; // x0
char *v11; // x3
cocos2d::CCString *v12; // x19
double v13; // d0
double v14; // d8
double v15; // d0
double v16; // d1
double v17; // d0
double v18; // d0
__int64 result; // x0
__int64 v21; // [xsp+60h] [xbp+60h] BYREF
size_t v22; // [xsp+68h] [xbp+68h]
void *v23; // [xsp+70h] [xbp+70h]
v4 = *((_QWORD *)this + 121);
v21 = 0;
v22 = 0;
v23 = nullptr;
v5 = strlen(a2);
v6 = v5;
v7 = a2;
if ( v5 > 0xFFFFFFFFFFFFFFEFLL )
sub_62C79C();
if ( v5 > 0x16 )
{
v8 = (v5 + 16) & 0xFFFFFFFFFFFFFFF0LL;
v9 = v8 | 1;
v10 = (char *)operator new(v8);
v21 = v9;
v7 = a2;
v11 = v10;
v23 = v10;
v22 = v6;
LABEL_4:
v11 = (char *)memcpy(v11, v7, v6);
goto LABEL_5;
}
LOBYTE(v21) = 2 * v5;
v11 = (char *)&v21 + 1;
if ( v5 )
goto LABEL_4;
LABEL_5:
v11[v6] = 0;
v12 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey(v4, &v21);
if ( (v21 & 1) != 0 )
{
operator delete(v23);
if ( v12 )
goto LABEL_7;
return 0;
}
if ( !v12 )
return 0;
LABEL_7:
cocos2d::CCString::doubleValue(v12);
v14 = v13;
v15 = sub_7FE580();
v16 = a3;
v17 = v15 - v14;
if ( v17 > a3 )
v18 = 0.0;
else
v18 = v16 - v17;
result = 0;
if ( v18 <= v16 )
return (unsigned int)(int)v18;
return result;
}