//
// __alloca_probe from 0x18011ff20 to 0x18011ff6e (78 bytes)
//
// 73 xrefs:
// > sub_180001540 @ 0x1800015fb
// > sub_180001540 @ 0x1800016ef
// > sub_180001A10 @ 0x180001aff
// > sub_180001A10 @ 0x180001cb5
// > sub_180001A10 @ 0x180001dd3
// > sub_180001E90 @ 0x180001f01
// > sub_180001E90 @ 0x180001f3d
// > sub_180001E90 @ 0x180002028
// > sub_180006380 @ 0x1800063ef
// > sub_180006380 @ 0x180006464
// > sub_180006ED0 @ 0x180006f2d
// > sub_180008050 @ 0x1800080d2
// > sub_180008050 @ 0x1800080fb
// > sub_180008050 @ 0x18000811c
// > sub_180008050 @ 0x180008139
// > sub_180008050 @ 0x180008222
// > sub_180008660 @ 0x18000870b
// > sub_180008660 @ 0x18000872c
// > sub_180008E90 @ 0x180008f6e
// > sub_180008E90 @ 0x180008f93
// > sub_180009770 @ 0x180009893
// > sub_180009770 @ 0x1800098c5
// > sub_180009770 @ 0x180009b57
// > sub_180009D60 @ 0x180009e31
// > sub_180015650 @ 0x180015659
// > sub_180017630 @ 0x180017645
// > sub_180017A50 @ 0x180017b00
// > sub_180018DF0 @ 0x180018e0d
// > sub_18001C780 @ 0x18001c79a
// > sub_180022480 @ 0x18002249a
// > sub_1800273E0 @ 0x1800273fa
// > sub_180029320 @ 0x180029336
// > sub_180031D30 @ 0x180031d48
// > sub_1800364B0 @ 0x1800364d5
// > sub_180037A60 @ 0x180037a7a
// > sub_18003C030 @ 0x18003c042
// > sub_18003C030 @ 0x18003c265
// > sub_18003C5E0 @ 0x18003c5e9
// > sub_18003F610 @ 0x18003f62a
// > sub_180049D80 @ 0x180049df7
// > sub_180049D80 @ 0x180049e23
// > sub_18004D3F0 @ 0x18004d486
// > sub_18004D3F0 @ 0x18004d4af
// > sub_18004D3F0 @ 0x18004d4d0
// > sub_18004D3F0 @ 0x18004d4f1
// > sub_18004F5A0 @ 0x18004f651
// > sub_18004F920 @ 0x18004faab
// > sub_18004F920 @ 0x18004fb93
// > sub_180058150 @ 0x180058165
// > sub_180058780 @ 0x180058795
// > sub_1800B4680 @ 0x1800b4699
// > sub_1800B5550 @ 0x1800b5565
// > sub_1800B7960 @ 0x1800b796b
// > sub_1800C1C80 @ 0x1800c1de7
// > sub_1800CB9B0 @ 0x1800cb9b7
// > sub_1800CF170 @ 0x1800cf17a
// > sub_1800CF380 @ 0x1800cf387
// > sub_1800D7EC0 @ 0x1800d7ed1
// > sub_1800D7EC0 @ 0x1800d87e6
// > sub_1800D7EC0 @ 0x1800d8817
// > sub_1800EC440 @ 0x1800ec450
// > sub_1800FE610 @ 0x1800fe622
// > sub_180108590 @ 0x18010859e
// > sub_18010BF50 @ 0x18010bf65
// > InternalCompareStringA @ 0x18013bc84
// > InternalCompareStringA @ 0x18013bd49
// > __acrt_GetStringTypeA @ 0x18013d7e7
// > write_text_ansi_nolock @ 0x18013fee3
// > write_text_utf16le_nolock @ 0x18013ffe7
// > write_text_utf8_nolock @ 0x180140107
// > __acrt_LCMapStringA_stat @ 0x180140ce3
// > __acrt_LCMapStringA_stat @ 0x180140e17
// > ??> @ 0x180202408
//
// 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
//
unsigned __int64 __fastcall _alloca_probe()
{
unsigned __int64 result; // rax
char *v1; // r10
char *StackLimit; // r11
char v3; // [rsp+18h] [rbp+8h] BYREF
v1 = &v3 - result;
if ( (unsigned __int64)&v3 < result )
v1 = nullptr;
StackLimit = (char *)NtCurrentTeb()->NtTib.StackLimit;
if ( v1 < StackLimit )
{
LOWORD(v1) = (unsigned __int16)v1 & 0xF000;
do
{
StackLimit -= 4096;
*StackLimit = 0;
}
while ( v1 != StackLimit );
}
return result;
}