//
// sub_1406082A0 from 0x1406082a0 to 0x140608412 (370 bytes)
//
// 2 xrefs:
// > SetupArtSwitchPopup::selectArtClosed @ 0x140608f05
// > ??> @ 0x14092fa2c
//
// 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 11:35:13 +0000
//
char **__fastcall sub_1406082A0(char **a1, __int64 a2, int a3)
{
__int64 v4; // r8
char *v5; // rax
cocos2d::CCString *v7; // rax
const char *CString; // rax
size_t v9; // r8
cocos2d::CCString *v10; // rax
cocos2d::CCString *v11; // rax
if ( a3 )
{
v4 = (unsigned int)(a3 - 1);
if ( (_DWORD)v4 )
{
if ( (_DWORD)v4 != 1 )
{
*(_OWORD *)a1 = 0;
a1[2] = nullptr;
a1[3] = nullptr;
v5 = (char *)sub_14003D460(0x20u);
*a1 = v5;
a1[2] = (char *)17;
a1[3] = (char *)31;
strcpy(v5, "mgIcon_00_001.png");
return a1;
}
if ( (int)a2 > 3 )
a2 = 3;
if ( (int)a2 < 0 )
a2 = 0;
v7 = cocos2d::CCString::createWithFormat("mgIcon_%02d_001.png", a2);
CString = cocos2d::CCString::getCString(v7);
v9 = -1;
*(_OWORD *)a1 = 0;
a1[2] = nullptr;
a1[3] = nullptr;
do
++v9;
while ( CString[v9] );
}
else
{
if ( (int)a2 > 22 )
a2 = 22;
if ( (int)a2 < 1 )
a2 = 1;
v10 = cocos2d::CCString::createWithFormat("gIcon_%02d_001.png", a2, v4);
CString = cocos2d::CCString::getCString(v10);
v9 = -1;
*(_OWORD *)a1 = 0;
a1[2] = nullptr;
a1[3] = nullptr;
do
++v9;
while ( CString[v9] );
}
}
else
{
if ( (int)a2 > 59 )
a2 = 59;
if ( (int)a2 < 1 )
a2 = 1;
v11 = cocos2d::CCString::createWithFormat("bgIcon_%02d_001.png", a2);
CString = cocos2d::CCString::getCString(v11);
v9 = -1;
*(_OWORD *)a1 = 0;
a1[2] = nullptr;
a1[3] = nullptr;
do
++v9;
while ( CString[v9] );
}
sub_14003D230(a1, CString, v9);
return a1;
}