//
// sub_1800D40F0 from 0x1800d40f0 to 0x1800d4122 (50 bytes)
//
// 4 xrefs:
// > sub_1800D3BA0 @ 0x1800d3c93
// > sub_1800D3D90 @ 0x1800d4002
// > sub_1800D4040 @ 0x1800d40c8
// > ??> @ 0x1801fed30
//
// 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:10 +0000
//
__int64 __fastcall sub_1800D40F0(__int64 a1)
{
__int64 result; // rax
__int64 v2; // rdx
result = *(_QWORD *)(a1 + 24);
*(_BYTE *)(result + 8) = 1;
if ( !*(_BYTE *)(a1 + 312) )
{
v2 = *(_QWORD *)(a1 + 24);
*(_BYTE *)(a1 + 312) = 1;
result = *(_QWORD *)(v2 + 432);
*(_QWORD *)(a1 + 304) = result;
*(_QWORD *)(v2 + 432) = a1;
}
return result;
}