//
// AchievementManager::storeAchievementUnlocks from 0x3b8308 to 0x3b8474 (364 bytes)
//
// 1 xrefs:
// > AchievementManager::init @ 0x3b84c6
//
// 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:46:21 +0000
//
unsigned int *__fastcall AchievementManager::storeAchievementUnlocks(unsigned int *this)
{
unsigned int v1; // r6
unsigned int *v2; // r7
cocos2d::CCObject *v3; // r0
cocos2d::CCString *v4; // r0
const char *CString; // r0
unsigned int v6; // r8
const char *v7; // r11
size_t v8; // r0
int v9; // r8
cocos2d::CCString *v10; // r10
const char *v11; // r0
const char *v12; // r8
size_t v13; // r0
int v14; // r3
int v15; // r3
size_t v16; // r0
cocos2d::CCObject *v17; // r11
const char *v18; // r10
size_t v19; // r0
cocos2d::CCArray *v20; // [sp+0h] [bp-3Ch]
int v21; // [sp+4h] [bp-38h]
int v22; // [sp+10h] [bp-2Ch] BYREF
int v23; // [sp+14h] [bp-28h]
int v24; // [sp+18h] [bp-24h]
int v25[3]; // [sp+1Ch] [bp-20h] BYREF
int v26; // [sp+28h] [bp-14h] BYREF
int v27; // [sp+2Ch] [bp-10h]
int v28; // [sp+30h] [bp-Ch]
v1 = *(this + 68);
v2 = this;
if ( !v1 )
{
v3 = (cocos2d::CCObject *)cocos2d::CCDictionary::create((cocos2d::CCDictionary *)this);
v2[68] = (unsigned int)v3;
cocos2d::CCObject::retain(v3);
v20 = (cocos2d::CCArray *)cocos2d::CCDictionary::allKeys((cocos2d::CCDictionary *)v2[67]);
while ( 1 )
{
this = (unsigned int *)cocos2d::CCArray::count(v20);
if ( v1 >= (unsigned int)this )
break;
v4 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v20, v1);
CString = (const char *)cocos2d::CCString::getCString(v4);
v26 = 0;
v27 = 0;
v28 = 0;
v6 = v2[67];
v7 = CString;
v8 = strlen(CString);
std::string::__init(&v26, v7, v8);
v9 = cocos2d::CCDictionary::objectForKey(v6, &v26);
std::string::~string((int)&v26);
v26 = 0;
v27 = 0;
v28 = 0;
std::string::__init(&v26, "icon", 4u);
v10 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey(v9, &v26);
std::string::~string((int)&v26);
if ( v10 )
{
v11 = (const char *)cocos2d::CCString::getCString(v10);
v22 = 0;
v23 = 0;
v24 = 0;
v12 = v11;
v13 = strlen(v11);
std::string::__init(&v22, v12, v13);
if ( (v22 & 1) != 0 )
v14 = v23;
else
v14 = (int)(unsigned __int8)v22 >> 1;
if ( v14 )
{
v15 = v2[68];
memset(v25, 0, sizeof(v25));
v21 = v15;
v16 = strlen(v7);
std::string::__init(v25, v7, v16);
v17 = (cocos2d::CCObject *)cocos2d::CCString::create(v25);
v18 = (const char *)cocos2d::CCString::getCString(v10);
v26 = 0;
v27 = 0;
v28 = 0;
v19 = strlen(v18);
std::string::__init(&v26, v18, v19);
cocos2d::CCDictionary::setObject(v21, v17);
std::string::~string((int)&v26);
std::string::~string((int)v25);
}
std::string::~string((int)&v22);
}
++v1;
}
}
return this;
}