//
// AchievementManager::achievementForUnlock from 0x3bf3a8 to 0x3bf524 (380 bytes)
//
// 6 xrefs:
// > GJGarageLayer::achievementForUnlock @ 0x50c258
// > GJGarageLayer::titleForUnlock @ 0x50c4b8
// > GJGarageLayer::descriptionForUnlock @ 0x50c56c
// > ItemInfoPopup::init @ 0x50db9a
// > GameStatsManager::getItemUnlockStateLite @ 0x528dbc
// > GameStatsManager::generateItemUnlockableData @ 0x52b790
//
// 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:29 +0000
//
int *__fastcall AchievementManager::achievementForUnlock(int *a1, int a2, int a3, int a4)
{
const char *v7; // r3
unsigned int v8; // r4
int v9; // r9
size_t v10; // r0
cocos2d::CCString *v11; // r0
const char *CString; // r0
const char *v13; // r9
size_t v14; // r0
int v16[3]; // [sp+8h] [bp-210h] BYREF
unsigned int v17; // [sp+14h] [bp-204h] BYREF
unsigned int v18; // [sp+18h] [bp-200h]
char *v19; // [sp+1Ch] [bp-1FCh]
_BYTE v20[500]; // [sp+20h] [bp-1F8h] BYREF
v18 = 500;
v19 = v20;
v17 = 0;
switch ( a4 )
{
case 1:
v7 = "icon_";
break;
case 2:
v7 = "color_";
break;
case 3:
v7 = "color2_";
break;
case 4:
v7 = "ship_";
break;
case 5:
v7 = "ball_";
break;
case 6:
v7 = "bird_";
break;
case 7:
v7 = "dart_";
break;
case 8:
v7 = "robot_";
break;
case 9:
v7 = "spider_";
break;
case 10:
v7 = "special_";
break;
case 11:
v7 = "death_";
break;
case 12:
v7 = "item_";
break;
case 13:
v7 = "swing_";
break;
case 14:
v7 = "jetpack_";
break;
case 15:
v7 = "shipstreak_";
break;
default:
v7 = " _";
break;
}
fmt::BasicWriter::operator<<(&v17, v7, 0);
if ( a3 <= 9 )
fmt::BasicWriter::operator<<(&v17, "0", 0);
fmt::BasicWriter::FormatInt,char>>(&v17, a3);
v8 = v17;
v9 = *(_DWORD *)(a2 + 272);
if ( v17 + 1 > v18 )
fmt::internal::Array::grow((int)&v17, v17 + 1);
v19[v8] = 0;
memset(v16, 0, sizeof(v16));
v10 = strlen(v19);
std::string::__init(v16, v19, v10);
v11 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v9, v16);
CString = (const char *)cocos2d::CCString::getCString(v11);
*a1 = 0;
a1[1] = 0;
v13 = CString;
a1[2] = 0;
v14 = strlen(CString);
std::string::__init(a1, v13, v14);
std::string::~string((int)v16);
if ( v19 != v20 && v19 )
operator delete[](v19);
return a1;
}