//
// deflateReset from 0xcbdebc to 0xcbdf70 (180 bytes)
//
// 5 xrefs:
// > sub_BEAB30 @ 0xbeada8
// > deflateInit2_ @ 0xcbfd8c
// > sub_CC9D88 @ 0xcc9ed8
// > gzclose_w @ 0xccb044
// > ??> @ 0x9a920
//
// 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 deflateReset(__int64 a1)
{
unsigned int v2; // w20
__int64 v3; // x19
char *v4; // x4
unsigned int v5; // w3
size_t v6; // x2
__int64 v7; // x0
int v8; // w4
int v9; // w5
int v10; // w1
v2 = deflateResetKeep(a1);
if ( !v2 )
{
v3 = *(_QWORD *)(a1 + 56);
v4 = *(char **)(v3 + 104);
v5 = *(_DWORD *)(v3 + 116) - 1;
v6 = 2LL * v5;
*(_QWORD *)(v3 + 88) = 2LL * *(unsigned int *)(v3 + 68);
*(_WORD *)&v4[v6] = 0;
memset(v4, 0, v6);
*(_DWORD *)(v3 + 156) = 0;
v7 = 16LL * *(int *)(v3 + 180);
*(_QWORD *)(v3 + 136) = 0;
*(_DWORD *)(v3 + 164) = 0;
*(_DWORD *)(v3 + 5916) = 0;
v8 = *(unsigned __int16 *)((char *)&unk_111DA30 + v7);
v9 = *(unsigned __int16 *)((char *)&unk_111DA30 + v7 + 2);
v10 = *(unsigned __int16 *)((char *)&unk_111DA30 + v7 + 4);
LODWORD(v7) = *(unsigned __int16 *)((char *)&unk_111DA30 + v7 + 6);
*(_DWORD *)(v3 + 176) = v9;
*(_DWORD *)(v3 + 188) = v8;
*(_DWORD *)(v3 + 192) = v10;
*(_DWORD *)(v3 + 172) = v7;
*(_DWORD *)(v3 + 168) = 2;
*(_DWORD *)(v3 + 144) = 2;
*(_DWORD *)(v3 + 152) = 0;
*(_DWORD *)(v3 + 112) = 0;
}
return v2;
}