//
// sub_1800DD5E0 from 0x1800dd5e0 to 0x1800dd64d (109 bytes)
//
// 5 xrefs:
// > sub_1800C7270 @ 0x1800c756e
// > sub_1800C9FF0 @ 0x1800ca3de
// > sub_1800DF320 @ 0x1800df5e4
// > sub_1800FE610 @ 0x1800ff973
// > ??> @ 0x1801ff624
//
// 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_1800DD5E0(__int64 a1)
{
__int64 v1; // rax
unsigned int v3; // edi
__int64 result; // rax
__int64 v5; // rcx
unsigned int v6; // r8d
v1 = *(_QWORD *)(a1 + 384);
if ( !v1 )
goto LABEL_8;
if ( (*(_DWORD *)(a1 + 44) & 0x400) != 0 || (v3 = *(_DWORD *)(a1 + 68), v3 > *(_DWORD *)(v1 + 68)) )
v3 = *(_DWORD *)(v1 + 68);
result = sub_1800DD230(a1, 0, v3, nullptr);
if ( (result & 0xFFFFFFEF) == 0 )
{
v5 = *(_QWORD *)(a1 + 384);
v6 = *(_DWORD *)(v5 + 68);
if ( v3 < v6 )
sub_1800DE780(v5, v3, v6 - v3);
LABEL_8:
_InterlockedAnd((volatile signed __int32 *)(a1 + 88), 0xFFFFFFEF);
return 0;
}
return result;
}