//
// __acrt_allocate_buffer_for_argv from 0x180131c4c to 0x180131ca9 (93 bytes)
//
// 3 xrefs:
// > _configure_narrow_argv @ 0x180131d54
// > common_expand_argv_wildcards @ 0x180139b57
// > ??> @ 0x180202f48
//
// 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:54:59 +0000
//
void *__fastcall _acrt_allocate_buffer_for_argv(unsigned __int64 a1, unsigned __int64 a2, unsigned __int64 a3)
{
__int64 v3; // rcx
void *v4; // rbx
if ( a1 >= 0x1FFFFFFFFFFFFFFFLL )
return nullptr;
if ( a2 >= 0xFFFFFFFFFFFFFFFFuLL / a3 )
return nullptr;
v3 = 8 * a1;
if ( ~v3 <= a3 * a2 )
return nullptr;
v4 = calloc_base(a3 * a2 + v3, 1u);
free_base(nullptr);
return v4;
}