//
// sub_1004F5CB0 from 0x1004f5cb0 to 0x1004f5df0 (320 bytes)
//
// 1 xrefs:
// > sub_1009269F0 @ 0x100926f66
//
// 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 12:31:26 +0000
//
__int64 __fastcall sub_1004F5CB0(__int64 a1, int a2)
{
std::string *v2; // rax
const std::string::value_type *v3; // rsi
std::string::size_type v4; // rdx
std::string *v5; // rax
std::string v7; // [rsp+8h] [rbp-68h] BYREF
std::string v8; // [rsp+20h] [rbp-50h] BYREF
size_t v9[2]; // [rsp+38h] [rbp-38h] BYREF
void *__p; // [rsp+48h] [rbp-28h]
if ( a2 <= 0 )
{
*(_BYTE *)a1 = 4;
strcpy((char *)(a1 + 1), "NA");
return a1;
}
if ( a2 != 10 )
{
if ( (unsigned int)a2 < 0x12 )
{
GameToolbox::intToString((size_t *)a1, a2);
return a1;
}
GameToolbox::intToString((size_t *)&v7, (a2 - 10) / 0xAu + 1);
v2 = std::string::append(&v7, ".");
v8 = *v2;
*(_OWORD *)&v2->__r_.__value_.__l.0 = 0;
v2->__r_.__value_.__r.__words[2] = 0;
GameToolbox::intToString(v9, (a2 - 10) % 0xAu);
if ( (v9[0] & 1) != 0 )
{
v3 = (const std::string::value_type *)__p;
v4 = v9[1];
}
else
{
v4 = LOBYTE(v9[0]) >> 1;
v3 = (char *)v9 + 1;
}
v5 = std::string::append(&v8, v3, v4);
*(std::string *)a1 = *v5;
*(_OWORD *)&v5->__r_.__value_.__l.0 = 0;
v5->__r_.__value_.__r.__words[2] = 0;
if ( (v9[0] & 1) != 0 )
{
operator delete(__p);
if ( (*(_BYTE *)&v8.__r_.__value_.__s.0 & 1) == 0 )
{
LABEL_12:
if ( (*(_BYTE *)&v7.__r_.__value_.__s.0 & 1) == 0 )
return a1;
LABEL_13:
operator delete(v7.__r_.__value_.__l.__data_);
return a1;
}
}
else if ( (*(_BYTE *)&v8.__r_.__value_.__s.0 & 1) == 0 )
{
goto LABEL_12;
}
operator delete(v8.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v7.__r_.__value_.__s.0 & 1) == 0 )
return a1;
goto LABEL_13;
}
*(_BYTE *)a1 = 6;
*(_DWORD *)(a1 + 1) = 3616305;
return a1;
}