//
// sub_10093F950 from 0x10093f950 to 0x10093fd3a (1002 bytes)
//
// 1 xrefs:
// > LevelPickerPopup::requestPage @ 0x10093f93a
//
// 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:38:30 +0000
//
void __fastcall sub_10093F950(unsigned __int8 *a1, __int64 a2, double a3, __m128d a4)
{
__int64 v4; // rax
char *v5; // rax
const char *v6; // r15
size_t v7; // rax
std::string::size_type v8; // r14
void **p_data; // r13
char *v10; // r12
__int64 v11; // rax
char *v12; // rax
const char *CString; // r15
size_t v14; // rax
std::string::size_type v15; // r14
char *data; // r12
size_t v17; // r13
char *v18; // r12
size_t v19; // r13
const std::string::value_type *Key; // rax
_BYTE *v21; // r14
__int64 v22; // rax
__int64 StoredOnlineLevels; // rax
__int64 v24; // r15
__int64 v25; // rax
const char *v26; // rsi
__int64 v27; // rax
const char *v28; // rsi
unsigned __int8 v29; // bl
__int64 v30; // rdi
const char *PageInfo; // r13
size_t v32; // rax
size_t v33; // r12
char *v34; // r15
unsigned __int8 *v35; // rdx
size_t v36; // r13
unsigned __int8 *v37; // rdx
__int64 v38; // [rsp+0h] [rbp-80h]
const char *v39; // [rsp+8h] [rbp-78h]
std::string __dst; // [rsp+10h] [rbp-70h] BYREF
std::string v41; // [rsp+28h] [rbp-58h] BYREF
_QWORD v42[2]; // [rsp+40h] [rbp-40h] BYREF
void *__p; // [rsp+50h] [rbp-30h]
if ( !a1[808] )
{
sub_10095D090(a1);
sub_10093F770((__int64)a1);
return;
}
if ( a1[809] != 1 )
{
v11 = GameManager::sharedState();
v12 = sub_10088E820("%i", *(_DWORD *)(v11 + 660) - *(_DWORD *)(v11 + 664));
CString = (const char *)cocos2d::CCString::getCString((__int64)v12);
v14 = strlen(CString);
if ( v14 >= 0xFFFFFFFFFFFFFFF8LL )
goto LABEL_56;
v15 = v14;
p_data = (void **)&v41.__r_.__value_.__l.__data_;
if ( v14 >= 0x17 )
{
v19 = 26;
if ( (v14 | 7) != 0x17 )
v19 = (v14 | 7) + 1;
data = (char *)operator new(v19);
v41.__r_.__value_.__r.__words[2] = (std::string::size_type)data;
v41.__r_.__value_.__r.__words[0] = v19 + 1;
p_data = (void **)&v41.__r_.__value_.__l.__data_;
v41.__r_.__value_.__l.__size_ = v15;
}
else
{
v41.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v14);
data = v41.__r_.__value_.__s.__data_;
if ( !v14 )
{
LABEL_22:
data[v15] = 0;
v18 = GJSearchObject::create_1(5, &v41);
if ( (*(_BYTE *)&v41.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_24;
goto LABEL_23;
}
}
memmove(data, CString, v15);
goto LABEL_22;
}
v4 = GJAccountManager::sharedState((__int64)a1, a2);
v5 = sub_10088E820("%i", *(_DWORD *)(v4 + 352) - *(_DWORD *)(v4 + 356));
v6 = (const char *)cocos2d::CCString::getCString((__int64)v5);
v7 = strlen(v6);
if ( v7 >= 0xFFFFFFFFFFFFFFF8LL )
goto LABEL_56;
v8 = v7;
p_data = (void **)&__dst.__r_.__value_.__l.__data_;
if ( v7 >= 0x17 )
{
v17 = 26;
if ( (v7 | 7) != 0x17 )
v17 = (v7 | 7) + 1;
v10 = (char *)operator new(v17);
__dst.__r_.__value_.__r.__words[2] = (std::string::size_type)v10;
__dst.__r_.__value_.__r.__words[0] = v17 + 1;
p_data = (void **)&__dst.__r_.__value_.__l.__data_;
__dst.__r_.__value_.__l.__size_ = v8;
goto LABEL_15;
}
__dst.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v7);
v10 = __dst.__r_.__value_.__s.__data_;
if ( v7 )
LABEL_15:
memmove(v10, v6, v8);
v10[v8] = 0;
v18 = GJSearchObject::create_1(5, &__dst);
if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 )
LABEL_23:
operator delete(*p_data);
LABEL_24:
if ( a1[809] == 1 )
*((_DWORD *)v18 + 108) = 1;
*((_DWORD *)v18 + 98) = *((_DWORD *)a1 + 208);
Key = (const std::string::value_type *)GJSearchObject::getKey((__int64)v18);
v21 = a1 + 840;
std::string::assign((std::string *)a1 + 35, Key);
v22 = GameLevelManager::sharedState();
if ( (a1[840] & 1) != 0 )
{
StoredOnlineLevels = GameLevelManager::getStoredOnlineLevels(v22, *((const char **)a1 + 107));
if ( !StoredOnlineLevels )
goto LABEL_36;
}
else
{
StoredOnlineLevels = GameLevelManager::getStoredOnlineLevels(v22, (const char *)a1 + 841);
if ( !StoredOnlineLevels )
{
LABEL_36:
*(_QWORD *)(GameLevelManager::sharedState() + 1224) = a1 + 776;
v29 = a1[809];
v30 = GameLevelManager::sharedState();
if ( v29 == 1 )
GameLevelManager::getLevelLists(v30, (__int64)v18);
else
GameLevelManager::getOnlineLevels(v30, (__int64)v18);
return;
}
}
v24 = StoredOnlineLevels;
v25 = GameLevelManager::sharedState();
if ( (*v21 & 1) != 0 )
v26 = *((const char **)a1 + 107);
else
v26 = (const char *)(a1 + 841);
if ( (int)GameLevelManager::getTimeLeft(v25, v26, COERCE_DOUBLE(1163984896), a4) <= 0 )
goto LABEL_36;
v27 = GameLevelManager::sharedState();
if ( (*v21 & 1) != 0 )
v28 = *((const char **)a1 + 107);
else
v28 = (const char *)(a1 + 841);
PageInfo = GameLevelManager::getPageInfo(v27, v28);
v32 = strlen(PageInfo);
if ( v32 >= 0xFFFFFFFFFFFFFFF8LL )
LABEL_56:
sub_100003630();
v33 = v32;
v38 = v24;
if ( v32 >= 0x17 )
{
v39 = PageInfo;
v36 = 26;
if ( (v32 | 7) != 0x17 )
v36 = (v32 | 7) + 1;
v34 = (char *)operator new(v36);
__p = v34;
v42[0] = v36 + 1;
PageInfo = v39;
v42[1] = v33;
LABEL_48:
memmove(v34, PageInfo, v33);
v34[v33] = 0;
if ( (*v21 & 1) == 0 )
goto LABEL_44;
LABEL_49:
v35 = *((unsigned __int8 **)a1 + 107);
goto LABEL_50;
}
LOBYTE(v42[0]) = 2 * v32;
v34 = (char *)v42 + 1;
if ( v32 )
goto LABEL_48;
BYTE1(v42[0]) = 0;
if ( (*v21 & 1) != 0 )
goto LABEL_49;
LABEL_44:
v35 = a1 + 841;
LABEL_50:
(*(void (__fastcall **)(unsigned __int8 *, _QWORD *, unsigned __int8 *))(*(_QWORD *)a1 + 1392LL))(a1, v42, v35);
if ( (v42[0] & 1) != 0 )
operator delete(__p);
if ( (*v21 & 1) != 0 )
v37 = *((unsigned __int8 **)a1 + 107);
else
v37 = a1 + 841;
(*(void (__fastcall **)(unsigned __int8 *, __int64, unsigned __int8 *, _QWORD))(*(_QWORD *)a1 + 1376LL))(
a1,
v38,
v37,
a1[809]);
}