//
// TIFFSetDirectory from 0x6a7680 to 0x6a778c (268 bytes)
//
// 1 xrefs:
// > ??> @ 0x57fec
//
// 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 TIFFSetDirectory(int a1, __int16 a2)
{
__int64 v6; // [sp+8h] [bp-14h] BYREF
__int16 i; // [sp+16h] [bp-6h]
if ( (*(_DWORD *)(a1 + 12) & 0x80000) != 0 )
v6 = *(_QWORD *)(a1 + 432);
else
v6 = *(unsigned int *)(a1 + 428);
for ( i = a2; i && v6; --i )
{
if ( !sub_6A6C44((const char **)a1, &v6, nullptr) )
return 0;
}
*(_QWORD *)(a1 + 24) = v6;
*(_WORD *)(a1 + 448) = a2 - i - 1;
*(_WORD *)(a1 + 38) = 0;
return TIFFReadDirectory(a1);
}