//
// sub_1003B51A8 from 0x1003b51a8 to 0x1003b524c (164 bytes)
//
// 2 xrefs:
// > LevelSettingsLayer::selectArtClosed @ 0x10020d848
// > GameManager::getBGTexture @ 0x1003b5a34
//
// 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 11:03:56 +0000
//
_DWORD *__fastcall sub_1003B51A8(_DWORD *result, int a2)
{
int v2; // w8
int v3; // w21
int v4; // w8
_DWORD *v5; // x19
void *v6; // x0
__int64 CString; // x20
void *v8; // x0
void *v9; // x0
char *v10; // x20
__int64 v11; // x1
void *v12; // x0
if ( a2 >= 59 )
v2 = 59;
else
v2 = a2;
if ( v2 <= 1 )
v3 = 1;
else
v3 = v2;
v4 = result[245];
if ( v3 != v4 )
{
v5 = result;
if ( v4 )
{
v6 = sub_1003065B0("game_bg_%02d_001.png", result[245]);
CString = cocos2d::CCString::getCString((__int64)v6);
v8 = cocos2d::CCTextureCache::sharedTextureCache();
cocos2d::CCTextureCache::removeTextureForKey((__int64)v8, CString);
}
v9 = sub_1003065B0("game_bg_%02d_001.png", v3);
v10 = (char *)cocos2d::CCString::getCString((__int64)v9);
AppDelegate::get((__int64)v10, v11);
v12 = cocos2d::CCTextureCache::sharedTextureCache();
result = cocos2d::CCTextureCache::addImage((__int64)v12, v10);
v5[245] = v3;
}
return result;
}