//
// TIFFReadRawTile from 0x8febd4 to 0x8fedb4 (480 bytes)
//
// 1 xrefs:
// > ??> @ 0x6b85c
//
// 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 TIFFReadRawTile(int a1, unsigned int a2, int a3, int a4)
{
int v10; // [sp+1Ch] [bp-18h]
unsigned __int64 v11; // [sp+20h] [bp-14h]
v10 = a1 + 40;
if ( !sub_8FF844(a1, 1) )
return -1;
if ( *(_DWORD *)(v10 + 128) > a2 )
{
if ( (*(_DWORD *)(a1 + 12) & 0x20000) != 0 )
{
TIFFErrorExt(
*(_DWORD *)(a1 + 628),
(int)"TIFFReadRawTile",
"Compression scheme does not support access to raw uncompressed data");
return -1;
}
else
{
v11 = *(_QWORD *)(*(_DWORD *)(v10 + 136) + 8 * a2);
if ( a4 != -1 && v11 > a4 )
v11 = a4;
if ( HIDWORD(v11) == (int)v11 >> 31 )
{
return sub_8FE864(a1, a2, a3, v11, (int)"TIFFReadRawTile");
}
else
{
TIFFErrorExt(*(_DWORD *)(a1 + 628), (int)"TIFFReadRawTile", "Integer overflow");
return -1;
}
}
}
else
{
TIFFErrorExt(
*(_DWORD *)(a1 + 628),
(int)"TIFFReadRawTile",
"%lu: Tile out of range, max %lu",
a2,
*(_DWORD *)(v10 + 128));
return -1;
}
}