//
// GameLevelManager::getGauntletLevels from 0x81fb04 to 0x81fe3c (824 bytes)
//
// 2 xrefs:
// > GauntletLayer::init @ 0xa79bf0
// > ??> @ 0x80128
//
// 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:00 +0000
//
__int64 __fastcall GameLevelManager::getGauntletLevels(GameLevelManager *this, const char *a2)
{
unsigned int v3; // w23
char *v4; // x1
char *v5; // x1
cocos2d::CCString *v6; // x0
size_t v7; // x0
cocos2d::CCString *v8; // x0
size_t v9; // x0
const char *v10; // x1
size_t v11; // x0
char *v12; // x1
size_t v13; // x0
char *CString; // [xsp+48h] [xbp+48h]
char *v16; // [xsp+48h] [xbp+48h]
char *v17; // [xsp+48h] [xbp+48h]
char *v18; // [xsp+48h] [xbp+48h]
__int64 v19[2]; // [xsp+58h] [xbp+58h] BYREF
char *v20; // [xsp+68h] [xbp+68h]
__int64 v21[2]; // [xsp+70h] [xbp+70h] BYREF
void *v22; // [xsp+80h] [xbp+80h]
__int64 v23[2]; // [xsp+88h] [xbp+88h] BYREF
void *v24; // [xsp+98h] [xbp+98h]
__int64 v25[3]; // [xsp+A0h] [xbp+A0h] BYREF
__int64 v26[2]; // [xsp+B8h] [xbp+B8h] BYREF
void *v27; // [xsp+C8h] [xbp+C8h]
__int64 v28[2]; // [xsp+D0h] [xbp+D0h] BYREF
void *v29; // [xsp+E0h] [xbp+E0h]
v3 = (unsigned int)a2;
GameLevelManager::getGauntletSearchKey(a2, v19);
v4 = (char *)v19 + 1;
if ( (v19[0] & 1) != 0 )
v4 = v20;
if ( !GameLevelManager::isDLActive(this, v4) )
{
v5 = (char *)v19 + 1;
if ( (v19[0] & 1) != 0 )
v5 = v20;
GameLevelManager::addDLToActive(this, v5);
GameLevelManager::getBasePostString(v21);
std::string::append((__int64)v21, "&gauntlet=", 0xAu);
v6 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", (const char *)v3);
CString = (char *)cocos2d::CCString::getCString(v6);
v7 = strlen(CString);
std::string::append((__int64)v21, CString, v7);
std::string::append((__int64)v21, "&secret=", 8u);
v8 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%c%s%s%c%c%s",
(const char *)off_50 + 7,
"mfd",
"2893",
103,
98,
"7");
v16 = (char *)cocos2d::CCString::getCString(v8);
v9 = strlen(v16);
std::string::append((__int64)v21, v16, v9);
v23[0] = 0;
v23[1] = 0;
v24 = nullptr;
std::string::__init(v23, "aHR0cDovL3d3dy5ib29tbGluZ3MuY29tL2RhdGFiYXNlL2dldEdKTGV2ZWxzMjEucGhw", 0x44u);
LevelTools::base64DecodeString((__int64)v23, v25);
v10 = (char *)v21 + 1;
if ( (v21[0] & 1) != 0 )
v10 = (const char *)v22;
v17 = (char *)v10;
v26[0] = 0;
v26[1] = 0;
v27 = nullptr;
v11 = strlen(v10);
std::string::__init(v26, v17, v11);
v12 = (char *)v19 + 1;
if ( (v19[0] & 1) != 0 )
v12 = v20;
v18 = v12;
v28[0] = 0;
v28[1] = 0;
v29 = nullptr;
v13 = strlen(v12);
std::string::__init(v28, v18, v13);
GameLevelManager::ProcessHttpRequest(this, v25, (__int64)v26, (char *)v28, 2);
if ( (v28[0] & 1) != 0 )
{
operator delete(v29);
if ( (v26[0] & 1) == 0 )
{
LABEL_12:
if ( (v25[0] & 1) == 0 )
goto LABEL_13;
goto LABEL_18;
}
}
else if ( (v26[0] & 1) == 0 )
{
goto LABEL_12;
}
operator delete(v27);
if ( (v25[0] & 1) == 0 )
{
LABEL_13:
if ( (v23[0] & 1) == 0 )
goto LABEL_14;
goto LABEL_19;
}
LABEL_18:
operator delete((void *)v25[2]);
if ( (v23[0] & 1) == 0 )
{
LABEL_14:
if ( (v21[0] & 1) == 0 )
goto LABEL_15;
LABEL_20:
operator delete(v22);
goto LABEL_15;
}
LABEL_19:
operator delete(v24);
if ( (v21[0] & 1) == 0 )
goto LABEL_15;
goto LABEL_20;
}
LABEL_15:
if ( (v19[0] & 1) != 0 )
operator delete(v20);
return _stack_chk_guard;
}