//
// sub_100556E80 from 0x100556e80 to 0x1005571d8 (856 bytes)
//
// 2 xrefs:
// > GameLevelManager::onUploadLevelCompleted @ 0x100522a5b
// > sub_10095E5D0 @ 0x10095e765
//
// 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:05 +0000
//
bool __fastcall sub_100556E80(__int64 a1, int a2, __int64 a3)
{
std::string *v4; // rax
__int64 v5; // rbx
__int64 v6; // r14
__int64 v7; // rax
__int64 v8; // rax
__int64 v9; // rax
const std::string::value_type *CString; // rax
const char *data; // r15
size_t v12; // rax
size_t v13; // r12
char *v14; // r13
char *v15; // r15
size_t v16; // r14
size_t v17; // rax
size_t v18; // r12
char *v19; // r13
size_t v20; // r14
char v22; // [rsp+0h] [rbp-C0h]
std::string v23; // [rsp+18h] [rbp-A8h] BYREF
_QWORD __dst[2]; // [rsp+30h] [rbp-90h] BYREF
void *v25; // [rsp+40h] [rbp-80h]
__int128 v26; // [rsp+48h] [rbp-78h] BYREF
void *__p; // [rsp+58h] [rbp-68h]
__int128 v28; // [rsp+60h] [rbp-60h] BYREF
char *__s; // [rsp+70h] [rbp-50h]
std::string v30; // [rsp+80h] [rbp-40h] BYREF
std::to_string(&v30, a2);
v4 = std::string::insert(&v30, 0, "lctrlup_");
__s = v4->__r_.__value_.__l.__data_;
v28 = *(_OWORD *)&v4->__r_.__value_.__l.0;
*(_OWORD *)&v4->__r_.__value_.__l.0 = 0;
v4->__r_.__value_.__r.__words[2] = 0;
if ( (*(_BYTE *)&v30.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v30.__r_.__value_.__l.__data_);
v5 = cocos2d::CCDictionary::objectForKey(*(_QWORD *)(a1 + 1088), (char *)&v28);
if ( v5 )
goto LABEL_30;
v6 = *(_QWORD *)(a1 + 1088);
v7 = sub_10088E600(a3);
cocos2d::CCDictionary::setObject(v6, v7, (char *)&v28);
GameLevelManager::getBasePostString(&v30);
v8 = sub_10088E820("%c%s%s%c%c%s", (char)"7");
cocos2d::CCString::getCString(v8);
v9 = sub_10088E820("&levelID=%i&data=%s&secret=%s", v22);
CString = (const std::string::value_type *)cocos2d::CCString::getCString(v9);
std::string::append(&v30, CString);
v23.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x40u);
v23.__r_.__value_.__r.__words[0] = 65;
v23.__r_.__value_.__l.__size_ = 60;
strcpy(v23.__r_.__value_.__l.__data_, "https://www.boomlings.com/database/uploadGJLevelControls.php");
if ( (*(_BYTE *)&v30.__r_.__value_.__s.0 & 1) != 0 )
data = v30.__r_.__value_.__l.__data_;
else
data = v30.__r_.__value_.__s.__data_;
v12 = strlen(data);
if ( v12 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v13 = v12;
if ( v12 >= 0x17 )
{
v16 = 26;
if ( (v12 | 7) != 0x17 )
v16 = (v12 | 7) + 1;
v14 = (char *)operator new(v16);
v25 = v14;
__dst[0] = v16 | 1;
__dst[1] = v13;
LABEL_15:
memmove(v14, data, v13);
v14[v13] = 0;
if ( (v28 & 1) != 0 )
goto LABEL_11;
goto LABEL_16;
}
LOBYTE(__dst[0]) = 2 * v12;
v14 = (char *)__dst + 1;
if ( v12 )
goto LABEL_15;
BYTE1(__dst[0]) = 0;
if ( (v28 & 1) != 0 )
{
LABEL_11:
v15 = __s;
goto LABEL_17;
}
LABEL_16:
v15 = (char *)&v28 + 1;
LABEL_17:
v17 = strlen(v15);
if ( v17 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v18 = v17;
if ( v17 >= 0x17 )
{
v20 = 26;
if ( (v17 | 7) != 0x17 )
v20 = (v17 | 7) + 1;
v19 = (char *)operator new(v20);
__p = v19;
*(_QWORD *)&v26 = v20 | 1;
*((_QWORD *)&v26 + 1) = v18;
goto LABEL_24;
}
LOBYTE(v26) = 2 * v17;
v19 = (char *)&v26 + 1;
if ( v17 )
LABEL_24:
memmove(v19, v15, v18);
v19[v18] = 0;
GameLevelManager::ProcessHttpRequest(a1, &v23, (__int64)__dst, &v26, 0x1Cu);
if ( (v26 & 1) == 0 )
{
if ( (__dst[0] & 1) == 0 )
goto LABEL_27;
LABEL_34:
operator delete(v25);
if ( (*(_BYTE *)&v23.__r_.__value_.__s.0 & 1) == 0 )
{
LABEL_28:
if ( (*(_BYTE *)&v30.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_30;
goto LABEL_29;
}
goto LABEL_35;
}
operator delete(__p);
if ( (__dst[0] & 1) != 0 )
goto LABEL_34;
LABEL_27:
if ( (*(_BYTE *)&v23.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_28;
LABEL_35:
operator delete(v23.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v30.__r_.__value_.__s.0 & 1) != 0 )
LABEL_29:
operator delete(v30.__r_.__value_.__l.__data_);
LABEL_30:
if ( (v28 & 1) != 0 )
operator delete(__s);
return v5 == 0;
}