//
// cocos2d::unzOpenCurrentFile3 from 0x1800a14d0 to 0x1800a175b (651 bytes)
//
// 7 xrefs:
// > cocos2d::unzOpenCurrentFile2 @ 0x1800a14bd
// > cocos2d::unzOpenCurrentFile @ 0x1800a1775
// > ??> @ 0x18013f438
// > ??> @ 0x18013f474
// > ??> @ 0x18013f484
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b78d8
//
// 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 cocos2d::unzOpenCurrentFile3(cocos2d *this, _DWORD *a2, int *a3, int *a4, __int64 a5)
{
int v5; // ebp
char *v10; // rbx
void *v11; // rax
_DWORD *v12; // rcx
int v13; // eax
__int128 v14; // xmm0
__int128 v15; // xmm1
int v16; // edx
__int64 v17; // rax
__int128 v18; // xmm0
__int128 v19; // xmm1
__int128 v20; // xmm0
__int64 v21; // rcx
__int64 v22; // rcx
unsigned int v23; // esi
unsigned int v24; // [rsp+20h] [rbp-28h] BYREF
_QWORD v25[4]; // [rsp+28h] [rbp-20h] BYREF
v5 = (int)a4;
if ( a5 || !this || !*((_QWORD *)this + 18) )
return 4294967194LL;
if ( *((_QWORD *)this + 34) )
cocos2d::unzCloseCurrentFile(this, a2);
if ( (unsigned int)sub_18009FA30((__int64)this, &v24, v25, (unsigned int *)&a5) )
return 4294967193LL;
v10 = (char *)malloc(0x120u);
if ( !v10 )
return 4294967192LL;
v11 = malloc(0x4000u);
*((_QWORD *)v10 + 14) = v25[0];
*((_DWORD *)v10 + 30) = a5;
*(_QWORD *)v10 = v11;
*((_QWORD *)v10 + 16) = 0;
*((_DWORD *)v10 + 70) = v5;
if ( v11 )
{
*((_DWORD *)v10 + 26) = 0;
v12 = (_DWORD *)((char *)this + 188);
if ( a2 )
*a2 = *v12;
if ( a3 )
{
*a3 = 6;
v13 = *((_DWORD *)this + 46) & 6;
switch ( v13 )
{
case 2:
*a3 = 9;
break;
case 4:
*a3 = 2;
break;
case 6:
*a3 = 1;
v12 = (_DWORD *)((char *)this + 188);
break;
}
}
v14 = *(_OWORD *)this;
v15 = *((_OWORD *)this + 1);
v16 = *v12;
*((_DWORD *)v10 + 37) = *((_DWORD *)this + 49);
*((_QWORD *)v10 + 32) = *((_QWORD *)this + 12);
v17 = *((_QWORD *)this + 15);
*((_DWORD *)v10 + 36) = 0;
*((_QWORD *)v10 + 17) = 0;
*((_DWORD *)v10 + 66) = v16;
*((_QWORD *)v10 + 34) = v17;
*((_DWORD *)v10 + 9) = 0;
*(_OWORD *)(v10 + 168) = v14;
v18 = *((_OWORD *)this + 2);
*(_OWORD *)(v10 + 184) = v15;
v19 = *((_OWORD *)this + 3);
*(_OWORD *)(v10 + 200) = v18;
v20 = *((_OWORD *)this + 4);
*(_OWORD *)(v10 + 216) = v19;
*(_QWORD *)&v19 = *((_QWORD *)this + 10);
*(_OWORD *)(v10 + 232) = v20;
*((_QWORD *)v10 + 31) = v19;
if ( v16 == 12 )
{
if ( !v5 )
*((_DWORD *)v10 + 70) = 1;
}
else if ( v16 == 8 && !v5 )
{
*((_QWORD *)v10 + 7) = 0;
*((_QWORD *)v10 + 1) = 0;
*((_QWORD *)v10 + 8) = 0;
*((_QWORD *)v10 + 9) = 0;
*((_DWORD *)v10 + 4) = 0;
v23 = inflateInit2_(v10 + 8, 4294967281LL, "1.3.0", 88);
if ( v23 )
{
free(v10);
return v23;
}
*((_DWORD *)v10 + 26) = 8;
}
v21 = v24;
*((_QWORD *)v10 + 19) = *((_QWORD *)this + 25);
v22 = *((_QWORD *)this + 33) + v21 + 30;
*((_QWORD *)v10 + 20) = *((_QWORD *)this + 26);
*((_QWORD *)v10 + 12) = v22;
*((_DWORD *)v10 + 4) = 0;
*((_QWORD *)this + 34) = v10;
*((_DWORD *)this + 70) = 0;
return 0;
}
free(v10);
return 4294967192LL;
}