// File: /workspace/github_c_makefile_star2_O0/neovim[P]libtermkey/driver-csi.c
// Function: peekkey
static TermKeyResult peekkey(TermKey *tk, void *info, TermKeyKey *key, int force, size_t *nbytep)
{
  if(tk->buffcount == 0)
    return tk->is_closed ? TERMKEY_RES_EOF : TERMKEY_RES_NONE;

  TermKeyCsi *csi = info;

  switch(CHARAT(0)) {
    case 0x1b:
      if(tk->buffcount < 2)
        return TERMKEY_RES_NONE;

      switch(CHARAT(1)) {
        case 0x4f: // ESC-prefixed SS3
          return peekkey_ss3(tk, csi, 2, key, force, nbytep);

        case 0x50: // ESC-prefixed DCS
        case 0x5d: // ESC-prefixed OSC
          return peekkey_ctrlstring(tk, csi, 2, key, force, nbytep);

        case 0x5b: // ESC-prefixed CSI
          return peekkey_csi(tk, csi, 2, key, force, nbytep);
      }

      return TERMKEY_RES_NONE;

    case 0x8f: // SS3
      return peekkey_ss3(tk, csi, 1, key, force, nbytep);

    case 0x90: // DCS
    case 0x9d: // OSC
      return peekkey_ctrlstring(tk, csi, 1, key, force, nbytep);

    case 0x9b: // CSI
      return peekkey_csi(tk, csi, 1, key, force, nbytep);
  }

  return TERMKEY_RES_NONE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movq %r8, -0x30(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x20(%rax)
jne 0x6d36
movq -0x10(%rbp), %rax
movsbl 0x8c(%rax), %edx
xorl %eax, %eax
movl $0x2, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x6ed1
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rcx
movq 0x10(%rcx), %rax
movq 0x18(%rcx), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x3c(%rbp)
subl $0x1b, %eax
je 0x6d9b
jmp 0x6d58
movl -0x3c(%rbp), %eax
subl $0x8f, %eax
je 0x6e61
jmp 0x6d68
movl -0x3c(%rbp), %eax
subl $0x90, %eax
je 0x6e84
jmp 0x6d78
movl -0x3c(%rbp), %eax
subl $0x9b, %eax
je 0x6ea7
jmp 0x6d88
movl -0x3c(%rbp), %eax
subl $0x9d, %eax
je 0x6e84
jmp 0x6eca
movq -0x10(%rbp), %rax
cmpq $0x2, 0x20(%rax)
jae 0x6db2
movl $0x0, -0x4(%rbp)
jmp 0x6ed1
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rcx
movq 0x18(%rax), %rax
movzbl 0x1(%rax,%rcx), %eax
addl $-0x4f, %eax
movl %eax, %ecx
movq %rcx, -0x48(%rbp)
subl $0xe, %eax
ja 0x6e58
movq -0x48(%rbp), %rax
leaq 0x3584(%rip), %rcx      # 0xa364
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x20(%rbp), %rcx
movl -0x24(%rbp), %r8d
movq -0x30(%rbp), %r9
movl $0x2, %edx
callq 0x7e00
movl %eax, -0x4(%rbp)
jmp 0x6ed1
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x20(%rbp), %rcx
movl -0x24(%rbp), %r8d
movq -0x30(%rbp), %r9
movl $0x2, %edx
callq 0x8050
movl %eax, -0x4(%rbp)
jmp 0x6ed1
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x20(%rbp), %rcx
movl -0x24(%rbp), %r8d
movq -0x30(%rbp), %r9
movl $0x2, %edx
callq 0x8270
movl %eax, -0x4(%rbp)
jmp 0x6ed1
movl $0x0, -0x4(%rbp)
jmp 0x6ed1
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x20(%rbp), %rcx
movl -0x24(%rbp), %r8d
movq -0x30(%rbp), %r9
movl $0x1, %edx
callq 0x7e00
movl %eax, -0x4(%rbp)
jmp 0x6ed1
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x20(%rbp), %rcx
movl -0x24(%rbp), %r8d
movq -0x30(%rbp), %r9
movl $0x1, %edx
callq 0x8050
movl %eax, -0x4(%rbp)
jmp 0x6ed1
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x20(%rbp), %rcx
movl -0x24(%rbp), %r8d
movq -0x30(%rbp), %r9
movl $0x1, %edx
callq 0x8270
movl %eax, -0x4(%rbp)
jmp 0x6ed1
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)