//
// sub_8FAF5C from 0x8faf5c to 0x8fb2c8 (876 bytes)
//
// 1 xrefs:
// > TIFFPrintDirectory @ 0x8fcbe4
//
// 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:15 +0000
//
int __fastcall sub_8FAF5C(int a1, int a2, FILE *a3, unsigned int a4, unsigned int a5, unsigned __int16 *a6)
{
unsigned int i; // [sp+1Ch] [bp-10h]
if ( !strncmp(*(const char **)(a2 + 28), "Tag ", 4u) )
return 0;
if ( a4 == 700 )
{
fwrite(" XMLPacket (XMP Metadata):\n", 1u, 0x1Cu, a3);
for ( i = 0; i < a5; ++i )
fputc(*((unsigned __int8 *)a6 + i), a3);
fputc(10, a3);
return 1;
}
if ( a4 > 0x2BC )
{
if ( a4 == 34377 )
{
fprintf(a3, " Photoshop Data:
, %lu bytes\n", a5);
return 1;
}
if ( a4 > 0x8649 )
{
if ( a4 == 34675 )
{
fprintf(a3, " ICC Profile: , %lu bytes\n", a5);
return 1;
}
if ( a4 == 37439 )
{
if ( a5 != 1 || *(_DWORD *)(a2 + 8) != 12 )
return 0;
fprintf(a3, " Sample to Nits conversion factor: %.4e\n", *(double *)a6);
return 1;
}
}
else if ( a4 == 33723 )
{
fprintf(a3, " RichTIFFIPTC Data: , %lu bytes\n", 4 * a5);
return 1;
}
return 0;
}
switch ( a4 )
{
case 0x14Cu:
if ( a5 == 2 && *(_DWORD *)(a2 + 8) == 3 )
{
fwrite(" Ink Set: ", 1u, 0xBu, a3);
if ( *a6 == 1 )
fwrite("CMYK\n", 1u, 5u, a3);
else
fprintf(a3, "%u (0x%x)\n", *a6, *a6);
return 1;
}
else
{
return 0;
}
case 0x150u:
if ( a5 == 2 && *(_DWORD *)(a2 + 8) == 3 )
{
fprintf(a3, " Dot Range: %u-%u\n", *a6, a6[1]);
return 1;
}
else
{
return 0;
}
case 0x13Eu:
if ( a5 == 2 && *(_DWORD *)(a2 + 8) == 5 )
{
fprintf(a3, " White Point: %g-%g\n", *(float *)a6, *((float *)a6 + 1));
return 1;
}
else
{
return 0;
}
default:
return 0;
}
}