//
// sub_6AF588 from 0x6af588 to 0x6af6c8 (320 bytes)
//
// 2 xrefs:
// > TIFFReadDirectory @ 0x6b1150
// > TIFFReadDirectory @ 0x6b1924
//
// 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_6AF588(int a1, int a2, unsigned __int16 *a3)
{
unsigned __int16 *v8; // [sp+10h] [bp-14h] BYREF
int v9; // [sp+14h] [bp-10h]
unsigned __int16 *v10; // [sp+18h] [bp-Ch]
__int16 v11; // [sp+1Eh] [bp-6h]
if ( (unsigned __int64)*(unsigned __int16 *)(a1 + 98) > *(_QWORD *)(a2 + 8) )
return 1;
v9 = sub_6ABE98((_DWORD *)a1, a2, &v8);
if ( v9 )
return v9;
v10 = v8;
v11 = *(_WORD *)(a1 + 98);
*a3 = *v8;
++v10;
--v11;
while ( v11 )
{
if ( *v10++ != *a3 )
{
v9 = 5;
break;
}
--v11;
}
TIFFfree(v8);
return v9;
}