//
// sub_6C6778 from 0x6c6778 to 0x6c6aa4 (812 bytes)
//
// 3 xrefs:
// > sub_6C6AF4 @ 0x6c6c28
// > sub_6C6AF4 @ 0x6c6c2c
// > ??> @ 0x6c6db0
//
// 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_6C6778(int result, FILE *a2, int a3)
{
int v3; // r3
int v6; // [sp+Ch] [bp-10h]
int v7; // [sp+10h] [bp-Ch]
const char *v8; // [sp+14h] [bp-8h]
v6 = result;
v7 = *(_DWORD *)(result + 576);
if ( !v7 )
result = _assert2();
if ( (*(_DWORD *)(v6 + 48) & 0x200) != 0 )
{
v8 = " ";
if ( *(_WORD *)(v6 + 88) == 4 )
{
fwrite(" Group 4 Options:", 1u, 0x12u, a2);
if ( (*(_DWORD *)(v7 + 28) & 2) == 0 )
{
LABEL_13:
result = fprintf(a2, " (%lu = 0x%lx)\n", *(_DWORD *)(v7 + 28), *(_DWORD *)(v7 + 28));
goto LABEL_14;
}
}
else
{
fwrite(" Group 3 Options:", 1u, 0x12u, a2);
if ( (*(_DWORD *)(v7 + 28) & 1) != 0 )
{
fprintf(a2, "%s2-d encoding", " ");
v8 = "+";
}
if ( (*(_DWORD *)(v7 + 28) & 4) != 0 )
{
fprintf(a2, "%sEOL padding", v8);
v8 = "+";
}
if ( (*(_DWORD *)(v7 + 28) & 2) == 0 )
goto LABEL_13;
}
fprintf(a2, "%suncompressed data", v8);
goto LABEL_13;
}
LABEL_14:
if ( (*(_DWORD *)(v6 + 48) & 8) != 0 )
{
fwrite(" Fax Data:", 1u, 0xBu, a2);
v3 = *(unsigned __int16 *)(v7 + 16);
if ( v3 == 1 )
{
fwrite(" receiver regenerated", 1u, 0x15u, a2);
}
else if ( v3 == 2 )
{
fwrite(" uncorrected errors", 1u, 0x13u, a2);
}
else if ( !*(_WORD *)(v7 + 16) )
{
fwrite(" clean", 1u, 6u, a2);
}
result = fprintf(a2, " (%u = 0x%x)\n", *(unsigned __int16 *)(v7 + 16), *(unsigned __int16 *)(v7 + 16));
}
if ( (*(_DWORD *)(v6 + 48) & 4) != 0 )
result = fprintf(a2, " Bad Fax Lines: %lu\n", *(_DWORD *)(v7 + 24));
if ( (*(_DWORD *)(v6 + 48) & 0x10) != 0 )
result = fprintf(a2, " Consecutive Bad Fax Lines: %lu\n", *(_DWORD *)(v7 + 20));
if ( *(_DWORD *)(v7 + 40) )
return (*(int (__fastcall **)(int, FILE *, int))(v7 + 40))(v6, a2, a3);
return result;
}