//
// sub_9058F8 from 0x9058f8 to 0x905a14 (284 bytes)
//
// 3 xrefs:
// > TIFFInitZIP @ 0x905ea0
// > TIFFInitZIP @ 0x905ea4
// > ??> @ 0x905f78
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:04:18 +0000
//
int __fastcall sub_9058F8(_DWORD *a1)
{
int v4; // [sp+8h] [bp-Ch]
unsigned int v5; // [sp+Ch] [bp-8h]
v4 = a1[144];
*(_DWORD *)(v4 + 68) = 0;
while ( 1 )
{
v5 = j_deflate(v4 + 64, 4);
if ( v5 > 1 )
break;
if ( *(_DWORD *)(v4 + 80) != a1[148] )
{
a1[152] = a1[148] - *(_DWORD *)(v4 + 80);
TIFFFlushData1((int)a1);
*(_DWORD *)(v4 + 76) = a1[147];
*(_DWORD *)(v4 + 80) = a1[148];
}
if ( v5 == 1 )
return 1;
}
TIFFErrorExt(a1[157], (int)"ZIPPostEncode", "ZLib error: %s", *(const char **)(v4 + 88));
return 0;
}