//
// TIFFOpen from 0x906330 to 0x906478 (328 bytes)
//
// 1 xrefs:
// > ??> @ 0x6ba4c
//
// 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:04:18 +0000
//
_DWORD *__fastcall TIFFOpen(const char *a1, const char *a2)
{
int *v3; // r0
int *v4; // r0
char *v5; // r0
int oflag; // [sp+14h] [bp-10h]
int fd; // [sp+18h] [bp-Ch]
_DWORD *v11; // [sp+1Ch] [bp-8h]
oflag = TIFFgetMode(a2, (int)"TIFFOpen");
if ( oflag == -1 )
return nullptr;
fd = open(a1, oflag, 438);
if ( fd >= 0 )
{
v11 = TIFFFdOpen(fd, a1, a2);
if ( !v11 )
close(fd);
return v11;
}
else
{
if ( *(int *)_errno() > 0 && (v3 = (int *)_errno(), strerror(*v3)) )
{
v4 = (int *)_errno();
v5 = strerror(*v4);
TIFFErrorExt(0, (int)"TIFFOpen", "%s: %s", a1, v5);
}
else
{
TIFFErrorExt(0, (int)"TIFFOpen", "%s: Cannot open", a1);
}
return nullptr;
}
}