//
// GameLevelManager::onGetGauntletsCompleted from 0x3ca1f0 to 0x3ca41a (554 bytes)
//
// 1 xrefs:
// > GameLevelManager::handleIt @ 0x3d75ca
//
// 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
//
int __fastcall GameLevelManager::onGetGauntletsCompleted(GameLevelManager *a1, char **a2, const char **a3)
{
char *v4; // r11
_BOOL4 v6; // r9
cocos2d::CCArray *v7; // r6
int result; // r0
cocos2d::CCString *v9; // r0
char *CString; // r0
cocos2d::CCString *v11; // r0
char *v12; // r0
char *v13; // r2
char *v14; // r3
cocos2d::CCArray *MapPacks; // r7
unsigned int i; // r9
int v17; // r10
cocos2d::CCString *v18; // r0
char *v19; // r0
cocos2d::CCString *v20; // r0
char *v21; // r0
const void *v22; // r0
unsigned __int8 *v23; // r3
char *v24; // r2
unsigned int j; // r9
GJMapPack *v26; // r0
LevelManagerDelegate *m_levelManagerDelegate; // r0
char v28[4]; // [sp+24h] [bp-60h] BYREF
char v29[4]; // [sp+28h] [bp-5Ch] BYREF
char *v30; // [sp+2Ch] [bp-58h] BYREF
char *v31; // [sp+30h] [bp-54h] BYREF
char v32[4]; // [sp+34h] [bp-50h] BYREF
cocos2d::CCArray v33; // [sp+38h] [bp-4Ch] BYREF
v4 = (char *)*a3;
GameLevelManager::removeDLFromActive(a1, *a3);
sub_776584((int)&v33, "-1");
v6 = sub_3BE0D8((int)a2, (int)&v33);
sub_774008(&v33);
if ( v6
|| (sub_776584((int)&v33, *a2), v7 = sub_3BE530(&v33, "#"), sub_774008(&v33), cocos2d::CCArray::count(v7) <= 1u) )
{
result = (int)a1->m_levelManagerDelegate;
if ( result )
return (*(int (__fastcall **)(int, char *))(*(_DWORD *)result + 4))(result, v4);
}
else
{
v9 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v7, 0);
CString = (char *)cocos2d::CCString::getCString(v9);
sub_776584((int)v28, CString);
v11 = cocos2d::CCArray::stringAtIndex(v7, 1u);
v12 = (char *)cocos2d::CCString::getCString(v11);
sub_776584((int)v29, v12);
sub_775C20(&v30, v28);
MapPacks = GameLevelManager::createAndGetMapPacks((cocos2d::CCArray *)a1, &v30, v13, v14);
sub_774008(&v30);
sub_776584((int)&v31, (char *)&unk_939830);
for ( i = 0; i < cocos2d::CCArray::count(MapPacks); ++i )
{
v17 = cocos2d::CCArray::objectAtIndex(MapPacks, i);
v18 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i",
*(const char **)(v17 + 268));
v19 = (char *)cocos2d::CCString::getCString(v18);
sub_774544((int)&v31, v19);
sub_775C20(v32, v17 + 288);
sub_77441C(&v31, v32);
sub_774008(v32);
}
v20 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%c%s%s%c%c%s",
(const char *)&dword_78,
"I25",
"fpAa",
112,
67,
"Qg");
v21 = (char *)cocos2d::CCString::getCString(v20);
sub_774544((int)&v31, v21);
v22 = (const void *)strlen(v31);
rtsha1::calc((rtsha1 *)v31, v22, (int)&v33.m_uID, v23);
rtsha1::toHexString((rtsha1 *)&v33.m_uID, (const unsigned __int8 *)&v33.m_eObjType, v24);
for ( j = 0; j < cocos2d::CCArray::count(MapPacks); ++j )
{
v26 = (GJMapPack *)cocos2d::CCArray::objectAtIndex(MapPacks, j);
v26->m_isGauntlet = 1;
GameLevelManager::saveGauntlet(a1, v26);
}
sub_776584((int)&v33, (char *)&unk_939830);
GameLevelManager::storeSearchResult(a1, MapPacks, (char **)&v33, v4);
sub_774008(&v33);
m_levelManagerDelegate = a1->m_levelManagerDelegate;
if ( m_levelManagerDelegate )
m_levelManagerDelegate->loadLevelsFinished(m_levelManagerDelegate, MapPacks, (const unsigned __int8 *)v4);
sub_774008(&v31);
sub_774008(v29);
return sub_774008(v28);
}
return result;
}