//
// sub_10055BD10 from 0x10055bd10 to 0x10055c0d8 (968 bytes)
//
// 1 xrefs:
// > sub_1008F0AC0 @ 0x1008f0ef8
//
// 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:32:07 +0000
//
void __fastcall sub_10055BD10(__int64 a1, __int64 a2)
{
const std::string::value_type *Key; // rax
std::string *v4; // rax
const char *v5; // r15
const char *v6; // rsi
__int64 v7; // rax
void (__fastcall ***v8)(_QWORD, __int64, const char *); // rdi
const char *v9; // rsi
char *v10; // rax
__int64 v11; // rax
char CString; // al
__int64 v13; // rax
const std::string::value_type *v14; // rax
const char *v15; // r14
size_t v16; // rax
size_t v17; // r15
char *v18; // r12
size_t v19; // r13
std::string v20; // [rsp+8h] [rbp-C8h] BYREF
__int128 v21; // [rsp+20h] [rbp-B0h] BYREF
void *v22; // [rsp+30h] [rbp-A0h]
char *v23; // [rsp+40h] [rbp-90h]
_QWORD __dst[2]; // [rsp+48h] [rbp-88h] BYREF
void *v25; // [rsp+58h] [rbp-78h]
__int128 v26; // [rsp+60h] [rbp-70h] BYREF
void *__p; // [rsp+70h] [rbp-60h]
std::string v28; // [rsp+78h] [rbp-58h] BYREF
__int128 v29; // [rsp+90h] [rbp-40h] BYREF
void *data; // [rsp+A0h] [rbp-30h]
v28.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)6;
*(_DWORD *)((char *)&v28.__r_.__value_.__l.0 + 1) = 6255461;
Key = (const std::string::value_type *)GJSearchObject::getKey(a2);
v4 = std::string::append(&v28, Key);
data = v4->__r_.__value_.__l.__data_;
v29 = *(_OWORD *)&v4->__r_.__value_.__l.0;
*(_OWORD *)&v4->__r_.__value_.__l.0 = 0;
v4->__r_.__value_.__r.__words[2] = 0;
if ( (*(_BYTE *)&v28.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v28.__r_.__value_.__l.__data_);
v5 = (char *)&v29 + 1;
v6 = (char *)&v29 + 1;
if ( (v29 & 1) != 0 )
v6 = (const char *)data;
if ( GameLevelManager::isTimeValid(a1, v6, COERCE_DOUBLE(1142292480)) )
{
v7 = cocos2d::CCDictionary::objectForKey(*(_QWORD *)(a1 + 1040), (char *)&v29);
if ( v7 )
{
v8 = *(void (__fastcall ****)(_QWORD, __int64, const char *))(a1 + 1328);
if ( v8 )
{
if ( (v29 & 1) != 0 )
v5 = (const char *)data;
(**v8)(v8, v7, v5);
}
goto LABEL_42;
}
}
v9 = (char *)&v29 + 1;
if ( (v29 & 1) != 0 )
v9 = (const char *)data;
if ( !GameLevelManager::isDLActive(a1, v9) )
{
if ( (v29 & 1) != 0 )
v5 = (const char *)data;
GameLevelManager::addDLToActive(a1, v5);
GameLevelManager::getBasePostString(&v28);
if ( (*(_BYTE *)(a2 + 320) & 1) != 0 )
{
sub_10001AD30(&v26, *(const void **)(a2 + 336), *(_QWORD *)(a2 + 328));
}
else
{
__p = *(void **)(a2 + 336);
v26 = *(_OWORD *)(a2 + 320);
}
if ( (v26 & 1) != 0 )
v10 = (char *)__p;
else
v10 = (char *)&v26 + 1;
v23 = v10;
v11 = sub_10088E820("%c%s%s%c%c%s", (char)"7");
CString = cocos2d::CCString::getCString(v11);
v13 = sub_10088E820("&str=%s&type=%i&page=%i&total=%i&count=10&star=%i&secret=%s", CString);
v14 = (const std::string::value_type *)cocos2d::CCString::getCString(v13);
std::string::append(&v28, v14);
if ( (v26 & 1) != 0 )
operator delete(__p);
v20.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x40u);
v20.__r_.__value_.__r.__words[0] = 65;
v20.__r_.__value_.__l.__size_ = 56;
strcpy(v20.__r_.__value_.__l.__data_, "https://www.boomlings.com/database/getGJEditorSounds.php");
if ( (*(_BYTE *)&v28.__r_.__value_.__s.0 & 1) != 0 )
v15 = v28.__r_.__value_.__l.__data_;
else
v15 = v28.__r_.__value_.__s.__data_;
v16 = strlen(v15);
if ( v16 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v17 = v16;
if ( v16 >= 0x17 )
{
v19 = 26;
if ( (v16 | 7) != 0x17 )
v19 = (v16 | 7) + 1;
v18 = (char *)operator new(v19);
v25 = v18;
__dst[0] = v19 | 1;
__dst[1] = v17;
}
else
{
LOBYTE(__dst[0]) = 2 * v16;
v18 = (char *)__dst + 1;
if ( !v16 )
{
BYTE1(__dst[0]) = 0;
if ( (v29 & 1) == 0 )
{
LABEL_31:
v22 = data;
v21 = v29;
goto LABEL_37;
}
LABEL_36:
sub_10001AD30(&v21, data, *((unsigned __int64 *)&v29 + 1));
LABEL_37:
GameLevelManager::ProcessHttpRequest(a1, &v20, (__int64)__dst, &v21, 0x46u);
if ( (v21 & 1) != 0 )
{
operator delete(v22);
if ( (__dst[0] & 1) == 0 )
{
LABEL_39:
if ( (*(_BYTE *)&v20.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_40;
goto LABEL_47;
}
}
else if ( (__dst[0] & 1) == 0 )
{
goto LABEL_39;
}
operator delete(v25);
if ( (*(_BYTE *)&v20.__r_.__value_.__s.0 & 1) == 0 )
{
LABEL_40:
if ( (*(_BYTE *)&v28.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_42;
goto LABEL_41;
}
LABEL_47:
operator delete(v20.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v28.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_42;
LABEL_41:
operator delete(v28.__r_.__value_.__l.__data_);
goto LABEL_42;
}
}
memmove(v18, v15, v17);
v18[v17] = 0;
if ( (v29 & 1) == 0 )
goto LABEL_31;
goto LABEL_36;
}
LABEL_42:
if ( (v29 & 1) != 0 )
operator delete(data);
}