//
// GameToolbox::pointsToString from 0x1004f7ab0 to 0x1004f7d84 (724 bytes)
//
// 38 xrefs:
// > GJBaseGameLayer::updateSpecialLabels @ 0x100155fda
// > GJScoreCell::loadFromScore @ 0x100249e36
// > GJScoreCell::loadFromScore @ 0x100249fe3
// > GJScoreCell::loadFromScore @ 0x10024a1cc
// > GJScoreCell::loadFromScore @ 0x10024a35e
// > GJScoreCell::loadFromScore @ 0x10024a529
// > GJScoreCell::loadFromScore @ 0x10024a700
// > GJScoreCell::loadFromScore @ 0x10024a8f0
// > GJLevelScoreCell::loadFromScore @ 0x10024b1f9
// > GJLocalLevelScoreCell::loadFromScore @ 0x10024b73e
// > LevelInfoLayer::setupPlatformerStats @ 0x1002c0efa
// > LevelInfoLayer::updateLabelValues @ 0x1002c2ed1
// > LevelInfoLayer::updateLabelValues @ 0x1002c2f8e
// > GJPathPage::init @ 0x10030077c
// > GJShopLayer::init @ 0x1003240f4
// > PurchaseItemPopup::init @ 0x100327deb
// > PauseLayer::setupProgressBars @ 0x1003d700c
// > EndLevelLayer::customSetup @ 0x1004c0715
// > ProfilePage::loadPageFromUserInfo @ 0x1007ba173
// > ProfilePage::onInfo @ 0x1007bd08b
// > ProfilePage::onInfo @ 0x1007bd0b4
// > ProfilePage::onInfo @ 0x1007bd0e6
// > ProfilePage::onInfo @ 0x1007bd118
// > ProfilePage::onInfo @ 0x1007bd15e
// > ProfilePage::onInfo @ 0x1007bd18d
// > ProfilePage::onInfo @ 0x1007bd29a
// > DemonInfoPopup::init @ 0x1007c1575
// > DemonInfoPopup::init @ 0x1007c160c
// > DemonInfoPopup::init @ 0x1007c18b2
// > DemonInfoPopup::init @ 0x1007c194a
// > DemonInfoPopup::init @ 0x1007c1ae7
// > DemonInfoPopup::init @ 0x1007c1bb1
// > StarInfoPopup::init @ 0x1007c213a
// > StarInfoPopup::init @ 0x1007c229c
// > StarInfoPopup::init @ 0x1007c23f8
// > StarInfoPopup::init @ 0x1007c24f2
// > StarInfoPopup::init @ 0x1007c25bb
// > StarInfoPopup::init @ 0x1007c2684
//
// 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
//
size_t *__fastcall GameToolbox::pointsToString(size_t *a1, int a2, double a3)
{
int v3; // r15d
size_t *v4; // r12
int v5; // esi
double v6; // xmm0_8
int v7; // ebx
unsigned int v8; // eax
int v9; // r14d
int v10; // r13d
char *v11; // rax
unsigned int v12; // edx
size_t v13; // r13
unsigned __int64 v14; // r14
char v15; // bl
char *v16; // r15
int v17; // r14d
const void *v18; // rsi
unsigned int v19; // r13d
unsigned int v20; // ecx
bool v21; // cf
int v22; // ebx
size_t v23; // r12
_BYTE *v24; // rax
int v26; // [rsp+8h] [rbp-98h]
__int64 v27; // [rsp+18h] [rbp-88h]
size_t v28; // [rsp+20h] [rbp-80h] BYREF
int v29; // [rsp+28h] [rbp-78h]
void *__p; // [rsp+30h] [rbp-70h]
int v31; // [rsp+3Ch] [rbp-64h]
unsigned int v32; // [rsp+40h] [rbp-60h]
unsigned int v33; // [rsp+44h] [rbp-5Ch]
size_t *v34; // [rsp+48h] [rbp-58h]
__int128 __dst; // [rsp+50h] [rbp-50h] BYREF
_BYTE *v36; // [rsp+60h] [rbp-40h]
int v37; // [rsp+74h] [rbp-2Ch]
v3 = a2;
v4 = a1;
if ( (unsigned int)(a2 + 999) <= 0x7CE )
{
GameToolbox::intToString(a1, a2, a3);
return v4;
}
v5 = -a2;
if ( v3 > 0 )
v5 = v3;
GameToolbox::intToString(&v28, v5, a3);
v6 = 0.0;
*(_OWORD *)a1 = 0;
a1[2] = 0;
if ( (v28 & 1) == 0 )
{
v7 = (unsigned __int8)v28 >> 1;
v8 = v7 - 1;
v34 = a1;
if ( v7 - 1 < 0 )
goto LABEL_33;
goto LABEL_9;
}
v7 = v29;
v8 = v29 - 1;
v34 = a1;
if ( v29 - 1 >= 0 )
{
LABEL_9:
v27 = v8;
v9 = -1;
v10 = 1;
v26 = v3;
while ( 1 )
{
v31 = v7;
v11 = (char *)&v28 + 1;
if ( (v28 & 1) != 0 )
v11 = (char *)__p;
v32 = v10;
v12 = *(unsigned __int8 *)v4;
v37 = v9;
if ( (v12 & 1) != 0 )
v13 = v4[1];
else
v13 = v12 >> 1;
v14 = v13 + 1;
if ( v13 + 1 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(v6);
v15 = v11[v27];
if ( v14 >= 0x17 )
break;
__dst = 0;
v36 = nullptr;
LOBYTE(__dst) = 2 * v14;
BYTE1(__dst) = v15;
v16 = (char *)&__dst + 2;
v17 = v37;
if ( v13 )
{
v18 = (char *)a1 + 1;
if ( (v12 & 1) != 0 )
goto LABEL_21;
goto LABEL_22;
}
LABEL_23:
v16[v13] = 0;
if ( (*(_BYTE *)v4 & 1) != 0 )
operator delete((void *)v4[2]);
v19 = v32;
v20 = v17 + 3 * (v32 / 3);
v4[2] = (size_t)v36;
v6 = *(double *)&__dst;
*(_OWORD *)v4 = __dst;
v21 = v27-- != 0;
v3 = v26;
v22 = v31;
if ( !v20 && v21 )
{
std::operator+(&__dst, ",", v4);
if ( (*(_BYTE *)v4 & 1) != 0 )
operator delete((void *)v4[2]);
v4[2] = (size_t)v36;
v6 = *(double *)&__dst;
*(_OWORD *)v4 = __dst;
}
v9 = v17 - 1;
v10 = v19 + 1;
v7 = v22 - 1;
if ( !v7 )
goto LABEL_33;
}
v33 = v12;
v23 = (v14 | 7) + 1;
if ( (v14 | 7) == 0x17 )
v23 = 26;
v24 = operator new(v23);
*(_QWORD *)&__dst = v23 | 1;
v36 = v24;
*((_QWORD *)&__dst + 1) = v13 + 1;
*v24 = v15;
v16 = v24 + 1;
v4 = v34;
v17 = v37;
v18 = (char *)a1 + 1;
if ( (v33 & 1) != 0 )
LABEL_21:
v18 = (const void *)v4[2];
LABEL_22:
memmove(v16, v18, v13);
goto LABEL_23;
}
LABEL_33:
if ( v3 >= 0 )
{
if ( (v28 & 1) == 0 )
return v4;
LABEL_35:
operator delete(__p);
return v4;
}
std::operator+(&__dst, "-", v4);
if ( (*(_BYTE *)v4 & 1) != 0 )
operator delete((void *)v4[2]);
v4[2] = (size_t)v36;
*(_OWORD *)v4 = __dst;
if ( (v28 & 1) != 0 )
goto LABEL_35;
return v4;
}