//
// __acrt_stdio_allocate_buffer_nolock from 0x180142078 to 0x1801420e3 (107 bytes)
//
// 3 xrefs:
// > unknown_libname_72 @ 0x18013f784
// > unknown_libname_73 @ 0x18013f83e
// > ??> @ 0x180203d04
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 10:55:05 +0000
//
__int64 __fastcall _acrt_stdio_allocate_buffer_nolock(__int64 a1)
{
int v2; // edi
__int64 result; // rax
++dword_1801F4BD8;
v2 = 4096;
*(_QWORD *)(a1 + 8) = calloc_base(0x1000u, 1u);
free_base(nullptr);
if ( *(_QWORD *)(a1 + 8) )
{
_InterlockedOr((volatile signed __int32 *)(a1 + 20), 0x40u);
}
else
{
_InterlockedOr((volatile signed __int32 *)(a1 + 20), 0x400u);
v2 = 2;
*(_QWORD *)(a1 + 8) = a1 + 28;
}
*(_DWORD *)(a1 + 32) = v2;
result = *(_QWORD *)(a1 + 8);
*(_DWORD *)(a1 + 16) = 0;
*(_QWORD *)a1 = result;
return result;
}