//
// sub_1800537E0 from 0x1800537e0 to 0x180053848 (104 bytes)
//
// 7 xrefs:
// > sub_180051410 @ 0x1800516fd
// > sub_180051410 @ 0x18005174d
// > sub_180051410 @ 0x18005184e
// > sub_180051410 @ 0x180051941
// > sub_180051B90 @ 0x180051c1e
// > sub_1800523F0 @ 0x1800528c7
// > ??> @ 0x1801f8b8c
//
// 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:53:18 +0000
//
__int64 __fastcall sub_1800537E0(__int64 *a1, __int64 a2)
{
__int64 v4; // rcx
unsigned int (__fastcall *v5)(__int64, __int64, _QWORD); // rax
v4 = *a1;
if ( !v4 )
return 4294967167LL;
v5 = (unsigned int (__fastcall *)(__int64, __int64, _QWORD))a1[99];
if ( !v5 || v5(v4, a2, 0) == -1 )
return 4294967168LL;
a1[2] = a2;
sub_18004C390((__int64)(a1 + 4));
return 0;
}