//
// GJMoreGamesLayer::getMoreGamesList from 0x100875b50 to 0x100875e5e (782 bytes)
//
// 1 xrefs:
// > GJMoreGamesLayer::customSetup @ 0x100875efe
//
// 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 12:36:52 +0000
//
void *GJMoreGamesLayer::getMoreGamesList()
{
int v0; // r15d
_QWORD *v1; // r14
_OWORD *v2; // rbx
char *v3; // rax
char *v4; // r14
__int128 v5; // xmm1
__int128 v6; // xmm2
char *i; // r13
char *v8; // rdi
__int64 v9; // rax
const std::string::value_type *CString; // rax
const char *data; // r14
size_t v12; // rax
size_t v13; // rbx
char *v14; // r15
size_t v15; // r12
bool doesFileExist; // bl
__int64 v17; // rax
_QWORD *v18; // rax
const char *v19; // rsi
char *v20; // rbx
void *v22; // [rsp+0h] [rbp-A0h]
_QWORD __dst[2]; // [rsp+8h] [rbp-98h] BYREF
void *__p; // [rsp+18h] [rbp-88h]
__int128 v25; // [rsp+20h] [rbp-80h] BYREF
void *v26; // [rsp+30h] [rbp-70h]
int v27; // [rsp+3Ch] [rbp-64h]
std::string __src; // [rsp+40h] [rbp-60h] BYREF
void *v29[2]; // [rsp+60h] [rbp-40h]
_QWORD *v30; // [rsp+70h] [rbp-30h]
v0 = cocos2d::CCTexture2D::defaultAlphaPixelFormat();
cocos2d::CCTexture2D::setDefaultAlphaPixelFormat(0);
v22 = sub_1007FE900();
v1 = operator new(0x18u);
*(_BYTE *)v1 = 6;
*(_DWORD *)((char *)v1 + 1) = 7170663;
v29[0] = v1;
v30 = v1 + 3;
v29[1] = v1 + 3;
v2 = operator new(0x30u);
v27 = v0;
*((_BYTE *)v2 + 24) = 6;
*(_DWORD *)((char *)v2 + 25) = 7826023;
*v2 = *(_OWORD *)v1;
*((_QWORD *)v2 + 2) = v1[2];
v29[0] = v2;
v30 = v2 + 3;
operator delete(v1);
v29[1] = v2 + 3;
v3 = (char *)operator new(0x60u);
v3[48] = 6;
*(_DWORD *)(v3 + 49) = 8022631;
v4 = v3 + 72;
v5 = v2[1];
v6 = v2[2];
*(_OWORD *)v3 = *v2;
*((_OWORD *)v3 + 1) = v5;
*((_OWORD *)v3 + 2) = v6;
v29[0] = v3;
v30 = v3 + 96;
operator delete(v2);
v29[1] = v4;
for ( i = (char *)v29[0]; i != v4; i += 24 )
{
if ( (*i & 1) != 0 )
{
sub_10001AD30(&v25, *((const void **)i + 2), *((_QWORD *)i + 1));
}
else
{
v26 = *((void **)i + 2);
v25 = *(_OWORD *)i;
}
memset(&__src, 0, sizeof(__src));
v8 = "promo_%s.png";
if ( (unsigned __int8)PlatformToolbox::isHD((__m128)0LL) )
v8 = "promo_%s-hd.png";
v9 = sub_10088E820(v8, (char)v22);
CString = (const std::string::value_type *)cocos2d::CCString::getCString(v9);
std::string::assign(&__src, CString);
data = __src.__r_.__value_.__s.__data_;
if ( (*(_BYTE *)&__src.__r_.__value_.__s.0 & 1) != 0 )
data = __src.__r_.__value_.__l.__data_;
v12 = strlen(data);
if ( v12 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v13 = v12;
if ( v12 >= 0x17 )
{
v15 = (v12 | 7) + 1;
if ( (v12 | 7) == 0x17 )
v15 = 26;
v14 = (char *)operator new(v15);
__p = v14;
__dst[0] = v15 | 1;
__dst[1] = v13;
LABEL_18:
memmove(v14, data, v13);
goto LABEL_19;
}
LOBYTE(__dst[0]) = 2 * v12;
v14 = (char *)__dst + 1;
if ( v12 )
goto LABEL_18;
LABEL_19:
v14[v13] = 0;
doesFileExist = PlatformToolbox::doesFileExist((__int64)__dst);
if ( (__dst[0] & 1) != 0 )
operator delete(__p);
if ( doesFileExist )
{
v17 = sub_10088E600(&v25);
sub_1007FEBF0((__int64)v22, v17);
v18 = cocos2d::CCTextureCache::sharedTextureCache();
v19 = __src.__r_.__value_.__s.__data_;
if ( (*(_BYTE *)&__src.__r_.__value_.__s.0 & 1) != 0 )
v19 = __src.__r_.__value_.__l.__data_;
cocos2d::CCTextureCache::addImage((__int64)v18, v19, 0);
}
if ( (*(_BYTE *)&__src.__r_.__value_.__s.0 & 1) != 0 )
operator delete(__src.__r_.__value_.__l.__data_);
if ( (v25 & 1) != 0 )
operator delete(v26);
v4 = (char *)v29[1];
}
cocos2d::CCTexture2D::setDefaultAlphaPixelFormat(v27);
v20 = (char *)v29[0];
if ( v29[0] )
{
while ( v4 != v20 )
{
if ( (*(v4 - 24) & 1) != 0 )
operator delete(*((void **)v4 - 1));
v4 -= 24;
}
operator delete(v20);
}
return v22;
}