//
// PauseLayer::setupPlatformerLabels from 0x1404da5d0 to 0x1404daab6 (1254 bytes)
//
// 2 xrefs:
// > PauseLayer::customSetup @ 0x1404d6c79
// > ??> @ 0x140929978
//
// 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:33:04 +0000
//
// Hidden C++ exception states: #wind=7
void __fastcall PauseLayer::setupPlatformerLabels(__int64 a1, char a2)
{
__int64 v4; // rax
__int64 v5; // rax
char v6; // di
float v7; // xmm7_4
float v8; // xmm6_4
float v9; // xmm1_4
int v10; // eax
__int64 v11; // rax
__int64 v12; // rax
int v13; // r9d
int v14; // r8d
int v15; // r9d
int v16; // r11d
int v17; // r10d
cocos2d::CCString *v18; // rax
char *CString; // rax
size_t v20; // r8
void **v21; // rdx
cocos2d::CCString *v22; // rax
const char *v23; // rax
cocos2d::CCLabelBMFont *v24; // rbx
__int64 v25; // rdx
__m128i *v26; // rax
__int64 v27; // rax
void **v28; // rcx
cocos2d::CCLabelBMFont *v29; // rbx
void *v30; // rcx
void *v31; // rcx
float v32[2]; // [rsp+38h] [rbp-69h] BYREF
_BYTE v33[8]; // [rsp+40h] [rbp-61h] BYREF
_BYTE v34[8]; // [rsp+48h] [rbp-59h] BYREF
void *v35; // [rsp+50h] [rbp-51h] BYREF
void *v36; // [rsp+58h] [rbp-49h]
void *v37[2]; // [rsp+60h] [rbp-41h] BYREF
__int64 v38; // [rsp+70h] [rbp-31h]
unsigned __int64 v39; // [rsp+78h] [rbp-29h]
void *Block[2]; // [rsp+80h] [rbp-21h] BYREF
__int128 v41; // [rsp+90h] [rbp-11h]
__m128i v42[2]; // [rsp+A0h] [rbp-1h] BYREF
v4 = cocos2d::CCDirector::sharedDirector(a1);
cocos2d::CCDirector::getWinSize(v4, v32);
v5 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v35 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v35);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v5 = qword_14090BFD0;
}
v6 = *(_BYTE *)(*(_QWORD *)(v5 + 560) + 2152LL);
v7 = 0.80000001;
v8 = 35.0;
if ( a2 && v6 )
{
v7 = 0.64000005;
v8 = 27.0;
}
else
{
v9 = 85.0;
if ( !a2 )
goto LABEL_10;
}
v10 = 92;
if ( v6 )
v10 = 100;
v9 = (float)v10;
LABEL_10:
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v33, v32[0] * 0.5, (float)(v32[1] * 0.5) + v9);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v35, 0.0, -v8);
cocos2d::CCPoint::operator+(v33, v34, v11);
v12 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v36 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v36);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v12 = qword_14090BFD0;
}
v13 = (int)(*(double *)(*(_QWORD *)(v12 + 560) + 13920LL) * 1000.0);
v14 = v13 / 1000;
v15 = v13 % 1000;
v16 = v14 % 60;
v17 = v14 / 60 % 60;
*(_OWORD *)v37 = 0;
v38 = 0;
v39 = 15;
LOBYTE(v37[0]) = 0;
if ( v14 / 3600 )
{
v18 = cocos2d::CCString::createWithFormat("%02d:%02d:%02d.%03d", v14 / 3600, v17, v16, v15);
}
else if ( v17 )
{
v18 = cocos2d::CCString::createWithFormat("%02d:%02d.%03d", v17, v16, v15);
}
else
{
v18 = cocos2d::CCString::createWithFormat("%i.%03d", v16, v15);
}
CString = (char *)cocos2d::CCString::getCString(v18);
v20 = -1;
do
++v20;
while ( CString[v20] );
sub_1400405A0(v37, CString, v20);
v21 = v37;
if ( v39 > 0xF )
v21 = (void **)v37[0];
v22 = cocos2d::CCString::createWithFormat("Time: %s", (const char *)v21);
v23 = cocos2d::CCString::getCString(v22);
v24 = cocos2d::CCLabelBMFont::create(v23, "goldFont.fnt");
(*(void (__fastcall **)(_QWORD, cocos2d::CCLabelBMFont *, __int64))(**(_QWORD **)(a1 + 632) + 456LL))(
*(_QWORD *)(a1 + 632),
v24,
3);
(*(void (__fastcall **)(cocos2d::CCLabelBMFont *, _BYTE *))(*(_QWORD *)v24 + 184LL))(v24, v33);
cocos2d::CCLabelBMFont::limitLabelWidth(v24, 150.0, v7, 0.0);
if ( v6 )
{
v25 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v36 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v36);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v25 = qword_14090BFD0;
}
v26 = GameToolbox::pointsToString(v42, *(_DWORD *)(*(_QWORD *)(v25 + 560) + 2148LL));
v27 = sub_140059D70(v26, 0, "Points: ", 8u);
*(_OWORD *)Block = 0;
v41 = 0u;
*(_OWORD *)Block = *(_OWORD *)v27;
v41 = *(_OWORD *)(v27 + 16);
*(_QWORD *)(v27 + 16) = 0;
*(_QWORD *)(v27 + 24) = 15;
*(_BYTE *)v27 = 0;
sub_14003D310((__int64)v42);
v28 = Block;
if ( *((_QWORD *)&v41 + 1) > 0xFu )
v28 = (void **)Block[0];
v29 = cocos2d::CCLabelBMFont::create((const char *)v28, "goldFont.fnt");
(*(void (__fastcall **)(_QWORD, cocos2d::CCLabelBMFont *, __int64))(**(_QWORD **)(a1 + 632) + 456LL))(
*(_QWORD *)(a1 + 632),
v29,
3);
(*(void (__fastcall **)(cocos2d::CCLabelBMFont *, _BYTE *))(*(_QWORD *)v29 + 184LL))(v29, v34);
cocos2d::CCLabelBMFont::limitLabelWidth(v29, 150.0, v7, 0.0);
if ( *((_QWORD *)&v41 + 1) > 0xFu )
{
v30 = Block[0];
if ( (unsigned __int64)(*((_QWORD *)&v41 + 1) + 1LL) >= 0x1000 )
{
v30 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v30 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v30);
}
}
if ( v39 > 0xF )
{
v31 = v37[0];
if ( v39 + 1 >= 0x1000 )
{
v31 = *((void **)v37[0] - 1);
if ( (unsigned __int64)((char *)v37[0] - (char *)v31 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v31);
}
}