// File: /workspace/github_c_makefile_star2_O2/enzo1982[P]smooth/classes/gui/window/backends/xlib/windowxlib.cpp
// Function: smooth::GUI::WindowXLib::ConvertKey(int)
S::Input::Keyboard::Key S::GUI::WindowXLib::ConvertKey(Int keySym)
{
	Input::Keyboard::Key	 key = Input::Keyboard::KeyOther;

	switch (keySym)
	{
		case XK_Left:	   key = Input::Keyboard::KeyLeft;    break;
		case XK_Up:	   key = Input::Keyboard::KeyUp;      break;
		case XK_Right:	   key = Input::Keyboard::KeyRight;   break;
		case XK_Down:	   key = Input::Keyboard::KeyDown;    break;

		case XK_Home:	   key = Input::Keyboard::KeyHome;    break;
		case XK_End:	   key = Input::Keyboard::KeyEnd;     break;
		case XK_Insert:	   key = Input::Keyboard::KeyInsert;  break;
		case XK_Delete:	   key = Input::Keyboard::KeyDelete;  break;
		case XK_Prior:	   key = Input::Keyboard::KeyPrior;   break;
		case XK_Next:	   key = Input::Keyboard::KeyNext;    break;

		case XK_Return:	   key = Input::Keyboard::KeyReturn;  break;
		case XK_BackSpace: key = Input::Keyboard::KeyBack;    break;
		case XK_Tab:	   key = Input::Keyboard::KeyTab;     break;

		case XK_space:	   key = Input::Keyboard::KeySpace;   break;

		case XK_Shift_L:
		case XK_Shift_R:   key = Input::Keyboard::KeyShift;   break;

		case XK_Control_L:
		case XK_Control_R: key = Input::Keyboard::KeyControl; break;

		case XK_Alt_L:
		case XK_Alt_R:	   key = Input::Keyboard::KeyAlt;     break;

		case XK_Escape:	   key = Input::Keyboard::KeyEscape;  break;

		case XK_F1:	   key = Input::Keyboard::KeyF1;      break;
		case XK_F2:	   key = Input::Keyboard::KeyF2;      break;
		case XK_F3:	   key = Input::Keyboard::KeyF3;      break;
		case XK_F4:	   key = Input::Keyboard::KeyF4;      break;
		case XK_F5:	   key = Input::Keyboard::KeyF5;      break;
		case XK_F6:	   key = Input::Keyboard::KeyF6;      break;
		case XK_F7:	   key = Input::Keyboard::KeyF7;      break;
		case XK_F8:	   key = Input::Keyboard::KeyF8;      break;
		case XK_F9:	   key = Input::Keyboard::KeyF9;      break;
		case XK_F10:	   key = Input::Keyboard::KeyF10;     break;
		case XK_F11:	   key = Input::Keyboard::KeyF11;     break;
		case XK_F12:	   key = Input::Keyboard::KeyF12;     break;
		case XK_F13:	   key = Input::Keyboard::KeyF13;     break;
		case XK_F14:	   key = Input::Keyboard::KeyF14;     break;
		case XK_F15:	   key = Input::Keyboard::KeyF15;     break;
		case XK_F16:	   key = Input::Keyboard::KeyF16;     break;
		case XK_F17:	   key = Input::Keyboard::KeyF17;     break;
		case XK_F18:	   key = Input::Keyboard::KeyF18;     break;
		case XK_F19:	   key = Input::Keyboard::KeyF19;     break;
		case XK_F20:	   key = Input::Keyboard::KeyF20;     break;
		case XK_F21:	   key = Input::Keyboard::KeyF21;     break;
		case XK_F22:	   key = Input::Keyboard::KeyF22;     break;
		case XK_F23:	   key = Input::Keyboard::KeyF23;     break;
		case XK_F24:	   key = Input::Keyboard::KeyF24;     break;
	}

	if	(keySym >= '0' && keySym <= '9') key = (Input::Keyboard::Key)  keySym;
	else if	(keySym >= 'A' && keySym <= 'Z') key = (Input::Keyboard::Key)  keySym;
	else if	(keySym >= 'a' && keySym <= 'z') key = (Input::Keyboard::Key) (keySym + ('A' - 'a'));

	return key;
}

// Assembly:
xorl %ecx, %ecx
leal -0xffbe(%rsi), %eax
cmpl $0x41, %eax
ja 0xb8d18
leaq 0x4a1f8(%rip), %rdx     # 0x102f00
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
pushq $0x10
jmp 0xb8e4d
leal -0xff50(%rsi), %eax
cmpl $0x13, %eax
ja 0xb8d3a
leaq 0x4a186(%rip), %rdx     # 0x102eb0
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
pushq $0x24
jmp 0xb8e4d
cmpl $0x20, %esi
je 0xb8e4b
cmpl $0xff08, %esi           # imm = 0xFF08
je 0xb8e3f
cmpl $0xff09, %esi           # imm = 0xFF09
je 0xb8e47
cmpl $0xff0d, %esi           # imm = 0xFF0D
je 0xb8e43
cmpl $0xff1b, %esi           # imm = 0xFF1B
jne 0xb8e4e
pushq $0x1b
jmp 0xb8e4d
pushq $0x11
jmp 0xb8e4d
pushq $0x12
jmp 0xb8e4d
pushq $0x23
jmp 0xb8e4d
pushq $0x2d
jmp 0xb8e4d
pushq $0x25
jmp 0xb8e4d
pushq $0x27
jmp 0xb8e4d
pushq $0x26
jmp 0xb8e4d
pushq $0x21
jmp 0xb8e4d
pushq $0x22
jmp 0xb8e4d
pushq $0x28
jmp 0xb8e4d
movl $0x81, %ecx
jmp 0xb8e4e
pushq $0x7f
jmp 0xb8e4d
pushq $0x75
jmp 0xb8e4d
pushq $0x7d
jmp 0xb8e4d
movl $0x82, %ecx
jmp 0xb8e4e
pushq $0x78
jmp 0xb8e4d
pushq $0x7e
jmp 0xb8e4d
pushq $0x70
jmp 0xb8e4d
pushq $0x72
jmp 0xb8e4d
pushq $0x71
jmp 0xb8e4d
pushq $0x74
jmp 0xb8e4d
pushq $0x73
jmp 0xb8e4d
movl $0x84, %ecx
jmp 0xb8e4e
pushq $0x7a
jmp 0xb8e4d
pushq $0x76
jmp 0xb8e4d
pushq $0x7c
jmp 0xb8e4d
pushq $0x77
jmp 0xb8e4d
pushq $0x7b
jmp 0xb8e4d
movl $0x80, %ecx
jmp 0xb8e4e
pushq $0x79
jmp 0xb8e4d
movl $0x83, %ecx
jmp 0xb8e4e
movl $0x85, %ecx
jmp 0xb8e4e
movl $0x87, %ecx
jmp 0xb8e4e
pushq $0x2e
jmp 0xb8e4d
movl $0x86, %ecx
jmp 0xb8e4e
pushq $0x8
jmp 0xb8e4d
pushq $0xd
jmp 0xb8e4d
pushq $0x9
jmp 0xb8e4d
pushq $0x20
popq %rcx
leal -0x30(%rsi), %edx
leal -0x61(%rsi), %edi
leal -0x20(%rsi), %eax
cmpl $0x1a, %edi
cmovael %ecx, %eax
leal -0x41(%rsi), %ecx
cmpl $0x1a, %ecx
cmovbl %esi, %eax
cmpl $0xa, %edx
cmovbl %esi, %eax
retq
nop