//
// GameLevelManager::getThreadInvites from 0x100575610 to 0x1005758ae (670 bytes)
//
// 2 xrefs:
// > InvitesPopup::init @ 0x10094c1e1
// > InvitesPopup::threadUpdateFailed @ 0x10094f12f
//
// 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:16 +0000
//
bool __fastcall GameLevelManager::getThreadInvites(__int64 a1)
{
__int64 v2; // rdi
__int64 v3; // r13
__int64 v4; // rbx
void *v5; // rax
__int64 v6; // rax
__int64 v7; // rax
const std::string::value_type *CString; // rax
const char *data; // r15
size_t v10; // rax
size_t v11; // r12
char *v12; // r13
size_t v13; // rbx
char v15; // [rsp+0h] [rbp-A0h]
std::string v16; // [rsp+18h] [rbp-88h] BYREF
__int128 v17; // [rsp+30h] [rbp-70h] BYREF
void *__p; // [rsp+40h] [rbp-60h]
_QWORD __dst[2]; // [rsp+48h] [rbp-58h] BYREF
void *v20; // [rsp+58h] [rbp-48h]
std::string v21; // [rsp+60h] [rbp-40h] BYREF
v2 = *(_QWORD *)(a1 + 1088);
v21.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)26;
strcpy(v21.__r_.__value_.__s.__data_, "threadInvites");
v3 = cocos2d::CCDictionary::objectForKey(v2, (char *)&v21);
if ( (*(_BYTE *)&v21.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v21.__r_.__value_.__l.__data_);
if ( v3 )
return v3 == 0;
v4 = *(_QWORD *)(a1 + 1088);
v5 = cocos2d::CCNode::create();
v21.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)26;
strcpy(v21.__r_.__value_.__s.__data_, "threadInvites");
cocos2d::CCDictionary::setObject(v4, (__int64)v5, (char *)&v21);
if ( (*(_BYTE *)&v21.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v21.__r_.__value_.__l.__data_);
GameLevelManager::getBasePostString(&v21);
v6 = sub_10088E820("%c%s%s%c%c%s", (char)"7");
cocos2d::CCString::getCString(v6);
v7 = sub_10088E820("&secret=%s", v15);
CString = (const std::string::value_type *)cocos2d::CCString::getCString(v7);
std::string::append(&v21, CString);
v16.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x40u);
v16.__r_.__value_.__r.__words[0] = 65;
v16.__r_.__value_.__l.__size_ = 57;
strcpy(v16.__r_.__value_.__l.__data_, "https://www.boomlings.com/database/getGJThreadInvites.php");
if ( (*(_BYTE *)&v21.__r_.__value_.__s.0 & 1) != 0 )
data = v21.__r_.__value_.__l.__data_;
else
data = v21.__r_.__value_.__s.__data_;
v10 = strlen(data);
if ( v10 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v11 = v10;
if ( v10 >= 0x17 )
{
v13 = 26;
if ( (v10 | 7) != 0x17 )
v13 = (v10 | 7) + 1;
v12 = (char *)operator new(v13);
v20 = v12;
__dst[0] = v13 | 1;
__dst[1] = v11;
goto LABEL_16;
}
LOBYTE(__dst[0]) = 2 * v10;
v12 = (char *)__dst + 1;
if ( v10 )
LABEL_16:
memmove(v12, data, v11);
v12[v11] = 0;
LOBYTE(v17) = 26;
strcpy((char *)&v17 + 1, "threadInvites");
GameLevelManager::ProcessHttpRequest(a1, &v16, (__int64)__dst, &v17, 0x62u);
v3 = 0;
if ( (v17 & 1) != 0 )
{
operator delete(__p);
if ( (__dst[0] & 1) == 0 )
{
LABEL_19:
if ( (*(_BYTE *)&v16.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_20;
LABEL_25:
operator delete(v16.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v21.__r_.__value_.__s.0 & 1) == 0 )
return v3 == 0;
goto LABEL_21;
}
}
else if ( (__dst[0] & 1) == 0 )
{
goto LABEL_19;
}
operator delete(v20);
if ( (*(_BYTE *)&v16.__r_.__value_.__s.0 & 1) != 0 )
goto LABEL_25;
LABEL_20:
if ( (*(_BYTE *)&v21.__r_.__value_.__s.0 & 1) != 0 )
LABEL_21:
operator delete(v21.__r_.__value_.__l.__data_);
return v3 == 0;
}