//
// sub_1000D4D50 from 0x1000d4d50 to 0x1000d4dec (156 bytes)
//
// 5 xrefs:
// > GJMapPack::hasCompletedMapPack @ 0x1000d4e10
// > MapPackCell::loadFromMapPack @ 0x100128354
// > MapPackCell::loadFromMapPack @ 0x1001285ac
// > MapPackCell::loadFromMapPack @ 0x100128600
// > GauntletNode::generateNode @ 0x1002577ac
//
// 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 10:58:56 +0000
//
__int64 __fastcall sub_1000D4D50(__int64 a1)
{
__int64 v2; // x0
__int64 v3; // x21
__int64 v4; // x20
__int64 v5; // x0
__int64 v6; // x22
int v7; // w23
__int64 v8; // x0
int hasCompletedGauntletLevel; // w0
v2 = *(_QWORD *)(a1 + 320);
if ( !v2 || !(unsigned int)sub_1002E757C(v2) )
return 0;
v3 = 0;
LODWORD(v4) = 0;
do
{
v5 = sub_1002E75A0(*(_QWORD *)(a1 + 320), v3);
v6 = cocos2d::CCString::intValue(v5);
v7 = *(unsigned __int8 *)(a1 + 404);
v8 = GameStatsManager::sharedState(v6);
if ( v7 == 1 )
hasCompletedGauntletLevel = GameStatsManager::hasCompletedGauntletLevel(v8, v6);
else
hasCompletedGauntletLevel = GameStatsManager::hasCompletedOnlineLevel(v8, v6);
v4 = (unsigned int)(v4 + hasCompletedGauntletLevel);
v3 = (unsigned int)(v3 + 1);
}
while ( (unsigned int)v3 < (unsigned int)sub_1002E757C(*(_QWORD *)(a1 + 320)) );
return v4;
}