//
// _fcloseall from 0x1801386bc to 0x18013876d (177 bytes)
//
// 2 xrefs:
// > __acrt_uninitialize_stdio @ 0x18012f993
// > ??> @ 0x18020368c
//
// 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 __cdecl fcloseall()
{
int i; // ebx
__int64 v1; // rcx
int v3; // [rsp+20h] [rbp-18h]
v3 = 0;
sub_1801346AC(8);
for ( i = 3; i != dword_1801F4BC8; ++i )
{
v1 = *((_QWORD *)Block + i);
if ( v1 )
{
if ( (*(_DWORD *)(v1 + 20) & 0x2000) != 0 && fclose(*((FILE **)Block + i)) != -1 )
++v3;
DeleteCriticalSection((LPCRITICAL_SECTION)(*((_QWORD *)Block + i) + 48LL));
free_base(*((void **)Block + i));
*((_QWORD *)Block + i) = 0;
}
}
sub_180134700(8);
return v3;
}