//
// GameLevelManager::deleteUserMessages from 0x1005696d0 to 0x100569add (1037 bytes)
//
// 3 xrefs:
// > MessagesProfilePage::deleteSelected @ 0x1002133bf
// > GJMessageCell::FLAlert_Clicked @ 0x1002426d7
// > GJMessagePopup::FLAlert_Clicked @ 0x100295060
//
// 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:12 +0000
//
__int64 __fastcall GameLevelManager::deleteUserMessages(__int64 a1, __int64 a2, __int64 a3, char a4)
{
__int64 v6; // r14
__int64 v7; // rax
const std::string::value_type *CString; // rax
const char *data; // rbx
__int64 v11; // rbx
void *v12; // rax
__int64 v13; // rax
__int64 v14; // rax
const std::string::value_type *v15; // rax
__int64 v16; // rax
const std::string::value_type *v17; // rax
size_t v18; // rax
size_t v19; // r14
char *v20; // r15
size_t v21; // r12
__int64 v22; // rax
const std::string::value_type *v23; // rax
unsigned int i; // r15d
__int64 v25; // rax
const std::string::value_type *v26; // rax
char v27; // [rsp+0h] [rbp-B0h]
char v28; // [rsp+0h] [rbp-B0h]
char v29; // [rsp+0h] [rbp-B0h]
char v30; // [rsp+0h] [rbp-B0h]
std::string v31; // [rsp+8h] [rbp-A8h] BYREF
__int128 v32; // [rsp+20h] [rbp-90h] BYREF
void *__p; // [rsp+30h] [rbp-80h]
_QWORD __dst[2]; // [rsp+38h] [rbp-78h] BYREF
void *v35; // [rsp+48h] [rbp-68h]
__int64 v36; // [rsp+50h] [rbp-60h]
std::string v37; // [rsp+58h] [rbp-58h] BYREF
std::string v38; // [rsp+70h] [rbp-40h] BYREF
v36 = a1;
*(_WORD *)&v37.__r_.__value_.__l.0 = 0;
if ( a3 )
{
v6 = a3;
if ( (unsigned int)sub_1007FEF90(a3) != 1 )
goto LABEL_5;
a2 = sub_1007FEFE0(v6, 0);
}
v6 = 0;
LABEL_5:
if ( a2 || v6 )
{
v7 = sub_10088E820("delMsg_%i_%i", v27);
CString = (const std::string::value_type *)cocos2d::CCString::getCString(v7);
std::string::assign(&v37, CString);
if ( !cocos2d::CCDictionary::objectForKey(*(_QWORD *)(v36 + 1088), (char *)&v37) )
{
v11 = *(_QWORD *)(v36 + 1088);
v12 = cocos2d::CCNode::create();
cocos2d::CCDictionary::setObject(v11, (__int64)v12, (char *)&v37);
GameLevelManager::getBasePostString(&v38);
v13 = sub_10088E820("%c%s%s%c%c%s", (char)"7");
cocos2d::CCString::getCString(v13);
v14 = sub_10088E820("&secret=%s", v28);
v15 = (const std::string::value_type *)cocos2d::CCString::getCString(v14);
std::string::append(&v38, v15);
if ( a4 )
std::string::append(&v38, "&isSender=1");
if ( a2 )
{
std::string::append(&v38, "&messageID=");
v16 = sub_10088E820("%i", v29);
v17 = (const std::string::value_type *)cocos2d::CCString::getCString(v16);
std::string::append(&v38, v17);
}
else
{
std::string::append(&v38, "&messages=");
if ( (unsigned int)sub_1007FEF90(v6) )
{
sub_1007FEFE0(v6, 0);
v22 = sub_10088E820("%i", v29);
v23 = (const std::string::value_type *)cocos2d::CCString::getCString(v22);
std::string::append(&v38, v23);
for ( i = 1; i < (unsigned int)sub_1007FEF90(v6); ++i )
{
sub_1007FEFE0(v6, i);
std::string::append(&v38, ",");
v25 = sub_10088E820("%i", v30);
v26 = (const std::string::value_type *)cocos2d::CCString::getCString(v25);
std::string::append(&v38, v26);
}
}
}
v31.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x40u);
v31.__r_.__value_.__r.__words[0] = 65;
v31.__r_.__value_.__l.__size_ = 57;
strcpy(v31.__r_.__value_.__l.__data_, "https://www.boomlings.com/database/deleteGJMessages20.php");
if ( (*(_BYTE *)&v38.__r_.__value_.__s.0 & 1) != 0 )
data = v38.__r_.__value_.__l.__data_;
else
data = v38.__r_.__value_.__s.__data_;
v18 = strlen(data);
if ( v18 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v19 = v18;
if ( v18 >= 0x17 )
{
v21 = 26;
if ( (v18 | 7) != 0x17 )
v21 = (v18 | 7) + 1;
v20 = (char *)operator new(v21);
v35 = v20;
__dst[0] = v21 | 1;
__dst[1] = v19;
}
else
{
LOBYTE(__dst[0]) = 2 * v18;
v20 = (char *)__dst + 1;
if ( !v18 )
{
BYTE1(__dst[0]) = 0;
if ( (*(_BYTE *)&v37.__r_.__value_.__s.0 & 1) == 0 )
{
LABEL_22:
__p = v37.__r_.__value_.__l.__data_;
v32 = *(_OWORD *)&v37.__r_.__value_.__l.0;
goto LABEL_28;
}
LABEL_27:
sub_10001AD30(&v32, v37.__r_.__value_.__l.__data_, v37.__r_.__value_.__l.__size_);
LABEL_28:
GameLevelManager::ProcessHttpRequest(v36, &v31, (__int64)__dst, &v32, 0x2Du);
if ( (v32 & 1) != 0 )
{
operator delete(__p);
if ( (__dst[0] & 1) == 0 )
{
LABEL_30:
if ( (*(_BYTE *)&v31.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_31;
goto LABEL_37;
}
}
else if ( (__dst[0] & 1) == 0 )
{
goto LABEL_30;
}
operator delete(v35);
if ( (*(_BYTE *)&v31.__r_.__value_.__s.0 & 1) == 0 )
{
LABEL_31:
if ( (*(_BYTE *)&v38.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_33;
goto LABEL_32;
}
LABEL_37:
operator delete(v31.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v38.__r_.__value_.__s.0 & 1) == 0 )
{
LABEL_33:
LOBYTE(data) = 1;
if ( (*(_BYTE *)&v37.__r_.__value_.__s.0 & 1) == 0 )
return (unsigned int)data;
goto LABEL_9;
}
LABEL_32:
operator delete(v38.__r_.__value_.__l.__data_);
goto LABEL_33;
}
}
memmove(v20, data, v19);
v20[v19] = 0;
if ( (*(_BYTE *)&v37.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_22;
goto LABEL_27;
}
}
LODWORD(data) = 0;
if ( (*(_BYTE *)&v37.__r_.__value_.__s.0 & 1) != 0 )
LABEL_9:
operator delete(v37.__r_.__value_.__l.__data_);
return (unsigned int)data;
}