//
// sub_6B35D4 from 0x6b35d4 to 0x6b3748 (372 bytes)
//
// 1 xrefs:
// > TIFFReadDirectory @ 0x6b0ecc
//
// 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_6B35D4(int a1, __int64 a2)
{
unsigned __int16 i; // [sp+1Ah] [bp-Ah]
int v8; // [sp+1Ch] [bp-8h]
if ( a2 )
{
for ( i = 0; i < (unsigned int)*(unsigned __int16 *)(a1 + 38) && *(_DWORD *)(a1 + 32); ++i )
{
if ( a2 == *(_QWORD *)(*(_DWORD *)(a1 + 32) + 8 * i) )
return 0;
}
if ( (unsigned __int16)++*(_WORD *)(a1 + 38) > (unsigned int)*(unsigned __int16 *)(a1 + 36) )
{
v8 = TIFFCheckRealloc((_DWORD *)a1, *(_DWORD *)(a1 + 32), *(unsigned __int16 *)(a1 + 38), 16, "for IFD list");
if ( !v8 )
return 0;
*(_WORD *)(a1 + 36) = 2 * *(_WORD *)(a1 + 38);
*(_DWORD *)(a1 + 32) = v8;
}
*(_QWORD *)(*(_DWORD *)(a1 + 32) + 8 * (*(unsigned __int16 *)(a1 + 38) - 1)) = a2;
return 1;
}
return 0;
}