//
// GameLevelManager::getNotifications from 0x100575a20 to 0x100575d11 (753 bytes)
//
// 7 xrefs:
// > NotificationsPage::init @ 0x10098ba2c
// > NotificationsPage::onPrevPage @ 0x10098bbb0
// > NotificationsPage::onNextPage @ 0x10098bc70
// > NotificationsPage::onUpdate @ 0x10098bd6b
// > NotificationsPage::loadPage @ 0x10098be3a
// > NotificationsPage::notificationMuteFinished @ 0x10098c8ef
// > NotificationFilterPopup::onClose @ 0x10098d616
//
// 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::getNotifications(__int64 a1)
{
__int64 v1; // rax
const char *CString; // r14
bool isDLActive; // al
__int64 v4; // rax
__int64 v5; // rax
__int64 v6; // rax
__int64 v7; // rax
const std::string::value_type *v8; // rax
const char *data; // r15
size_t v10; // rax
size_t v11; // r12
char *v12; // r13
size_t v13; // rbx
size_t v14; // rax
size_t v15; // r15
char *v16; // r12
size_t v17; // rbx
char v19; // [rsp+0h] [rbp-A0h]
char v20; // [rsp+0h] [rbp-A0h]
std::string v21; // [rsp+10h] [rbp-90h] BYREF
std::string v22; // [rsp+28h] [rbp-78h] BYREF
_QWORD __dst[2]; // [rsp+40h] [rbp-60h] BYREF
void *v24; // [rsp+50h] [rbp-50h]
__int128 v25; // [rsp+58h] [rbp-48h] BYREF
void *__p; // [rsp+68h] [rbp-38h]
bool v27; // [rsp+77h] [rbp-29h]
v1 = sub_10088E820("notifications_%i", v19);
CString = (const char *)cocos2d::CCString::getCString(v1);
isDLActive = GameLevelManager::isDLActive(a1, CString);
if ( !isDLActive )
{
v27 = 0;
GameLevelManager::addDLToActive(a1, CString);
GameLevelManager::getBasePostString(&v22);
v4 = GameManager::sharedState();
GameManager::getIntGameVariable(v4, "0239");
v5 = GameManager::sharedState();
GameManager::safeModeEnabled(v5);
v6 = sub_10088E820("%c%s%s%c%c%s", (char)"7");
cocos2d::CCString::getCString(v6);
v7 = sub_10088E820("&page=%i&total=%i&mask=%i&secret=%s", v20);
v8 = (const std::string::value_type *)cocos2d::CCString::getCString(v7);
std::string::append(&v22, v8);
v21.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x40u);
v21.__r_.__value_.__r.__words[0] = 65;
v21.__r_.__value_.__l.__size_ = 57;
strcpy(v21.__r_.__value_.__l.__data_, "https://www.boomlings.com/database/getGJNotifications.php");
if ( (*(_BYTE *)&v22.__r_.__value_.__s.0 & 1) != 0 )
data = v22.__r_.__value_.__l.__data_;
else
data = v22.__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);
v24 = v12;
__dst[0] = v13 | 1;
__dst[1] = v11;
}
else
{
LOBYTE(__dst[0]) = 2 * v10;
v12 = (char *)__dst + 1;
if ( !v10 )
{
LABEL_13:
v12[v11] = 0;
v14 = strlen(CString);
if ( v14 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v15 = v14;
if ( v14 >= 0x17 )
{
v17 = 26;
if ( (v14 | 7) != 0x17 )
v17 = (v14 | 7) + 1;
v16 = (char *)operator new(v17);
__p = v16;
*(_QWORD *)&v25 = v17 | 1;
*((_QWORD *)&v25 + 1) = v15;
}
else
{
LOBYTE(v25) = 2 * v14;
v16 = (char *)&v25 + 1;
if ( !v14 )
{
LABEL_21:
v16[v15] = 0;
GameLevelManager::ProcessHttpRequest(a1, &v21, (__int64)__dst, &v25, 0x6Du);
if ( (v25 & 1) != 0 )
{
operator delete(__p);
if ( (__dst[0] & 1) == 0 )
{
LABEL_23:
if ( (*(_BYTE *)&v21.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_24;
goto LABEL_30;
}
}
else if ( (__dst[0] & 1) == 0 )
{
goto LABEL_23;
}
operator delete(v24);
if ( (*(_BYTE *)&v21.__r_.__value_.__s.0 & 1) == 0 )
{
LABEL_24:
if ( (*(_BYTE *)&v22.__r_.__value_.__s.0 & 1) == 0 )
{
LABEL_26:
isDLActive = v27;
return !isDLActive;
}
LABEL_25:
operator delete(v22.__r_.__value_.__l.__data_);
goto LABEL_26;
}
LABEL_30:
operator delete(v21.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v22.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_26;
goto LABEL_25;
}
}
memmove(v16, CString, v15);
goto LABEL_21;
}
}
memmove(v12, data, v11);
goto LABEL_13;
}
return !isDLActive;
}