//
// GameManager::addDuplicateLastFrame from 0xaf3af8 to 0xaf3d80 (648 bytes)
//
// 1 xrefs:
// > ??> @ 0x93388
//
// 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 13:01:14 +0000
//
__int64 __fastcall GameManager::addDuplicateLastFrame(cocos2d::CCDictionary **this, int a2)
{
__int64 v2; // x22
GameManager *v5; // x0
unsigned int v6; // w19
__int64 v7; // x0
cocos2d::CCArray *v8; // x0
cocos2d::CCString *v9; // x0
const char *CString; // x0
size_t v11; // x0
GameManager *v12; // x0
__int64 v13; // x0
cocos2d::CCArray *v14; // x0
cocos2d::CCString *v15; // x0
size_t v16; // x0
cocos2d::CCDictionary *v17; // x23
cocos2d::CCObject *v18; // x20
char *v20; // [xsp+58h] [xbp+58h]
char *v21; // [xsp+58h] [xbp+58h]
__int64 v22; // [xsp+68h] [xbp+68h] BYREF
size_t v23; // [xsp+70h] [xbp+70h]
void *v24; // [xsp+78h] [xbp+78h]
__int64 v25; // [xsp+80h] [xbp+80h] BYREF
size_t v26; // [xsp+88h] [xbp+88h]
void *v27; // [xsp+90h] [xbp+90h]
__int64 v28; // [xsp+98h] [xbp+98h] BYREF
size_t v29; // [xsp+A0h] [xbp+A0h]
void *v30; // [xsp+A8h] [xbp+A8h]
__int64 v31; // [xsp+B0h] [xbp+B0h] BYREF
size_t v32; // [xsp+B8h] [xbp+B8h]
void *v33; // [xsp+C0h] [xbp+C0h]
v2 = a2;
v5 = (GameManager *)GameManager::framesForAnimation(this, a2);
v6 = (unsigned int)v5;
v7 = GameManager::sharedState(v5);
v8 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(*(cocos2d::CCDictionary **)(v7 + 376), v2);
v9 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v8, v6 - 1);
CString = (const char *)cocos2d::CCString::getCString(v9);
v22 = 0;
v20 = (char *)CString;
v23 = 0;
v24 = nullptr;
v11 = strlen(CString);
v12 = (GameManager *)std::string::__init(&v22, v20, v11);
v13 = GameManager::sharedState(v12);
v14 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(*(cocos2d::CCDictionary **)(v13 + 384), v2);
v15 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v14, v6 - 1);
v21 = (char *)cocos2d::CCString::getCString(v15);
v25 = 0;
v26 = 0;
v27 = nullptr;
v16 = strlen(v21);
std::string::__init(&v25, v21, v16);
v28 = 0;
v29 = 0;
v30 = nullptr;
if ( (v22 & 1) != 0 )
{
std::string::__init(&v28, v24, v23);
}
else
{
v30 = v24;
v28 = v22;
v29 = v23;
}
v31 = 0;
v32 = 0;
v33 = nullptr;
if ( (v25 & 1) != 0 )
{
std::string::__init(&v31, v27, v26);
}
else
{
v31 = v25;
v32 = v26;
v33 = v27;
}
GameManager::addCustomAnimationFrame((__int64)this, a2, v6, (__int64)&v28, (unsigned __int8 *)&v31);
if ( (v31 & 1) != 0 )
operator delete(v33);
if ( (v28 & 1) != 0 )
operator delete(v30);
v17 = *(this + 50);
v18 = (cocos2d::CCObject *)operator new(0x40u);
cocos2d::CCObject::CCObject(v18);
*((_DWORD *)v18 + 14) = v6 + 1;
*(_QWORD *)v18 = &off_1428350;
cocos2d::CCObject::autorelease(v18);
cocos2d::CCDictionary::setObject(v17, v18, v2);
if ( (v25 & 1) != 0 )
operator delete(v27);
if ( (v22 & 1) != 0 )
operator delete(v24);
return _stack_chk_guard;
}