//
// sub_100573460 from 0x100573460 to 0x100573963 (1283 bytes)
//
// 2 xrefs:
// > sub_100930DF0 @ 0x100930e62
// > sub_1009314B0 @ 0x10093150f
//
// 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:15 +0000
//
char __fastcall sub_100573460(__int64 a1, int a2, std::string *a3, __int64 a4)
{
__int64 v4; // r14
unsigned int v5; // eax
__int64 v7; // rax
void *CString; // rax
size_t v9; // rax
std::string::size_type v10; // rbx
char *data; // r15
size_t v12; // r14
__int64 v13; // rbx
__int64 v15; // r15
size_t v16; // rax
std::string::size_type v17; // rbx
char *v18; // r15
size_t v19; // r14
__int64 v20; // rax
__int64 v21; // rax
const std::string::value_type *v22; // rax
const std::string::value_type *v23; // rsi
std::string::size_type size; // rdx
const char *v25; // r14
size_t v26; // rax
size_t v27; // r15
char *v28; // rbx
size_t v29; // r12
size_t v30; // rax
size_t v31; // r14
char *v32; // rbx
size_t v33; // r15
char v34; // [rsp+0h] [rbp-F0h]
char v35; // [rsp+0h] [rbp-F0h]
std::string *v36; // [rsp+8h] [rbp-E8h]
__int64 v37; // [rsp+10h] [rbp-E0h]
std::string v38; // [rsp+18h] [rbp-D8h] BYREF
std::string v39; // [rsp+30h] [rbp-C0h] BYREF
std::string v40; // [rsp+50h] [rbp-A0h] BYREF
_QWORD v41[2]; // [rsp+68h] [rbp-88h] BYREF
void *v42; // [rsp+78h] [rbp-78h]
__int128 v43; // [rsp+80h] [rbp-70h] BYREF
void *v44; // [rsp+90h] [rbp-60h]
void *v45; // [rsp+98h] [rbp-58h]
__int64 v46; // [rsp+A0h] [rbp-50h]
void *__src; // [rsp+A8h] [rbp-48h]
std::string __dst[2]; // [rsp+B0h] [rbp-40h] BYREF
if ( a2 <= 0 || a4 < 0 )
return 0;
v4 = a1;
v5 = (unsigned int)a3->__r_.__value_.__l.0;
if ( (v5 & 1) != 0 )
{
if ( !a3->__r_.__value_.__l.__size_ )
return 0;
}
else if ( !(v5 >> 1) )
{
return 0;
}
v7 = sub_10088E820("threadSearch_%i_%lli", v34);
CString = (void *)cocos2d::CCString::getCString(v7);
v45 = *(void **)(a1 + 1088);
__src = CString;
v9 = strlen((const char *)CString);
if ( v9 >= 0xFFFFFFFFFFFFFFF8LL )
LABEL_67:
sub_100003630();
v10 = v9;
v36 = a3;
if ( v9 >= 0x17 )
{
v46 = a1;
v12 = 26;
if ( (v9 | 7) != 0x17 )
v12 = (v9 | 7) + 1;
data = (char *)operator new(v12);
__dst[0].__r_.__value_.__r.__words[2] = (std::string::size_type)data;
__dst[0].__r_.__value_.__r.__words[0] = v12 + 1;
v4 = v46;
__dst[0].__r_.__value_.__l.__size_ = v10;
goto LABEL_13;
}
__dst[0].__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v9);
data = __dst[0].__r_.__value_.__s.__data_;
if ( v9 )
LABEL_13:
memmove(data, __src, v10);
data[v10] = 0;
v13 = cocos2d::CCDictionary::objectForKey((__int64)v45, (char *)__dst);
if ( (*(_BYTE *)&__dst[0].__r_.__value_.__s.0 & 1) != 0 )
operator delete(__dst[0].__r_.__value_.__l.__data_);
if ( v13 )
return 0;
v15 = *(_QWORD *)(v4 + 1088);
v45 = cocos2d::CCNode::create();
v16 = strlen((const char *)__src);
if ( v16 >= 0xFFFFFFFFFFFFFFF8LL )
goto LABEL_67;
v17 = v16;
v37 = v15;
v46 = v4;
if ( v16 >= 0x17 )
{
v19 = 26;
if ( (v16 | 7) != 0x17 )
v19 = (v16 | 7) + 1;
v18 = (char *)operator new(v19);
__dst[0].__r_.__value_.__r.__words[2] = (std::string::size_type)v18;
__dst[0].__r_.__value_.__r.__words[0] = v19 + 1;
__dst[0].__r_.__value_.__l.__size_ = v17;
goto LABEL_25;
}
__dst[0].__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v16);
v18 = __dst[0].__r_.__value_.__s.__data_;
if ( v16 )
LABEL_25:
memmove(v18, __src, v17);
v18[v17] = 0;
cocos2d::CCDictionary::setObject(v37, (__int64)v45, (char *)__dst);
if ( (*(_BYTE *)&__dst[0].__r_.__value_.__s.0 & 1) != 0 )
operator delete(__dst[0].__r_.__value_.__l.__data_);
GameLevelManager::getBasePostString(__dst);
v20 = sub_10088E820("%c%s%s%c%c%s", (char)"7");
cocos2d::CCString::getCString(v20);
v21 = sub_10088E820("&threadID=%i&beforeID=%lli&secret=%s", v35);
v22 = (const std::string::value_type *)cocos2d::CCString::getCString(v21);
std::string::append(__dst, v22);
std::string::append(__dst, "&query=");
if ( (*(_BYTE *)&v36->__r_.__value_.__s.0 & 1) != 0 )
sub_10001AD30(&v39, v36->__r_.__value_.__l.__data_, v36->__r_.__value_.__l.__size_);
else
v39 = *v36;
LevelTools::base64EncodeString(&v40, &v39);
if ( (*(_BYTE *)&v40.__r_.__value_.__s.0 & 1) != 0 )
{
v23 = v40.__r_.__value_.__l.__data_;
size = v40.__r_.__value_.__l.__size_;
}
else
{
size = *(_BYTE *)&v40.__r_.__value_.__l.0 >> 1;
v23 = v40.__r_.__value_.__s.__data_;
}
std::string::append(__dst, v23, size);
if ( (*(_BYTE *)&v40.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v40.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v39.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v39.__r_.__value_.__l.__data_);
v38.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x40u);
v38.__r_.__value_.__r.__words[0] = 65;
v38.__r_.__value_.__l.__size_ = 61;
strcpy(v38.__r_.__value_.__l.__data_, "https://www.boomlings.com/database/searchGJThreadMessages.php");
if ( (*(_BYTE *)&__dst[0].__r_.__value_.__s.0 & 1) != 0 )
v25 = __dst[0].__r_.__value_.__l.__data_;
else
v25 = __dst[0].__r_.__value_.__s.__data_;
v26 = strlen(v25);
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);
v42 = v28;
v41[0] = v29 | 1;
v41[1] = v27;
goto LABEL_48;
}
LOBYTE(v41[0]) = 2 * v26;
v28 = (char *)v41 + 1;
if ( v26 )
LABEL_48:
memmove(v28, v25, v27);
v28[v27] = 0;
v30 = strlen((const char *)__src);
if ( v30 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v31 = v30;
if ( v30 >= 0x17 )
{
v33 = 26;
if ( (v30 | 7) != 0x17 )
v33 = (v30 | 7) + 1;
v32 = (char *)operator new(v33);
v44 = v32;
*(_QWORD *)&v43 = v33 | 1;
*((_QWORD *)&v43 + 1) = v31;
goto LABEL_56;
}
LOBYTE(v43) = 2 * v30;
v32 = (char *)&v43 + 1;
if ( v30 )
LABEL_56:
memmove(v32, __src, v31);
v32[v31] = 0;
GameLevelManager::ProcessHttpRequest(v46, &v38, (__int64)v41, &v43, 0x5Eu);
if ( (v43 & 1) != 0 )
{
operator delete(v44);
if ( (v41[0] & 1) == 0 )
{
LABEL_59:
if ( (*(_BYTE *)&v38.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_60;
LABEL_65:
operator delete(v38.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&__dst[0].__r_.__value_.__s.0 & 1) == 0 )
return 1;
goto LABEL_61;
}
}
else if ( (v41[0] & 1) == 0 )
{
goto LABEL_59;
}
operator delete(v42);
if ( (*(_BYTE *)&v38.__r_.__value_.__s.0 & 1) != 0 )
goto LABEL_65;
LABEL_60:
if ( (*(_BYTE *)&__dst[0].__r_.__value_.__s.0 & 1) != 0 )
LABEL_61:
operator delete(__dst[0].__r_.__value_.__l.__data_);
return 1;
}