//
// sub_1800D9A80 from 0x1800d9a80 to 0x1800d9b2c (172 bytes)
//
// 9 xrefs:
// > sub_1800D8360 @ 0x1800d844a
// > sub_1800D8360 @ 0x1800d8486
// > sub_1800D8360 @ 0x1800d84c2
// > sub_1800D8360 @ 0x1800d84fe
// > sub_1800DA0D0 @ 0x1800da787
// > sub_1800DA0D0 @ 0x1800da7ae
// > sub_1800DA0D0 @ 0x1800da7e5
// > sub_1800DA0D0 @ 0x1800daa95
// > ??> @ 0x1801c4b3c
//
// 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:22:34 +0000
//
__int64 sub_1800D9A80()
{
int v0; // ebx
int v1; // edi
int v2; // esi
SHORT KeyState; // bx
int v4; // edi
unsigned int v5; // ebx
char v6; // al
unsigned int v7; // ecx
v0 = (unsigned __int16)GetKeyState(16) >> 15;
v1 = v0 | 2;
if ( GetKeyState(17) >= 0 )
v1 = v0;
v2 = v1 | 4;
if ( GetKeyState(18) >= 0 )
v2 = v1;
KeyState = GetKeyState(92);
v4 = v2 | 8;
if ( ((GetKeyState(91) | KeyState) & 0x8000u) == 0 )
v4 = v2;
v5 = v4 | 0x10;
if ( (GetKeyState(20) & 1) == 0 )
v5 = v4;
v6 = GetKeyState(144);
v7 = v5 | 0x20;
if ( (v6 & 1) == 0 )
return v5;
return v7;
}