//
// sub_EB9A38 from 0xeb9a38 to 0xeb9c6c (564 bytes)
//
// 8 xrefs:
// > TIFFInitCCITTFax3 @ 0xebed50
// > TIFFInitCCITTFax3 @ 0xebed58
// > TIFFInitCCITTFax4 @ 0xebef28
// > TIFFInitCCITTFax4 @ 0xebef30
// > TIFFInitCCITTRLE @ 0xebf12c
// > TIFFInitCCITTRLE @ 0xebf134
// > TIFFInitCCITTRLEW @ 0xebf2bc
// > TIFFInitCCITTRLEW @ 0xebf2c4
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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 13:11:28 +0000
//
__int64 __fastcall sub_EB9A38(__int64 a1, FILE *s, __int64 a3)
{
__int64 result; // x0
__int64 v7; // x21
unsigned int v8; // w0
const char *v9; // x2
__int64 (__fastcall *v10)(__int64, FILE *, __int64); // x3
int v11; // w2
result = *(_QWORD *)(a1 + 72);
v7 = *(_QWORD *)(a1 + 848);
if ( (result & 0x200) != 0 )
{
if ( *(_WORD *)(a1 + 120) == 4 )
{
fwrite(" Group 4 Options:", 1u, 0x12u, s);
v8 = *(_DWORD *)(v7 + 32);
if ( (v8 & 2) != 0 )
{
fprintf(s, "%suncompressed data", &byte_11E1A70);
v8 = *(_DWORD *)(v7 + 32);
}
goto LABEL_6;
}
fwrite(" Group 3 Options:", 1u, 0x12u, s);
v8 = *(_DWORD *)(v7 + 32);
if ( (v8 & 1) != 0 )
{
fprintf(s, "%s2-d encoding", &byte_11E1A70);
v8 = *(_DWORD *)(v7 + 32);
v9 = "+";
if ( (v8 & 4) == 0 )
{
LABEL_5:
if ( (v8 & 2) == 0 )
{
LABEL_6:
fprintf(s, " (%lu = 0x%lx)\n", v8, v8);
result = *(_QWORD *)(a1 + 72);
goto LABEL_7;
}
LABEL_24:
fprintf(s, "%suncompressed data", v9);
v8 = *(_DWORD *)(v7 + 32);
goto LABEL_6;
}
}
else
{
v9 = &byte_11E1A70;
if ( (v8 & 4) == 0 )
goto LABEL_5;
}
fprintf(s, "%sEOL padding", v9);
v8 = *(_DWORD *)(v7 + 32);
v9 = "+";
if ( (v8 & 2) == 0 )
goto LABEL_6;
goto LABEL_24;
}
LABEL_7:
if ( (result & 8) == 0 )
{
if ( (result & 4) == 0 )
goto LABEL_9;
LABEL_13:
fprintf(s, " Bad Fax Lines: %lu\n", *(unsigned int *)(v7 + 28));
result = *(_QWORD *)(a1 + 72);
if ( (result & 0x10) == 0 )
goto LABEL_10;
goto LABEL_14;
}
fwrite(" Fax Data:", 1u, 0xBu, s);
v11 = *(unsigned __int16 *)(v7 + 20);
if ( v11 == 1 )
{
fwrite(" receiver regenerated", 1u, 0x15u, s);
v11 = *(unsigned __int16 *)(v7 + 20);
}
else if ( *(_WORD *)(v7 + 20) )
{
if ( v11 == 2 )
{
fwrite(" uncorrected errors", 1u, 0x13u, s);
v11 = *(unsigned __int16 *)(v7 + 20);
}
}
else
{
fwrite(" clean", 1u, 6u, s);
v11 = *(unsigned __int16 *)(v7 + 20);
}
fprintf(s, " (%u = 0x%x)\n", v11, v11);
result = *(_QWORD *)(a1 + 72);
if ( (result & 4) != 0 )
goto LABEL_13;
LABEL_9:
if ( (result & 0x10) == 0 )
goto LABEL_10;
LABEL_14:
result = fprintf(s, " Consecutive Bad Fax Lines: %lu\n", *(unsigned int *)(v7 + 24));
LABEL_10:
v10 = *(__int64 (__fastcall **)(__int64, FILE *, __int64))(v7 + 56);
if ( v10 )
return v10(a1, s, a3);
return result;
}