// File: /workspace/github_c_makefile_star2_O1/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
cmpl $0xffbd, %esi           # imm = 0xFFBD
jle 0xbfc05
leal -0xffbe(%rsi), %eax
cmpl $0x41, %eax
ja 0xbfdb8
leaq 0x5422e(%rip), %rdx     # 0x113e20
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
movl $0x10, %ecx
jmp 0xbfdb8
cmpl $0xff0c, %esi           # imm = 0xFF0C
jle 0xbfc32
leal -0xff50(%rsi), %eax
cmpl $0x13, %eax
ja 0xbfc69
leaq 0x541b1(%rip), %rdx     # 0x113dd0
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
movl $0x24, %ecx
jmp 0xbfdb8
cmpl $0x20, %esi
je 0xbfc8b
cmpl $0xff08, %esi           # imm = 0xFF08
je 0xbfc95
cmpl $0xff09, %esi           # imm = 0xFF09
jne 0xbfdb8
movl $0x9, %ecx
jmp 0xbfdb8
movl $0x12, %ecx
jmp 0xbfdb8
movl $0x11, %ecx
jmp 0xbfdb8
cmpl $0xff0d, %esi           # imm = 0xFF0D
je 0xbfdb3
cmpl $0xff1b, %esi           # imm = 0xFF1B
jne 0xbfdb8
movl $0x1b, %ecx
jmp 0xbfdb8
movl $0x20, %ecx
jmp 0xbfdb8
movl $0x8, %ecx
jmp 0xbfdb8
movl $0x7d, %ecx
jmp 0xbfdb8
movl $0x80, %ecx
jmp 0xbfdb8
movl $0x7f, %ecx
jmp 0xbfdb8
movl $0x85, %ecx
jmp 0xbfdb8
movl $0x7b, %ecx
jmp 0xbfdb8
movl $0x78, %ecx
jmp 0xbfdb8
movl $0x7a, %ecx
jmp 0xbfdb8
movl $0x81, %ecx
jmp 0xbfdb8
movl $0x86, %ecx
jmp 0xbfdb8
movl $0x83, %ecx
jmp 0xbfdb8
movl $0x77, %ecx
jmp 0xbfdb8
movl $0x79, %ecx
jmp 0xbfdb8
movl $0x70, %ecx
jmp 0xbfdb8
movl $0x74, %ecx
jmp 0xbfdb8
movl $0x82, %ecx
jmp 0xbfdb8
movl $0x72, %ecx
jmp 0xbfdb8
movl $0x84, %ecx
jmp 0xbfdb8
movl $0x7c, %ecx
jmp 0xbfdb8
movl $0x71, %ecx
jmp 0xbfdb8
movl $0x76, %ecx
jmp 0xbfdb8
movl $0x73, %ecx
jmp 0xbfdb8
movl $0x75, %ecx
jmp 0xbfdb8
movl $0x2e, %ecx
jmp 0xbfdb8
movl $0x87, %ecx
jmp 0xbfdb8
movl $0x7e, %ecx
jmp 0xbfdb8
movl $0x21, %ecx
jmp 0xbfdb8
movl $0x28, %ecx
jmp 0xbfdb8
movl $0x26, %ecx
jmp 0xbfdb8
movl $0x25, %ecx
jmp 0xbfdb8
movl $0x27, %ecx
jmp 0xbfdb8
movl $0x22, %ecx
jmp 0xbfdb8
movl $0x2d, %ecx
jmp 0xbfdb8
movl $0x23, %ecx
jmp 0xbfdb8
movl $0xd, %ecx
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