//
// sub_18011BE10 from 0x18011be10 to 0x18011beb5 (165 bytes)
//
// 2 xrefs:
// > ??> @ 0x18016e160
// > ??> @ 0x18020215c
//
// 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:50 +0000
//
__int64 __fastcall sub_18011BE10(__int64 a1)
{
__int64 result; // rax
void *v4; // rcx
result = sub_1800F5350(*(_QWORD *)(a1 + 72), *(_QWORD *)(a1 + 48), *(_QWORD *)(a1 + 104), 0, 1);
if ( !(_DWORD)result )
{
memmove(
(void *)(*(_QWORD *)(a1 + 96) + 8LL * *(_DWORD *)(a1 + 40) * (*(_DWORD *)(a1 + 16) + 1)),
*(const void **)(a1 + 104),
8LL * (*(_DWORD *)(a1 + 16) + 1));
if ( --*(_DWORD *)(a1 + 40) < 0 )
*(_DWORD *)(a1 + 40) = *(_DWORD *)(a1 + 32) - 1;
_InterlockedExchangeAdd((volatile signed __int32 *)(a1 + 136), 1u);
v4 = (void *)qword_1801F2B78[86 * *(unsigned int *)(*(_QWORD *)(a1 + 8) + 69808LL) + 43 * *(int *)(a1 + 168)];
if ( v4 )
sub_1800C14F0(v4);
return 0;
}
return result;
}