//
// sub_8FD564 from 0x8fd564 to 0x8fd8c8 (868 bytes)
//
// 1 xrefs:
// > TIFFReadScanline @ 0x8fd91c
//
// 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:16 +0000
//
int __fastcall sub_8FD564(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_8FCF80(a1, v7, 0, 1) )
return 0;
}
else if ( !sub_8FF46C(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;
}
}