//
// cocos2d::extension::AssetsManager::Helper::update from 0x5a07d0 to 0x5a08aa (218 bytes)
//
// 0 xrefs:
//
// 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
//
void __fastcall cocos2d::extension::AssetsManager::Helper::update(
cocos2d::extension::AssetsManager::Helper *this,
float a2,
stl::StringData::Internal *a3,
stl::StringData::Internal *a4)
{
pthread_mutex_t *v4; // r8
_DWORD *v6; // r1
int v7; // r3
_DWORD *v8; // r5
_DWORD *v9; // r2
int v10; // r4
char *v11; // r2
cocos2d::CCUserDefault *v12; // r7
cocos2d::CCUserDefault *v13; // r0
_DWORD *v14; // r3
int v15; // r0
_DWORD *v16; // r3
_DWORD **v17; // r0
std::string v18[2]; // [sp+8h] [bp-8h] BYREF
v18[0].m_data.m_data = a3;
v18[1].m_data.m_data = a4;
v4 = (pthread_mutex_t *)((char *)this + 56);
pthread_mutex_lock((pthread_mutex_t *)((char *)this + 56));
v6 = *((_DWORD **)this + 13);
v7 = 0;
v8 = (_DWORD *)*v6;
v9 = (_DWORD *)*v6;
while ( v9 != v6 )
{
v9 = (_DWORD *)*v9;
++v7;
}
if ( v7 )
{
v10 = v8[2];
sub_74AB00(*v6);
operator delete(v8);
pthread_mutex_unlock(v4);
switch ( *(_DWORD *)v10 )
{
case 0:
cocos2d::extension::AssetsManager::Helper::handleUpdateSucceed((int)this, v10, v11, *(char **)v10);
break;
case 1:
v12 = cocos2d::CCUserDefault::sharedUserDefault();
sub_776584((int)v18, *(char **)(*(_DWORD *)(v10 + 4) + 8));
cocos2d::CCUserDefault::setStringForKey(v12, "downloaded-version-code", v18);
sub_774008(v18);
v13 = cocos2d::CCUserDefault::sharedUserDefault();
cocos2d::CCUserDefault::flush(v13);
break;
case 2:
v14 = *(_DWORD **)(v10 + 4);
v15 = *(_DWORD *)(v14[1] + 40);
if ( v15 )
(*(void (__fastcall **)(int, _DWORD, _DWORD, _DWORD *))(*(_DWORD *)v15 + 4))(
v15,
*v14,
*(_DWORD *)(*(_DWORD *)v15 + 4),
v14);
goto LABEL_13;
case 3:
v16 = *(_DWORD **)(v10 + 4);
v17 = *(_DWORD ***)(v16[1] + 40);
if ( v17 )
((void (__fastcall *)(_DWORD **, _DWORD, _DWORD, _DWORD *))**v17)(v17, *v16, **v17, v16);
LABEL_13:
operator delete(*(void **)(v10 + 4));
break;
default:
break;
}
operator delete((void *)v10);
}
else
{
pthread_mutex_unlock(v4);
}
}