//
// sub_100794EB0 from 0x100794eb0 to 0x1007950b9 (521 bytes)
//
// 4 xrefs:
// > sub_1007950D0 @ 0x1007950d5
// > sub_1007950E0 @ 0x1007950ec
// > sub_100795100 @ 0x100795109
// > sub_100795120 @ 0x100795133
//
// 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
//
__int64 __fastcall sub_100794EB0(_QWORD *a1, double a2)
{
unsigned int i; // r15d
cocos2d::CCString *v3; // rax
const char *CString; // r12
size_t v5; // rax
size_t v6; // r13
char *v7; // r14
__int64 v8; // rax
size_t v9; // rbx
char *v10; // rdi
cocos2d::CCString *v11; // rax
const char *v12; // rax
cocos2d::CCTextureCache *v13; // rax
const char *data; // rsi
cocos2d::CCObject *v15; // rdi
std::string v17; // [rsp+0h] [rbp-60h] BYREF
_QWORD __dst[2]; // [rsp+18h] [rbp-48h] BYREF
void *__p; // [rsp+28h] [rbp-38h]
_QWORD *v20; // [rsp+30h] [rbp-30h]
*a1 = off_10098C6C8;
a1[40] = off_10098CC30;
a1[41] = &off_10098CCA0;
a1[42] = off_10098CCB8;
a1[43] = off_10098CCD8;
a1[44] = off_10098CCF8;
a1[51] = off_10098CD20;
v20 = a1;
a1[54] = off_10098CDA0;
for ( i = 0; i < (unsigned int)sub_100720070(v20[76]); ++i )
{
v3 = (cocos2d::CCString *)sub_1007200C0(v20[76], i);
CString = cocos2d::CCString::getCString(v3);
v5 = strlen(CString);
if ( v5 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(a2);
v6 = v5;
if ( v5 >= 0x17 )
{
v8 = v5 | 7;
v9 = 26;
if ( (v6 | 7) != 0x17 )
v9 = v8 + 1;
v7 = (char *)operator new(v9);
__p = v7;
__dst[0] = v9 | 1;
__dst[1] = v6;
LABEL_11:
memmove(v7, CString, v6);
goto LABEL_12;
}
LOBYTE(__dst[0]) = 2 * v5;
v7 = (char *)__dst + 1;
if ( v5 )
goto LABEL_11;
LABEL_12:
v7[v6] = 0;
a2 = 0.0;
memset(&v17, 0, sizeof(v17));
v10 = "promo_%s-hd.png";
if ( !PlatformToolbox::isHD() )
v10 = "promo_%s.png";
v11 = (cocos2d::CCString *)sub_1007AB580(v10, *(_BYTE *)&v17.__r_.__value_.__l.0);
v12 = cocos2d::CCString::getCString(v11);
std::string::assign(&v17, v12);
v13 = cocos2d::CCTextureCache::sharedTextureCache();
data = v17.__r_.__value_.__s.__data_;
if ( (*(_BYTE *)&v17.__r_.__value_.__s.0 & 1) != 0 )
data = v17.__r_.__value_.__l.__data_;
cocos2d::CCTextureCache::removeTextureForKey(v13, data);
if ( (*(_BYTE *)&v17.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v17.__r_.__value_.__l.__data_);
if ( (__dst[0] & 1) != 0 )
operator delete(__p);
}
v15 = (cocos2d::CCObject *)v20[76];
if ( v15 )
cocos2d::CCObject::release(v15);
return GJDropDownLayer::dGJDropDownLayer((__int64)v20);
}