//
// GJBaseGameLayer::updatePlatformerTime from 0x1403422c0 to 0x1403424d5 (533 bytes)
//
// 3 xrefs:
// > GJBaseGameLayer::updateSpecialLabels @ 0x140342010
// > PlayLayer::toggleProgressbar @ 0x140511384
// > ??> @ 0x14091fd90
//
// 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:30:40 +0000
//
// Hidden C++ exception states: #wind=2
void __fastcall GJBaseGameLayer::updatePlatformerTime(__int64 a1, __int64 a2, __int64 a3, __int64 a4)
{
unsigned int v5; // ebx
__int64 v6; // rsi
__int64 v7; // rdx
__int64 v8; // rax
cocos2d::CCString *v9; // rax
const char *CString; // rax
size_t v11; // r8
__int64 v12; // rax
__int64 *v13; // rbx
__int64 *i; // rsi
__int64 v15; // rdi
void **v16; // rdx
__int64 v17; // rax
void *v18; // rcx
int v19; // [rsp+30h] [rbp-78h] BYREF
_BYTE v20[32]; // [rsp+38h] [rbp-70h] BYREF
void *Block[2]; // [rsp+58h] [rbp-50h] BYREF
__int128 v22; // [rsp+68h] [rbp-40h]
_QWORD v23[4]; // [rsp+78h] [rbp-30h] BYREF
v5 = (int)(float)((float)(int)(*(double *)(a1 + 13920) * 1000.0) / 1000.0);
v6 = (unsigned int)(int)(float)((float)(int)((int)(*(double *)(a1 + 13920) * 1000.0) - 1000 * v5) / 10.0);
LOBYTE(a4) = 1;
(*(void (__fastcall **)(__int64, _QWORD, __int64, __int64))(*(_QWORD *)a1 + 1400LL))(a1, v5, v6, a4);
v7 = *(_QWORD *)(a1 + 4400);
v8 = *(_QWORD *)(v7 + 16 * (*(_QWORD *)(a1 + 4424) & 0x994F76653E2A3951uLL) + 8);
if ( v8 != *(_QWORD *)(a1 + 4384) )
{
if ( *(_DWORD *)(v8 + 16) == -1 )
goto LABEL_7;
while ( v8 != *(_QWORD *)(v7 + 16 * (*(_QWORD *)(a1 + 4424) & 0x994F76653E2A3951uLL)) )
{
v8 = *(_QWORD *)(v8 + 8);
if ( *(_DWORD *)(v8 + 16) == -1 )
goto LABEL_7;
}
}
v8 = 0;
LABEL_7:
if ( v8 )
{
v9 = cocos2d::CCString::createWithFormat("%i.%02d", v5, v6);
CString = cocos2d::CCString::getCString(v9);
*(_OWORD *)Block = 0;
v22 = 0;
v11 = -1;
do
++v11;
while ( CString[v11] );
sub_14003D230(Block, CString, v11);
GameToolbox::intToString(v23, v5);
v19 = -1;
v12 = sub_1403572D0(a1 + 4376, v20, &v19);
v13 = *(__int64 **)(*(_QWORD *)v12 + 24LL);
for ( i = *(__int64 **)(*(_QWORD *)v12 + 32LL); v13 != i; ++v13 )
{
v15 = *v13;
if ( *(_BYTE *)(*v13 + 773) )
{
v16 = (void **)v23;
if ( !*(_BYTE *)(v15 + 1912) )
v16 = Block;
v17 = sub_14003F4F0((__int64)v20, (__int64)v16);
LabelGameObject::updateLabel(v15, v17);
}
}
sub_14003D310((__int64)v23);
if ( *((_QWORD *)&v22 + 1) > 0xFu )
{
v18 = Block[0];
if ( (unsigned __int64)(*((_QWORD *)&v22 + 1) + 1LL) >= 0x1000 )
{
v18 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v18 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v18);
}
}
}