//
// sub_140280020 from 0x140280020 to 0x14028027e (606 bytes)
//
// 2 xrefs:
// > sub_14027FF00 @ 0x14027ff0f
// > ??> @ 0x1406d13c4
//
// 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
//
void __fastcall sub_140280020(__int64 a1)
{
unsigned int i; // esi
cocos2d::CCString *v3; // rax
const char *CString; // rax
size_t v5; // r8
const char *v6; // rdx
cocos2d::CCString *v7; // rax
char *v8; // rax
size_t v9; // r8
const char *v10; // rbx
cocos2d::CCTextureCache *v11; // rax
void *v12; // rcx
void *v13; // rcx
cocos2d::CCObject *v14; // rcx
__int128 v15; // [rsp+20h] [rbp-58h] BYREF
__int64 v16; // [rsp+30h] [rbp-48h]
unsigned __int64 v17; // [rsp+38h] [rbp-40h]
__int128 v18; // [rsp+40h] [rbp-38h] BYREF
__int64 v19; // [rsp+50h] [rbp-28h]
unsigned __int64 v20; // [rsp+58h] [rbp-20h]
*(_QWORD *)a1 = &GJMoreGamesLayer::`vftable';
*(_QWORD *)(a1 + 320) = &GJMoreGamesLayer::`vftable';
*(_QWORD *)(a1 + 328) = &GJMoreGamesLayer::`vftable';
*(_QWORD *)(a1 + 336) = &GJMoreGamesLayer::`vftable';
*(_QWORD *)(a1 + 344) = &GJMoreGamesLayer::`vftable';
*(_QWORD *)(a1 + 352) = &GJMoreGamesLayer::`vftable';
*(_QWORD *)(a1 + 408) = &GJMoreGamesLayer::`vftable';
*(_QWORD *)(a1 + 432) = &GJMoreGamesLayer::`vftable';
for ( i = 0; i < cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 608)); ++i )
{
v3 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(*(cocos2d::CCArray **)(a1 + 608), i);
CString = cocos2d::CCString::getCString(v3);
v18 = 0;
v19 = 0;
v20 = 0;
v5 = -1;
do
++v5;
while ( CString[v5] );
sub_14003A930(&v18, CString, v5);
v15 = 0;
v16 = 0;
v17 = 15;
LOBYTE(v15) = 0;
v6 = (const char *)&v18;
if ( v20 > 0xF )
v6 = (const char *)v18;
v7 = cocos2d::CCString::createWithFormat("promo_%s.png", v6);
v8 = (char *)cocos2d::CCString::getCString(v7);
v9 = -1;
do
++v9;
while ( v8[v9] );
sub_14003CCE0((void **)&v15, v8, v9);
v10 = (const char *)&v15;
if ( v17 > 0xF )
v10 = (const char *)v15;
v11 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache();
cocos2d::CCTextureCache::removeTextureForKey(v11, v10);
if ( v17 > 0xF )
{
v12 = (void *)v15;
if ( v17 + 1 >= 0x1000 )
{
v12 = *(void **)(v15 - 8);
if ( (unsigned __int64)(v15 - (_QWORD)v12 - 8) > 0x1F )
LABEL_22:
invalid_parameter_noinfo_noreturn();
}
j_j_free(v12);
}
v16 = 0;
v17 = 15;
LOBYTE(v15) = 0;
if ( v20 > 0xF )
{
v13 = (void *)v18;
if ( v20 + 1 >= 0x1000 )
{
v13 = *(void **)(v18 - 8);
if ( (unsigned __int64)(v18 - (_QWORD)v13 - 8) > 0x1F )
goto LABEL_22;
}
j_j_free(v13);
}
}
v14 = *(cocos2d::CCObject **)(a1 + 608);
if ( v14 )
cocos2d::CCObject::release(v14);
GJDropDownLayer::dGJDropDownLayer((cocos2d::CCLayerColor *)a1);
}