// File: drofp[P]RoadRun/src/settings_menu.cc
// Function: roadrun::SettingsMenu::PrintMenu()
void SettingsMenu::PrintMenu()
  {
    endwin();
    refresh();
    WINDOW *menu_win;
    int highlight = 1;
    int choice = 0;
    int c;
    initscr();
    clear();
    noecho();
    cbreak();
    int startx = 5;  // (80 - kWidth) / 2;
    int starty = 5;  // (80 - kHeight) / 2;
    menu_win = newwin(kHeight, kWidth, starty, startx);
    keypad(menu_win, TRUE);
    mvprintw(0, 0, "Use up and down arrows to choose, enter to select.");
    refresh();
    RenderOptions(menu_win, highlight);
    int enter_pressed = 0;
    while(!enter_pressed)
    {
      c = wgetch(menu_win);
      switch (c)
      {
      case KEY_UP:
        if(highlight == 1)
            highlight = 2;
          else
            --highlight;
          break;
      case KEY_DOWN:
        if(highlight == 2)
          highlight = 1;
        else
          ++highlight;
        break;
      case 10:
        choice = highlight;
        enter_pressed = 1;
        break;
      default:
        // mvprintw(24, 0, "Charcter pressed is = %3d Hopefully it can be printed as '%c'", c, c);
        refresh();
        break;
      }
      current_choice = settings_item_list[highlight - 1];
      RenderOptions(menu_win, highlight);
    }
    // mvprintw(23, 0, "You chose choice %d with choice string %s\n", choice, choices[choice - 1]);
    clrtoeol();
    refresh();
    endwin();
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
callq 0x21d0
callq 0x2260
movl $0x1, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
callq 0x2230
callq 0x2270
callq 0x21c0
callq 0x2070
movq -0x30(%rbp), %rax
movl $0x5, -0x20(%rbp)
movl $0x5, -0x24(%rbp)
movl 0x18(%rax), %edi
movl 0x14(%rax), %esi
movl -0x24(%rbp), %edx
movl -0x20(%rbp), %ecx
callq 0x2170
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movl $0x1, %esi
callq 0x20a0
xorl %esi, %esi
leaq 0x1415(%rip), %rdx      # 0x6d43
movl %esi, %edi
movb $0x0, %al
callq 0x2200
callq 0x2260
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
movq (%rdi), %rax
callq *0x10(%rax)
movl $0x0, -0x28(%rbp)
cmpl $0x0, -0x28(%rbp)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x5966
jmp 0x5a0b
movq -0x10(%rbp), %rdi
callq 0x2090
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x34(%rbp)
subl $0xa, %eax
je 0x59cb
jmp 0x597f
movl -0x34(%rbp), %eax
subl $0x102, %eax            # imm = 0x102
je 0x59b1
jmp 0x598b
movl -0x34(%rbp), %eax
subl $0x103, %eax            # imm = 0x103
jne 0x59da
jmp 0x5997
cmpl $0x1, -0x14(%rbp)
jne 0x59a6
movl $0x2, -0x14(%rbp)
jmp 0x59af
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x59df
cmpl $0x2, -0x14(%rbp)
jne 0x59c0
movl $0x1, -0x14(%rbp)
jmp 0x59c9
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x59df
movl -0x14(%rbp), %eax
movl %eax, -0x18(%rbp)
movl $0x1, -0x28(%rbp)
jmp 0x59df
callq 0x2260
movq -0x30(%rbp), %rdi
movl -0x14(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rcx
leaq 0x15f5(%rip), %rax      # 0x6fe8
movl (%rax,%rcx,4), %eax
movl %eax, 0x10(%rdi)
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
movq (%rdi), %rax
callq *0x10(%rax)
jmp 0x5954
movq 0x45c6(%rip), %rax      # 0x9fd8
movq (%rax), %rdi
callq 0x21a0
callq 0x2260
callq 0x21d0
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)