//
// AchievementManager::storeAchievementUnlocks from 0x10010dd0c to 0x10010dea8 (412 bytes)
//
// 1 xrefs:
// > AchievementManager::init @ 0x1000dc9f4
//
// 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::storeAchievementUnlocks(__int64 result)
{
__int64 v1; // x19
__int64 v2; // x0
__int64 v3; // x20
__int64 v4; // x21
__int64 v5; // x0
char *CString; // x23
__int64 v7; // x24
__int64 v8; // x24
__int64 v9; // x0
__int64 v10; // x24
char *v11; // x0
unsigned __int64 v12; // x9
unsigned __int8 v13; // w8
__int64 v14; // x25
__int64 v15; // x23
char *v16; // x0
void *v17[2]; // [xsp+8h] [xbp-88h] BYREF
char v18; // [xsp+1Fh] [xbp-71h]
void *v19[2]; // [xsp+20h] [xbp-70h] BYREF
char v20; // [xsp+37h] [xbp-59h]
void *__p[2]; // [xsp+38h] [xbp-58h] BYREF
unsigned __int8 v22; // [xsp+4Fh] [xbp-41h]
if ( !*(_QWORD *)(result + 336) )
{
v1 = result;
v2 = cocos2d::CCDictionary::create(result);
*(_QWORD *)(v1 + 336) = v2;
cocos2d::CCObject::retain(v2);
v3 = cocos2d::CCDictionary::allKeys(*(_QWORD *)(v1 + 328));
result = sub_1002E757C(v3);
if ( (_DWORD)result )
{
v4 = 0;
do
{
v5 = cocos2d::CCArray::stringAtIndex(v3, v4);
CString = (char *)cocos2d::CCString::getCString(v5);
v7 = *(_QWORD *)(v1 + 328);
sub_100009900(__p, CString);
v8 = cocos2d::CCDictionary::objectForKey(v7, __p);
if ( (char)v22 < 0 )
operator delete(__p[0]);
sub_100009900(__p, "icon");
v9 = cocos2d::CCDictionary::objectForKey(v8, __p);
v10 = v9;
if ( (char)v22 < 0 )
{
operator delete(__p[0]);
if ( v10 )
{
LABEL_10:
v11 = (char *)cocos2d::CCString::getCString(v10);
sub_100009900(__p, v11);
v12 = v22;
v13 = v22;
if ( (v22 & 0x80u) != 0 )
v12 = (unsigned __int64)__p[1];
if ( v12 )
{
v14 = *(_QWORD *)(v1 + 336);
sub_100009900(v19, CString);
v15 = sub_1003064AC(v19);
v16 = (char *)cocos2d::CCString::getCString(v10);
sub_100009900(v17, v16);
cocos2d::CCDictionary::setObject(v14, v15, v17);
if ( v18 < 0 )
operator delete(v17[0]);
if ( v20 < 0 )
operator delete(v19[0]);
v13 = v22;
}
if ( (v13 & 0x80) != 0 )
operator delete(__p[0]);
}
}
else if ( v9 )
{
goto LABEL_10;
}
v4 = (unsigned int)(v4 + 1);
result = sub_1002E757C(v3);
}
while ( (unsigned int)v4 < (unsigned int)result );
}
}
return result;
}