//
// sub_1000C8838 from 0x1000c8838 to 0x1000c8aec (692 bytes)
//
// 21 xrefs:
// > sub_1000C8B88 @ 0x1000c8c44
// > sub_1004F5648 @ 0x1004f5714
// > MessageThreadsPage::FLAlert_Clicked @ 0x1004f6208
// > MessageThreadsPage::FLAlert_Clicked @ 0x1004f6250
// > MessageThreadsPage::FLAlert_Clicked @ 0x1004f6338
// > sub_1005018F0 @ 0x100501994
// > sub_100507BEC @ 0x100507c7c
// > MemberListPopup::FLAlert_Clicked @ 0x100508254
// > MemberListPopup::FLAlert_Clicked @ 0x1005082e4
// > MemberListPopup::FLAlert_Clicked @ 0x100508374
// > sub_10050D428 @ 0x10050d484
// > sub_10050D4EC @ 0x10050d548
// > ThreadOptionsPopup::FLAlert_Clicked @ 0x10050da80
// > ThreadOptionsPopup::FLAlert_Clicked @ 0x10050daf8
// > ThreadOptionsPopup::FLAlert_Clicked @ 0x10050dc08
// > ThreadOptionsPopup::FLAlert_Clicked @ 0x10050dc90
// > sub_1005104E8 @ 0x100510540
// > InvitesPopup::FLAlert_Clicked @ 0x100510720
// > sub_100511188 @ 0x10051121c
// > sub_1005135EC @ 0x10051379c
// > sub_100513BD8 @ 0x100513c00
//
// 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:50 +0000
//
__int64 __fastcall sub_1000C8838(__int64 a1, int a2, int a3, __int64 a4)
{
__int64 result; // x0
__int64 v9; // 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
__int64 v22; // x8
const std::string::value_type *v23; // x1
std::string::size_type v24; // x2
std::string *v25; // x1
void *v26[2]; // [xsp+38h] [xbp-D8h] BYREF
char v27; // [xsp+4Fh] [xbp-C1h]
void *v28[2]; // [xsp+50h] [xbp-C0h] BYREF
char v29; // [xsp+67h] [xbp-A9h]
std::string v30; // [xsp+68h] [xbp-A8h] BYREF
void *__p[2]; // [xsp+80h] [xbp-90h] BYREF
__int64 v32; // [xsp+90h] [xbp-80h]
void *v33[2]; // [xsp+A0h] [xbp-70h] BYREF
unsigned __int8 v34; // [xsp+B7h] [xbp-59h]
std::string v35; // [xsp+B8h] [xbp-58h] BYREF
result = 0;
if ( (a2 & 0x80000000) == 0 && a3 >= 1 )
{
if ( !a2 && a3 != 3 )
{
if ( a3 != 1 )
return 0;
v9 = *(unsigned __int8 *)(a4 + 23);
if ( (v9 & 0x80u) != 0LL )
v9 = *(_QWORD *)(a4 + 8);
if ( !v9 )
return 0;
}
v10 = sub_1003065B0("threadUpd_%i_%i", a2, a3);
CString = (char *)cocos2d::CCString::getCString(v10);
v12 = *(_QWORD *)(a1 + 1088);
sub_100009900(&v35, CString);
v13 = cocos2d::CCDictionary::objectForKey(v12, &v35);
v14 = v13;
if ( SHIBYTE(v35.__r_.__value_.__r.__words[2]) < 0 )
{
operator delete(v35.__r_.__value_.__l.__data_);
if ( v14 )
return 0;
}
else if ( v13 )
{
return 0;
}
v15 = *(_QWORD *)(a1 + 1088);
v16 = cocos2d::CCNode::create(v13);
sub_100009900(&v35, CString);
v17 = cocos2d::CCDictionary::setObject(v15, v16, &v35);
if ( SHIBYTE(v35.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v35.__r_.__value_.__l.__data_);
GameLevelManager::getBasePostString(v17, &v35);
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&mode=%i&secret=%s", a2, a3, v19);
v21 = (const std::string::value_type *)cocos2d::CCString::getCString(v20);
std::string::append(&v35, v21);
v22 = *(unsigned __int8 *)(a4 + 23);
if ( (v22 & 0x80u) != 0LL )
v22 = *(_QWORD *)(a4 + 8);
if ( v22 )
{
std::string::append(&v35, "&value=");
if ( *(char *)(a4 + 23) < 0 )
{
sub_1000097D0(__p, *(void **)a4, *(_QWORD *)(a4 + 8));
}
else
{
*(_OWORD *)__p = *(_OWORD *)a4;
v32 = *(_QWORD *)(a4 + 16);
}
LevelTools::base64EncodeString(v33, __p);
if ( (v34 & 0x80u) == 0 )
v23 = (const std::string::value_type *)v33;
else
v23 = (const std::string::value_type *)v33[0];
if ( (v34 & 0x80u) == 0 )
v24 = v34;
else
v24 = (std::string::size_type)v33[1];
std::string::append(&v35, v23, v24);
if ( (char)v34 < 0 )
operator delete(v33[0]);
if ( SHIBYTE(v32) < 0 )
operator delete(__p[0]);
}
sub_100009900(&v30, "https://www.boomlings.com/database/updateGJThread.php");
if ( (v35.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v25 = &v35;
else
v25 = (std::string *)v35.__r_.__value_.__r.__words[0];
sub_100009900(v28, (char *)v25);
sub_100009900(v26, CString);
GameLevelManager::ProcessHttpRequest(a1, &v30, (char *)v28, (const std::string::value_type *)v26, 95);
if ( v27 < 0 )
operator delete(v26[0]);
if ( v29 < 0 )
operator delete(v28[0]);
if ( SHIBYTE(v30.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v30.__r_.__value_.__l.__data_);
if ( SHIBYTE(v35.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v35.__r_.__value_.__l.__data_);
return 1;
}
return result;
}