//
// GJGarageLayer::titleForUnlock from 0x100358a90 to 0x100358bb8 (296 bytes)
//
// 1 xrefs:
// > ItemInfoPopup::init @ 0x10035b55c
//
// This function is hookable on this platform (idp: pc, 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:28:53 +0000
//
size_t *__fastcall GJGarageLayer::titleForUnlock(size_t *a1, __int64 a2, unsigned int a3)
{
unsigned int v4; // r15d
__int64 v5; // rsi
__int64 v6; // rax
char *v7; // rsi
__int64 AchievementsWithID; // rax
void *v9; // rax
const char *CString; // r14
size_t v11; // rax
size_t v12; // r15
_BYTE *v13; // r12
size_t v15; // r13
char v16; // [rsp+8h] [rbp-58h] BYREF
char v17; // [rsp+9h] [rbp-57h] BYREF
void *v18; // [rsp+18h] [rbp-48h]
char v19[16]; // [rsp+20h] [rbp-40h] BYREF
void *__p; // [rsp+30h] [rbp-30h]
v4 = a2;
v5 = AchievementManager::sharedState(a1, a2);
AchievementManager::achievementForUnlock(&v16, v5, v4, a3);
v6 = AchievementManager::sharedState(&v16, v5);
if ( (v16 & 1) != 0 )
v7 = (char *)v18;
else
v7 = &v17;
AchievementsWithID = AchievementManager::getAchievementsWithID(v6, v7);
strcpy(v19, "\ntitle");
v9 = cocos2d::CCDictionary::valueForKey(AchievementsWithID, (__int64)v19);
CString = (const char *)cocos2d::CCString::getCString(v9);
v11 = strlen(CString);
if ( v11 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v12 = v11;
if ( v11 >= 0x17 )
{
v15 = 26;
if ( (v11 | 7) != 0x17 )
v15 = (v11 | 7) + 1;
v13 = operator new(v15);
a1[2] = (size_t)v13;
*a1 = v15 | 1;
a1[1] = v12;
}
else
{
*(_BYTE *)a1 = 2 * v11;
v13 = (char *)a1 + 1;
if ( !v11 )
{
*v13 = 0;
if ( (v19[0] & 1) == 0 )
goto LABEL_9;
goto LABEL_8;
}
}
memmove(v13, CString, v12);
v13[v12] = 0;
if ( (v19[0] & 1) != 0 )
LABEL_8:
operator delete(__p);
LABEL_9:
if ( (v16 & 1) != 0 )
operator delete(v18);
return a1;
}