//
// GameLevelManager::updateLevel from 0x140153880 to 0x140153ab5 (565 bytes)
//
// 3 xrefs:
// > LevelInfoLayer::init @ 0x1402f8240
// > LevelInfoLayer::onUpdate @ 0x1402fedf6
// > ??> @ 0x1406ca8c0
//
// 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
//
// Hidden C++ exception states: #wind=3
void GameLevelManager::updateLevel(GameLevelManager *a1, GJGameLevel *a2)
{
int v3; // ebx
cocos2d::CCString *v4; // rax
const char *CString; // rdi
__int64 v6; // rcx
cocos2d::CCString *v7; // rax
const char *v8; // rax
cocos2d::CCString *v9; // rax
char *v10; // rax
size_t v11; // rbx
size_t v12; // r8
size_t v13; // r8
_QWORD *v14; // rdx
__int128 v15; // [rsp+40h] [rbp-59h] BYREF
__int64 v16; // [rsp+50h] [rbp-49h]
__int64 v17; // [rsp+58h] [rbp-41h]
__int128 v18; // [rsp+60h] [rbp-39h] BYREF
__int64 v19; // [rsp+70h] [rbp-29h]
__int64 v20; // [rsp+78h] [rbp-21h]
__int128 v21; // [rsp+80h] [rbp-19h] BYREF
__int64 v22; // [rsp+90h] [rbp-9h]
__int64 v23; // [rsp+98h] [rbp-1h]
__int128 *v24; // [rsp+A0h] [rbp+7h]
__int128 *v25; // [rsp+A8h] [rbp+Fh]
_QWORD Src[4]; // [rsp+B8h] [rbp+1Fh] BYREF
v3 = a2->m_levelID.random - a2->m_levelID.seed;
v4 = cocos2d::CCString::createWithFormat(
"%i_%i_%i",
v3,
a2->m_gauntletLevel,
a2->m_dailyID.random - a2->m_dailyID.seed);
CString = cocos2d::CCString::getCString(v4);
if ( !GameLevelManager::isDLActive(a1, CString) )
{
GameLevelManager::addDLToActive(a1, CString);
GameLevelManager::getBasePostString(v6, Src);
v7 = cocos2d::CCString::createWithFormat("%c%s%s%c%c%s", 87, "mfd", "2893", 103, 98, (const char *)&word_140531E88);
v8 = cocos2d::CCString::getCString(v7);
v9 = cocos2d::CCString::createWithFormat("&levelID=%i&gameVersion=%i&secret=%s", v3, 22, v8);
v10 = (char *)cocos2d::CCString::getCString(v9);
v11 = -1;
v12 = -1;
do
++v12;
while ( v10[v12] );
sub_140041270(Src, v10, v12);
v24 = &v18;
v25 = &v21;
v18 = 0;
v19 = 0;
v20 = 0;
v13 = -1;
do
++v13;
while ( CString[v13] );
sub_14003A930(&v18, CString, v13);
v14 = Src;
if ( Src[3] > 0xFu )
v14 = (_QWORD *)Src[0];
v21 = 0;
v22 = 0;
v23 = 0;
do
++v11;
while ( *((_BYTE *)v14 + v11) );
sub_14003A930(&v21, v14, v11);
v15 = 0;
*(_QWORD *)&v15 = sub_14003AA10(0x40u);
v16 = 56;
v17 = 63;
strcpy((char *)v15, "https://www.boomlings.com/database/downloadGJLevel22.php");
GameLevelManager::ProcessHttpRequest(a1, (__int64)&v15, (const char *)&v21, (const char *)&v18, 5);
sub_14003A830((__int64)Src);
}
}