//
// sub_C58630 from 0xc58630 to 0xc586f8 (200 bytes)
//
// 2 xrefs:
// > TIFFInitLZW @ 0xc58b90
// > TIFFInitLZW @ 0xc58b98
//
// 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 sub_C58630(__int64 a1)
{
__int64 v1; // x19
_QWORD *v3; // x2
_QWORD *v4; // x0
__int64 v5; // x3
v1 = *(_QWORD *)(a1 + 848);
v3 = *(_QWORD **)(v1 + 280);
if ( !v3 )
{
(*(void (**)(void))(a1 + 728))();
v3 = *(_QWORD **)(v1 + 280);
}
v4 = v3 + 18000;
v5 = *(_QWORD *)(a1 + 872) + *(_QWORD *)(a1 + 880) - 5LL;
*(_WORD *)(v1 + 128) = 9;
*(_WORD *)(v1 + 130) = 511;
*(_QWORD *)(v1 + 144) = 0;
*(_WORD *)(v1 + 132) = 258;
*(_QWORD *)(v1 + 136) = 0;
*(_QWORD *)(v1 + 240) = 10000;
*(_QWORD *)(v1 + 248) = 0;
*(_QWORD *)(v1 + 256) = 0;
*(_QWORD *)(v1 + 264) = 0;
*(_QWORD *)(v1 + 272) = v5;
do
{
*(v4 - 14) = -1;
*(v4 - 12) = -1;
*(v4 - 10) = -1;
*(v4 - 8) = -1;
*(v4 - 6) = -1;
*(v4 - 4) = -1;
*(v4 - 2) = -1;
*v4 = -1;
v4 -= 16;
}
while ( v4 != v3 );
*v4 = -1;
*(_DWORD *)(v1 + 232) = 0xFFFF;
return 1;
}