//
// sub_14003B2E0 from 0x14003b2e0 to 0x14003b35a (122 bytes)
//
// 2 xrefs:
// > sub_1402F2AC0 @ 0x1402f2b67
// > ??> @ 0x1406c3dc8
//
// 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
//
__int64 __fastcall sub_14003B2E0(__int64 a1, __int64 a2, __int64 a3, __int64 a4)
{
_QWORD *v6; // rcx
v6 = *(_QWORD **)a1;
if ( v6 )
{
if ( *(_QWORD *)(a1 + 16) - (_QWORD)v6 >= 0x1000u )
{
if ( (unsigned __int64)v6 - *(v6 - 1) - 8 > 0x1F )
invalid_parameter_noinfo_noreturn();
v6 = (_QWORD *)*(v6 - 1);
}
j_j_free(v6);
}
*(_QWORD *)a1 = a2;
*(_QWORD *)(a1 + 8) = a2 + 10000;
*(_QWORD *)(a1 + 16) = a2 + a4;
return a2 + a4;
}