//
// sub_77A014 from 0x77a014 to 0x77a050 (60 bytes)
//
// 2 xrefs:
// > sub_77B440 @ 0x77b462
// > sub_77B58C @ 0x77b5ae
//
// 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_77A014(int a1, int a2, char a3)
{
const char *v5; // r0
FILE *v7; // r0
v5 = sub_779E7C(a3);
if ( !v5 )
return 0;
if ( *(_DWORD *)a1 )
return 0;
v7 = fdopen(a2, v5);
*(_DWORD *)a1 = v7;
if ( !v7 )
return 0;
*(_BYTE *)(a1 + 4) = 1;
if ( !a2 )
setvbuf(v7, nullptr, 2, 0);
return a1;
}