user: Translate the below assembly code into C programming language:

```asm
<level_select>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x10,%rsp
  mov    $0x2b,%ecx
  mov    $0x5,%edx
  mov    $0x25,%esi
  mov    $0xf,%edi
  call   <newwin@plt>
  mov    %rax,-0x8(%rbp)
  movl   $0x1,-0xc(%rbp)
  mov    -0x8(%rbp),%rax
  lea    D15(%rip),%rdx
  mov    %rdx,%rcx
  mov    $0x0,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <mvwaddstr@plt>
  movl   $0x1,-0x10(%rbp)
  jmp    L32
L122:
  mov    -0x10(%rbp),%edx
  mov    -0x10(%rbp),%esi
  mov    -0x8(%rbp),%rax
  mov    %edx,%r8d
  lea    D4(%rip),%rdx
  mov    %rdx,%rcx
  mov    $0x2,%edx
  mov    %rax,%rdi
  call   <mvwprintw@plt>
  addl   $0x1,-0x10(%rbp)
L32:
  cmpl   $0xd,-0x10(%rbp)
  jle    L122
L135:
  mov    -0xc(%rbp),%ecx
  mov    -0x8(%rbp),%rax
  mov    $0x0,%edx
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <draw_arrow@plt>
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <wrefresh@plt>
  mov    $0x0,%eax
  call   <getch@plt>
  mov    %eax,%edi
  call   <tolower@plt>
  mov    %eax,-0x10(%rbp)
  mov    $0x0,%eax
  call   <flushinp@plt>
  cmpl   $0x80,-0x10(%rbp)
  je     L28
  cmpl   $0x81,-0x10(%rbp)
  je     L75
  jmp    L159
L28:
  mov    -0xc(%rbp),%ecx
  mov    -0x8(%rbp),%rax
  mov    $0x0,%edx
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <erase_arrow@plt>
  cmpl   $0x1,-0xc(%rbp)
  jle    L30
  subl   $0x1,-0xc(%rbp)
  jmp    L140
L30:
  movl   $0xd,-0xc(%rbp)
  jmp    L140
L75:
  mov    -0xc(%rbp),%ecx
  mov    -0x8(%rbp),%rax
  mov    $0x0,%edx
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <erase_arrow@plt>
  cmpl   $0xc,-0xc(%rbp)
  jg     L109
  addl   $0x1,-0xc(%rbp)
  jmp    L140
L109:
  movl   $0x1,-0xc(%rbp)
  jmp    L140
L159:
  cmpl   $0xa,-0x10(%rbp)
  je     L49
  cmpl   $0x20,-0x10(%rbp)
  jne    L14
L49:
  mov    -0x8(%rbp),%rax
  mov    $0x25,%edx
  mov    $0xf,%esi
  mov    %rax,%rdi
  call   <erase_window@plt>
  mov    -0xc(%rbp),%eax
  jmp    L150
L14:
  mov    -0x10(%rbp),%eax
  mov    %eax,%esi
  mov    $0xa,%edi
  call   <pressed@plt>
  test   %eax,%eax
  jne    L156
  cmpl   $0x1b,-0x10(%rbp)
  jne    L26
L156:
  mov    -0x8(%rbp),%rax
  mov    $0x25,%edx
  mov    $0xf,%esi
  mov    %rax,%rdi
  call   <erase_window@plt>
  mov    $0xffffffff,%eax
  jmp    L150
L26:
  nop
L140:
  jmp    L135
L150:
  leave
  ret
```

tool_calls: name: parse_data
arguments: data_tag: D15
type: string
name: parse_data
arguments: data_tag: D4
type: string

tool: D15: Choose a level; press space or enter.

tool: D4: %d

assistant: ```c
int level_select() {
  WINDOW *win = newwin(15, 37, 5, 43);
  int input;
  int active = 1;
  mvwaddstr(win, 0, 0, "Choose a level; press space or enter.");
  for (input = 1; input <= 13; input++) {
    mvwprintw(win, input, 2, "%d", input);
  }
  while (true) {
    draw_arrow(win, active, 0);
    wrefresh(win);
    input = tolower(getch());
    flushinp();
    switch (input) {
    case KEY_UP:
      erase_arrow(win, active, 0);
      if (active > 1) {
        active--;
        break;
      }
      active = 13;
      break;
    case KEY_DOWN:
      erase_arrow(win, active, 0);
      if (active < 13) {
        active++;
        break;
      }
      active = 1;
      break;
    default:
      if (input == '\n' || input == ' ') {
        erase_window(win, 15, 37);
        return active;
      } else if (pressed(10, input) || input == 27) {
        erase_window(win, 15, 37);
        return -1;
      }
      break;
    }
  }
}
```