//
// GJBaseGameLayer::updateTimerLabels from 0x140235240 to 0x1402355a5 (869 bytes)
//
// 2 xrefs:
// > GJBaseGameLayer::update @ 0x140238cc9
// > ??> @ 0x1406ce040
//
// 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=5
void GJBaseGameLayer::updateTimerLabels(GJBaseGameLayer *a1)
{
std::_List_val>>>::_Nodeptr Myhead; // rdi
__int64 *v3; // rbx
double v4; // xmm0_8
bool v5; // r12
double v6; // xmm6_8
int v7; // esi
int v8; // eax
int v9; // r14d
unsigned int v10; // r15d
_BYTE *v11; // rax
size_t v12; // r8
_BYTE *v13; // rax
size_t v14; // r8
__int64 *v15; // r15
__int64 *i; // r12
__int64 v17; // r14
__int128 *v18; // rdx
__int64 v19; // rax
__int64 v20; // rsi
void *v21; // rdx
__int128 v22; // [rsp+28h] [rbp-E0h] BYREF
__int16 *v23; // [rsp+38h] [rbp-D0h]
__int64 v24; // [rsp+40h] [rbp-C8h]
const char *v25; // [rsp+48h] [rbp-C0h]
__int64 v26; // [rsp+50h] [rbp-B8h]
const char *v27; // [rsp+58h] [rbp-B0h]
__int64 v28; // [rsp+60h] [rbp-A8h]
_BYTE v29[32]; // [rsp+68h] [rbp-A0h] BYREF
__int128 v30; // [rsp+88h] [rbp-80h] BYREF
__int64 v31; // [rsp+98h] [rbp-70h]
__int64 v32; // [rsp+A0h] [rbp-68h]
__int128 v33; // [rsp+A8h] [rbp-60h] BYREF
__int64 v34; // [rsp+B8h] [rbp-50h]
__int64 v35; // [rsp+C0h] [rbp-48h]
_BYTE v36[528]; // [rsp+C8h] [rbp-40h] BYREF
_BYTE v37[528]; // [rsp+2D8h] [rbp+1D0h] BYREF
Myhead = a1->m_timeLabelObjects._List._Mypair._Myval2._Myhead;
v3 = *(__int64 **)Myhead;
if ( *(std::_List_val>>>::_Nodeptr *)Myhead != Myhead )
{
*(_QWORD *)&v22 = &unk_14055D9E4;
*((_QWORD *)&v22 + 1) = 0;
do
{
v4 = GJEffectManager::timeForItem(a1->m_effectManager, *((_DWORD *)v3 + 4));
v5 = v4 < 0.0;
v6 = fabs(v4);
*(float *)&v4 = v6;
v7 = (int)floorf(*(float *)&v4);
*(float *)&v4 = (v6 - (double)v7) * 100.0;
v8 = (int)roundf(*(float *)&v4);
v9 = 0;
if ( v8 != 100 )
v9 = v8;
v10 = v7 + 1;
if ( v8 != 100 )
v10 = v7;
fmt::BasicWriter::BasicWriter(v37);
fmt::BasicWriter::operator<<(v37, v10);
v11 = (_BYTE *)fmt::BasicWriter::c_str(v37);
v33 = 0;
v34 = 0;
v35 = 0;
v12 = -1;
do
++v12;
while ( v11[v12] );
sub_14003A930(&v33, v11, v12);
fmt::BasicWriter::~BasicWriter(v37);
fmt::BasicWriter::BasicWriter(v36);
if ( v5 )
{
v23 = &word_140533640;
v24 = 0;
v22 = (unsigned __int64)&word_140533640;
fmt::BasicWriter::operator<<(v36, &v22);
}
fmt::BasicWriter::operator<<(v36, v10);
v22 = (unsigned __int64)&unk_14055D9E4;
fmt::BasicWriter::operator<<(v36, &v22);
if ( v9 )
{
if ( v9 < 10 )
{
v27 = "0";
v28 = 0;
v22 = (unsigned __int64)"0";
fmt::BasicWriter::operator<<(v36, &v22);
}
fmt::BasicWriter::operator<<(v36, (unsigned int)v9);
}
else
{
v25 = "00";
v26 = 0;
v22 = (unsigned __int64)"00";
fmt::BasicWriter::operator<<(v36, &v22);
}
v13 = (_BYTE *)fmt::BasicWriter::c_str(v36);
v30 = 0;
v31 = 0;
v32 = 0;
v14 = -1;
do
++v14;
while ( v13[v14] );
sub_14003A930(&v30, v13, v14);
v15 = (__int64 *)v3[3];
for ( i = (__int64 *)v3[4]; v15 != i; ++v15 )
{
v17 = *v15;
v18 = &v33;
if ( !*(_BYTE *)(*v15 + 1912) )
v18 = &v30;
v19 = sub_14003BDB0((__int64)v29, (__int64)v18);
v20 = v19;
*(_QWORD *)&v22 = v19;
if ( !*(_BYTE *)(v17 + 1928) )
{
if ( v17 + 1872 != v19 )
{
v21 = (void *)v19;
if ( *(_QWORD *)(v19 + 24) > 0xFu )
v21 = *(void **)v19;
sub_14003CCE0((void **)(v17 + 1872), v21, *(_QWORD *)(v19 + 16));
}
*(_BYTE *)(v17 + 1864) = 1;
}
sub_14003A830(v20);
}
sub_14003A830((__int64)&v30);
fmt::BasicWriter::~BasicWriter(v36);
sub_14003A830((__int64)&v33);
v3 = (__int64 *)*v3;
}
while ( v3 != (__int64 *)Myhead );
}
}