//
// sub_B94C64 from 0xb94c64 to 0xb94ea8 (580 bytes)
//
// 4 xrefs:
// > cocos2d::extension::AssetsManager::downLoad @ 0xa982ec
// > cocos2d::extension::AssetsManager::checkUpdate @ 0xa98fa4
// > sub_AAC850 @ 0xaacaa8
// > sub_AAC850 @ 0xaacb64
//
// 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 sub_B94C64(__int64 a1)
{
unsigned int v2; // w19
__int64 v4; // x21
int v5; // w19
int v6; // w25
__time_t v7; // x0
__int64 v8; // x1
__int64 v9; // x23
__int64 v10; // x22
int v11; // w0
__int64 v12; // x0
__time_t v13; // x0
__int64 v14; // x1
__int64 v15; // x0
__int64 v16; // x0
int v17; // [xsp+64h] [xbp+64h] BYREF
_QWORD v18[4]; // [xsp+68h] [xbp+68h] BYREF
_QWORD v19[2]; // [xsp+88h] [xbp+88h] BYREF
__int64 v20; // [xsp+98h] [xbp+98h]
__int64 v21; // [xsp+A0h] [xbp+A0h]
char v22; // [xsp+A8h] [xbp+A8h]
if ( a1 )
{
if ( *(_QWORD *)(a1 + 96) )
{
v2 = 2;
sub_B7B690(a1, "easy handle already used in multi handle");
return v2;
}
v4 = *(_QWORD *)(a1 + 104);
if ( !v4 )
{
v16 = sub_B9A870(1, 3);
v4 = v16;
if ( !v16 )
return 27;
*(_QWORD *)(a1 + 104) = v16;
}
sub_B9B60C(v4, 6, *(_QWORD *)(a1 + 2264));
v5 = sub_B9BCE8(v4, a1);
if ( !v5 )
{
v22 = *(_BYTE *)(a1 + 1596);
if ( !v22 )
{
v19[0] = 0;
v19[1] = 0;
v20 = 0;
v21 = 0;
sigaction(13, nullptr, (struct sigaction *)v19);
v18[0] = v19[0];
v18[2] = v20;
v18[3] = v21;
v18[1] = 1;
sigaction(13, (const struct sigaction *)v18, nullptr);
}
*(_QWORD *)(a1 + 96) = v4;
v6 = 0;
while ( 1 )
{
v17 = 0;
v7 = sub_B70B94();
v9 = v8;
v10 = v7;
v11 = sub_B9ACF0(v4, 0, 0, 1000, v18);
if ( v11 )
break;
if ( LODWORD(v18[0]) )
{
v6 = 0;
}
else
{
v13 = sub_B70B94();
if ( sub_B70BFC(v13, v14, v10, v9) > 10 )
{
v6 = 0;
}
else if ( v6 + 1 <= 2 )
{
++v6;
}
else
{
v15 = 1000;
if ( v6 + 1 <= 9 )
v15 = (unsigned int)(1 << v6);
++v6;
sub_B9FEF0(v15);
}
}
v11 = sub_B9D6EC(v4, &v17);
if ( v11 )
break;
if ( !v17 )
{
v12 = sub_B9B4E0(v4, v18);
if ( v12 )
{
v2 = *(_DWORD *)(v12 + 16);
goto LABEL_18;
}
}
}
if ( v11 == 3 )
v2 = 27;
else
v2 = 43;
LABEL_18:
sub_B9C0DC(v4, a1);
if ( !v22 )
sigaction(13, (const struct sigaction *)v19, nullptr);
return v2;
}
sub_B9B234(v4);
if ( v5 != 3 )
return 2;
return 27;
}
return 43;
}