//
// sub_1005863E0 from 0x1005863e0 to 0x10058653c (348 bytes)
//
// 2 xrefs:
// > PlayLayer::levelComplete @ 0x10008151d
// > sub_100586770 @ 0x1005867fb
//
// 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:32:22 +0000
//
std::string *__fastcall sub_1005863E0(__int64 a1, std::string *a2, int a3, int a4)
{
char v4; // al
int v5; // eax
int v6; // r14d
std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0 v7; // r12
char v8; // r13
std::string::size_type v9; // r15
std::string::pointer data; // rax
std::string::size_type v11; // r15
std::string::size_type v12; // rax
std::string::pointer v13; // rcx
__int64 v14; // rax
const std::string::value_type *CString; // rax
char v17; // [rsp+0h] [rbp-30h]
v17 = v4;
v5 = 100;
if ( a3 < 100 )
v5 = a3;
v6 = 0;
if ( v5 > 0 )
v6 = v5;
v7 = a2->__r_.__value_.__s.0;
v8 = *(_BYTE *)&a2->__r_.__value_.__s.0 & 1;
if ( !a4 )
goto LABEL_17;
if ( v8 )
{
if ( !a2->__r_.__value_.__l.__size_ )
goto LABEL_17;
}
else if ( !(*(unsigned __int8 *)&v7 >> 1) )
{
goto LABEL_17;
}
v9 = std::string::rfind(a2, 44, 0xFFFFFFFFFFFFFFFFLL);
v7 = a2->__r_.__value_.__s.0;
data = a2->__r_.__value_.__s.__data_;
v17 = (_BYTE)a2 + 1;
v8 = *(_BYTE *)&a2->__r_.__value_.__s.0 & 1;
if ( v8 )
data = a2->__r_.__value_.__l.__data_;
if ( atoi(&data[v9 + 1]) != v6 )
{
LABEL_17:
if ( v8 )
{
if ( !a2->__r_.__value_.__l.__size_ )
goto LABEL_22;
}
else if ( !(*(unsigned __int8 *)&v7 >> 1) )
{
LABEL_22:
v14 = sub_10088E820("%i", v17);
goto LABEL_23;
}
std::string::append(a2, ",");
goto LABEL_22;
}
v11 = v9 + 1;
v12 = std::string::find(a2, 120, v11);
if ( v12 != -1 )
{
v13 = a2->__r_.__value_.__s.__data_;
if ( (*(_BYTE *)&a2->__r_.__value_.__s.0 & 1) != 0 )
v13 = a2->__r_.__value_.__l.__data_;
atoi(&v13[v12 + 1]);
}
std::string::erase(a2, v11, 0xFFFFFFFFFFFFFFFFLL);
v14 = sub_10088E820("%ix%i", v17);
LABEL_23:
CString = (const std::string::value_type *)cocos2d::CCString::getCString(v14);
return std::string::append(a2, CString);
}