// File: /workspace/github_cpp_makefile_star2_O2/drofp[P]RoadRun/src/main_menu.cc
// Function: roadrun::MainMenu::PrintMenu()
void MainMenu::PrintMenu()
  {

    endwin();
    refresh();
    WINDOW *menu_win;
    WINDOW *info_win;

    int highlight = 1;
    int choice = 0;
    int c;

    initscr();
    clear();
    noecho();
    cbreak();
    curs_set(0);

    int startx = 5; //(80 - kWidth) / 2;
    int starty = 5; //(80 - kHeight) / 2;

    menu_win = newwin(kMenuHeight, kMenuWidth, starty, startx);
    info_win = newwin(kInfoHeight, kMenuWidth, starty, kMenuWidth+7);

    keypad(menu_win, TRUE);
    mvprintw(0, 0, "Use up and down arrows to choose, enter to select.");
    mvprintw(1, 0, "==================================================");
    mvprintw(2, 0, "To play: Press left and right arrow keys to move.");
    mvprintw(3, 0, "         Dodge the obstacles as long as you can!");
    mvprintw(4, 0, "Your Character: ^");
    mvwprintw(info_win, 0, 0, R"ronmak(
    ____                  ______
   / __ \____  ____ _____/ / __ \__  ______
  / /_/ / __ \/ __ `/ __  / /_/ / / / / __ \
 / _, _/ /_/ / /_/ / /_/ / _, _/ /_/ / / / /
/_/ |_|\____/\__,_/\__,_/_/ |_|\__,_/_/ /_/
              )ronmak");
    refresh();
    RenderOptions(menu_win, highlight);

    mvwprintw(info_win, 7, 0, "Easy High Score: %d",
                            difficulty_map->operator[](SettingsItem::kRegular));
    mvwprintw(info_win, 8, 0, "Hard High Score: %d",
                          difficulty_map->operator[](SettingsItem::kLudicrous));
    mvwprintw(info_win, 9, 0, "Previous Score: %d", *prev_score);
    wrefresh(info_win);

    int enter_pressed = 0;

    while(!enter_pressed)
    {
      c = wgetch(menu_win);
      switch (c)
      {
      case KEY_UP:
        if(highlight == 1)
            highlight = 3;
        else
          --highlight;
          break;
      case KEY_DOWN:
        if(highlight == 3)
          highlight = 1;
        else
          ++highlight;
        break;
      case 10:
        choice = highlight;
        enter_pressed = 1;
        break;
      default:
        refresh();
        break;
      }
      current_choice = menu_item_list[highlight - 1];
      RenderOptions(menu_win, highlight);
    }

    wclear(menu_win);
    clear();
    refresh();
    wrefresh(menu_win);
    endwin();
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x21d0
callq 0x2260
callq 0x2230
callq 0x2270
callq 0x21c0
callq 0x2070
xorl %r15d, %r15d
xorl %edi, %edi
callq 0x2120
pushq $0x1e
popq %rdi
pushq $0x3d
popq %r12
pushq $0x5
popq %r13
movl %r12d, %esi
movl %r13d, %edx
movl %r13d, %ecx
callq 0x2170
movq %rax, %r14
pushq $0x44
popq %rcx
pushq $0x1e
popq %rdi
movl %r12d, %esi
movl %r13d, %edx
callq 0x2170
movq %rax, %r13
pushq $0x1
popq %r12
movq %r14, %rdi
movl %r12d, %esi
callq 0x20a0
leaq 0x1324(%rip), %rdx      # 0x45bb
xorl %edi, %edi
xorl %esi, %esi
xorl %eax, %eax
callq 0x2200
leaq 0x1345(%rip), %rdx      # 0x45ee
movl %r12d, %edi
xorl %esi, %esi
xorl %eax, %eax
callq 0x2200
leaq 0x1365(%rip), %rdx      # 0x4621
pushq $0x2
popq %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x2200
leaq 0x1384(%rip), %rdx      # 0x4653
pushq $0x3
popq %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x2200
leaq 0x13a2(%rip), %rdx      # 0x4684
pushq $0x4
popq %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x2200
leaq 0x13a1(%rip), %rcx      # 0x4696
movq %r13, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x2040
callq 0x2260
movq (%rbx), %rax
movq %rbx, %rdi
movq %r14, %rsi
movl %r12d, %edx
callq *0x10(%rax)
movq 0x18(%rbx), %rdi
leaq -0x30(%rbp), %rsi
andl $0x0, (%rsi)
callq 0x2f66
movl (%rax), %r8d
leaq 0x1448(%rip), %rcx      # 0x4779
pushq $0x7
popq %rsi
movq %r13, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0x2040
movq 0x18(%rbx), %rdi
leaq -0x2c(%rbp), %rsi
movl $0x1, (%rsi)
callq 0x2f66
movl (%rax), %r8d
leaq 0x1430(%rip), %rcx      # 0x478d
pushq $0x8
popq %rsi
movq %r13, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0x2040
movq 0x20(%rbx), %rax
movl (%rax), %r8d
leaq 0x1427(%rip), %rcx      # 0x47a1
pushq $0x9
popq %rsi
movq %r13, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0x2040
movq %r13, %rdi
callq 0x21b0
leaq 0x141c(%rip), %r12      # 0x47b4
pushq $0x1
popq %rax
movl %eax, %r13d
movq %r14, %rdi
testl %r15d, %r15d
jne 0x340a
callq 0x2090
cmpl $0xa, %eax
je 0x33e0
cmpl $0x102, %eax            # imm = 0x102
je 0x33ca
cmpl $0x103, %eax            # imm = 0x103
jne 0x33e6
cmpl $0x1, %r13d
leal -0x1(%r13), %eax
pushq $0x3
jmp 0x33d4
cmpl $0x3, %r13d
leal 0x1(%r13), %eax
pushq $0x1
popq %rcx
cmovel %ecx, %eax
xorl %r15d, %r15d
movl %eax, %r13d
jmp 0x33ee
pushq $0x1
popq %r15
jmp 0x33ee
callq 0x2260
xorl %r15d, %r15d
leal -0x1(%r13), %eax
movl (%r12,%rax,4), %eax
movl %eax, 0x10(%rbx)
movq (%rbx), %rax
movq %rbx, %rdi
movq %r14, %rsi
movl %r13d, %edx
callq *0x10(%rax)
jmp 0x339e
callq 0x2150
callq 0x2270
callq 0x2260
movq %r14, %rdi
callq 0x21b0
callq 0x21d0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop