// File: /workspace/github_c_makefile_star2_O0/zenlinux[P]cwm/menu.c
// Function: menu_keycode
static int
menu_keycode(XKeyEvent *ev, enum ctltype *ctl, char *chr)
{
	KeySym	 ks;
	u_int 	 state = ev->state;

	*ctl = CTL_NONE;
	chr[0] = '\0';

	ks = XkbKeycodeToKeysym(X_Dpy, ev->keycode, 0,
	     (state & ShiftMask) ? 1 : 0);

	/* Look for control characters. */
	switch (ks) {
	case XK_BackSpace:
		*ctl = CTL_ERASEONE;
		break;
	case XK_Return:
		*ctl = CTL_RETURN;
		break;
	case XK_Up:
		*ctl = CTL_UP;
		break;
	case XK_Down:
		*ctl = CTL_DOWN;
		break;
	case XK_Escape:
		*ctl = CTL_ABORT;
		break;
	}

	if (*ctl == CTL_NONE && (state & ControlMask)) {
		switch (ks) {
		case XK_s:
		case XK_S:
			/* Emacs "next" */
			*ctl = CTL_DOWN;
			break;
		case XK_r:
		case XK_R:
			/* Emacs "previous" */
			*ctl = CTL_UP;
			break;
		case XK_u:
		case XK_U:
			*ctl = CTL_WIPE;
			break;
		case XK_h:
		case XK_H:
			*ctl = CTL_ERASEONE;
			break;
		case XK_a:
		case XK_A:
			*ctl = CTL_ALL;
			break;
		}
	}

	if (*ctl == CTL_NONE && (state & Mod1Mask)) {
		switch (ks) {
		case XK_j:
		case XK_J:
			/* Vi "down" */
			*ctl = CTL_DOWN;
			break;
		case XK_k:
		case XK_K:
			/* Vi "up" */
			*ctl = CTL_UP;
			break;
		}
	}

	if (*ctl != CTL_NONE)
		return (0);

	if (XLookupString(ev, chr, 32, &ks, NULL) < 0)
		return (-1);

	return (0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movl 0x50(%rax), %eax
movl %eax, -0x2c(%rbp)
movq -0x18(%rbp), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movq -0x20(%rbp), %rax
movb $0x0, (%rax)
leaq 0x12962(%rip), %rax     # 0x1c7a8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movzbl 0x54(%rax), %esi
movl -0x2c(%rbp), %ecx
andl $0x1, %ecx
xorl %edx, %edx
callq 0x5270
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x38(%rbp)
subq $0xff08, %rax           # imm = 0xFF08
je 0x9eac
jmp 0x9e74
movq -0x38(%rbp), %rax
subq $0xff0d, %rax           # imm = 0xFF0D
je 0x9eb8
jmp 0x9e82
movq -0x38(%rbp), %rax
subq $0xff1b, %rax           # imm = 0xFF1B
je 0x9edc
jmp 0x9e90
movq -0x38(%rbp), %rax
subq $0xff52, %rax           # imm = 0xFF52
je 0x9ec4
jmp 0x9e9e
movq -0x38(%rbp), %rax
subq $0xff54, %rax           # imm = 0xFF54
je 0x9ed0
jmp 0x9ee6
movq -0x18(%rbp), %rax
movl $0x0, (%rax)
jmp 0x9ee6
movq -0x18(%rbp), %rax
movl $0x4, (%rax)
jmp 0x9ee6
movq -0x18(%rbp), %rax
movl $0x2, (%rax)
jmp 0x9ee6
movq -0x18(%rbp), %rax
movl $0x3, (%rax)
jmp 0x9ee6
movq -0x18(%rbp), %rax
movl $0x5, (%rax)
movq -0x18(%rbp), %rax
cmpl $-0x1, (%rax)
jne 0x9f5c
movl -0x2c(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x9f5c
movq -0x28(%rbp), %rax
addq $-0x41, %rax
movq %rax, -0x40(%rbp)
subq $0x34, %rax
ja 0x9f5a
movq -0x40(%rbp), %rax
leaq 0xa21d(%rip), %rcx      # 0x14134
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x18(%rbp), %rax
movl $0x3, (%rax)
jmp 0x9f5a
movq -0x18(%rbp), %rax
movl $0x2, (%rax)
jmp 0x9f5a
movq -0x18(%rbp), %rax
movl $0x1, (%rax)
jmp 0x9f5a
movq -0x18(%rbp), %rax
movl $0x0, (%rax)
jmp 0x9f5a
movq -0x18(%rbp), %rax
movl $0x6, (%rax)
jmp 0x9f5c
movq -0x18(%rbp), %rax
cmpl $-0x1, (%rax)
jne 0x9fae
movl -0x2c(%rbp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x9fae
movq -0x28(%rbp), %rax
addq $-0x4a, %rax
movq %rax, -0x48(%rbp)
subq $0x21, %rax
ja 0x9fac
movq -0x48(%rbp), %rax
leaq 0xa27b(%rip), %rcx      # 0x14208
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x18(%rbp), %rax
movl $0x3, (%rax)
jmp 0x9fac
movq -0x18(%rbp), %rax
movl $0x2, (%rax)
jmp 0x9fae
movq -0x18(%rbp), %rax
cmpl $-0x1, (%rax)
je 0x9fc0
movl $0x0, -0x4(%rbp)
jmp 0x9ff0
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl $0x20, %edx
leaq -0x28(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r8d
callq 0x5150
cmpl $0x0, %eax
jge 0x9fe9
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x9ff0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)