//
// cocos2d::extension::AssetsManager::checkUpdate from 0xd0ac8c to 0xd0aed0 (580 bytes)
//
// 2 xrefs:
// > ??> @ 0xe4d00
// > ??> @ 0x1509c50
//
// 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 13:06:59 +0000
//
__int64 __fastcall cocos2d::extension::AssetsManager::checkUpdate(cocos2d::extension::AssetsManager *this)
{
char *v2; // x21
unsigned __int8 v3; // w0
__int64 v4; // x1
unsigned int v5; // w21
__int64 v7; // x0
char *v8; // x2
__int64 v9; // x2
cocos2d::CCUserDefault *v10; // x0
cocos2d::CCUserDefault *v11; // x0
int v12; // w3
size_t v13; // x2
unsigned __int8 v14; // w1
int v15; // w4
__int64 v16; // x0
unsigned __int8 *v17; // x0
unsigned __int8 *v18; // x1
unsigned __int8 *v19; // x21
unsigned __int8 *v20; // x2
int v21; // t1
__int64 v22[2]; // [xsp+40h] [xbp+40h] BYREF
void *v23; // [xsp+50h] [xbp+50h]
v2 = (char *)this + 80;
v3 = *((_BYTE *)this + 80);
v4 = v3 >> 1;
if ( (v3 & 1) != 0 )
v4 = *((_QWORD *)v2 + 1);
if ( v4 && (v7 = sub_E0ACDC(), (*((_QWORD *)this + 16) = v7) != 0) )
{
if ( (*((_BYTE *)this + 32) & 1) != 0 )
{
**((_BYTE **)this + 6) = 0;
*((_QWORD *)this + 5) = 0;
v7 = *((_QWORD *)this + 16);
}
else
{
*((_BYTE *)this + 33) = 0;
*((_BYTE *)this + 32) = 0;
}
v8 = (char *)this + 81;
if ( (*((_BYTE *)this + 80) & 1) != 0 )
v8 = *((char **)v2 + 2);
sub_E0AD88(v7, 10002, v8);
sub_E0AD88(*((_QWORD *)this + 16), 64, 0);
sub_E0AD88(*((_QWORD *)this + 16), 20011, sub_D09D64);
sub_E0AD88(*((_QWORD *)this + 16), 10001, (char *)this + 32);
v9 = *((unsigned int *)this + 38);
if ( (_DWORD)v9 )
sub_E0AD88(*((_QWORD *)this + 16), 78, v9);
v10 = (cocos2d::CCUserDefault *)sub_E0AE1C(*((_QWORD *)this + 16));
if ( (_DWORD)v10 )
{
v5 = 0;
cocos2d::extension::AssetsManager::sendErrorMessage((__int64)this, 1);
sub_E0B060(*((_QWORD *)this + 16));
return v5;
}
v11 = (cocos2d::CCUserDefault *)cocos2d::CCUserDefault::sharedUserDefault(v10);
cocos2d::CCUserDefault::getStringForKey(v22, v11, "current-version-code");
v12 = v22[0] & 1;
v13 = LOBYTE(v22[0]) >> 1;
if ( v12 )
v13 = v22[1];
v14 = *((_BYTE *)this + 32);
v15 = v14 & 1;
v16 = v14 >> 1;
if ( (v14 & 1) != 0 )
v16 = *((_QWORD *)this + 5);
v5 = 1;
if ( v13 == v16 )
{
v17 = (unsigned __int8 *)v22 + 1;
if ( v12 )
v17 = (unsigned __int8 *)v23;
v18 = (unsigned __int8 *)this + 33;
if ( v15 )
v18 = *((unsigned __int8 **)this + 6);
if ( v12 )
{
if ( v13 )
{
v5 = 1;
if ( memcmp(v17, v18, v13) )
goto LABEL_20;
}
}
else if ( v13 )
{
if ( *v17 != *v18 )
return 1;
v19 = v17 + 1;
v20 = &v17[v13];
while ( 1 )
{
++v18;
if ( v19 == v20 )
break;
v21 = *v19++;
if ( *v18 != v21 )
return 1;
}
}
cocos2d::extension::AssetsManager::sendErrorMessage((__int64)this, 2);
cocos2d::extension::AssetsManager::setSearchPath(this);
v5 = 0;
v12 = v22[0] & 1;
}
if ( v12 )
LABEL_20:
operator delete(v23);
}
else
{
return 0;
}
return v5;
}