//
// sub_6ED9A4 from 0x6ed9a4 to 0x6edd08 (868 bytes)
//
// 1 xrefs:
// > TIFFReadScanline @ 0x6edd5c
//
// 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_6ED9A4(int a1, unsigned int a2, unsigned __int16 a3)
{
int v7; // [sp+1Ch] [bp-20h]
if ( *(_DWORD *)(a1 + 60) > a2 )
{
if ( *(_WORD *)(a1 + 126) == 2 )
{
if ( a3 >= (unsigned int)*(unsigned __int16 *)(a1 + 98) )
{
TIFFErrorExt(
*(_DWORD *)(a1 + 628),
*(_DWORD *)a1,
"%lu: Sample out of range, max %lu",
a3,
*(unsigned __int16 *)(a1 + 98));
return 0;
}
v7 = *(_DWORD *)(a1 + 164) * a3 + a2 / *(_DWORD *)(a1 + 100);
}
else
{
v7 = a2 / *(_DWORD *)(a1 + 100);
}
if ( *(_DWORD *)(a1 + 452) == v7 || TIFFFillStrip(a1, v7) )
{
if ( *(_DWORD *)(a1 + 444) > a2 )
{
if ( *(_DWORD *)(a1 + 596) )
{
if ( !sub_6ED3C0(a1, v7, 0, 1) )
return 0;
}
else if ( !sub_6EF8AC(a1, v7) )
{
return 0;
}
}
if ( *(_DWORD *)(a1 + 444) != a2 )
{
if ( !(*(int (__fastcall **)(int, unsigned int))(a1 + 560))(a1, a2 - *(_DWORD *)(a1 + 444)) )
return 0;
*(_DWORD *)(a1 + 444) = a2;
}
return 1;
}
return 0;
}
else
{
TIFFErrorExt(*(_DWORD *)(a1 + 628), *(_DWORD *)a1, "%lu: Row out of range, max %lu", a2, *(_DWORD *)(a1 + 60));
return 0;
}
}