//
// sub_14051E500 from 0x14051e500 to 0x14051e573 (115 bytes)
//
// 2 xrefs:
// > sub_14052CDE0 @ 0x14052cede
// > ??> @ 0x14092b304
//
// 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 11:33:36 +0000
//
unsigned __int64 __fastcall sub_14051E500(_QWORD *a1)
{
unsigned __int64 v2; // rcx
_QWORD *v3; // rdx
unsigned __int64 result; // rax
unsigned __int64 *v5; // rdx
unsigned __int64 *v6; // rcx
unsigned __int64 v7; // [rsp+30h] [rbp+8h] BYREF
v2 = a1[2];
if ( v2 )
{
v3 = (_QWORD *)a1[1];
if ( a1[7] >> 3 <= v2 )
{
sub_14051D460(v2, (__int64)v3);
*(_QWORD *)a1[1] = a1[1];
*(_QWORD *)(a1[1] + 8LL) = a1[1];
a1[2] = 0;
v5 = (unsigned __int64 *)a1[4];
v6 = (unsigned __int64 *)a1[3];
v7 = a1[1];
return sub_14003EC90(v6, v5, &v7);
}
else
{
return sub_14051E580(a1, *v3, a1[1]);
}
}
return result;
}