//
// sub_10055EFA0 from 0x10055efa0 to 0x10055f12d (397 bytes)
//
// 5 xrefs:
// > GameLevelManager::downloadLevel @ 0x10055e6cb
// > GameLevelManager::claimNotificationReward @ 0x100577067
// > GameLevelManager::getGJSecretReward @ 0x10057fc12
// > GameLevelManager::getGJRewards @ 0x10058028c
// > GameLevelManager::getGJDailyLevelState @ 0x100580b00
//
// 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:08 +0000
//
std::string *__fastcall sub_10055EFA0(std::string *a1)
{
__int64 v1; // rax
const char *CString; // r15
size_t v3; // rax
std::string::size_type v4; // r14
char *data; // r12
size_t v6; // r13
const std::string::value_type *v7; // rsi
std::string::size_type size; // rdx
std::string *v9; // rax
char v11; // [rsp+0h] [rbp-90h]
std::string v12; // [rsp+8h] [rbp-88h] BYREF
__int128 v13; // [rsp+20h] [rbp-70h] BYREF
void *__p; // [rsp+30h] [rbp-60h]
std::string v15; // [rsp+38h] [rbp-58h] BYREF
std::string __dst[2]; // [rsp+50h] [rbp-40h] BYREF
GameManager::sharedState();
v1 = sub_10088E820("%i", v11);
CString = (const char *)cocos2d::CCString::getCString(v1);
v3 = strlen(CString);
if ( v3 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v4 = v3;
if ( v3 >= 0x17 )
{
v6 = 26;
if ( (v3 | 7) != 0x17 )
v6 = (v3 | 7) + 1;
data = (char *)operator new(v6);
__dst[0].__r_.__value_.__r.__words[2] = (std::string::size_type)data;
__dst[0].__r_.__value_.__r.__words[0] = v6 + 1;
__dst[0].__r_.__value_.__l.__size_ = v4;
goto LABEL_8;
}
__dst[0].__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v3);
data = __dst[0].__r_.__value_.__s.__data_;
if ( v3 )
LABEL_8:
memmove(data, CString, v4);
data[v4] = 0;
strcpy((char *)&v13, "\n59182");
cocos2d::ZipUtils::base64EncodeEnc(&v15, __dst, &v13);
if ( (v13 & 1) != 0 )
operator delete(__p);
sub_10051B980(&v12, 5);
if ( (*(_BYTE *)&v15.__r_.__value_.__s.0 & 1) != 0 )
{
v7 = v15.__r_.__value_.__l.__data_;
size = v15.__r_.__value_.__l.__size_;
}
else
{
size = *(_BYTE *)&v15.__r_.__value_.__l.0 >> 1;
v7 = v15.__r_.__value_.__s.__data_;
}
v9 = std::string::append(&v12, v7, size);
*a1 = *v9;
*(_OWORD *)&v9->__r_.__value_.__l.0 = 0;
v9->__r_.__value_.__r.__words[2] = 0;
if ( (*(_BYTE *)&v12.__r_.__value_.__s.0 & 1) == 0 )
{
if ( (*(_BYTE *)&v15.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_16;
LABEL_20:
operator delete(v15.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&__dst[0].__r_.__value_.__s.0 & 1) == 0 )
return a1;
goto LABEL_17;
}
operator delete(v12.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v15.__r_.__value_.__s.0 & 1) != 0 )
goto LABEL_20;
LABEL_16:
if ( (*(_BYTE *)&__dst[0].__r_.__value_.__s.0 & 1) != 0 )
LABEL_17:
operator delete(__dst[0].__r_.__value_.__l.__data_);
return a1;
}