//
// GameLevelManager::uploadLevelControls from 0x835af4 to 0x835e2c (824 bytes)
//
// 3 xrefs:
// > GameLevelManager::onUploadLevelCompleted @ 0x836018
// > PlatformerControlsPopup::onUpload @ 0xcfc32c
// > ??> @ 0xa4a40
//
// This function is hookable on this platform (idp: arm, 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:55:10 +0000
//
__int64 __fastcall GameLevelManager::uploadLevelControls(cocos2d::CCObject *a1, unsigned int a2, __int64 a3)
{
_QWORD *v6; // x0
__int64 v7; // x3
unsigned int v8; // w23
__int64 v10; // x23
cocos2d::CCObject *v11; // x0
__int64 v12; // x26
cocos2d::CCString *v13; // x0
__int64 CString; // x0
cocos2d::CCString *v15; // x0
size_t v16; // x0
const char *v17; // x1
size_t v18; // x0
const char *v19; // x1
size_t v20; // x0
char *v21; // [xsp+58h] [xbp+58h]
char *v22; // [xsp+58h] [xbp+58h]
char *v23; // [xsp+58h] [xbp+58h]
_QWORD v24[2]; // [xsp+60h] [xbp+60h] BYREF
void *v25; // [xsp+70h] [xbp+70h]
__int64 v26[2]; // [xsp+78h] [xbp+78h] BYREF
void *v27; // [xsp+88h] [xbp+88h]
__int64 v28[2]; // [xsp+90h] [xbp+90h] BYREF
void *v29; // [xsp+A0h] [xbp+A0h]
__int64 v30[2]; // [xsp+A8h] [xbp+A8h] BYREF
void *v31; // [xsp+B8h] [xbp+B8h]
__int64 v32[2]; // [xsp+C0h] [xbp+C0h] BYREF
void *v33; // [xsp+D0h] [xbp+D0h]
std::to_string(v32, a2);
v6 = std::string::insert(v32, 0, "lctrlup_", 8u);
v7 = v6[1];
v24[0] = *v6;
v24[1] = v7;
v25 = (void *)v6[2];
*v6 = 0;
v6[1] = 0;
v6[2] = 0;
if ( (v32[0] & 1) != 0 )
operator delete(v33);
v8 = 0;
if ( !cocos2d::CCDictionary::objectForKey(*((_QWORD *)a1 + 136), v24) )
{
v10 = *((_QWORD *)a1 + 136);
v11 = (cocos2d::CCObject *)cocos2d::CCString::create(a3);
cocos2d::CCDictionary::setObject(v10, v11);
GameLevelManager::getBasePostString(v26);
v12 = a3 + 1;
if ( (*(_BYTE *)a3 & 1) != 0 )
v12 = *(_QWORD *)(a3 + 16);
v13 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%c%s%s%c%c%s",
(const char *)off_50 + 7,
"mfd",
"2893",
103,
98,
"7");
CString = cocos2d::CCString::getCString(v13);
v15 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"&levelID=%i&data=%s&secret=%s",
(const char *)a2,
v12,
CString);
v21 = (char *)cocos2d::CCString::getCString(v15);
v16 = strlen(v21);
std::string::append((__int64)v26, v21, v16);
v28[0] = 0;
v28[1] = 0;
v29 = nullptr;
std::string::__init(v28, "https://www.boomlings.com/database/uploadGJLevelControls.php", 0x3Cu);
v17 = (char *)v26 + 1;
if ( (v26[0] & 1) != 0 )
v17 = (const char *)v27;
v22 = (char *)v17;
v30[0] = 0;
v30[1] = 0;
v31 = nullptr;
v18 = strlen(v17);
std::string::__init(v30, v22, v18);
v19 = (char *)v24 + 1;
if ( (v24[0] & 1) != 0 )
v19 = (const char *)v25;
v23 = (char *)v19;
v32[0] = 0;
v32[1] = 0;
v33 = nullptr;
v20 = strlen(v19);
std::string::__init(v32, v23, v20);
GameLevelManager::ProcessHttpRequest(a1, v28, (__int64)v30, (char *)v32, 28);
if ( (v32[0] & 1) != 0 )
operator delete(v33);
if ( (v30[0] & 1) != 0 )
operator delete(v31);
if ( (v28[0] & 1) != 0 )
operator delete(v29);
v8 = 1;
if ( (v26[0] & 1) != 0 )
operator delete(v27);
}
if ( (v24[0] & 1) != 0 )
operator delete(v25);
return v8;
}