//
// sub_6F5B54 from 0x6f5b54 to 0x6f5d10 (444 bytes)
//
// 9 xrefs:
// > TIFFInitZIP @ 0x6f62f0
// > TIFFInitZIP @ 0x6f62f4
// > TIFFInitZIP @ 0x6f6300
// > TIFFInitZIP @ 0x6f6304
// > TIFFInitZIP @ 0x6f6310
// > TIFFInitZIP @ 0x6f6314
// > ??> @ 0x6f63bc
// > ??> @ 0x6f63c0
// > ??> @ 0x6f63c4
//
// 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_6F5B54(_DWORD *a1, int a2, int a3)
{
int v8; // [sp+14h] [bp-8h]
v8 = a1[144];
if ( !v8 )
_assert2();
if ( *(_DWORD *)(v8 + 124) != 2 )
_assert2();
*(_DWORD *)(v8 + 64) = a2;
*(_DWORD *)(v8 + 68) = a3;
if ( *(_DWORD *)(v8 + 68) == a3 )
{
do
{
if ( j_deflate(v8 + 64, 0) )
{
TIFFErrorExt(a1[157], (int)"ZIPEncode", "Encoder error: %s", *(const char **)(v8 + 88));
return 0;
}
if ( !*(_DWORD *)(v8 + 80) )
{
a1[152] = a1[148];
TIFFFlushData1((int)a1);
*(_DWORD *)(v8 + 76) = a1[147];
*(_DWORD *)(v8 + 80) = a1[148];
}
}
while ( *(_DWORD *)(v8 + 68) );
return 1;
}
else
{
TIFFErrorExt(a1[157], (int)"ZIPEncode", "ZLib cannot deal with buffers this size");
return 0;
}
}