//
// GameLevelManager::updateEditorSoundDescription from 0x14022ff90 to 0x140230390 (1024 bytes)
//
// 2 xrefs:
// > EditorSoundConfigInfoLayer::soundPackDescSaved @ 0x14019609c
// > ??> @ 0x14091bea8
//
// 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 11:28:30 +0000
//
// Hidden C++ exception states: #wind=5
char __fastcall GameLevelManager::updateEditorSoundDescription(__int64 a1, int a2, const char *a3, const char *a4)
{
cocos2d::CCString *v6; // rax
const char *CString; // rax
size_t v8; // rbx
size_t v9; // r8
__int64 *v10; // rdx
__int64 *v11; // r14
unsigned __int64 v12; // r13
size_t v13; // rsi
void **v14; // r15
_QWORD *v15; // rcx
void **v16; // rdx
size_t v17; // rdi
size_t v18; // r8
unsigned int v19; // ecx
unsigned int v20; // ecx
__int64 *v21; // rax
const void *v22; // rax
void **v23; // rcx
size_t v24; // rdi
size_t v25; // r8
int v26; // eax
void **v27; // rax
cocos2d::CCActionManager **v29; // r14
__int64 v30; // rcx
const char *v31; // rsi
const char *v32; // rdi
cocos2d::CCString *v33; // rax
const char *v34; // rax
cocos2d::CCString *v35; // rax
char *v36; // rax
size_t v37; // r8
void **v38; // rdx
size_t v39; // r8
_QWORD *v40; // rdx
void *v41; // rcx
__int128 v43; // [rsp+48h] [rbp-B8h] BYREF
__int64 v44; // [rsp+58h] [rbp-A8h]
__int64 v45; // [rsp+60h] [rbp-A0h]
__int128 *v46; // [rsp+68h] [rbp-98h]
const char *v47; // [rsp+70h] [rbp-90h]
__int128 v48; // [rsp+78h] [rbp-88h] BYREF
__int64 v49; // [rsp+88h] [rbp-78h]
__int64 v50; // [rsp+90h] [rbp-70h]
__int128 v51; // [rsp+98h] [rbp-68h] BYREF
__int64 v52; // [rsp+A8h] [rbp-58h]
__int64 v53; // [rsp+B0h] [rbp-50h]
const char *v54; // [rsp+B8h] [rbp-48h]
void *Buf2[2]; // [rsp+C0h] [rbp-40h] BYREF
size_t Size; // [rsp+D0h] [rbp-30h]
unsigned __int64 v57; // [rsp+D8h] [rbp-28h]
_QWORD Src[4]; // [rsp+E0h] [rbp-20h] BYREF
v47 = a4;
v46 = (__int128 *)a1;
v54 = a3;
v6 = cocos2d::CCString::createWithFormat("es_desc_%i", a2);
CString = cocos2d::CCString::getCString(v6);
*(_OWORD *)Buf2 = 0;
Size = 0;
v57 = 0;
v8 = -1;
v9 = -1;
do
++v9;
while ( CString[v9] );
sub_14003D230(Buf2, CString, v9);
v10 = *(__int64 **)(a1 + 824);
v11 = (__int64 *)v10[1];
v12 = v57;
v13 = Size;
v14 = (void **)Buf2[0];
if ( !*((_BYTE *)v11 + 25) )
{
do
{
*(_QWORD *)&v43 = v10;
v15 = v11 + 4;
v16 = Buf2;
if ( v12 > 0xF )
v16 = v14;
if ( (unsigned __int64)v11[7] > 0xF )
v15 = (_QWORD *)*v15;
v17 = v11[6];
v18 = v17;
if ( v13 < v17 )
v18 = v13;
v19 = memcmp(v15, v16, v18);
if ( !v19 )
{
if ( v17 >= v13 )
v19 = v17 > v13;
else
v19 = -1;
}
v20 = v19 >> 31;
v10 = v11;
if ( (_BYTE)v20 )
v10 = (__int64 *)v43;
v21 = v11 + 2;
if ( !(_BYTE)v20 )
v21 = v11;
v11 = (__int64 *)*v21;
}
while ( !*(_BYTE *)(*v21 + 25) );
}
if ( !*((_BYTE *)v10 + 25) )
{
v22 = v10 + 4;
if ( (unsigned __int64)v10[7] > 0xF )
v22 = (const void *)v10[4];
v23 = Buf2;
if ( v12 > 0xF )
v23 = v14;
v24 = v10[6];
v25 = v13;
if ( v24 < v13 )
v25 = v10[6];
v26 = memcmp(v23, v22, v25);
if ( !v26 )
{
if ( v13 >= v24 )
v26 = v13 > v24;
else
v26 = -1;
}
if ( v26 >= 0 )
{
if ( v12 <= 0xF )
{
LABEL_35:
sub_14003D310((__int64)a3);
return 0;
}
v27 = v14;
if ( v12 + 1 < 0x1000 || (v14 = (void **)*(v14 - 1), (unsigned __int64)((char *)v27 - (char *)v14 - 8) <= 0x1F) )
{
j_j_free(v14);
goto LABEL_35;
}
LABEL_55:
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
}
v29 = (cocos2d::CCActionManager **)v46;
sub_1400CF4B0((__int64 *)v46 + 103, (__int64)&v43, Buf2);
GameLevelManager::getBasePostString(v30, Src);
v31 = v47;
if ( *((_QWORD *)v47 + 3) > 0xFu )
v31 = *(const char **)v47;
v32 = a3;
if ( *((_QWORD *)a3 + 3) > 0xFu )
v32 = *(const char **)a3;
v33 = cocos2d::CCString::createWithFormat("%c%s%s%c%c%s", 87, "mfv", "2898", 103, 99, "9");
v34 = cocos2d::CCString::getCString(v33);
v35 = cocos2d::CCString::createWithFormat("&soundID=%i&soundDesc=%s&emote=%s&secret=%s", a2, v32, v31, v34);
v36 = (char *)cocos2d::CCString::getCString(v35);
v37 = -1;
do
++v37;
while ( v36[v37] );
sub_140044D80(Src, v36, v37);
v47 = (const char *)&v48;
v46 = &v51;
v38 = Buf2;
if ( v57 > 0xF )
v38 = (void **)Buf2[0];
v48 = 0;
v49 = 0;
v50 = 0;
v39 = -1;
do
++v39;
while ( *((_BYTE *)v38 + v39) );
sub_14003D230(&v48, v38, v39);
v40 = Src;
if ( Src[3] > 0xFu )
v40 = (_QWORD *)Src[0];
v51 = 0;
v52 = 0;
v53 = 0;
do
++v8;
while ( *((_BYTE *)v40 + v8) );
sub_14003D230(&v51, v40, v8);
v43 = 0;
v44 = 0;
v45 = 0;
*(_QWORD *)&v43 = sub_14003D460(0x40u);
v44 = 56;
v45 = 63;
strcpy((char *)v43, "https://www.boomlings.com/database/updateGJSoundDesc.php");
GameLevelManager::ProcessHttpRequest(v29, (__int64)&v43, (const char *)&v51, (const char *)&v48, 0x49u);
sub_14003D310((__int64)Src);
if ( v57 > 0xF )
{
v41 = Buf2[0];
if ( v57 + 1 >= 0x1000 )
{
v41 = *((void **)Buf2[0] - 1);
if ( (unsigned __int64)((char *)Buf2[0] - (char *)v41 - 8) > 0x1F )
goto LABEL_55;
}
j_j_free(v41);
}
sub_14003D310((__int64)a3);
return 1;
}