//
// sub_10055CCC0 from 0x10055ccc0 to 0x10055d162 (1186 bytes)
//
// 1 xrefs:
// > EditorSoundConfigInfoLayer::soundPackDescSaved @ 0x1008f7cfc
//
// 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
//
__int64 __fastcall sub_10055CCC0(__int64 a1, int a2)
{
__int64 v2; // rax
const char *CString; // rbx
size_t v4; // rax
size_t v5; // r13
char *v6; // r12
size_t v7; // r14
__int64 **v8; // r15
size_t v9; // rbx
char *v10; // r14
unsigned int v11; // r13d
size_t v12; // r13
__int64 *v13; // rsi
size_t v14; // r12
int v15; // eax
bool v16; // cl
int v17; // eax
bool v18; // cl
__int64 v19; // rax
__int64 v20; // rax
const std::string::value_type *v21; // rax
const char *data; // r14
size_t v23; // rax
size_t v24; // r15
char *v25; // rbx
const char *v26; // r14
size_t v27; // r12
size_t v28; // rax
size_t v29; // r15
char *v30; // rbx
size_t v31; // r12
char v33; // [rsp+0h] [rbp-E0h]
char v34; // [rsp+0h] [rbp-E0h]
char *v35; // [rsp+10h] [rbp-D0h]
std::string v36; // [rsp+28h] [rbp-B8h] BYREF
std::string v37; // [rsp+40h] [rbp-A0h] BYREF
__int64 v38; // [rsp+58h] [rbp-88h]
_QWORD v39[2]; // [rsp+60h] [rbp-80h] BYREF
void *v40; // [rsp+70h] [rbp-70h]
__int128 v41; // [rsp+78h] [rbp-68h] BYREF
void *__p; // [rsp+88h] [rbp-58h]
int v43; // [rsp+94h] [rbp-4Ch]
size_t __dst; // [rsp+98h] [rbp-48h] BYREF
size_t v45; // [rsp+A0h] [rbp-40h]
void *__s1; // [rsp+A8h] [rbp-38h]
char v47; // [rsp+B7h] [rbp-29h]
v43 = a2;
v2 = sub_10088E820("es_desc_%i", v33);
CString = (const char *)cocos2d::CCString::getCString(v2);
v4 = strlen(CString);
if ( v4 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v5 = v4;
if ( v4 >= 0x17 )
{
v7 = 26;
if ( (v4 | 7) != 0x17 )
v7 = (v4 | 7) + 1;
v6 = (char *)operator new(v7);
__s1 = v6;
__dst = v7 + 1;
v45 = v5;
goto LABEL_8;
}
LOBYTE(__dst) = 2 * v4;
v6 = (char *)&__dst + 1;
if ( v4 )
LABEL_8:
memmove(v6, CString, v5);
v6[v5] = 0;
v38 = a1;
v8 = *(__int64 ***)(a1 + 728);
if ( !v8 )
{
LABEL_27:
sub_1005913C0(v38 + 720, &__dst);
GameLevelManager::getBasePostString(&v37);
v19 = sub_10088E820("%c%s%s%c%c%s", (char)"9");
cocos2d::CCString::getCString(v19);
v20 = sub_10088E820("&soundID=%i&soundDesc=%s&emote=%s&secret=%s", v34);
v21 = (const std::string::value_type *)cocos2d::CCString::getCString(v20);
std::string::append(&v37, v21);
v36.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x40u);
v36.__r_.__value_.__r.__words[0] = 65;
v36.__r_.__value_.__l.__size_ = 56;
strcpy(v36.__r_.__value_.__l.__data_, "https://www.boomlings.com/database/updateGJSoundDesc.php");
if ( (*(_BYTE *)&v37.__r_.__value_.__s.0 & 1) != 0 )
data = v37.__r_.__value_.__l.__data_;
else
data = v37.__r_.__value_.__s.__data_;
v23 = strlen(data);
if ( v23 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v24 = v23;
if ( v23 >= 0x17 )
{
v27 = 26;
if ( (v23 | 7) != 0x17 )
v27 = (v23 | 7) + 1;
v25 = (char *)operator new(v27);
v40 = v25;
v39[0] = v27 | 1;
v39[1] = v24;
}
else
{
LOBYTE(v39[0]) = 2 * v23;
v25 = (char *)v39 + 1;
if ( !v23 )
{
BYTE1(v39[0]) = 0;
if ( (__dst & 1) != 0 )
{
LABEL_34:
v26 = (const char *)__s1;
goto LABEL_40;
}
LABEL_39:
v26 = (char *)&__dst + 1;
LABEL_40:
v28 = strlen(v26);
if ( v28 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v29 = v28;
if ( v28 >= 0x17 )
{
v31 = 26;
if ( (v28 | 7) != 0x17 )
v31 = (v28 | 7) + 1;
v30 = (char *)operator new(v31);
__p = v30;
*(_QWORD *)&v41 = v31 | 1;
*((_QWORD *)&v41 + 1) = v29;
}
else
{
LOBYTE(v41) = 2 * v28;
v30 = (char *)&v41 + 1;
if ( !v28 )
{
LABEL_48:
v30[v29] = 0;
GameLevelManager::ProcessHttpRequest(v38, &v36, (__int64)v39, &v41, 0x49u);
if ( (v41 & 1) != 0 )
{
operator delete(__p);
if ( (v39[0] & 1) == 0 )
{
LABEL_50:
if ( (*(_BYTE *)&v36.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_51;
goto LABEL_58;
}
}
else if ( (v39[0] & 1) == 0 )
{
goto LABEL_50;
}
operator delete(v40);
if ( (*(_BYTE *)&v36.__r_.__value_.__s.0 & 1) == 0 )
{
LABEL_51:
if ( (*(_BYTE *)&v37.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_53;
goto LABEL_52;
}
LABEL_58:
operator delete(v36.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v37.__r_.__value_.__s.0 & 1) == 0 )
{
LABEL_53:
LOBYTE(v30) = 1;
if ( (__dst & 1) != 0 )
goto LABEL_54;
return (unsigned int)v30;
}
LABEL_52:
operator delete(v37.__r_.__value_.__l.__data_);
goto LABEL_53;
}
}
memmove(v30, v26, v29);
goto LABEL_48;
}
}
memmove(v25, data, v24);
v25[v24] = 0;
if ( (__dst & 1) != 0 )
goto LABEL_34;
goto LABEL_39;
}
v47 = __dst & 1;
if ( (__dst & 1) != 0 )
{
v9 = v45;
v10 = (char *)__s1;
}
else
{
v10 = (char *)&__dst + 1;
v9 = (unsigned __int8)__dst >> 1;
}
v35 = v10;
while ( 1 )
{
v11 = *((unsigned __int8 *)v8 + 32);
if ( (v11 & 1) != 0 )
{
v12 = (size_t)v8[5];
v13 = v8[6];
}
else
{
v12 = v11 >> 1;
v13 = (__int64 *)((char *)v8 + 33);
}
v14 = v9;
if ( v12 < v9 )
v14 = v12;
v15 = memcmp(v10, v13, v14);
v16 = v9 < v12;
if ( v15 )
v16 = v15 < 0;
if ( v16 )
goto LABEL_14;
v17 = memcmp(v13, v10, v14);
v18 = v12 < v9;
if ( v17 )
v18 = v17 < 0;
if ( !v18 )
break;
++v8;
LABEL_14:
v8 = (__int64 **)*v8;
v10 = v35;
if ( !v8 )
goto LABEL_27;
}
LODWORD(v30) = 0;
if ( !v47 )
return (unsigned int)v30;
LABEL_54:
operator delete(__s1);
return (unsigned int)v30;
}