//
// GameLevelManager::onGetGJDailyLevelStateCompleted from 0x83b8e8 to 0x83bca8 (960 bytes)
//
// 2 xrefs:
// > GameLevelManager::handleIt @ 0x85acdc
// > ??> @ 0x97108
//
// This function is hookable on this platform (idp: arm, 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:55:14 +0000
//
__int64 __fastcall GameLevelManager::onGetGJDailyLevelStateCompleted(
GameLevelManager *this,
unsigned __int8 *a2,
char *a3)
{
const char *v6; // x2
char v7; // t1
_BOOL4 v8; // w25
unsigned int v9; // w23
_BOOL4 v10; // w21
__int64 v11; // x0
_BOOL4 v13; // w21
__int64 v14; // x0
_BOOL4 v15; // w21
cocos2d::CCArray *v16; // x0
cocos2d::CCArray *v17; // x21
cocos2d::CCString *v18; // x0
int v19; // w19
cocos2d::CCString *v20; // x0
int v21; // w0
void (__fastcall ***v22)(_QWORD, _QWORD); // x0
cocos2d::CCString *v23; // x0
int v24; // w25
cocos2d::CCString *v25; // x0
int v26; // w0
cocos2d::CCString *v27; // x0
const char *CString; // x0
size_t v29; // x0
cocos2d::CCString *v30; // x0
size_t v31; // x0
GJRewardItem *v32; // x19
GameStatsManager *v33; // x0
GameStatsManager *v34; // x0
__int64 v35; // x0
char *v36; // [xsp+58h] [xbp+58h]
char *v37; // [xsp+58h] [xbp+58h]
GameStatsManager *v38[2]; // [xsp+68h] [xbp+68h] BYREF
void *v39; // [xsp+78h] [xbp+78h]
__int64 v40; // [xsp+80h] [xbp+80h] BYREF
__int64 v41; // [xsp+88h] [xbp+88h]
void *v42; // [xsp+90h] [xbp+90h]
v7 = *a3;
v6 = a3 + 1;
if ( (v7 & 1) != 0 )
v6 = *((const char **)a3 + 2);
GameLevelManager::removeDLFromActive(this, v6);
v40 = 0;
v41 = 0;
v42 = nullptr;
std::string::__init(&v40, "weekly_state", 0xCu);
v8 = sub_7FEA60((__int64)a3, (__int64)&v40);
if ( (v40 & 1) != 0 )
operator delete(v42);
v9 = 1;
if ( !v8 )
{
v40 = 0;
v41 = 0;
v42 = nullptr;
std::string::__init(&v40, "event_state", 0xBu);
v15 = sub_7FEA60((__int64)a3, (__int64)&v40);
if ( (v40 & 1) != 0 )
operator delete(v42);
if ( v15 )
v9 = 2;
else
v9 = 0;
}
v40 = 0;
v41 = 0;
v42 = nullptr;
std::string::__init(&v40, &word_117CE08, 2u);
v10 = sub_7FEA60((__int64)a2, (__int64)&v40);
if ( (v40 & 1) != 0 )
{
operator delete(v42);
if ( v10 )
goto LABEL_8;
}
else if ( v10 )
{
goto LABEL_8;
}
v40 = 0;
v41 = 0;
v42 = nullptr;
std::string::__init(&v40, "-2", 2u);
v13 = sub_7FEA60((__int64)a2, (__int64)&v40);
if ( (v40 & 1) != 0 )
operator delete(v42);
if ( v13 )
{
v14 = *((_QWORD *)this + 179);
if ( v14 )
(*(void (__fastcall **)(__int64, _QWORD, __int64))(*(_QWORD *)v14 + 8LL))(v14, v9, 3);
return _stack_chk_guard;
}
v16 = sub_80CFCC(a2, "|");
v17 = v16;
if ( v9 != 2 )
{
if ( (unsigned int)cocos2d::CCArray::count(v16) > 1 )
{
v18 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v17, 0);
v19 = cocos2d::CCString::intValue(v18);
v20 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v17, 1u);
v21 = cocos2d::CCString::intValue(v20);
GameLevelManager::storeDailyLevelState(this, v19, v21, v9);
goto LABEL_25;
}
LABEL_8:
v11 = *((_QWORD *)this + 179);
if ( v11 )
(*(void (__fastcall **)(__int64, _QWORD, __int64))(*(_QWORD *)v11 + 8LL))(v11, v9, 0xFFFFFFFFLL);
return _stack_chk_guard;
}
if ( (unsigned int)cocos2d::CCArray::count(v16) <= 3 )
goto LABEL_8;
v23 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v17, 0);
v24 = cocos2d::CCString::intValue(v23);
v25 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v17, 1u);
v26 = cocos2d::CCString::intValue(v25);
GameLevelManager::storeDailyLevelState(this, v24, v26, 2);
v27 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v17, 2u);
CString = (const char *)cocos2d::CCString::getCString(v27);
v38[0] = nullptr;
v36 = (char *)CString;
v38[1] = nullptr;
v39 = nullptr;
v29 = strlen(CString);
std::string::__init((__int64 *)v38, v36, v29);
v30 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v17, 3u);
v37 = (char *)cocos2d::CCString::getCString(v30);
v40 = 0;
v41 = 0;
v42 = nullptr;
v31 = strlen(v37);
std::string::__init(&v40, v37, v31);
v32 = (GJRewardItem *)GameLevelManager::parseEventReward((__int64)this, (__int64)v38, (__int64)&v40);
if ( (v40 & 1) != 0 )
operator delete(v42);
v33 = (GameStatsManager *)LOBYTE(v38[0]);
if ( ((__int64)v38[0] & 1) != 0 )
operator delete(v39);
if ( v32 )
{
v34 = (GameStatsManager *)GameStatsManager::sharedState(v33);
GameStatsManager::storeEventChest(v34, v24, v32);
LABEL_25:
v22 = *((void (__fastcall ****)(_QWORD, _QWORD))this + 179);
if ( v22 )
(**v22)(v22, v9);
return _stack_chk_guard;
}
v35 = *((_QWORD *)this + 179);
if ( v35 )
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)v35 + 8LL))(v35, 2, 0xFFFFFFFFLL);
return _stack_chk_guard;
}