//
// GameManager::loadMiddleground from 0x4147a0 to 0x414830 (144 bytes)
//
// 2 xrefs:
// > GameManager::getMGTexture @ 0x414be8
// > LevelSettingsLayer::selectArtClosed @ 0x6a8cb0
//
// 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:47:39 +0000
//
const char **__fastcall GameManager::loadMiddleground(const char **this, unsigned int a2)
{
const char *v2; // r4
const char *v3; // r1
const char **v4; // r5
cocos2d::CCString *v5; // r0
cocos2d::CCTextureCache *CString; // r6
cocos2d::CCTextureCache *v7; // r0
cocos2d::CCTextureCache *v8; // r0
cocos2d::CCTextureCache *v9; // r8
cocos2d::CCString *v10; // r0
const char *v11; // r0
cocos2d::CCTextureCache *v12; // r8
cocos2d::CCString *v13; // r0
const char *v14; // r0
cocos2d::CCTextureCache *v15; // r0
cocos2d::CCTextureCache *v16; // r7
cocos2d::CCString *v17; // r0
const char *v18; // r0
v2 = (const char *)__usat(2u, a2);
v3 = *(this + 194);
v4 = this;
if ( v2 != v3 )
{
v5 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"fg_%02d_001.png", v3);
CString = (cocos2d::CCTextureCache *)cocos2d::CCString::getCString(v5);
v7 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache(CString);
v8 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::removeTextureForKey(v7, (const char *)CString);
v9 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache(v8);
v10 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"fg_%02d_2_001.png", v4[194]);
v11 = (const char *)cocos2d::CCString::getCString(v10);
this = (const char **)cocos2d::CCTextureCache::removeTextureForKey(v9, v11);
if ( (int)v2 > 0 )
{
v12 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache((cocos2d::CCTextureCache *)this);
v13 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"fg_%02d_001.png", v2);
v14 = (const char *)cocos2d::CCString::getCString(v13);
v15 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::addImage(v12, v14, 0);
v16 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache(v15);
v17 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"fg_%02d_2_001.png", v2);
v18 = (const char *)cocos2d::CCString::getCString(v17);
this = (const char **)cocos2d::CCTextureCache::addImage(v16, v18, 0);
}
v4[194] = v2;
}
return this;
}