//
// GameLevelManager::onGetGauntletsCompleted from 0x4c4620 to 0x4c47d4 (436 bytes)
//
// 1 xrefs:
// > GameLevelManager::handleIt @ 0x4daf7a
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 11:50:28 +0000
//
int __fastcall GameLevelManager::onGetGauntletsCompleted(GameLevelManager *a1, int a2, int a3)
{
char *v5; // r5
_BOOL4 v6; // r9
bool v7; // nf
size_t v8; // r0
cocos2d::CCArray *v9; // r6
int result; // r0
cocos2d::CCString *v11; // r0
const char *CString; // r6
size_t v13; // r0
cocos2d::CCArray *MapPacks; // r6
signed int i; // r9
unsigned int j; // r9
int v17; // r0
int v18; // r2
int v19; // r3
_DWORD **v20; // r0
int v21; // [sp+0h] [bp-2Ch] BYREF
int v22; // [sp+4h] [bp-28h]
int v23; // [sp+8h] [bp-24h]
int v24[3]; // [sp+Ch] [bp-20h] BYREF
int v25; // [sp+18h] [bp-14h] BYREF
int v26; // [sp+1Ch] [bp-10h]
int v27; // [sp+20h] [bp-Ch]
if ( (*(_BYTE *)a3 & 1) != 0 )
v5 = *(char **)(a3 + 8);
else
v5 = (char *)(a3 + 1);
GameLevelManager::removeDLFromActive(a1, v5);
v25 = 0;
v26 = 0;
v27 = 0;
std::string::__init(&v25, "-1", 2u);
v6 = sub_4A9CC4((unsigned __int8 *)a2, (unsigned __int8 *)&v25);
std::string::~string((int)&v25);
if ( v6 )
goto LABEL_10;
v7 = (*(_BYTE *)a2 & 1) != 0;
if ( (*(_BYTE *)a2 & 1) == 0 )
++a2;
v25 = 0;
if ( v7 )
a2 = *(_DWORD *)(a2 + 8);
v26 = 0;
v27 = 0;
v8 = strlen((const char *)a2);
std::string::__init(&v25, (const void *)a2, v8);
v9 = sub_4C1A88(&v25, "#");
std::string::~string((int)&v25);
if ( cocos2d::CCArray::count(v9) <= 1u )
{
LABEL_10:
result = *((_DWORD *)a1 + 205);
if ( result )
return (*(int (__fastcall **)(int, char *))(*(_DWORD *)result + 4))(result, v5);
}
else
{
v11 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v9, 0);
v21 = 0;
v22 = 0;
v23 = 0;
CString = (const char *)cocos2d::CCString::getCString(v11);
v13 = strlen(CString);
std::string::__init(&v21, CString, v13);
std::string::basic_string(v24, (int)&v21);
MapPacks = GameLevelManager::createAndGetMapPacks(a1, (int)v24);
std::string::~string((int)v24);
for ( i = cocos2d::CCArray::count(MapPacks) - 1; i >= 0; --i )
{
if ( *(int *)(cocos2d::CCArray::objectAtIndex(MapPacks, i) + 268) > 62 )
cocos2d::CCArray::removeObjectAtIndex(MapPacks, i, 1);
}
for ( j = 0; j < cocos2d::CCArray::count(MapPacks); ++j )
{
v17 = cocos2d::CCArray::objectAtIndex(MapPacks, j);
*(_BYTE *)(v17 + 320) = 1;
GameLevelManager::saveGauntlet(a1, (const char **)v17, v18, v19);
}
v25 = 0;
v26 = 0;
v27 = 0;
std::string::__init(&v25, &unk_B6B226, 0);
GameLevelManager::storeSearchResult(a1, MapPacks, COERCE_FLOAT(&v25), v5);
std::string::~string((int)&v25);
v20 = *((_DWORD ***)a1 + 205);
if ( v20 )
((void (__fastcall *)(_DWORD **, cocos2d::CCArray *, char *, _DWORD, int, int, int))**v20)(
v20,
MapPacks,
v5,
**v20,
v21,
v22,
v23);
return std::string::~string((int)&v21);
}
return result;
}