//
// sub_1404718C0 from 0x1404718c0 to 0x140471a32 (370 bytes)
//
// 2 xrefs:
// > SetupArtSwitchPopup::selectArtClosed @ 0x14047248a
// > ??> @ 0x1406db324
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
char **__fastcall sub_1404718C0(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] = (char *)15;
v5 = (char *)sub_14003AA10(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_14003A930(a1, CString, v9);
return a1;
}