//
// sub_10055C7F0 from 0x10055c7f0 to 0x10055cbff (1039 bytes)
//
// 4 xrefs:
// > sub_1008F8DC0 @ 0x1008f8e15
// > EditorSoundConfigInfoLayer::adminActionConfirmed @ 0x1008f8e7d
// > sub_1008F8E90 @ 0x1008f8ee4
// > EditorSoundConfigInfoLayer::FLAlert_Clicked @ 0x1008f90c6
//
// 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_10055C7F0(__int64 a1, int a2, std::string *a3, _QWORD *a4)
{
__int64 v4; // rbx
__int64 v5; // rax
const char *CString; // r14
size_t v7; // rax
size_t v8; // r13
char *v9; // r15
size_t v10; // rbx
__int64 **v11; // r12
size_t v12; // r14
char *v13; // rbx
unsigned int v14; // r13d
size_t v15; // r13
__int64 *v16; // rsi
size_t v17; // r15
int v18; // eax
bool v19; // cl
int v20; // eax
bool v21; // cl
__int64 v22; // rax
__int64 v23; // rax
const std::string::value_type *v24; // rax
const char *data; // r14
size_t v26; // rax
size_t v27; // r15
char *v28; // r12
size_t v29; // r13
char v30; // [rsp+0h] [rbp-F0h]
char v31; // [rsp+0h] [rbp-F0h]
char *v32; // [rsp+18h] [rbp-D8h]
__int64 v33; // [rsp+20h] [rbp-D0h]
std::string v36; // [rsp+38h] [rbp-B8h] BYREF
__int128 v37; // [rsp+50h] [rbp-A0h] BYREF
void *__p; // [rsp+60h] [rbp-90h]
std::string v39; // [rsp+70h] [rbp-80h] BYREF
_QWORD v40[2]; // [rsp+88h] [rbp-68h] BYREF
void *v41; // [rsp+98h] [rbp-58h]
int v42; // [rsp+A4h] [rbp-4Ch]
__int128 __dst; // [rsp+A8h] [rbp-48h] BYREF
void *__s1; // [rsp+B8h] [rbp-38h]
char v45; // [rsp+C7h] [rbp-29h]
v4 = a1;
v42 = a2;
v5 = sub_10088E820("es_del_%i", v30);
CString = (const char *)cocos2d::CCString::getCString(v5);
v7 = strlen(CString);
if ( v7 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v8 = v7;
if ( v7 >= 0x17 )
{
v10 = 26;
if ( (v7 | 7) != 0x17 )
v10 = (v7 | 7) + 1;
v9 = (char *)operator new(v10);
__s1 = v9;
*(_QWORD *)&__dst = v10 + 1;
v4 = a1;
*((_QWORD *)&__dst + 1) = v8;
goto LABEL_8;
}
LOBYTE(__dst) = 2 * v7;
v9 = (char *)&__dst + 1;
if ( v7 )
LABEL_8:
memmove(v9, CString, v8);
v9[v8] = 0;
v33 = v4;
v11 = *(__int64 ***)(v4 + 728);
if ( !v11 )
{
LABEL_27:
sub_1005913C0(v33 + 720, &__dst);
GameLevelManager::getBasePostString(&v39);
v22 = sub_10088E820("%c%s%s%c%c%s", (char)"9");
cocos2d::CCString::getCString(v22);
v23 = sub_10088E820("&soundID=%i&secret=%s", v31);
v24 = (const std::string::value_type *)cocos2d::CCString::getCString(v23);
std::string::append(&v39, v24);
GameLevelManager::appendModReason((__int64)&v39, &v39, a3, a4);
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_ = 58;
strcpy(v36.__r_.__value_.__l.__data_, "https://www.boomlings.com/database/deleteGJEditorSound.php");
if ( (*(_BYTE *)&v39.__r_.__value_.__s.0 & 1) != 0 )
data = v39.__r_.__value_.__l.__data_;
else
data = v39.__r_.__value_.__s.__data_;
v26 = strlen(data);
if ( v26 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v27 = v26;
if ( v26 >= 0x17 )
{
v29 = 26;
if ( (v26 | 7) != 0x17 )
v29 = (v26 | 7) + 1;
v28 = (char *)operator new(v29);
v41 = v28;
v40[0] = v29 | 1;
v40[1] = v27;
}
else
{
LOBYTE(v40[0]) = 2 * v26;
v28 = (char *)v40 + 1;
if ( !v26 )
{
BYTE1(v40[0]) = 0;
if ( (__dst & 1) == 0 )
{
LABEL_34:
__p = __s1;
v37 = __dst;
goto LABEL_40;
}
LABEL_39:
sub_10001AD30(&v37, __s1, *((unsigned __int64 *)&__dst + 1));
LABEL_40:
GameLevelManager::ProcessHttpRequest(v33, &v36, (__int64)v40, &v37, 0x48u);
if ( (v37 & 1) != 0 )
{
operator delete(__p);
if ( (v40[0] & 1) == 0 )
{
LABEL_42:
if ( (*(_BYTE *)&v36.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_43;
goto LABEL_50;
}
}
else if ( (v40[0] & 1) == 0 )
{
goto LABEL_42;
}
operator delete(v41);
if ( (*(_BYTE *)&v36.__r_.__value_.__s.0 & 1) == 0 )
{
LABEL_43:
if ( (*(_BYTE *)&v39.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_45;
goto LABEL_44;
}
LABEL_50:
operator delete(v36.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v39.__r_.__value_.__s.0 & 1) == 0 )
{
LABEL_45:
if ( (__dst & 1) == 0 )
return;
goto LABEL_46;
}
LABEL_44:
operator delete(v39.__r_.__value_.__l.__data_);
goto LABEL_45;
}
}
memmove(v28, data, v27);
v28[v27] = 0;
if ( (__dst & 1) == 0 )
goto LABEL_34;
goto LABEL_39;
}
v45 = __dst & 1;
if ( (__dst & 1) != 0 )
{
v12 = *((_QWORD *)&__dst + 1);
v13 = (char *)__s1;
}
else
{
v13 = (char *)&__dst + 1;
v12 = (unsigned __int8)__dst >> 1;
}
v32 = v13;
while ( 1 )
{
v14 = *((unsigned __int8 *)v11 + 32);
if ( (v14 & 1) != 0 )
{
v15 = (size_t)v11[5];
v16 = v11[6];
}
else
{
v15 = v14 >> 1;
v16 = (__int64 *)((char *)v11 + 33);
}
v17 = v12;
if ( v15 < v12 )
v17 = v15;
v18 = memcmp(v13, v16, v17);
v19 = v12 < v15;
if ( v18 )
v19 = v18 < 0;
if ( v19 )
goto LABEL_14;
v20 = memcmp(v16, v13, v17);
v21 = v15 < v12;
if ( v20 )
v21 = v20 < 0;
if ( !v21 )
break;
++v11;
LABEL_14:
v11 = (__int64 **)*v11;
v13 = v32;
if ( !v11 )
goto LABEL_27;
}
if ( v45 )
LABEL_46:
operator delete(__s1);
}