//
// AchievementManager::getAllAchievementsSorted from 0x10010dbac to 0x10010dcec (320 bytes)
//
// 2 xrefs:
// > AchievementManager::init @ 0x1000dc9d0
// > AchievementManager::init @ 0x1000dc9e4
//
// 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:59:07 +0000
//
__int64 __fastcall AchievementManager::getAllAchievementsSorted(__int64 a1, int a2)
{
__int64 v4; // x22
__int64 v5; // x19
__int64 v6; // x23
__int64 v7; // x0
char *CString; // x0
__int64 v9; // x25
__int64 v10; // x25
__int64 v11; // x0
__int64 v12; // x26
void *__p[2]; // [xsp+8h] [xbp-58h] BYREF
char v15; // [xsp+1Fh] [xbp-41h]
v4 = cocos2d::CCDictionary::allKeys(*(_QWORD *)(a1 + 328));
v5 = sub_1002E736C(v4);
if ( (unsigned int)sub_1002E757C(v4) )
{
v6 = 0;
while ( 1 )
{
v7 = sub_1002E75A0(v4, v6);
CString = (char *)cocos2d::CCString::getCString(v7);
v9 = *(_QWORD *)(a1 + 328);
sub_100009900(__p, CString);
v10 = cocos2d::CCDictionary::objectForKey(v9, __p);
if ( v15 < 0 )
{
operator delete(__p[0]);
if ( !a2 )
goto LABEL_9;
}
else if ( !a2 )
{
goto LABEL_9;
}
sub_100009900(__p, "un");
v11 = cocos2d::CCDictionary::objectForKey(v10, __p);
v12 = v11;
if ( v15 < 0 )
break;
if ( !v11 )
goto LABEL_9;
LABEL_10:
v6 = (unsigned int)(v6 + 1);
if ( (unsigned int)v6 >= (unsigned int)sub_1002E757C(v4) )
goto LABEL_14;
}
operator delete(__p[0]);
if ( v12 )
goto LABEL_10;
LABEL_9:
sub_1002E74E0(v5, v10);
goto LABEL_10;
}
LABEL_14:
if ( (unsigned int)sub_1002E757C(v5) )
qsort(
*(void **)(*(_QWORD *)(v5 + 56) + 16LL),
**(unsigned int **)(v5 + 56),
8u,
(int (__cdecl *)(const void *, const void *))sub_1000DC834);
return v5;
}