//
// sub_10057DA60 from 0x10057da60 to 0x10057dda0 (832 bytes)
//
// 1 xrefs:
// > PlatformerControlsPopup::FLAlert_Clicked @ 0x100960230
//
// 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:19 +0000
//
bool __fastcall sub_10057DA60(__int64 a1, int a2)
{
std::string *v2; // rax
__int64 v3; // rbx
__int64 v4; // r14
void *v5; // rax
__int64 v6; // rax
__int64 v7; // rax
const std::string::value_type *CString; // rax
const char *data; // r15
size_t v10; // rax
size_t v11; // r12
char *v12; // r13
char *v13; // r15
size_t v14; // r14
size_t v15; // rax
size_t v16; // r12
char *v17; // r13
size_t v18; // r14
char v20; // [rsp+0h] [rbp-C0h]
std::string v21; // [rsp+18h] [rbp-A8h] BYREF
_QWORD __dst[2]; // [rsp+30h] [rbp-90h] BYREF
void *v23; // [rsp+40h] [rbp-80h]
__int128 v24; // [rsp+48h] [rbp-78h] BYREF
void *__p; // [rsp+58h] [rbp-68h]
__int128 v26; // [rsp+60h] [rbp-60h] BYREF
char *__s; // [rsp+70h] [rbp-50h]
std::string v28; // [rsp+80h] [rbp-40h] BYREF
std::to_string(&v28, a2);
v2 = std::string::insert(&v28, 0, "lctrldel_");
__s = v2->__r_.__value_.__l.__data_;
v26 = *(_OWORD *)&v2->__r_.__value_.__l.0;
*(_OWORD *)&v2->__r_.__value_.__l.0 = 0;
v2->__r_.__value_.__r.__words[2] = 0;
if ( (*(_BYTE *)&v28.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v28.__r_.__value_.__l.__data_);
v3 = cocos2d::CCDictionary::objectForKey(*(_QWORD *)(a1 + 1088), (char *)&v26);
if ( v3 )
goto LABEL_30;
v4 = *(_QWORD *)(a1 + 1088);
v5 = cocos2d::CCNode::create();
cocos2d::CCDictionary::setObject(v4, (__int64)v5, (char *)&v26);
GameLevelManager::getBasePostString(&v28);
v6 = sub_10088E820("%c%s%s%c%c%s", (char)"7");
cocos2d::CCString::getCString(v6);
v7 = sub_10088E820("&levelID=%i&secret=%s", v20);
CString = (const std::string::value_type *)cocos2d::CCString::getCString(v7);
std::string::append(&v28, CString);
v21.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x40u);
v21.__r_.__value_.__r.__words[0] = 65;
v21.__r_.__value_.__l.__size_ = 60;
strcpy(v21.__r_.__value_.__l.__data_, "https://www.boomlings.com/database/deleteGJLevelControls.php");
if ( (*(_BYTE *)&v28.__r_.__value_.__s.0 & 1) != 0 )
data = v28.__r_.__value_.__l.__data_;
else
data = v28.__r_.__value_.__s.__data_;
v10 = strlen(data);
if ( v10 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v11 = v10;
if ( v10 >= 0x17 )
{
v14 = 26;
if ( (v10 | 7) != 0x17 )
v14 = (v10 | 7) + 1;
v12 = (char *)operator new(v14);
v23 = v12;
__dst[0] = v14 | 1;
__dst[1] = v11;
LABEL_15:
memmove(v12, data, v11);
v12[v11] = 0;
if ( (v26 & 1) != 0 )
goto LABEL_11;
goto LABEL_16;
}
LOBYTE(__dst[0]) = 2 * v10;
v12 = (char *)__dst + 1;
if ( v10 )
goto LABEL_15;
BYTE1(__dst[0]) = 0;
if ( (v26 & 1) != 0 )
{
LABEL_11:
v13 = __s;
goto LABEL_17;
}
LABEL_16:
v13 = (char *)&v26 + 1;
LABEL_17:
v15 = strlen(v13);
if ( v15 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v16 = v15;
if ( v15 >= 0x17 )
{
v18 = 26;
if ( (v15 | 7) != 0x17 )
v18 = (v15 | 7) + 1;
v17 = (char *)operator new(v18);
__p = v17;
*(_QWORD *)&v24 = v18 | 1;
*((_QWORD *)&v24 + 1) = v16;
goto LABEL_24;
}
LOBYTE(v24) = 2 * v15;
v17 = (char *)&v24 + 1;
if ( v15 )
LABEL_24:
memmove(v17, v13, v16);
v17[v16] = 0;
GameLevelManager::ProcessHttpRequest(a1, &v21, (__int64)__dst, &v24, 0x1Du);
if ( (v24 & 1) == 0 )
{
if ( (__dst[0] & 1) == 0 )
goto LABEL_27;
LABEL_34:
operator delete(v23);
if ( (*(_BYTE *)&v21.__r_.__value_.__s.0 & 1) == 0 )
{
LABEL_28:
if ( (*(_BYTE *)&v28.__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 *)&v21.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_28;
LABEL_35:
operator delete(v21.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v28.__r_.__value_.__s.0 & 1) != 0 )
LABEL_29:
operator delete(v28.__r_.__value_.__l.__data_);
LABEL_30:
if ( (v26 & 1) != 0 )
operator delete(__s);
return v3 == 0;
}