//
// GameLevelManager::updateLevel from 0x1000a0950 to 0x1000a0ad0 (384 bytes)
//
// 2 xrefs:
// > LevelInfoLayer::init @ 0x100026440
// > LevelInfoLayer::onUpdate @ 0x1000283c0
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void __fastcall GameLevelManager::updateLevel(GameLevelManager *a1, GJGameLevel *a2)
{
int v3; // w21
cocos2d::CCString *v4; // x0
char *CString; // x20
cocos2d::CCString *v6; // x0
const char *v7; // x0
cocos2d::CCString *v8; // x0
const char *v9; // x0
std::string *v10; // x1
void *__p[2]; // [xsp+30h] [xbp-80h] BYREF
char v12; // [xsp+47h] [xbp-69h]
void *v13[2]; // [xsp+48h] [xbp-68h] BYREF
char v14; // [xsp+5Fh] [xbp-51h]
std::string v15; // [xsp+60h] [xbp-50h] BYREF
std::string v16; // [xsp+78h] [xbp-38h] BYREF
v3 = a2->m_levelID.random - a2->m_levelID.seed;
v4 = (cocos2d::CCString *)sub_100268F4C(
"%i_%i_%i",
v3,
a2->m_gauntletLevel,
a2->m_dailyID.random - a2->m_dailyID.seed);
CString = (char *)cocos2d::CCString::getCString(v4);
if ( !GameLevelManager::isDLActive(a1, CString) )
{
GameLevelManager::addDLToActive(a1, CString);
GameLevelManager::getBasePostString(&v16);
v6 = (cocos2d::CCString *)sub_100268F4C("%c%s%s%c%c%s", 87, "mfd", "2893", 103, 98, "7");
v7 = cocos2d::CCString::getCString(v6);
v8 = (cocos2d::CCString *)sub_100268F4C("&levelID=%i&gameVersion=%i&secret=%s", v3, 22, v7);
v9 = cocos2d::CCString::getCString(v8);
std::string::append(&v16, v9);
sub_100009900(&v15, "https://www.boomlings.com/database/downloadGJLevel22.php");
if ( (v16.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v10 = &v16;
else
v10 = (std::string *)v16.__r_.__value_.__r.__words[0];
sub_100009900(v13, (char *)v10);
sub_100009900(__p, CString);
GameLevelManager::ProcessHttpRequest(a1, &v15, (char *)v13, (const std::string::value_type *)__p, 5);
if ( v12 < 0 )
operator delete(__p[0]);
if ( v14 < 0 )
operator delete(v13[0]);
if ( SHIBYTE(v15.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v15.__r_.__value_.__l.__data_);
if ( SHIBYTE(v16.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v16.__r_.__value_.__l.__data_);
}
}