//
// sub_6F58F8 from 0x6f58f8 to 0x6f5a14 (284 bytes)
//
// 3 xrefs:
// > TIFFInitZIP @ 0x6f62c0
// > TIFFInitZIP @ 0x6f62c4
// > ??> @ 0x6f63b0
//
// 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
//
int __fastcall sub_6F58F8(int a1)
{
int v4; // [sp+Ch] [bp-8h]
v4 = *(_DWORD *)(a1 + 576);
if ( !v4 )
_assert2();
if ( (*(_DWORD *)(v4 + 124) & 1) != 0 )
{
j_inflateEnd(v4 + 64);
*(_DWORD *)(v4 + 124) = 0;
}
if ( j_deflateInit_(v4 + 64, *(_DWORD *)(v4 + 120), "1.2.3", 56) )
{
TIFFErrorExt(*(_DWORD *)(a1 + 628), (int)"ZIPSetupEncode", "%s", *(const char **)(v4 + 88));
return 0;
}
else
{
*(_DWORD *)(v4 + 124) |= 2u;
return 1;
}
}