//
// sub_6DC95C from 0x6dc95c to 0x6dcb80 (548 bytes)
//
// 3 xrefs:
// > TIFFInitLZW @ 0x6df2cc
// > TIFFInitLZW @ 0x6df2d0
// > ??> @ 0x6df3e4
//
// 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_6DC95C(int a1)
{
int v5; // [sp+8h] [bp-Ch]
int v6; // [sp+Ch] [bp-8h]
v5 = *(_DWORD *)(a1 + 576);
if ( v5 )
{
LABEL_5:
if ( !v5 )
_assert2();
if ( !*(_DWORD *)(v5 + 124) )
{
*(_DWORD *)(v5 + 124) = TIFFmalloc(40952);
if ( !*(_DWORD *)(v5 + 124) )
{
TIFFErrorExt(*(_DWORD *)(a1 + 628), (int)"LZWSetupDecode", "No space for LZW code table");
return 0;
}
v6 = 255;
do
{
*(_BYTE *)(*(_DWORD *)(v5 + 124) + 8 * v6 + 6) = v6;
*(_BYTE *)(*(_DWORD *)(v5 + 124) + 8 * v6 + 7) = v6;
*(_WORD *)(*(_DWORD *)(v5 + 124) + 8 * v6 + 4) = 1;
*(_DWORD *)(*(_DWORD *)(v5 + 124) + 8 * v6) = 0;
}
while ( v6-- != 0 );
TIFFmemset(*(_DWORD *)(v5 + 124) + 2048, 0, 16);
}
return 1;
}
*(_DWORD *)(a1 + 576) = TIFFmalloc(160);
if ( *(_DWORD *)(a1 + 576) )
{
*(_DWORD *)(*(_DWORD *)(a1 + 576) + 124) = 0;
*(_DWORD *)(*(_DWORD *)(a1 + 576) + 104) = 0;
TIFFPredictorInit(a1);
v5 = *(_DWORD *)(a1 + 576);
goto LABEL_5;
}
TIFFErrorExt(*(_DWORD *)(a1 + 628), (int)"LZWSetupDecode", "No space for LZW state block");
return 0;
}