//
// GameLevelManager::processOnDownloadLevelCompleted from 0x707304 to 0x708454 (4432 bytes)
//
// 3 xrefs:
// > GameLevelManager::onDownloadLevelCompleted @ 0x7084b8
// > GameLevelManager::onUpdateLevelCompleted @ 0x708644
// > ??> @ 0x3def0
//
// 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
//
__int64 __fastcall GameLevelManager::processOnDownloadLevelCompleted(
GameLevelManager *a1,
_QWORD *a2,
const char **a3,
unsigned __int8 a4)
{
int v7; // w22
cocos2d::CCArray *v8; // x21
void *v9; // x0
cocos2d::CCString *v11; // x0
cocos2d::CCString *v12; // x0
bool v13; // w0
_BOOL4 v14; // w23
cocos2d::CCString *v15; // x0
cocos2d::CCArray *v16; // x19
void *m_levelUpdateDelegate; // x0
_QWORD *v18; // x1
_BOOL4 v19; // w25
_DWORD *v20; // x20
unsigned __int64 v21; // x21
unsigned __int64 v22; // x22
size_t v23; // x2
unsigned __int64 v24; // x21
char *v25; // x0
cocos2d::CCString *v26; // x0
char *CString; // x0
cocos2d::CCString *v28; // x0
char *v29; // x0
cocos2d::CCString *v30; // x0
char *v31; // x0
cocos2d::CCString *v32; // x0
char *v33; // x0
char *v34; // x0
char *v35; // x0
unsigned int *v36; // x1
int v37; // w2
cocos2d::CCString *v38; // x0
char *v39; // x0
cocos2d::CCString *v40; // x0
char *v41; // x1
MusicDownloadManager *v42; // x20
void *v43; // x0
void *v44; // x0
char *v45; // x0
char *v46; // x0
unsigned int *v47; // x1
int v48; // w2
char *v49; // x0
char *v50; // x20
int v51; // w0
__int64 v52; // x22
int v53; // w21
__int64 v54; // x28
char *v55; // x0
char v56; // w25
__int64 v57; // x1
__int64 v58; // x20
char *v59; // x0
cocos2d::CCString *v60; // x0
size_t v61; // x0
char *v62; // x19
unsigned int v63; // w0
unsigned __int8 *v64; // x3
char *v65; // x2
unsigned __int64 v66; // x20
size_t v67; // x2
int v68; // w19
__int64 v69; // x20
void *m_levelDownloadDelegate; // x0
char *v71; // x0
char *v72; // x0
char *v73; // x0
char *v74; // x0
void *v75; // x20
unsigned int *v76; // x19
int v77; // w0
GameManager *v78; // x0
unsigned int *v79; // x20
int v80; // w1
unsigned int *v81; // x3
int v82; // w1
cocos2d::CCString *v83; // x0
char *v84; // x0
cocos2d::CCString *v85; // x0
size_t v86; // x0
char *v87; // x19
unsigned int v88; // w0
unsigned __int8 *v89; // x3
char *v90; // x2
_DWORD *v91; // x21
unsigned __int64 v92; // x22
unsigned __int64 v93; // x20
size_t v94; // x2
int v95; // w19
__int64 v96; // x20
char *v97; // x0
void *v98; // x0
int v99; // w19
GJGameLevel *SavedLevel; // x1
unsigned int v101; // w19
const char *LevelKey; // x0
LevelUpdateDelegate *v103; // x0
int v104; // w19
int v105; // w0
unsigned int *v106; // x1
int v107; // w2
unsigned int *v108; // x1
int v109; // w2
unsigned int *v110; // x1
int v111; // w2
unsigned int *v112; // x1
int v113; // w2
unsigned int *v114; // x1
int v115; // w2
const char *LevelDownloadKey; // x0
LevelDownloadDelegate *v117; // x0
unsigned int *v118; // x1
int v119; // w2
unsigned int *v120; // x1
int v121; // w2
unsigned int *v122; // x1
int v123; // w2
unsigned int *v124; // x1
int v125; // w2
unsigned int *v126; // x21
int v127; // w1
int v128; // w0
LevelDownloadDelegate *v129; // x0
int v130; // w0
int v131; // w0
unsigned __int64 v132; // [xsp+78h] [xbp+68h]
const char *v133; // [xsp+80h] [xbp+70h]
_DWORD *v134; // [xsp+80h] [xbp+70h]
const char *v135; // [xsp+80h] [xbp+70h]
bool v136; // [xsp+93h] [xbp+83h]
int v137; // [xsp+94h] [xbp+84h]
GJGameLevel *v138; // [xsp+98h] [xbp+88h]
unsigned int v139; // [xsp+A8h] [xbp+98h]
int v140; // [xsp+ACh] [xbp+9Ch]
__int64 v141; // [xsp+B8h] [xbp+A8h] BYREF
void *v142; // [xsp+C0h] [xbp+B0h] BYREF
void *v143; // [xsp+C8h] [xbp+B8h] BYREF
char *v144; // [xsp+D0h] [xbp+C0h] BYREF
__int64 v145; // [xsp+D8h] [xbp+C8h] BYREF
__int64 v146; // [xsp+E0h] [xbp+D0h] BYREF
char *v147; // [xsp+E8h] [xbp+D8h] BYREF
char *v148; // [xsp+F0h] [xbp+E0h] BYREF
char *v149; // [xsp+F8h] [xbp+E8h] BYREF
void *v150; // [xsp+100h] [xbp+F0h] BYREF
char *v151; // [xsp+108h] [xbp+F8h] BYREF
void *v152; // [xsp+110h] [xbp+100h] BYREF
_BYTE v153[24]; // [xsp+118h] [xbp+108h] BYREF
unsigned __int8 v154[24]; // [xsp+130h] [xbp+120h] BYREF
unsigned __int8 v155[48]; // [xsp+148h] [xbp+138h] BYREF
unsigned __int8 v156[48]; // [xsp+178h] [xbp+168h] BYREF
v140 = a4;
v7 = a4;
v8 = sub_6F004C(a3, "_");
if ( (unsigned int)cocos2d::CCArray::count(v8) )
{
v11 = cocos2d::CCArray::stringAtIndex(v8, 0);
v139 = cocos2d::CCString::intValue(v11);
v12 = cocos2d::CCArray::stringAtIndex(v8, 1u);
v13 = cocos2d::CCString::boolValue(v12);
v14 = v13;
v136 = v13;
v15 = cocos2d::CCArray::stringAtIndex(v8, 2u);
v137 = cocos2d::CCString::intValue(v15);
GameLevelManager::removeDLFromActive(a1, *a3);
v16 = sub_6F004C(a2, "#");
if ( (unsigned int)cocos2d::CCArray::count(v16) <= 2 )
goto LABEL_9;
sub_D153B8((int)&v152, "-1");
v18 = (_QWORD *)*a2;
v19 = 0;
v20 = v152;
v21 = *(v18 - 3);
v22 = *((_QWORD *)v152 - 3);
if ( v22 > v21 )
v23 = *(v18 - 3);
else
v23 = *((_QWORD *)v152 - 3);
if ( !memcmp(v18, v152, v23) )
{
v24 = v21 - v22;
if ( v24 + 0x80000000 <= 0xFFFFFFFF )
v19 = v24 == 0;
}
v25 = (char *)(v20 - 6);
if ( v20 - 6 != (_DWORD *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v79 = v20 - 2;
do
v80 = __ldaxr(v79);
while ( __stlxr(v80 - 1, v79) );
}
else
{
v80 = *(v20 - 2);
*(v20 - 2) = v80 - 1;
}
if ( v80 <= 0 )
operator delete(v25);
}
if ( v19 )
{
LABEL_9:
if ( v140 )
{
m_levelUpdateDelegate = a1->m_levelUpdateDelegate;
if ( !m_levelUpdateDelegate )
return _stack_chk_guard;
}
else
{
m_levelUpdateDelegate = a1->m_levelDownloadDelegate;
if ( !m_levelUpdateDelegate )
return _stack_chk_guard;
}
(*(void (__fastcall **)(void *, _QWORD))(*(_QWORD *)m_levelUpdateDelegate + 8LL))(m_levelUpdateDelegate, v139);
return _stack_chk_guard;
}
v26 = cocos2d::CCArray::stringAtIndex(v16, 0);
CString = (char *)cocos2d::CCString::getCString(v26);
sub_D153B8((int)&v141, CString);
v28 = cocos2d::CCArray::stringAtIndex(v16, 1u);
v29 = (char *)cocos2d::CCString::getCString(v28);
sub_D153B8((int)&v142, v29);
v30 = cocos2d::CCArray::stringAtIndex(v16, 2u);
v31 = (char *)cocos2d::CCString::getCString(v30);
sub_D153B8((int)&v143, v31);
if ( (unsigned int)cocos2d::CCArray::count(v16) > 3 )
{
v32 = cocos2d::CCArray::stringAtIndex(v16, 3u);
v33 = (char *)cocos2d::CCString::getCString(v32);
sub_D153B8((int)&v152, v33);
sub_D18D28(&v144, &v152);
GameLevelManager::storeUserNames(a1, &v144);
v34 = v144 - 24;
if ( v144 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v122 = (unsigned int *)(v144 - 8);
do
v123 = __ldaxr(v122);
while ( __stlxr(v123 - 1, v122) );
}
else
{
v123 = *((_DWORD *)v144 - 2);
*((_DWORD *)v144 - 2) = v123 - 1;
}
if ( v123 <= 0 )
operator delete(v34);
}
v35 = (char *)v152 - 24;
if ( (char *)v152 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v36 = (unsigned int *)((char *)v152 - 8);
do
v37 = __ldaxr(v36);
while ( __stlxr(v37 - 1, v36) );
}
else
{
v37 = *((_DWORD *)v152 - 2);
*((_DWORD *)v152 - 2) = v37 - 1;
}
if ( v37 <= 0 )
operator delete(v35);
}
}
if ( (unsigned int)cocos2d::CCArray::count(v16) > 4 )
{
v38 = cocos2d::CCArray::stringAtIndex(v16, 4u);
v39 = (char *)cocos2d::CCString::getCString(v38);
sub_D153B8((int)&v151, v39);
if ( (unsigned int)cocos2d::CCArray::count(v16) <= 5 )
{
v41 = &byte_F288A0;
}
else
{
v40 = cocos2d::CCArray::stringAtIndex(v16, 5u);
v41 = (char *)cocos2d::CCString::getCString(v40);
}
sub_D153B8((int)&v152, v41);
v42 = MusicDownloadManager::sharedState();
sub_D18D28(&v145, &v151);
sub_D18D28(&v146, &v152);
MusicDownloadManager::createSongsInfo(v42, (std::string)&v145, (std::string)&v146);
v43 = (void *)(v146 - 24);
if ( (__int64 *)(v146 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v124 = (unsigned int *)(v146 - 8);
do
v125 = __ldaxr(v124);
while ( __stlxr(v125 - 1, v124) );
}
else
{
v125 = *(_DWORD *)(v146 - 8);
*(_DWORD *)(v146 - 8) = v125 - 1;
}
if ( v125 <= 0 )
operator delete(v43);
}
v44 = (void *)(v145 - 24);
if ( (__int64 *)(v145 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v120 = (unsigned int *)(v145 - 8);
do
v121 = __ldaxr(v120);
while ( __stlxr(v121 - 1, v120) );
}
else
{
v121 = *(_DWORD *)(v145 - 8);
*(_DWORD *)(v145 - 8) = v121 - 1;
}
if ( v121 <= 0 )
operator delete(v44);
}
v45 = (char *)v152 - 24;
if ( (char *)v152 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v118 = (unsigned int *)((char *)v152 - 8);
do
v119 = __ldaxr(v118);
while ( __stlxr(v119 - 1, v118) );
}
else
{
v119 = *((_DWORD *)v152 - 2);
*((_DWORD *)v152 - 2) = v119 - 1;
}
if ( v119 <= 0 )
operator delete(v45);
}
v46 = v151 - 24;
if ( v151 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v47 = (unsigned int *)(v151 - 8);
do
v48 = __ldaxr(v47);
while ( __stlxr(v48 - 1, v47) );
}
else
{
v48 = *((_DWORD *)v151 - 2);
*((_DWORD *)v151 - 2) = v48 - 1;
}
if ( v48 <= 0 )
operator delete(v46);
}
}
sub_D18D28(&v147, &v141);
GameLevelManager::responseToDict(&v147, 0);
v138 = GJGameLevel::create();
v49 = v147 - 24;
if ( v147 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v106 = (unsigned int *)(v147 - 8);
do
v107 = __ldaxr(v106);
while ( __stlxr(v107 - 1, v106) );
}
else
{
v107 = *((_DWORD *)v147 - 2);
*((_DWORD *)v147 - 2) = v107 - 1;
}
if ( v107 <= 0 )
operator delete(v49);
}
if ( v138->m_lowDetailMode && (v78 = GameManager::sharedState(), GameManager::getGameVariable(v78, "0108")) )
{
v138->m_lowDetailModeToggled = 1;
if ( !v14 )
{
LABEL_45:
if ( v139 == -2 )
{
v104 = v138->m_dailyID.random - v138->m_dailyID.seed;
v138->m_dailyID.value = v104;
v105 = (int)(float)((float)((float)rand() * 4.6566e-10) * 1000.0);
v138->m_dailyID.seed = v105;
v138->m_dailyID.random = v104 + v105;
}
sub_D18D28(&v148, &v138->m_levelString);
sub_D153B8((int)&v149, &byte_F288A0);
v50 = v148;
v51 = strlen(v148);
if ( v51 <= 39 )
{
sub_D18EA8(&v149, &v148);
}
else
{
v52 = 0;
v53 = 40;
v54 = (int)(float)((float)v51 / 40.0);
while ( 1 )
{
if ( (*((_DWORD *)v50 - 2) & 0x80000000) == 0 )
{
sub_D176A8(&v148);
v50 = v148;
}
v55 = v149;
v56 = v50[v52];
v57 = *((_QWORD *)v149 - 3);
v58 = v57 + 1;
if ( (unsigned __int64)(v57 + 1) > *((_QWORD *)v149 - 2) || *((int *)v149 - 2) > 0 )
{
sub_D15888(&v149, v57 + 1);
v55 = v149;
v57 = *((_QWORD *)v149 - 3);
}
v55[v57] = v56;
v59 = v149;
if ( v149 - 24 != (char *)&qword_124B6B0 )
{
*((_DWORD *)v149 - 2) = 0;
*((_QWORD *)v59 - 3) = v58;
v59[v58] = 0;
}
--v53;
v52 += v54;
if ( !v53 )
break;
v50 = v148;
}
}
v60 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%c%s%s%c%c%s",
(const char *)&dword_78,
"I25",
"fpAa",
112,
67,
"Qg");
v133 = cocos2d::CCString::getCString(v60);
v61 = strlen(v133);
sub_D15FD4(&v149, v133, v61);
v62 = v149;
v63 = strlen(v149);
rtsha1::calc((rtsha1 *)v62, (const void *)v63, (__int64)v153, v64);
rtsha1::toHexString((rtsha1 *)v153, v155, v65);
sub_D153B8((int)&v150, (char *)v155);
v134 = v150;
v66 = *((_QWORD *)v150 - 3);
v132 = *((_QWORD *)v142 - 3);
if ( v132 > v66 )
v67 = *((_QWORD *)v150 - 3);
else
v67 = *((_QWORD *)v142 - 3);
v68 = memcmp(v150, v142, v67);
if ( !v68 )
{
v68 = 0x7FFFFFFF;
v69 = v66 - v132;
if ( v69 <= 0x7FFFFFFF )
{
if ( v69 >= (__int64)0xFFFFFFFF80000000LL )
v68 = v69;
else
v68 = 0x80000000;
}
}
if ( v134 - 6 != (_DWORD *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v81 = v134 - 2;
do
v82 = __ldaxr(v81);
while ( __stlxr(v82 - 1, v81) );
}
else
{
v82 = *(v134 - 2);
*(v134 - 2) = v82 - 1;
}
if ( v82 <= 0 )
operator delete(v134 - 6);
}
if ( v68 )
{
if ( v140 )
{
m_levelDownloadDelegate = a1->m_levelUpdateDelegate;
if ( !m_levelDownloadDelegate )
{
LABEL_72:
v71 = v149 - 24;
if ( v149 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v114 = (unsigned int *)(v149 - 8);
do
v115 = __ldaxr(v114);
while ( __stlxr(v115 - 1, v114) );
}
else
{
v115 = *((_DWORD *)v149 - 2);
*((_DWORD *)v149 - 2) = v115 - 1;
}
if ( v115 <= 0 )
operator delete(v71);
}
v72 = v148 - 24;
if ( v148 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v112 = (unsigned int *)(v148 - 8);
do
v113 = __ldaxr(v112);
while ( __stlxr(v113 - 1, v112) );
}
else
{
v113 = *((_DWORD *)v148 - 2);
*((_DWORD *)v148 - 2) = v113 - 1;
}
if ( v113 <= 0 )
operator delete(v72);
}
v73 = (char *)v143 - 24;
if ( (char *)v143 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v110 = (unsigned int *)((char *)v143 - 8);
do
v111 = __ldaxr(v110);
while ( __stlxr(v111 - 1, v110) );
}
else
{
v111 = *((_DWORD *)v143 - 2);
*((_DWORD *)v143 - 2) = v111 - 1;
}
if ( v111 <= 0 )
operator delete(v73);
}
v74 = (char *)v142 - 24;
if ( (char *)v142 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v108 = (unsigned int *)((char *)v142 - 8);
do
v109 = __ldaxr(v108);
while ( __stlxr(v109 - 1, v108) );
}
else
{
v109 = *((_DWORD *)v142 - 2);
*((_DWORD *)v142 - 2) = v109 - 1;
}
if ( v109 <= 0 )
operator delete(v74);
}
v75 = (void *)(v141 - 24);
if ( (__int64 *)(v141 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v76 = (unsigned int *)(v141 - 8);
do
v77 = __ldaxr(v76);
while ( __stlxr(v77 - 1, v76) );
}
else
{
v77 = *(_DWORD *)(v141 - 8);
*(_DWORD *)(v141 - 8) = v77 - 1;
}
if ( v77 <= 0 )
operator delete(v75);
}
return _stack_chk_guard;
}
}
else
{
m_levelDownloadDelegate = a1->m_levelDownloadDelegate;
if ( !m_levelDownloadDelegate )
goto LABEL_72;
}
(*(void (__fastcall **)(void *, _QWORD))(*(_QWORD *)m_levelDownloadDelegate + 8LL))(
m_levelDownloadDelegate,
v139);
goto LABEL_72;
}
v83 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i,%i,%i,%i,%i,%i,%i,%i",
(const char *)(unsigned int)(v138->m_userID.random - v138->m_userID.seed),
(unsigned int)(v138->m_stars.random - v138->m_stars.seed),
(unsigned int)(v138->m_demon.random - v138->m_demon.seed),
(unsigned int)(v138->m_levelID.random - v138->m_levelID.seed),
(unsigned int)(v138->m_coinsVerified.random - v138->m_coinsVerified.seed),
(unsigned int)v138->m_featured,
(unsigned int)(v138->m_password.random - v138->m_password.seed),
v138->m_dailyID.random - v138->m_dailyID.seed);
v84 = (char *)cocos2d::CCString::getCString(v83);
sub_D153B8((int)&v151, v84);
v85 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%c%s%s%c%c%s",
(const char *)&dword_78,
"I25",
"fpAa",
112,
67,
"Qg");
v135 = cocos2d::CCString::getCString(v85);
v86 = strlen(v135);
sub_D15FD4(&v151, v135, v86);
v87 = v151;
v88 = strlen(v151);
rtsha1::calc((rtsha1 *)v87, (const void *)v88, (__int64)v154, v89);
rtsha1::toHexString((rtsha1 *)v154, v156, v90);
sub_D153B8((int)&v152, (char *)v156);
v91 = v152;
v92 = *((_QWORD *)v143 - 3);
v93 = *((_QWORD *)v152 - 3);
if ( v92 > v93 )
v94 = *((_QWORD *)v152 - 3);
else
v94 = *((_QWORD *)v143 - 3);
v95 = memcmp(v152, v143, v94);
if ( !v95 )
{
v95 = 0x7FFFFFFF;
v96 = v93 - v92;
if ( v96 <= 0x7FFFFFFF )
{
if ( v96 >= (__int64)0xFFFFFFFF80000000LL )
v95 = v96;
else
v95 = 0x80000000;
}
}
v97 = (char *)(v91 - 6);
if ( v91 - 6 != (_DWORD *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v126 = v91 - 2;
do
v127 = __ldaxr(v126);
while ( __stlxr(v127 - 1, v126) );
}
else
{
v127 = *(v91 - 2);
*(v91 - 2) = v127 - 1;
}
if ( v127 <= 0 )
operator delete(v97);
}
if ( v95 )
{
if ( !v140 )
{
v98 = a1->m_levelDownloadDelegate;
if ( !v98 )
{
LABEL_112:
if ( v151 - 24 != (char *)&qword_124B6B0 )
sub_6EE220(v151 - 24);
goto LABEL_72;
}
LABEL_111:
(*(void (__fastcall **)(void *, _QWORD))(*(_QWORD *)v98 + 8LL))(v98, v139);
goto LABEL_112;
}
LABEL_110:
v98 = a1->m_levelUpdateDelegate;
if ( !v98 )
goto LABEL_112;
goto LABEL_111;
}
if ( v140 )
{
if ( v137 > 0 )
{
v138->m_dailyID.value = v137;
v99 = (int)(float)((float)((float)rand() * 4.6566e-10) * 1000.0);
v138->m_dailyID.seed = v99;
v138->m_dailyID.random = v137 + v99;
}
SavedLevel = GameLevelManager::getSavedLevel(a1, v138);
if ( !SavedLevel )
goto LABEL_110;
if ( v138->m_levelVersion <= SavedLevel->m_levelVersion )
v101 = 1;
else
v101 = 3;
GameLevelManager::saveLevel(a1, v138);
LevelKey = GameLevelManager::getLevelKey(a1, v139);
GameLevelManager::makeTimeStamp(a1, LevelKey);
GameLevelManager::updateLevelRewards(a1, v138);
v103 = a1->m_levelUpdateDelegate;
if ( v103 )
v103->levelUpdateFinished(v103, v138, (UpdateResponse)v101);
LABEL_123:
if ( v151 - 24 != (char *)&qword_124B6B0 )
sub_6EE220(v151 - 24);
if ( v149 - 24 != (char *)&qword_124B6B0 )
sub_6EE220(v149 - 24);
if ( v148 - 24 != (char *)&qword_124B6B0 )
sub_6EE220(v148 - 24);
if ( (char *)v143 - 24 != (char *)&qword_124B6B0 )
sub_6EE220((char *)v143 - 24);
if ( (char *)v142 - 24 != (char *)&qword_124B6B0 )
sub_6EE220((char *)v142 - 24);
if ( (__int64 *)(v141 - 24) != &qword_124B6B0 )
sub_6EE220((void *)(v141 - 24));
return _stack_chk_guard;
}
switch ( v139 )
{
case 0xFFFFFFFF:
GameLevelManager::saveLevel(a1, v138);
v131 = v138->m_dailyID.random - v138->m_dailyID.seed;
if ( a1->m_activeDailyID < v131 )
a1->m_activeDailyID = v131;
break;
case 0xFFFFFFFE:
GameLevelManager::saveLevel(a1, v138);
v130 = v138->m_dailyID.random - v138->m_dailyID.seed;
if ( a1->m_activeWeeklyID < v130 )
a1->m_activeWeeklyID = v130;
break;
case 0xFFFFFFFD:
GameLevelManager::saveLevel(a1, v138);
v128 = v138->m_dailyID.random - v138->m_dailyID.seed;
if ( a1->m_activeEventID < v128 )
a1->m_activeEventID = v128;
break;
default:
GameLevelManager::markLevelAsDownloaded(a1, v139);
GameLevelManager::saveLevel(a1, v138);
LevelDownloadKey = GameLevelManager::getLevelDownloadKey(a1, v139, v136, v137);
GameLevelManager::makeTimeStamp(a1, LevelDownloadKey);
v117 = a1->m_levelDownloadDelegate;
if ( v117 )
v117->levelDownloadFinished(v117, v138);
GameLevelManager::updateLevelRewards(a1, v138);
goto LABEL_123;
}
v129 = a1->m_levelDownloadDelegate;
if ( v129 )
v129->levelDownloadFinished(v129, v138);
goto LABEL_123;
}
}
else if ( !v14 )
{
goto LABEL_45;
}
v138->m_gauntletLevel = 1;
goto LABEL_45;
}
if ( v7 )
{
v9 = a1->m_levelUpdateDelegate;
if ( !v9 )
return _stack_chk_guard;
goto LABEL_4;
}
v9 = a1->m_levelDownloadDelegate;
if ( v9 )
LABEL_4:
(*(void (__fastcall **)(void *, _QWORD))(*(_QWORD *)v9 + 8LL))(v9, 0);
return _stack_chk_guard;
}