//
// GameLevelManager::getGauntlets from 0x140151200 to 0x1401514e7 (743 bytes)
//
// 3 xrefs:
// > GauntletSelectLayer::init @ 0x1401f9722
// > GauntletSelectLayer::onRefresh @ 0x1401f99e8
// > ??> @ 0x1406ca86c
//
// 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=4
void GameLevelManager::getGauntlets(GameLevelManager *a1)
{
__int64 v2; // rbx
void *v3; // rcx
__int64 v4; // rax
__int64 v5; // rcx
void *v6; // rcx
cocos2d::CCString *v7; // rax
const char *CString; // rax
cocos2d::CCString *v9; // rax
char *v10; // rax
size_t v11; // rbx
size_t v12; // r8
_QWORD *v13; // rdx
__int128 v14; // [rsp+40h] [rbp-49h] BYREF
__int64 v15; // [rsp+50h] [rbp-39h]
__int64 v16; // [rsp+58h] [rbp-31h]
__int128 v17; // [rsp+60h] [rbp-29h] BYREF
__int64 v18; // [rsp+70h] [rbp-19h]
__int64 v19; // [rsp+78h] [rbp-11h]
__int128 *v20; // [rsp+80h] [rbp-9h]
__int128 *v21; // [rsp+88h] [rbp-1h]
void *Block[2]; // [rsp+98h] [rbp+Fh] BYREF
__int128 v23; // [rsp+A8h] [rbp+1Fh]
_QWORD Src[4]; // [rsp+B8h] [rbp+2Fh] BYREF
*(_OWORD *)Block = 0;
v23 = 0;
sub_14003A930(Block, "get_gauntlets", 0xDu);
v2 = cocos2d::CCDictionary::objectForKey(a1->m_downloadObjects, Block);
if ( *((_QWORD *)&v23 + 1) > 0xFu )
{
v3 = Block[0];
if ( (unsigned __int64)(*((_QWORD *)&v23 + 1) + 1LL) >= 0x1000 )
{
v3 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v3 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v3);
}
if ( !v2 )
{
*(_OWORD *)Block = 0;
v23 = 0;
sub_14003A930(Block, "get_gauntlets", 0xDu);
v4 = cocos2d::CCNode::create();
cocos2d::CCDictionary::setObject(a1->m_downloadObjects, v4, Block);
if ( *((_QWORD *)&v23 + 1) > 0xFu )
{
v6 = Block[0];
if ( (unsigned __int64)(*((_QWORD *)&v23 + 1) + 1LL) >= 0x1000 )
{
v6 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v6 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v6);
}
GameLevelManager::getBasePostString(v5, Src);
v7 = cocos2d::CCString::createWithFormat("%c%s%s%c%c%s", 87, "mfd", "2893", 103, 98, (const char *)&word_140531E88);
CString = cocos2d::CCString::getCString(v7);
v9 = cocos2d::CCString::createWithFormat("&secret=%s&special=1&vkey=%i", CString, 47);
v10 = (char *)cocos2d::CCString::getCString(v9);
v11 = -1;
v12 = -1;
do
++v12;
while ( v10[v12] );
sub_140041270(Src, v10, v12);
v20 = &v14;
v21 = &v17;
v14 = 0;
v15 = 0;
v16 = 0;
sub_14003A930(&v14, "get_gauntlets", 0xDu);
v13 = Src;
if ( Src[3] > 0xFu )
v13 = (_QWORD *)Src[0];
v17 = 0;
v18 = 0;
v19 = 0;
do
++v11;
while ( *((_BYTE *)v13 + v11) );
sub_14003A930(&v17, v13, v11);
*(_OWORD *)Block = 0;
*(_QWORD *)&v23 = 0;
*((_QWORD *)&v23 + 1) = 15;
Block[0] = sub_14003AA10(0x40u);
*(_QWORD *)&v23 = 55;
*((_QWORD *)&v23 + 1) = 63;
strcpy((char *)Block[0], "https://www.boomlings.com/database/getGJGauntlets21.php");
GameLevelManager::ProcessHttpRequest(a1, (__int64)Block, (const char *)&v17, (const char *)&v14, 52);
sub_14003A830((__int64)Src);
}
}