//
// GameLevelManager::getGauntletLevels from 0x140151ab0 to 0x140151df8 (840 bytes)
//
// 2 xrefs:
// > GauntletLayer::init @ 0x1401f68a0
// > ??> @ 0x1406ca884
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
// Hidden C++ exception states: #wind=5
void GameLevelManager::getGauntletLevels(GameLevelManager *a1, int a2)
{
cocos2d::CCString *v4; // rax
const char *CString; // rax
size_t v6; // rbx
size_t v7; // r8
void **v8; // rdx
void **v9; // rdx
__int64 v10; // rcx
cocos2d::CCString *v11; // rax
char *v12; // rax
size_t v13; // r8
cocos2d::CCString *v14; // rax
char *v15; // rax
size_t v16; // r8
void **v17; // rdx
size_t v18; // r8
_QWORD *v19; // rdx
void *v20; // rcx
__int128 v21; // [rsp+40h] [rbp-C0h] BYREF
__int128 v22; // [rsp+50h] [rbp-B0h]
__int128 *v23; // [rsp+60h] [rbp-A0h]
__int128 *v24; // [rsp+68h] [rbp-98h]
__int128 v25; // [rsp+70h] [rbp-90h] BYREF
__int64 v26; // [rsp+80h] [rbp-80h]
__int64 v27; // [rsp+88h] [rbp-78h]
__int128 v28; // [rsp+90h] [rbp-70h] BYREF
__int64 v29; // [rsp+A0h] [rbp-60h]
__int64 v30; // [rsp+A8h] [rbp-58h]
_OWORD v31[2]; // [rsp+B0h] [rbp-50h] BYREF
__int128 *v32; // [rsp+D0h] [rbp-30h]
void *Block[2]; // [rsp+D8h] [rbp-28h] BYREF
__int128 v34; // [rsp+E8h] [rbp-18h]
_QWORD Src[4]; // [rsp+F8h] [rbp-8h] BYREF
v4 = cocos2d::CCString::createWithFormat("gauntlet_%i", a2);
CString = cocos2d::CCString::getCString(v4);
*(_OWORD *)Block = 0;
v34 = 0;
v6 = -1;
v7 = -1;
do
++v7;
while ( CString[v7] );
sub_14003A930(Block, CString, v7);
v8 = Block;
if ( *((_QWORD *)&v34 + 1) > 0xFu )
v8 = (void **)Block[0];
if ( !GameLevelManager::isDLActive(a1, (const char *)v8) )
{
v9 = Block;
if ( *((_QWORD *)&v34 + 1) > 0xFu )
v9 = (void **)Block[0];
GameLevelManager::addDLToActive(a1, (const char *)v9);
GameLevelManager::getBasePostString(v10, Src);
sub_140041270(Src, "&gauntlet=", 0xAu);
v11 = cocos2d::CCString::createWithFormat("%i", a2);
v12 = (char *)cocos2d::CCString::getCString(v11);
v13 = -1;
do
++v13;
while ( v12[v13] );
sub_140041270(Src, v12, v13);
sub_140041270(Src, "&secret=", 8u);
v14 = cocos2d::CCString::createWithFormat("%c%s%s%c%c%s", 87, "mfd", "2893", 103, 98, (const char *)&word_140531E88);
v15 = (char *)cocos2d::CCString::getCString(v14);
v16 = -1;
do
++v16;
while ( v15[v16] );
sub_140041270(Src, v15, v16);
v24 = &v25;
v32 = &v28;
v17 = Block;
if ( *((_QWORD *)&v34 + 1) > 0xFu )
v17 = (void **)Block[0];
v25 = 0;
v26 = 0;
v27 = 0;
v18 = -1;
do
++v18;
while ( *((_BYTE *)v17 + v18) );
sub_14003A930(&v25, v17, v18);
v19 = Src;
if ( Src[3] > 0xFu )
v19 = (_QWORD *)Src[0];
v28 = 0;
v29 = 0;
v30 = 0;
do
++v6;
while ( *((_BYTE *)v19 + v6) );
sub_14003A930(&v28, v19, v6);
v21 = 0;
*(_QWORD *)&v21 = sub_14003AA10(0x50u);
*(_QWORD *)&v22 = 68;
*((_QWORD *)&v22 + 1) = 79;
strcpy((char *)v21, "aHR0cDovL3d3dy5ib29tbGluZ3MuY29tL2RhdGFiYXNlL2dldEdKTGV2ZWxzMjEucGhw");
v23 = &v21;
if ( (_QWORD)v22 )
{
cocos2d::ZipUtils::base64URLDecode(v31, &v21);
}
else
{
v31[0] = v21;
v31[1] = v22;
*(_QWORD *)&v22 = 0;
*((_QWORD *)&v22 + 1) = 15;
LOBYTE(v21) = 0;
}
sub_14003A830((__int64)&v21);
GameLevelManager::ProcessHttpRequest(a1, (__int64)v31, (const char *)&v28, (const char *)&v25, 2);
sub_14003A830((__int64)Src);
}
if ( *((_QWORD *)&v34 + 1) > 0xFu )
{
v20 = Block[0];
if ( (unsigned __int64)(*((_QWORD *)&v34 + 1) + 1LL) >= 0x1000 )
{
v20 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v20 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v20);
}
}