//
// cocos2d::extension::AssetsManager::downLoad from 0xd0a040 to 0xd0a1c4 (388 bytes)
//
// 2 xrefs:
// > cocos2d::extension::assetsManagerDownloadAndUncompress @ 0xd0a210
// > ??> @ 0xa2508
//
// 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::downLoad(cocos2d::extension::AssetsManager *this)
{
char *v2; // x0
FILE *v3; // x20
char *v4; // x2
int v5; // w22
unsigned int v6; // w19
unsigned __int64 v8[2]; // [xsp+30h] [xbp+30h] BYREF
char *filename; // [xsp+40h] [xbp+40h]
std::operator+("cocos2dx-update-temp-package.zip", (__int64)this + 8, v8);
v2 = (char *)v8 + 1;
if ( (v8[0] & 1) != 0 )
v2 = filename;
v3 = fopen(v2, "wb");
if ( v3 )
{
v4 = (char *)this + 57;
if ( (*((_BYTE *)this + 56) & 1) != 0 )
v4 = *((char **)this + 9);
sub_E0AD88(*((_QWORD *)this + 16), 10002, v4);
sub_E0AD88(*((_QWORD *)this + 16), 20011, j__fwrite);
sub_E0AD88(*((_QWORD *)this + 16), 10001, v3);
sub_E0AD88(*((_QWORD *)this + 16), 43, 0);
sub_E0AD88(*((_QWORD *)this + 16), 20056, cocos2d::extension::assetsManagerProgressFunc);
sub_E0AD88(*((_QWORD *)this + 16), 10057, this);
v5 = sub_E0AE1C(*((_QWORD *)this + 16));
sub_E0B060(*((_QWORD *)this + 16));
if ( v5 )
{
cocos2d::extension::AssetsManager::sendErrorMessage((__int64)this, 1);
fclose(v3);
v6 = 0;
}
else
{
fclose(v3);
v6 = 1;
}
}
else
{
cocos2d::extension::AssetsManager::sendErrorMessage((__int64)this, 0);
v6 = 0;
}
if ( (v8[0] & 1) != 0 )
operator delete(filename);
return v6;
}