//
// GameLevelManager::updateUserScore from 0x140155c60 to 0x14015764c (6636 bytes)
//
// 10 xrefs:
// > CreatorLayer::init @ 0x14009d279
// > InfoLayer::loadPage @ 0x1402be7cf
// > LeaderboardsLayer::selectLeaderboard @ 0x1402c357e
// > LevelInfoLayer::onRateStars @ 0x1402fe2c3
// > LevelInfoLayer::onLike @ 0x1402fe93a
// > LevelLeaderboard::init @ 0x140301c28
// > LevelListLayer::onLike @ 0x140307b0a
// > ProfilePage::init @ 0x1403bf6b4
// > UploadPopup::onReturnToLevel @ 0x140491078
// > ??> @ 0x1406ca95c
//
// 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=67
void GameLevelManager::updateUserScore(GameLevelManager *a1)
{
__int64 v2; // rbx
void *v3; // rcx
__int64 v4; // rax
void *v5; // rcx
__int64 v6; // rdx
GameStatsManager *v7; // rcx
GameStatsManager *v8; // rcx
GameStatsManager *v9; // rcx
GameStatsManager *v10; // rcx
GameStatsManager *v11; // rcx
GameStatsManager *v12; // rcx
__int64 v13; // rdx
__int64 v14; // rax
__int64 v15; // rcx
__int64 v16; // rcx
__int64 v17; // rcx
int v18; // r12d
int v19; // esi
int v20; // r13d
int v21; // r14d
int v22; // edi
const char *v23; // r15
int v24; // ebx
cocos2d::CCString *v25; // rax
const char *CString; // rax
int v27; // esi
cocos2d::CCString *v28; // rax
char *v29; // rax
size_t v30; // rbx
size_t v31; // r8
GJAccountManager *v32; // rax
_OWORD *DemonLevelsString; // rax
char v34; // r15
void *v35; // rcx
unsigned int CompletedDailyLevels; // r14d
unsigned int v37; // r12d
size_t v38; // r13
void **v39; // rdx
GameLevelManager *v40; // rcx
unsigned int CompletedWeeklyLevels; // r14d
GameLevelManager *v42; // r9
cocos2d::CCDictionary *m_gauntletLevels; // rcx
cocos2d::CCDictElement *m_pElements; // rcx
cocos2d::CCDictElement *i; // r14
GJGameLevel *v46; // rax
GJGameLevel *v47; // rdi
GameStatsManager *v48; // rcx
unsigned int CompletedEventLevels; // edi
void **v50; // rax
void *v51; // rdx
void **v52; // rax
void *v53; // rdx
void **v54; // rax
void *v55; // rdx
GJAccountManager *v56; // rax
_OWORD *StarLevelsString; // rax
char v58; // r15
void *v59; // rcx
unsigned int v60; // r15d
size_t v61; // rdi
void **v62; // rdx
GameLevelManager *v63; // rcx
GameLevelManager *v64; // r9
cocos2d::CCDictionary *v65; // rcx
cocos2d::CCDictElement *v66; // rcx
cocos2d::CCDictElement *j; // r14
GJGameLevel *v68; // rax
GJGameLevel *v69; // rdi
GameStatsManager *v70; // rcx
unsigned int v71; // edi
void **v72; // rax
void *v73; // rdx
void **v74; // rax
void *v75; // rdx
void **v76; // rax
void *v77; // rdx
GJAccountManager *v78; // rax
cocos2d::CCString *v79; // rax
char *v80; // rax
size_t v81; // r8
cocos2d::CCString *v82; // rax
char *v83; // rax
size_t v84; // r8
cocos2d::CCString *v85; // rax
char *v86; // rax
size_t v87; // r8
cocos2d::CCString *v88; // rax
char *v89; // rax
size_t v90; // r8
cocos2d::CCString *v91; // rax
char *v92; // rax
size_t v93; // r8
cocos2d::CCString *v94; // rax
char *v95; // rax
size_t v96; // r8
cocos2d::CCString *v97; // rax
char *v98; // rax
size_t v99; // r8
cocos2d::CCString *v100; // rax
char *v101; // rax
size_t v102; // r8
__int64 v103; // rax
cocos2d::CCString *v104; // rax
char *v105; // rax
size_t v106; // r8
__int64 v107; // rax
cocos2d::CCString *v108; // rax
char *v109; // rax
size_t v110; // r8
__int64 v111; // rax
cocos2d::CCString *v112; // rax
char *v113; // rax
size_t v114; // r8
__int64 v115; // rax
cocos2d::CCString *v116; // rax
char *v117; // rax
size_t v118; // r8
__int64 v119; // rax
cocos2d::CCString *v120; // rax
char *v121; // rax
size_t v122; // r8
__int64 v123; // rax
cocos2d::CCString *v124; // rax
char *v125; // rax
size_t v126; // r8
__int64 v127; // rax
cocos2d::CCString *v128; // rax
char *v129; // rax
size_t v130; // r8
__int64 v131; // rax
cocos2d::CCString *v132; // rax
char *v133; // rax
size_t v134; // r8
__int64 v135; // rax
cocos2d::CCString *v136; // rax
char *v137; // rax
size_t v138; // r8
cocos2d::CCString *v139; // rax
char *v140; // rax
size_t v141; // r8
cocos2d::CCString *v142; // rax
char *v143; // rax
size_t v144; // r8
cocos2d::CCString *v145; // rax
char *v146; // rax
size_t v147; // r8
cocos2d::CCString *v148; // rax
char *v149; // rax
size_t v150; // r8
void **v151; // rdx
cocos2d::CCString *v152; // rax
char *v153; // rax
size_t v154; // r8
cocos2d::CCString *v155; // rax
char *v156; // rax
size_t v157; // r8
cocos2d::CCString *v158; // rax
char *v159; // rax
size_t v160; // r8
cocos2d::CCString *v161; // rax
char *v162; // rax
size_t v163; // r8
__int128 *v164; // rax
__int128 *v165; // rcx
__int64 v166; // rdx
size_t v167; // r8
void *v168; // rcx
const char *v169; // r8
const char *v170; // rdx
cocos2d::CCString *v171; // rax
char *v172; // rax
size_t v173; // r8
_QWORD *v174; // rdx
void *v175; // rcx
void *v176; // rcx
__int64 v177; // [rsp+20h] [rbp-140h]
__int64 v178; // [rsp+28h] [rbp-138h]
int v179; // [rsp+80h] [rbp-E0h]
int v180; // [rsp+E0h] [rbp-80h]
unsigned int v181; // [rsp+E0h] [rbp-80h]
void *Sized; // [rsp+E8h] [rbp-78h]
void *Sizee; // [rsp+E8h] [rbp-78h]
void *Sizef; // [rsp+E8h] [rbp-78h]
int Size; // [rsp+E8h] [rbp-78h]
size_t Sizea[2]; // [rsp+E8h] [rbp-78h]
void *Sizeg; // [rsp+E8h] [rbp-78h]
void *Sizeh; // [rsp+E8h] [rbp-78h]
void *Sizei; // [rsp+E8h] [rbp-78h]
void *Sizej; // [rsp+E8h] [rbp-78h]
size_t Sizeb[2]; // [rsp+E8h] [rbp-78h]
void *Sizek; // [rsp+E8h] [rbp-78h]
unsigned int Sizec; // [rsp+E8h] [rbp-78h]
void *Sizel; // [rsp+E8h] [rbp-78h]
void *Sizem; // [rsp+E8h] [rbp-78h]
void *Sizen; // [rsp+E8h] [rbp-78h]
void *Sizeo; // [rsp+E8h] [rbp-78h]
void *Sizep; // [rsp+E8h] [rbp-78h]
void *Sizeq; // [rsp+E8h] [rbp-78h]
void *Sizer; // [rsp+E8h] [rbp-78h]
void *Sizes; // [rsp+E8h] [rbp-78h]
void *Sizet; // [rsp+E8h] [rbp-78h]
void *Sizeu; // [rsp+E8h] [rbp-78h]
int v204; // [rsp+F8h] [rbp-68h]
int v205; // [rsp+F8h] [rbp-68h]
int v206; // [rsp+FCh] [rbp-64h]
int v207; // [rsp+FCh] [rbp-64h]
void *v208; // [rsp+100h] [rbp-60h]
void *v209; // [rsp+100h] [rbp-60h]
void *v210; // [rsp+100h] [rbp-60h]
void *v211; // [rsp+100h] [rbp-60h]
void *v212; // [rsp+100h] [rbp-60h]
int v213; // [rsp+100h] [rbp-60h]
void *v214; // [rsp+100h] [rbp-60h]
void *v215; // [rsp+100h] [rbp-60h]
int v216; // [rsp+108h] [rbp-58h]
int v217; // [rsp+10Ch] [rbp-54h]
int Stat; // [rsp+110h] [rbp-50h]
int v219; // [rsp+114h] [rbp-4Ch]
int v220; // [rsp+118h] [rbp-48h]
int v221; // [rsp+11Ch] [rbp-44h]
void *v222; // [rsp+120h] [rbp-40h]
int v223; // [rsp+120h] [rbp-40h]
int v224; // [rsp+128h] [rbp-38h]
int v225; // [rsp+12Ch] [rbp-34h]
int v226; // [rsp+130h] [rbp-30h]
int v227; // [rsp+134h] [rbp-2Ch]
int v228; // [rsp+138h] [rbp-28h]
void *Block[2]; // [rsp+148h] [rbp-18h] BYREF
__int64 v231; // [rsp+158h] [rbp-8h]
unsigned __int64 v232; // [rsp+160h] [rbp+0h]
__int128 v233; // [rsp+168h] [rbp+8h] BYREF
__int64 v234; // [rsp+178h] [rbp+18h]
unsigned __int64 v235; // [rsp+180h] [rbp+20h]
_QWORD Src[4]; // [rsp+188h] [rbp+28h] BYREF
__int128 v237; // [rsp+1A8h] [rbp+48h] BYREF
__int64 v238; // [rsp+1B8h] [rbp+58h]
__int64 v239; // [rsp+1C0h] [rbp+60h]
void *v240[2]; // [rsp+1C8h] [rbp+68h] BYREF
__int128 v241; // [rsp+1D8h] [rbp+78h]
void *v242[2]; // [rsp+1E8h] [rbp+88h] BYREF
__int128 v243; // [rsp+1F8h] [rbp+98h]
_QWORD v244[4]; // [rsp+208h] [rbp+A8h] BYREF
_QWORD v245[4]; // [rsp+228h] [rbp+C8h] BYREF
_QWORD v246[4]; // [rsp+248h] [rbp+E8h] BYREF
_QWORD v247[4]; // [rsp+268h] [rbp+108h] BYREF
__int128 v248; // [rsp+288h] [rbp+128h] BYREF
__int64 v249; // [rsp+298h] [rbp+138h]
__int64 v250; // [rsp+2A0h] [rbp+140h]
_BYTE v251[48]; // [rsp+2A8h] [rbp+148h] BYREF
*(_OWORD *)Block = 0;
v231 = 0;
v232 = 0;
sub_14003A930(Block, "user_score", 0xAu);
v2 = cocos2d::CCDictionary::objectForKey(a1->m_downloadObjects, Block);
if ( v232 > 0xF )
{
v3 = Block[0];
if ( v232 + 1 >= 0x1000 )
{
v3 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v3 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v3);
}
if ( !v2 )
{
*(_OWORD *)Block = 0;
v231 = 0;
v232 = 0;
sub_14003A930(Block, "user_score", 0xAu);
v4 = cocos2d::CCNode::create();
cocos2d::CCDictionary::setObject(a1->m_downloadObjects, v4, Block);
if ( v232 > 0xF )
{
v5 = Block[0];
if ( v232 + 1 >= 0x1000 )
{
v5 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v5 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v5);
}
v231 = 0;
v232 = 15;
LOBYTE(Block[0]) = 0;
v6 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
Sized = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(Sized);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v6 = qword_1406C2ED8;
}
sub_14003BDB0((__int64)v244, v6 + 616);
v7 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
Sizee = operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0(Sizee);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v7 = (GameStatsManager *)qword_1406C2EE8;
}
Stat = GameStatsManager::getStat(v7, "6");
v8 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
Sizef = operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0(Sizef);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v8 = (GameStatsManager *)qword_1406C2EE8;
}
Size = GameStatsManager::getStat(v8, "28");
v9 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v208 = operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0(v208);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v9 = (GameStatsManager *)qword_1406C2EE8;
}
v221 = GameStatsManager::getStat(v9, "13");
v10 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v209 = operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0(v209);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v10 = (GameStatsManager *)qword_1406C2EE8;
}
v217 = GameStatsManager::getStat(v10, (const char *)&word_140531E90);
v11 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v210 = operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0(v210);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v11 = (GameStatsManager *)qword_1406C2EE8;
}
v219 = GameStatsManager::getStat(v11, "8");
v12 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v211 = operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0(v211);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v12 = (GameStatsManager *)qword_1406C2EE8;
}
v216 = GameStatsManager::getStat(v12, "12");
v13 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v212 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(v212);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v13 = qword_1406C2ED8;
}
v220 = *(_DWORD *)(v13 + 908);
v213 = *(_BYTE *)(v13 + 904) != 0 ? 2 : 0;
switch ( v220 )
{
case 1:
v180 = *(_DWORD *)(v13 + 720) - *(_DWORD *)(v13 + 724);
break;
case 2:
v180 = *(_DWORD *)(v13 + 732) - *(_DWORD *)(v13 + 736);
break;
case 3:
v180 = *(_DWORD *)(v13 + 744) - *(_DWORD *)(v13 + 748);
break;
case 4:
v180 = *(_DWORD *)(v13 + 756) - *(_DWORD *)(v13 + 760);
break;
case 5:
v180 = *(_DWORD *)(v13 + 768) - *(_DWORD *)(v13 + 772);
break;
case 6:
v180 = *(_DWORD *)(v13 + 780) - *(_DWORD *)(v13 + 784);
break;
case 7:
v180 = *(_DWORD *)(v13 + 792) - *(_DWORD *)(v13 + 796);
break;
case 8:
v180 = *(_DWORD *)(v13 + 876) - *(_DWORD *)(v13 + 880);
break;
default:
v180 = *(_DWORD *)(v13 + 708) - *(_DWORD *)(v13 + 712);
break;
}
v14 = sub_14003BDB0((__int64)&v237, (__int64)v244);
GameLevelManager::removeDelimiterChars(v15, v14, 0);
GameLevelManager::getBasePostString(v16, Src);
v17 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v222 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(v222);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v17 = qword_1406C2ED8;
}
v206 = *(_DWORD *)(v17 + 876) - *(_DWORD *)(v17 + 880);
v204 = *(_DWORD *)(v17 + 792) - *(_DWORD *)(v17 + 796);
v224 = *(_DWORD *)(v17 + 864) - *(_DWORD *)(v17 + 868);
v225 = *(_DWORD *)(v17 + 780) - *(_DWORD *)(v17 + 784);
v226 = *(_DWORD *)(v17 + 768) - *(_DWORD *)(v17 + 772);
v227 = *(_DWORD *)(v17 + 756) - *(_DWORD *)(v17 + 760);
v228 = *(_DWORD *)(v17 + 744) - *(_DWORD *)(v17 + 748);
v223 = *(_DWORD *)(v17 + 732) - *(_DWORD *)(v17 + 736);
v18 = *(_DWORD *)(v17 + 720) - *(_DWORD *)(v17 + 724);
v19 = *(_DWORD *)(v17 + 708) - *(_DWORD *)(v17 + 712);
v20 = *(_DWORD *)(v17 + 828) - *(_DWORD *)(v17 + 832);
v21 = *(_DWORD *)(v17 + 816) - *(_DWORD *)(v17 + 820);
v22 = *(_DWORD *)(v17 + 804) - *(_DWORD *)(v17 + 808);
v23 = (const char *)v244;
if ( v244[3] > 0xFu )
v23 = (const char *)v244[0];
v24 = *(unsigned __int8 *)(v17 + 904);
v25 = cocos2d::CCString::createWithFormat("%c%s%s%c%c%s", 87, "mfd", "2893", 103, 98, (const char *)&word_140531E88);
CString = cocos2d::CCString::getCString(v25);
v179 = v19;
v27 = v180;
v28 = cocos2d::CCString::createWithFormat(
"&userName=%s&stars=%i&moons=%i&demons=%i&diamonds=%i&icon=%i&color1=%i&color2=%i&color3=%i&iconType=%i&coins"
"=%i&userCoins=%i&special=%i&gameVersion=%i&secret=%s&accIcon=%i&accShip=%i&accBall=%i&accBird=%i&accDart=%i&"
"accRobot=%i&accGlow=%i&accSpider=%i&accExplosion=%i&accSwing=%i&accJetpack=%i",
v23,
Stat,
Size,
v217,
v221,
v180,
v22,
v21,
v20,
v220,
v219,
v216,
v213,
22,
CString,
v179,
v18,
v223,
v228,
v227,
v226,
v24,
v225,
v224,
v204,
v206);
v29 = (char *)cocos2d::CCString::getCString(v28);
v30 = -1;
v31 = -1;
do
++v31;
while ( v29[v31] );
sub_140041270(Src, v29, v31);
v32 = GJAccountManager::sharedState();
if ( v32->m_accountID - v32->m_unkInt1 <= 0 )
{
*(_OWORD *)Block = 0;
v231 = 0;
v232 = 15;
LOBYTE(Block[0]) = 0;
DemonLevelsString = Block;
v34 = 18;
}
else
{
DemonLevelsString = GameLevelManager::getDemonLevelsString((__int64)a1, &v237);
v34 = 17;
}
*(_OWORD *)v242 = *DemonLevelsString;
*(_OWORD *)Sizea = DemonLevelsString[1];
v243 = *(_OWORD *)Sizea;
*((_QWORD *)DemonLevelsString + 2) = 0;
*((_QWORD *)DemonLevelsString + 3) = 15;
*(_BYTE *)DemonLevelsString = 0;
if ( (v34 & 2) != 0 )
{
v34 &= ~2u;
if ( v232 > 0xF )
{
v35 = Block[0];
if ( v232 + 1 >= 0x1000 )
{
v35 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v35 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v35);
}
}
if ( (v34 & 1) != 0 )
{
v34 &= ~1u;
sub_14003A830((__int64)&v237);
}
CompletedDailyLevels = 0;
v181 = 0;
v37 = 0;
v207 = 0;
v205 = 0;
v38 = Sizea[0];
if ( Sizea[0] )
{
sub_140041270(Src, "&dinfo=", 7u);
v39 = v242;
if ( *((_QWORD *)&v243 + 1) > 0xFu )
v39 = (void **)v242[0];
sub_140041270(Src, v39, Sizea[0]);
v40 = (GameLevelManager *)qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
Sizeg = operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)Sizeg);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v40 = (GameLevelManager *)qword_1406C2EC0;
}
CompletedWeeklyLevels = GameLevelManager::getCompletedWeeklyLevels(v40);
v181 = CompletedWeeklyLevels;
v42 = (GameLevelManager *)qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
Sizeh = operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)Sizeh);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v42 = (GameLevelManager *)qword_1406C2EC0;
}
v37 = 0;
m_gauntletLevels = v42->m_gauntletLevels;
if ( m_gauntletLevels )
{
m_pElements = m_gauntletLevels->m_pElements;
if ( m_pElements )
{
for ( i = (cocos2d::CCDictElement *)m_pElements->hh.next; ; i = (cocos2d::CCDictElement *)i->hh.next )
{
v46 = (GJGameLevel *)_RTDynamicCast(
m_pElements->m_pObject,
0,
&cocos2d::CCObject `RTTI Type Descriptor',
&GJGameLevel `RTTI Type Descriptor',
0);
v47 = v46;
if ( v46
&& v46->m_stars.random - v46->m_stars.seed == 10
&& v46->m_normalPercent.random - v46->m_normalPercent.seed == 100 )
{
v48 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
Sizei = operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0(Sizei);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v48 = (GameStatsManager *)qword_1406C2EE8;
}
if ( GameStatsManager::hasCompletedLevel(v48, v47) )
++v37;
}
m_pElements = i;
if ( !i )
break;
}
v42 = (GameLevelManager *)qword_1406C2EC0;
CompletedWeeklyLevels = v181;
}
}
if ( !v42 )
{
Sizej = operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)Sizej);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v42 = (GameLevelManager *)qword_1406C2EC0;
}
CompletedEventLevels = GameLevelManager::getCompletedEventLevels(v42, 10, 10);
v205 = CompletedEventLevels;
sub_140041270(Src, "&dinfow=", 8u);
v50 = (void **)GameToolbox::intToString(Block, CompletedWeeklyLevels);
v51 = v50;
if ( (unsigned __int64)v50[3] > 0xF )
v51 = *v50;
sub_140041270(Src, v51, (size_t)v50[2]);
sub_14003A830((__int64)Block);
sub_140041270(Src, "&dinfog=", 8u);
v52 = (void **)GameToolbox::intToString(Block, v37);
v53 = v52;
if ( (unsigned __int64)v52[3] > 0xF )
v53 = *v52;
sub_140041270(Src, v53, (size_t)v52[2]);
sub_14003A830((__int64)Block);
sub_140041270(Src, "&dinfoe=", 8u);
v54 = (void **)GameToolbox::intToString(Block, CompletedEventLevels);
v55 = v54;
if ( (unsigned __int64)v54[3] > 0xF )
v55 = *v54;
sub_140041270(Src, v55, (size_t)v54[2]);
sub_14003A830((__int64)Block);
v38 = v243;
CompletedDailyLevels = 0;
}
v56 = GJAccountManager::sharedState();
if ( v56->m_accountID - v56->m_unkInt1 <= 0 )
{
*(_OWORD *)Block = 0;
v231 = 0;
v232 = 15;
LOBYTE(Block[0]) = 0;
StarLevelsString = Block;
v58 = v34 | 8;
}
else
{
StarLevelsString = GameLevelManager::getStarLevelsString((__int64)a1, v247);
v58 = v34 | 4;
}
*(_OWORD *)v240 = *StarLevelsString;
*(_OWORD *)Sizeb = StarLevelsString[1];
v241 = *(_OWORD *)Sizeb;
*((_QWORD *)StarLevelsString + 2) = 0;
*((_QWORD *)StarLevelsString + 3) = 15;
*(_BYTE *)StarLevelsString = 0;
if ( (v58 & 8) != 0 )
{
v58 &= ~8u;
if ( v232 > 0xF )
{
v59 = Block[0];
if ( v232 + 1 >= 0x1000 )
{
v59 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v59 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v59);
}
}
if ( (v58 & 4) != 0 )
sub_14003A830((__int64)v247);
v60 = 0;
v61 = Sizeb[0];
if ( Sizeb[0] )
{
sub_140041270(Src, "&sinfo=", 7u);
v62 = v240;
if ( *((_QWORD *)&v241 + 1) > 0xFu )
v62 = (void **)v240[0];
sub_140041270(Src, v62, Sizeb[0]);
v63 = (GameLevelManager *)qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
Sizek = operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)Sizek);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v63 = (GameLevelManager *)qword_1406C2EC0;
}
CompletedDailyLevels = GameLevelManager::getCompletedDailyLevels(v63);
Sizec = CompletedDailyLevels;
v64 = (GameLevelManager *)qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
v214 = operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v214);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v64 = (GameLevelManager *)qword_1406C2EC0;
}
v60 = 0;
v65 = v64->m_gauntletLevels;
if ( v65 )
{
v66 = v65->m_pElements;
if ( v66 )
{
for ( j = (cocos2d::CCDictElement *)v66->hh.next; ; j = (cocos2d::CCDictElement *)j->hh.next )
{
v68 = (GJGameLevel *)_RTDynamicCast(
v66->m_pObject,
0,
&cocos2d::CCObject `RTTI Type Descriptor',
&GJGameLevel `RTTI Type Descriptor',
0);
v69 = v68;
if ( v68
&& v68->m_stars.random - v68->m_stars.seed < 10
&& v68->m_normalPercent.random - v68->m_normalPercent.seed == 100 )
{
v70 = (GameStatsManager *)qword_1406C2EE8;
if ( !qword_1406C2EE8 )
{
v215 = operator new(0x3E0u);
qword_1406C2EE8 = sub_1401D0AE0(v215);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);
v70 = (GameStatsManager *)qword_1406C2EE8;
}
if ( GameStatsManager::hasCompletedLevel(v70, v69) )
++v60;
}
v66 = j;
if ( !j )
break;
}
v64 = (GameLevelManager *)qword_1406C2EC0;
CompletedDailyLevels = Sizec;
}
}
if ( !v64 )
{
Sizel = operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)Sizel);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v64 = (GameLevelManager *)qword_1406C2EC0;
}
v71 = GameLevelManager::getCompletedEventLevels(v64, 1, 9);
v207 = v71;
sub_140041270(Src, "&sinfod=", 8u);
v72 = (void **)GameToolbox::intToString(&v237, CompletedDailyLevels);
v73 = v72;
if ( (unsigned __int64)v72[3] > 0xF )
v73 = *v72;
sub_140041270(Src, v73, (size_t)v72[2]);
sub_14003A830((__int64)&v237);
sub_140041270(Src, "&sinfog=", 8u);
v74 = (void **)GameToolbox::intToString(&v237, v60);
v75 = v74;
if ( (unsigned __int64)v74[3] > 0xF )
v75 = *v74;
sub_140041270(Src, v75, (size_t)v74[2]);
sub_14003A830((__int64)&v237);
sub_140041270(Src, "&sinfoe=", 8u);
v76 = (void **)GameToolbox::intToString(&v237, v71);
v77 = v76;
if ( (unsigned __int64)v76[3] > 0xF )
v77 = *v76;
sub_140041270(Src, v77, (size_t)v76[2]);
sub_14003A830((__int64)&v237);
v61 = v241;
}
v233 = 0;
v234 = 0;
v235 = 15;
LOBYTE(v233) = 0;
v78 = GJAccountManager::sharedState();
v79 = cocos2d::CCString::createWithFormat("%i", v78->m_accountID - v78->m_unkInt1);
v80 = (char *)cocos2d::CCString::getCString(v79);
v81 = -1;
do
++v81;
while ( v80[v81] );
sub_140041270(&v233, v80, v81);
v82 = cocos2d::CCString::createWithFormat("%i", v216);
v83 = (char *)cocos2d::CCString::getCString(v82);
v84 = -1;
do
++v84;
while ( v83[v84] );
sub_140041270(&v233, v83, v84);
v85 = cocos2d::CCString::createWithFormat("%i", v217);
v86 = (char *)cocos2d::CCString::getCString(v85);
v87 = -1;
do
++v87;
while ( v86[v87] );
sub_140041270(&v233, v86, v87);
v88 = cocos2d::CCString::createWithFormat("%i", Stat);
v89 = (char *)cocos2d::CCString::getCString(v88);
v90 = -1;
do
++v90;
while ( v89[v90] );
sub_140041270(&v233, v89, v90);
v91 = cocos2d::CCString::createWithFormat("%i", v219);
v92 = (char *)cocos2d::CCString::getCString(v91);
v93 = -1;
do
++v93;
while ( v92[v93] );
sub_140041270(&v233, v92, v93);
v94 = cocos2d::CCString::createWithFormat("%i", v220);
v95 = (char *)cocos2d::CCString::getCString(v94);
v96 = -1;
do
++v96;
while ( v95[v96] );
sub_140041270(&v233, v95, v96);
v97 = cocos2d::CCString::createWithFormat("%i", v27);
v98 = (char *)cocos2d::CCString::getCString(v97);
v99 = -1;
do
++v99;
while ( v98[v99] );
sub_140041270(&v233, v98, v99);
v100 = cocos2d::CCString::createWithFormat("%i", v221);
v101 = (char *)cocos2d::CCString::getCString(v100);
v102 = -1;
do
++v102;
while ( v101[v102] );
sub_140041270(&v233, v101, v102);
v103 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
Sizem = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(Sizem);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v103 = qword_1406C2ED8;
}
v104 = cocos2d::CCString::createWithFormat("%i", *(_DWORD *)(v103 + 708) - *(_DWORD *)(v103 + 712));
v105 = (char *)cocos2d::CCString::getCString(v104);
v106 = -1;
do
++v106;
while ( v105[v106] );
sub_140041270(&v233, v105, v106);
v107 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
Sizen = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(Sizen);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v107 = qword_1406C2ED8;
}
v108 = cocos2d::CCString::createWithFormat("%i", *(_DWORD *)(v107 + 720) - *(_DWORD *)(v107 + 724));
v109 = (char *)cocos2d::CCString::getCString(v108);
v110 = -1;
do
++v110;
while ( v109[v110] );
sub_140041270(&v233, v109, v110);
v111 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
Sizeo = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(Sizeo);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v111 = qword_1406C2ED8;
}
v112 = cocos2d::CCString::createWithFormat("%i", *(_DWORD *)(v111 + 732) - *(_DWORD *)(v111 + 736));
v113 = (char *)cocos2d::CCString::getCString(v112);
v114 = -1;
do
++v114;
while ( v113[v114] );
sub_140041270(&v233, v113, v114);
v115 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
Sizep = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(Sizep);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v115 = qword_1406C2ED8;
}
v116 = cocos2d::CCString::createWithFormat("%i", *(_DWORD *)(v115 + 744) - *(_DWORD *)(v115 + 748));
v117 = (char *)cocos2d::CCString::getCString(v116);
v118 = -1;
do
++v118;
while ( v117[v118] );
sub_140041270(&v233, v117, v118);
v119 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
Sizeq = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(Sizeq);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v119 = qword_1406C2ED8;
}
v120 = cocos2d::CCString::createWithFormat("%i", *(_DWORD *)(v119 + 756) - *(_DWORD *)(v119 + 760));
v121 = (char *)cocos2d::CCString::getCString(v120);
v122 = -1;
do
++v122;
while ( v121[v122] );
sub_140041270(&v233, v121, v122);
v123 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
Sizer = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(Sizer);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v123 = qword_1406C2ED8;
}
v124 = cocos2d::CCString::createWithFormat("%i", *(_DWORD *)(v123 + 768) - *(_DWORD *)(v123 + 772));
v125 = (char *)cocos2d::CCString::getCString(v124);
v126 = -1;
do
++v126;
while ( v125[v126] );
sub_140041270(&v233, v125, v126);
v127 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
Sizes = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(Sizes);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v127 = qword_1406C2ED8;
}
v128 = cocos2d::CCString::createWithFormat("%i", *(unsigned __int8 *)(v127 + 904));
v129 = (char *)cocos2d::CCString::getCString(v128);
v130 = -1;
do
++v130;
while ( v129[v130] );
sub_140041270(&v233, v129, v130);
v131 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
Sizet = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(Sizet);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v131 = qword_1406C2ED8;
}
v132 = cocos2d::CCString::createWithFormat("%i", *(_DWORD *)(v131 + 780) - *(_DWORD *)(v131 + 784));
v133 = (char *)cocos2d::CCString::getCString(v132);
v134 = -1;
do
++v134;
while ( v133[v134] );
sub_140041270(&v233, v133, v134);
v135 = qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
Sizeu = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(Sizeu);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v135 = qword_1406C2ED8;
}
v136 = cocos2d::CCString::createWithFormat("%i", *(_DWORD *)(v135 + 864) - *(_DWORD *)(v135 + 868));
v137 = (char *)cocos2d::CCString::getCString(v136);
v138 = -1;
do
++v138;
while ( v137[v138] );
sub_140041270(&v233, v137, v138);
if ( v38 )
{
v139 = cocos2d::CCString::createWithFormat("%i", v38);
v140 = (char *)cocos2d::CCString::getCString(v139);
v141 = -1;
do
++v141;
while ( v140[v141] );
sub_140041270(&v233, v140, v141);
v142 = cocos2d::CCString::createWithFormat("%i", v181);
v143 = (char *)cocos2d::CCString::getCString(v142);
v144 = -1;
do
++v144;
while ( v143[v144] );
sub_140041270(&v233, v143, v144);
v145 = cocos2d::CCString::createWithFormat("%i", v37);
v146 = (char *)cocos2d::CCString::getCString(v145);
v147 = -1;
do
++v147;
while ( v146[v147] );
sub_140041270(&v233, v146, v147);
if ( v205 > 0 )
{
v148 = cocos2d::CCString::createWithFormat("%i", v205);
v149 = (char *)cocos2d::CCString::getCString(v148);
v150 = -1;
do
++v150;
while ( v149[v150] );
sub_140041270(&v233, v149, v150);
}
}
if ( v61 )
{
v151 = v240;
if ( *((_QWORD *)&v241 + 1) > 0xFu )
v151 = (void **)v240[0];
sub_140041270(&v233, v151, v61);
v152 = cocos2d::CCString::createWithFormat("%i", CompletedDailyLevels);
v153 = (char *)cocos2d::CCString::getCString(v152);
v154 = -1;
do
++v154;
while ( v153[v154] );
sub_140041270(&v233, v153, v154);
v155 = cocos2d::CCString::createWithFormat("%i", v60);
v156 = (char *)cocos2d::CCString::getCString(v155);
v157 = -1;
do
++v157;
while ( v156[v157] );
sub_140041270(&v233, v156, v157);
if ( v207 > 0 )
{
v158 = cocos2d::CCString::createWithFormat("%i", v207);
v159 = (char *)cocos2d::CCString::getCString(v158);
v160 = -1;
do
++v160;
while ( v159[v160] );
sub_140041270(&v233, v159, v160);
}
}
LODWORD(v178) = 67;
LODWORD(v177) = 112;
v161 = cocos2d::CCString::createWithFormat("%c%s%s%c%c%s", 120, "I35", "fsAa", v177, v178, "Rg");
v162 = (char *)cocos2d::CCString::getCString(v161);
v163 = -1;
do
++v163;
while ( v162[v163] );
sub_140041270(&v233, v162, v163);
v164 = &v233;
if ( v235 <= 0xF )
{
v165 = &v233;
}
else
{
v164 = (__int128 *)v233;
v165 = (__int128 *)v233;
}
v166 = -1;
do
++v166;
while ( *((_BYTE *)v164 + v166) );
sub_140070860((__int64)v165, v166, &v248);
sub_140070B30((unsigned __int8 *)&v248, v251);
*(_OWORD *)Block = 0;
v231 = 0;
v232 = 0;
v167 = -1;
do
++v167;
while ( v251[v167] );
sub_14003A930(Block, v251, v167);
v248 = 0;
v249 = 5;
v250 = 15;
strcpy((char *)&v248, "85271");
cocos2d::ZipUtils::base64EncodeEnc(v246, Block, &v248);
if ( v232 > 0xF )
{
v168 = Block[0];
if ( v232 + 1 >= 0x1000 )
{
v168 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v168 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v168);
}
v231 = 0;
v232 = 15;
LOBYTE(Block[0]) = 0;
sub_140142B90(v245, 0xAu);
v169 = (const char *)v246;
if ( v246[3] > 0xFu )
v169 = (const char *)v246[0];
v170 = (const char *)v245;
if ( v245[3] > 0xFu )
v170 = (const char *)v245[0];
v171 = cocos2d::CCString::createWithFormat("&seed=%s&seed2=%s", v170, v169);
v172 = (char *)cocos2d::CCString::getCString(v171);
v173 = -1;
do
++v173;
while ( v172[v173] );
sub_140041270(Src, v172, v173);
*(_OWORD *)Block = 0;
v231 = 0;
v232 = 15;
Block[0] = sub_14003AA10(0x20u);
v231 = 17;
v232 = 31;
strcpy((char *)Block[0], "Update user score");
v174 = Src;
if ( Src[3] > 0xFu )
v174 = (_QWORD *)Src[0];
v237 = 0;
v238 = 0;
v239 = 0;
do
++v30;
while ( *((_BYTE *)v174 + v30) );
sub_14003A930(&v237, v174, v30);
v248 = 0;
v249 = 0;
v250 = 15;
*(_QWORD *)&v248 = sub_14003AA10(0x40u);
v249 = 58;
v250 = 63;
strcpy((char *)v248, "https://www.boomlings.com/database/updateGJUserScore22.php");
GameLevelManager::ProcessHttpRequest(a1, (__int64)&v248, (const char *)&v237, (const char *)Block, 10);
sub_14003A830((__int64)v245);
sub_14003A830((__int64)v246);
sub_14003A830((__int64)&v233);
if ( *((_QWORD *)&v241 + 1) > 0xFu )
{
v175 = v240[0];
if ( (unsigned __int64)(*((_QWORD *)&v241 + 1) + 1LL) >= 0x1000 )
{
v175 = *((void **)v240[0] - 1);
if ( (unsigned __int64)((char *)v240[0] - (char *)v175 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v175);
}
if ( *((_QWORD *)&v243 + 1) > 0xFu )
{
v176 = v242[0];
if ( (unsigned __int64)(*((_QWORD *)&v243 + 1) + 1LL) >= 0x1000 )
{
v176 = *((void **)v242[0] - 1);
if ( (unsigned __int64)((char *)v242[0] - (char *)v176 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v176);
}
sub_14003A830((__int64)Src);
sub_14003A830((__int64)v244);
}
}