//
// TIFFSetDirectory from 0x8b7700 to 0x8b780c (268 bytes)
//
// 1 xrefs:
// > ??> @ 0x6b00c
//
// 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:03:56 +0000
//
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_8B6CC4((const char **)a1, &v6, nullptr) )
return 0;
}
*(_QWORD *)(a1 + 24) = v6;
*(_WORD *)(a1 + 448) = a2 - i - 1;
*(_WORD *)(a1 + 38) = 0;
return TIFFReadDirectory(a1);
}