//
// sub_6B7304 from 0x6b7304 to 0x6b74bc (440 bytes)
//
// 1 xrefs:
// > TIFFReadCustomDirectory @ 0x6b2f00
//
// 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_6B7304(int a1, unsigned __int16 *a2)
{
unsigned int v6; // [sp+14h] [bp-20h] BYREF
__int64 v7; // [sp+18h] [bp-1Ch] BYREF
int v8; // [sp+24h] [bp-10h]
double v9; // [sp+28h] [bp-Ch]
v7 = 0;
if ( *((_QWORD *)a2 + 1) == 1 )
{
if ( a2[1] == 5 )
{
if ( (*(_DWORD *)(a1 + 12) & 0x80000) != 0 )
{
v7 = *((_QWORD *)a2 + 2);
v8 = 0;
}
else
{
v6 = *((_DWORD *)a2 + 4);
if ( (*(_DWORD *)(a1 + 12) & 0x80) != 0 )
TIFFSwabLong(&v6);
v8 = sub_6B0978(a1, v6, 8, (int)&v7);
}
}
else
{
v8 = 2;
}
}
else
{
v8 = 1;
}
if ( v8 )
{
sub_6B0B30(a1, v8, (int)"TIFFFetchSubjectDistance", "SubjectDistance", 1);
return 0;
}
else
{
if ( (*(_DWORD *)(a1 + 12) & 0x80) != 0 )
TIFFSwabArrayOfLong(&v7, 2);
if ( (_DWORD)v7 )
{
if ( (_DWORD)v7 == -1 )
v9 = -1.0;
else
v9 = (double)(unsigned int)v7 / (double)HIDWORD(v7);
}
else
{
v9 = 0.0;
}
return TIFFSetField(a1, *a2, v9);
}
}