//
// __acrt_errno_map_os_error from 0x18012fde0 to 0x18012fe2e (78 bytes)
//
// 14 xrefs:
// > __acrt_mbs_to_wcs_cp<__crt_win32_buffer_internal_dynamic_resizing> @ 0x18012901e
// > common_stat<_stat64i32> @ 0x18012919e
// > common_stat_handle_file_opened<_stat64i32> @ 0x180129342
// > get_drive_number_from_path @ 0x180129675
// > _beginthreadex @ 0x180130b2b
// > unknown_libname_66 @ 0x1801348e2
// > __acrt_get_full_path_name_wide<__crt_win32_buffer_public_dynamic_resizing> @ 0x180134967
// > __acrt_wcs_to_mbs_cp<__crt_win32_buffer_no_resizing> @ 0x180134ab0
// > _close_nolock @ 0x180138cc2
// > __acrt_GetModuleFileNameA @ 0x180139266
// > __acrt_wcs_to_mbs_cp<__crt_win32_buffer_internal_dynamic_resizing> @ 0x18013998b
// > _write_nolock @ 0x1801405d4
// > common_lseek_nolock<__int64> @ 0x180142022
// > ??> @ 0x180202dec
//
// 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 _acrt_errno_map_os_error(int a1)
{
__int64 v2; // rax
int *v3; // rax
__int64 v4; // rax
_DWORD *v5; // rbx
__int64 result; // rax
v2 = _acrt_getptd_noexit();
if ( v2 )
v3 = (int *)(v2 + 36);
else
v3 = (int *)&unk_1801B1854;
*v3 = a1;
v4 = _acrt_getptd_noexit();
v5 = &unk_1801B1850;
if ( v4 )
v5 = (_DWORD *)(v4 + 32);
result = _acrt_errno_from_os_error(a1);
*v5 = result;
return result;
}