// File: /workspace/github_c_makefile_star2_O0/jaimecgomezz[P]st/x.c
// Function: kpress
void kpress(XEvent *ev) {
  XKeyEvent *e = &ev->xkey;
  KeySym ksym;
  char buf[64], *customkey;
  int len;
  Rune c;
  Status status;
  Shortcut *bp;

  // >>>>>>>>>>>>>>>>>>>> hide-cursor
  // ==================== hide-cursor
  // ==================== hide-cursor
  // <<<<<<<<<<<<<<<<<<<< hide-cursor

  if (IS_SET(MODE_KBDLOCK))
    return;

  if (xw.ime.xic)
    len = XmbLookupString(xw.ime.xic, e, buf, sizeof buf, &ksym, &status);
  else
    len = XLookupString(e, buf, sizeof buf, &ksym, NULL);
  // >>>>>>>>>>>>>>>>>>>> vim-browse
  // ==================== vim-browse
  // ==================== vim-browse
  // <<<<<<<<<<<<<<<<<<<< vim-browse
  // >>>>>>>>>>>>>>>>>>>> keyboard-select
  // ==================== keyboard-select
  // ==================== keyboard-select
  // <<<<<<<<<<<<<<<<<<<< keyboard-select
  /* 1. shortcuts */
  for (bp = shortcuts; bp < shortcuts + LEN(shortcuts); bp++) {
    if (ksym == bp->keysym && match(bp->mod, e->state)) {
      bp->func(&(bp->arg));
      return;
    }
  }

  /* 2. custom keys from config.h */
  if ((customkey = kmap(ksym, e->state))) {
    ttywrite(customkey, strlen(customkey), 1);
    return;
  }

  /* 3. composed string from input method */
  if (len == 0)
    return;
  if (len == 1 && e->state & Mod1Mask) {
    if (IS_SET(MODE_8BIT)) {
      if (*buf < 0177) {
        c = *buf | 0x80;
        len = utf8encode(c, buf);
      }
    } else {
      buf[1] = buf[0];
      buf[0] = '\033';
      len = 2;
    }
  }
  ttywrite(buf, len, 1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movl 0xb9ab(%rip), %eax      # 0x1b3b8
andl $0x40, %eax
cmpl $0x0, %eax
je 0xfa1a
jmp 0xfb8e
cmpq $0x0, 0xb8ce(%rip)      # 0x1b2f0
je 0xfa4a
movq 0xb8c5(%rip), %rdi      # 0x1b2f0
movq -0x10(%rbp), %rsi
leaq -0x60(%rbp), %rdx
movl $0x40, %ecx
leaq -0x18(%rbp), %r8
leaq -0x74(%rbp), %r9
callq 0x5710
movl %eax, -0x6c(%rbp)
jmp 0xfa68
movq -0x10(%rbp), %rdi
leaq -0x60(%rbp), %rsi
movl $0x40, %edx
leaq -0x18(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r8d
callq 0x5150
movl %eax, -0x6c(%rbp)
leaq 0x76a1(%rip), %rax      # 0x17110
movq %rax, -0x80(%rbp)
leaq 0x7696(%rip), %rax      # 0x17110
addq $0x180, %rax            # imm = 0x180
cmpq %rax, -0x80(%rbp)
jae 0xfad2
movq -0x18(%rbp), %rax
movq -0x80(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0xfac2
movq -0x80(%rbp), %rax
movl (%rax), %edi
movq -0x10(%rbp), %rax
movl 0x50(%rax), %esi
callq 0x105a0
cmpl $0x0, %eax
je 0xfac2
movq -0x80(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x80(%rbp), %rdi
addq $0x18, %rdi
callq *%rax
jmp 0xfb8e
jmp 0xfac4
movq -0x80(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x80(%rbp)
jmp 0xfa73
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x50(%rax), %esi
callq 0x105e0
movq %rax, -0x68(%rbp)
cmpq $0x0, %rax
je 0xfb16
movq -0x68(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x68(%rbp), %rdi
callq 0x5350
movq -0x88(%rbp), %rdi
movq %rax, %rsi
movl $0x1, %edx
callq 0x6f80
jmp 0xfb8e
cmpl $0x0, -0x6c(%rbp)
jne 0xfb1e
jmp 0xfb8e
cmpl $0x1, -0x6c(%rbp)
jne 0xfb7c
movq -0x10(%rbp), %rax
movl 0x50(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0xfb7c
movl 0xb87f(%rip), %eax      # 0x1b3b8
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0xfb69
movsbl -0x60(%rbp), %eax
cmpl $0x7f, %eax
jge 0xfb67
movsbl -0x60(%rbp), %eax
orl $0x80, %eax
movl %eax, -0x70(%rbp)
movl -0x70(%rbp), %edi
leaq -0x60(%rbp), %rsi
callq 0x5bc0
movl %eax, -0x6c(%rbp)
jmp 0xfb7a
movb -0x60(%rbp), %al
movb %al, -0x5f(%rbp)
movb $0x1b, -0x60(%rbp)
movl $0x2, -0x6c(%rbp)
jmp 0xfb7c
leaq -0x60(%rbp), %rdi
movslq -0x6c(%rbp), %rsi
movl $0x1, %edx
callq 0x6f80
addq $0x90, %rsp
popq %rbp
retq
nopw (%rax,%rax)