//
// sub_1000C5CF4 from 0x1000c5cf4 to 0x1000c5f7c (648 bytes)
//
// 2 xrefs:
// > sub_1004FAD8C @ 0x1004fade8
// > sub_1004FB1D8 @ 0x1004fb228
//
// This function is hookable on this platform (idp: arm, 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 10:58:49 +0000
//
__int64 __fastcall sub_1000C5CF4(__int64 a1, int a2, __int64 a3, __int64 a4)
{
__int64 result; // x0
__int64 v8; // x8
__int64 v10; // x0
char *CString; // x20
__int64 v12; // x24
__int64 v13; // x0
__int64 v14; // x24
__int64 v15; // x24
__int64 v16; // x25
__int64 v17; // x0
__int64 v18; // x0
const char *v19; // x0
__int64 v20; // x0
const std::string::value_type *v21; // x0
const std::string::value_type *v22; // x1
std::string::size_type v23; // x2
std::string *v24; // x1
void *v25[2]; // [xsp+38h] [xbp-D8h] BYREF
char v26; // [xsp+4Fh] [xbp-C1h]
void *v27[2]; // [xsp+50h] [xbp-C0h] BYREF
char v28; // [xsp+67h] [xbp-A9h]
std::string v29; // [xsp+68h] [xbp-A8h] BYREF
void *__p[2]; // [xsp+80h] [xbp-90h] BYREF
__int64 v31; // [xsp+90h] [xbp-80h]
void *v32[2]; // [xsp+A0h] [xbp-70h] BYREF
unsigned __int8 v33; // [xsp+B7h] [xbp-59h]
std::string v34; // [xsp+B8h] [xbp-58h] BYREF
result = 0;
if ( a2 >= 1 && (a4 & 0x8000000000000000LL) == 0 )
{
v8 = *(unsigned __int8 *)(a3 + 23);
if ( (v8 & 0x80u) != 0LL )
v8 = *(_QWORD *)(a3 + 8);
if ( !v8 )
return 0;
v10 = sub_1003065B0("threadSearch_%i_%lli", a2, a4);
CString = (char *)cocos2d::CCString::getCString(v10);
v12 = *(_QWORD *)(a1 + 1088);
sub_100009900(&v34, CString);
v13 = cocos2d::CCDictionary::objectForKey(v12, &v34);
v14 = v13;
if ( SHIBYTE(v34.__r_.__value_.__r.__words[2]) < 0 )
{
operator delete(v34.__r_.__value_.__l.__data_);
if ( v14 )
return 0;
}
else if ( v13 )
{
return 0;
}
v15 = *(_QWORD *)(a1 + 1088);
v16 = cocos2d::CCNode::create(v13);
sub_100009900(&v34, CString);
v17 = cocos2d::CCDictionary::setObject(v15, v16, &v34);
if ( SHIBYTE(v34.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v34.__r_.__value_.__l.__data_);
GameLevelManager::getBasePostString(v17, &v34);
v18 = sub_1003065B0("%c%s%s%c%c%s", 87, "mfd", "2893", 103, 98, "7");
v19 = (const char *)cocos2d::CCString::getCString(v18);
v20 = sub_1003065B0("&threadID=%i&beforeID=%lli&secret=%s", a2, a4, v19);
v21 = (const std::string::value_type *)cocos2d::CCString::getCString(v20);
std::string::append(&v34, v21);
std::string::append(&v34, "&query=");
if ( *(char *)(a3 + 23) < 0 )
{
sub_1000097D0(__p, *(void **)a3, *(_QWORD *)(a3 + 8));
}
else
{
*(_OWORD *)__p = *(_OWORD *)a3;
v31 = *(_QWORD *)(a3 + 16);
}
LevelTools::base64EncodeString(v32, __p);
if ( (v33 & 0x80u) == 0 )
v22 = (const std::string::value_type *)v32;
else
v22 = (const std::string::value_type *)v32[0];
if ( (v33 & 0x80u) == 0 )
v23 = v33;
else
v23 = (std::string::size_type)v32[1];
std::string::append(&v34, v22, v23);
if ( (char)v33 < 0 )
operator delete(v32[0]);
if ( SHIBYTE(v31) < 0 )
operator delete(__p[0]);
sub_100009900(&v29, "https://www.boomlings.com/database/searchGJThreadMessages.php");
if ( (v34.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v24 = &v34;
else
v24 = (std::string *)v34.__r_.__value_.__r.__words[0];
sub_100009900(v27, (char *)v24);
sub_100009900(v25, CString);
GameLevelManager::ProcessHttpRequest(a1, &v29, (char *)v27, (const std::string::value_type *)v25, 94);
if ( v26 < 0 )
operator delete(v25[0]);
if ( v28 < 0 )
operator delete(v27[0]);
if ( SHIBYTE(v29.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v29.__r_.__value_.__l.__data_);
if ( SHIBYTE(v34.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v34.__r_.__value_.__l.__data_);
return 1;
}
return result;
}