//
// GameStatsManager::resetSpecialStatAchievements from 0x8d87d8 to 0x8d8b18 (832 bytes)
//
// 2 xrefs:
// > GameStatsManager::recountSpecialStats @ 0x8ec05c
// > ??> @ 0x728b0
//
// 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 12:56:45 +0000
//
__int64 __fastcall GameStatsManager::resetSpecialStatAchievements(GameStatsManager *this)
{
int i; // w28
int v2; // w27
int j; // w21
char *v4; // x3
const char *v5; // x1
cocos2d::CCString *v6; // x0
GameManager *CString; // x23
GameManager *v8; // x24
size_t v9; // x0
size_t v10; // x20
unsigned __int64 v11; // x22
__int64 v13[2]; // [xsp+88h] [xbp+88h] BYREF
void *v14; // [xsp+98h] [xbp+98h]
__int64 v15; // [xsp+A0h] [xbp+A0h] BYREF
size_t v16; // [xsp+A8h] [xbp+A8h]
void *v17; // [xsp+B0h] [xbp+B0h]
for ( i = 0; i != 13; ++i )
{
v13[0] = 0;
v13[1] = 0;
v14 = nullptr;
std::string::__init(v13, &byte_11B8890, 0);
switch ( i )
{
case 1:
std::string::assign(v13, "geometry.ach.shardFire");
v2 = 5;
break;
case 2:
std::string::assign(v13, "geometry.ach.shardIce");
v2 = 5;
break;
case 3:
std::string::assign(v13, "geometry.ach.shardPoison");
v2 = 5;
break;
case 4:
std::string::assign(v13, "geometry.ach.shardShadow");
v2 = 5;
break;
case 5:
std::string::assign(v13, "geometry.ach.shardLava");
v2 = 5;
break;
case 6:
std::string::assign(v13, "geometry.ach.shardBonus");
v2 = 5;
break;
case 7:
std::string::assign(v13, "geometry.ach.shardEarth");
v2 = 5;
break;
case 8:
std::string::assign(v13, "geometry.ach.shardBlood");
v2 = 5;
break;
case 9:
std::string::assign(v13, "geometry.ach.shardMetal");
v2 = 5;
break;
case 10:
std::string::assign(v13, "geometry.ach.shardLight");
v2 = 5;
break;
case 11:
std::string::assign(v13, "geometry.ach.shardSoul");
v2 = 5;
break;
case 12:
std::string::assign(v13, "geometry.ach.shardBonusB");
v2 = 5;
break;
default:
std::string::assign(v13, "geometry.ach.diamonds");
v2 = 18;
break;
}
for ( j = 1; j <= v2; ++j )
{
while ( 1 )
{
v5 = (char *)v13 + 1;
if ( (v13[0] & 1) != 0 )
v5 = (const char *)v14;
v6 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%s%02d",
v5,
(unsigned int)j);
CString = (GameManager *)cocos2d::CCString::getCString(v6);
v8 = (GameManager *)GameManager::sharedState(CString);
v15 = 0;
v16 = 0;
v17 = nullptr;
v9 = strlen((const char *)CString);
v10 = v9;
if ( v9 > 0xFFFFFFFFFFFFFFEFLL )
sub_62CC1C();
if ( v9 <= 0x16 )
{
LOBYTE(v15) = 2 * v9;
v4 = (char *)&v15 + 1;
if ( !v9 )
goto LABEL_6;
}
else
{
v11 = (v9 + 16) & 0xFFFFFFFFFFFFFFF0LL;
v4 = (char *)operator new(v11);
v17 = v4;
v16 = v10;
v15 = v11 | 1;
}
v4 = (char *)memcpy(v4, CString, v10);
LABEL_6:
v4[v10] = 0;
GameManager::resetAchievement(v8, (char *)&v15);
if ( (v15 & 1) != 0 )
break;
if ( v2 < ++j )
goto LABEL_15;
}
operator delete(v17);
}
LABEL_15:
if ( (v13[0] & 1) != 0 )
operator delete(v14);
}
return _stack_chk_guard;
}