//
// sub_CCE438 from 0xcce438 to 0xcce4b8 (128 bytes)
//
// 4 xrefs:
// > sub_D0D938 @ 0xd0d9d0
// > sub_D0D938 @ 0xd0da2c
// > sub_D114B8 @ 0xd1155c
// > sub_D114B8 @ 0xd115b8
//
// 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
//
__int64 __fastcall sub_CCE438(__int64 a1)
{
FILE *v1; // x20
_DWORD *v3; // x21
v1 = *(FILE **)a1;
if ( !*(_QWORD *)a1 )
return 0;
if ( *(_BYTE *)(a1 + 8) )
{
v3 = (_DWORD *)__errno();
*v3 = 0;
while ( fclose(v1) )
{
if ( *v3 != 4 )
{
*(_QWORD *)a1 = 0;
return 0;
}
v1 = *(FILE **)a1;
}
}
*(_QWORD *)a1 = 0;
return a1;
}