//
// GameLevelManager::getTimeLeft from 0x140149ed0 to 0x14014a01b (331 bytes)
//
// 11 xrefs:
// > AccountLayer::onBackup @ 0x14007e18b
// > AccountLayer::onSync @ 0x14007e410
// > FRequestProfilePage::onUpdate @ 0x14013e6a3
// > FriendsProfilePage::onUpdate @ 0x140140ac7
// > InfoLayer::onRefreshComments @ 0x1402bcd47
// > InfoLayer::onComment @ 0x1402bd9e3
// > LevelLeaderboard::onUpdate @ 0x140302880
// > MessagesProfilePage::onUpdate @ 0x140337263
// > ProfilePage::onUpdate @ 0x1403bf870
// > ProfilePage::onComment @ 0x1403c3d7b
// > ??> @ 0x1406ca704
//
// 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=1
int GameLevelManager::getTimeLeft(GameLevelManager *a1, const char *a2, float a3)
{
size_t v5; // r8
cocos2d::CCString *v6; // rbx
void *v7; // rcx
double v9; // xmm0_8
double v10; // xmm2_8
double v11; // xmm0_8
double v12; // xmm1_8
void *Block[2]; // [rsp+20h] [rbp-58h] BYREF
__m128i si128; // [rsp+30h] [rbp-48h]
*(_OWORD *)Block = 0;
si128 = 0;
v5 = -1;
do
++v5;
while ( a2[v5] );
sub_14003A930(Block, a2, v5);
v6 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey(a1->m_timerDict, Block);
if ( si128.m128i_i64[1] > 0xFuLL )
{
v7 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v7 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v7 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v7);
}
si128 = _mm_load_si128((const __m128i *)&xmmword_140623F30);
LOBYTE(Block[0]) = 0;
if ( !v6 )
return 0;
v9 = cocos2d::CCString::doubleValue(v6);
ftime64((struct __timeb64 *)Block);
v10 = (double)(LOWORD(Block[1]) + 1000 * ((__int64)Block[0] & 0xFFFFF)) / 1000.0 - v9;
v11 = 0.0;
v12 = a3;
if ( a3 >= v10 )
v11 = v12 - v10;
if ( v11 > v12 )
return (int)0.0;
return (int)v11;
}