//
// GameLevelManager::getThreads from 0x4bf4fc to 0x4bf754 (600 bytes)
//
// 1 xrefs:
// > MessageThreadsPage::loadPage @ 0x74ff4c
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 11:50:21 +0000
//
int __fastcall GameLevelManager::getThreads(GameManager *a1, int a2, unsigned __int8 *a3, int a4, unsigned __int8 *a5)
{
const char *v6; // r11
int v10; // r7
int v11; // r7
cocos2d::CCNode *v12; // r0
cocos2d::CCObject *v13; // r0
cocos2d::CCString *v14; // r0
int CString; // r0
cocos2d::CCString *v16; // r0
char *v17; // r0
int v18; // r3
int v19; // r3
char *v20; // r1
size_t v21; // r2
int v22; // r5
size_t v23; // r5
const void *v24; // r1
char *v25; // r1
size_t v26; // r2
size_t v27; // r0
cocos2d::CCObject *v28; // [sp+10h] [bp-64h]
int v29; // [sp+14h] [bp-60h]
char *v30[3]; // [sp+18h] [bp-5Ch] BYREF
int v31[3]; // [sp+24h] [bp-50h] BYREF
_DWORD v32[3]; // [sp+30h] [bp-44h] BYREF
int v33; // [sp+3Ch] [bp-38h] BYREF
size_t v34; // [sp+40h] [bp-34h]
char *v35; // [sp+44h] [bp-30h]
int v36[3]; // [sp+48h] [bp-2Ch] BYREF
int v37[3]; // [sp+54h] [bp-20h] BYREF
int v38; // [sp+60h] [bp-14h] BYREF
int v39; // [sp+64h] [bp-10h]
int v40; // [sp+68h] [bp-Ch]
v6 = (const char *)a2;
if ( a2 < 0 )
return 0;
v10 = *((_DWORD *)a1 + 187);
v38 = 0;
v39 = 0;
v40 = 0;
std::string::__init(&v38, "getThreads", 0xAu);
v11 = cocos2d::CCDictionary::objectForKey(v10, &v38);
v12 = (cocos2d::CCNode *)std::string::~string((int)&v38);
if ( v11 )
return 0;
v29 = *((_DWORD *)a1 + 187);
v13 = (cocos2d::CCObject *)cocos2d::CCNode::create(v12);
v38 = 0;
v39 = 0;
v40 = 0;
v28 = v13;
std::string::__init(&v38, "getThreads", 0xAu);
cocos2d::CCDictionary::setObject(v29, v28);
std::string::~string((int)&v38);
GameLevelManager::getBasePostString((GameLevelManager *)v30);
v14 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%c%s%s%c%c%s",
(const char *)&dword_54 + 3,
"mfd",
"2893",
103,
98,
&a1i2r3e45s789g[9]);
CString = cocos2d::CCString::getCString(v14);
v16 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"&page=%i&filter=%i&removed=1&secret=%s",
v6,
a4,
CString);
v17 = (char *)cocos2d::CCString::getCString(v16);
std::string::append(v30, v17);
v18 = *a3;
if ( (v18 & 1) != 0 )
v19 = *((_DWORD *)a3 + 1);
else
v19 = v18 >> 1;
if ( v19 )
{
std::string::append(v30, "&search=");
std::string::basic_string(v31, (int)a3);
LevelTools::base64EncodeString(v32, v31);
if ( (v32[0] & 1) != 0 )
{
v20 = (char *)v32[2];
v21 = v32[1];
}
else
{
v21 = (int)LOBYTE(v32[0]) >> 1;
v20 = (char *)v32 + 1;
}
std::string::append(v30, v20, v21);
std::string::~string((int)v32);
std::string::~string((int)v31);
}
v22 = *a5;
if ( (v22 & 1) != 0 )
{
v23 = *((_DWORD *)a5 + 1);
if ( !v23 )
goto LABEL_21;
LABEL_15:
v33 = 0;
v34 = 0;
v35 = nullptr;
std::string::__init(&v33, "&user=", 6u, v23 + 6);
if ( (*a5 & 1) != 0 )
v24 = *((const void **)a5 + 2);
else
v24 = a5 + 1;
std::string::append(&v33, v24, v23);
if ( (v33 & 1) != 0 )
{
v25 = v35;
v26 = v34;
}
else
{
v26 = (int)(unsigned __int8)v33 >> 1;
v25 = (char *)&v33 + 1;
}
std::string::append(v30, v25, v26);
std::string::~string((int)&v33);
goto LABEL_21;
}
v23 = v22 >> 1;
if ( v23 )
goto LABEL_15;
LABEL_21:
memset(v36, 0, sizeof(v36));
std::string::__init(v36, "https://www.boomlings.com/database/getGJThreads.php", 0x33u);
v37[0] = 0;
v37[1] = 0;
if ( ((int)v30[0] & 1) == 0 )
v6 = (char *)v30 + 1;
v37[2] = 0;
if ( ((int)v30[0] & 1) != 0 )
v6 = v30[2];
v27 = strlen(v6);
std::string::__init(v37, v6, v27);
v38 = 0;
v39 = 0;
v40 = 0;
std::string::__init(&v38, "getThreads", 0xAu);
GameLevelManager::ProcessHttpRequest(a1, v36, (int)v37, (int)&v38, 92);
std::string::~string((int)&v38);
std::string::~string((int)v37);
std::string::~string((int)v36);
std::string::~string((int)v30);
return 1;
}