//
// GameLevelManager::isTimeValid from 0x140221d40 to 0x140221e88 (328 bytes)
//
// 5 xrefs:
// > GameLevelManager::getStoredOnlineLevels @ 0x1402217f7
// > GameLevelManager::getEditorSoundConfigs @ 0x14022eafb
// > GameLevelManager::getStoredLevelComments @ 0x14023e277
// > LevelInfoLayer::onUpdate @ 0x140424477
// > ??> @ 0x14091bc08
//
// This function is hookable on this platform (idp: pc, 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 11:28:25 +0000
//
// Hidden C++ exception states: #wind=1
bool __fastcall GameLevelManager::isTimeValid(__int64 a1, _BYTE *a2, float a3)
{
size_t v4; // r8
cocos2d::CCString *v5; // rbx
void *v6; // r8
double v7; // xmm0_8
void *Block[2]; // [rsp+30h] [rbp-58h] BYREF
__m128i si128; // [rsp+40h] [rbp-48h]
*(_OWORD *)Block = 0;
si128 = 0;
v4 = -1;
do
++v4;
while ( a2[v4] );
sub_14003D230(Block, a2, v4);
v5 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey(*(_QWORD *)(a1 + 1056), Block);
if ( si128.m128i_i64[1] > 0xFuLL )
{
v6 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v6 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v6 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v6);
}
si128 = _mm_load_si128((const __m128i *)&Size);
LOBYTE(Block[0]) = 0;
if ( !v5 )
return 0;
v7 = cocos2d::CCString::doubleValue(v5);
ftime64((struct __timeb64 *)Block);
return a3 >= (double)LOWORD(Block[1]) / 1000.0 + (double)SLODWORD(Block[0]) - v7;
}