// File: 5hubh4m[P]snake-ncurses/snake_ncurses.cpp
// Function: show_menu()
int show_menu(void) {
	int c=1, ch;
	initscr();
	erase();
	raw();
	keypad(stdscr, TRUE);
	noecho();
	curs_set(0);
	print_snake();
	attron(A_STANDOUT);
	mvprintw(12, 28, "Play Classic Snake Game.");
	attroff(A_STANDOUT);
	mvprintw(13, 30, "Have Fun with Snake.");
	mvprintw(14, 24, "Show All Scores of Classic Mode.");
	mvprintw(15, 34, "Exit Game.");
	while(1) {
		ch=getch();
		if(ch=='\n') {
			return c;
		}
		else if(ch==KEY_UP) {
			if(c>1) {
				c--;
			}
			else {
				c=4;
			}
		}
		else if(ch==KEY_DOWN) {
			if(c<4) {
				c++;
			}
			else {
				c=1;
			}
		}
		switch(c) {
			case 1:
				erase();
				print_snake();
				attron(A_STANDOUT);
				mvprintw(12, 28, "Play Classic Snake Game.");
				attroff(A_STANDOUT);
				mvprintw(13, 30, "Have Fun with Snake.");
				mvprintw(14, 24, "Show All Scores of Classic Mode.");
				mvprintw(15, 34, "Exit Game.");
				break;
			case 2:
				erase();
				print_snake();
				mvprintw(12, 28, "Play Classic Snake Game.");
				attron(A_STANDOUT);
				mvprintw(13, 30, "Have Fun with Snake.");
				attroff(A_STANDOUT);
				mvprintw(14, 24, "Show All Scores of Classic Mode.");
				mvprintw(15, 34, "Exit Game.");
				break;
			case 3:
				erase();
				print_snake();
				mvprintw(12, 28, "Play Classic Snake Game.");
				mvprintw(13, 30, "Have Fun with Snake.");
				attron(A_STANDOUT);
				mvprintw(14, 24, "Show All Scores of Classic Mode.");
				attroff(A_STANDOUT);
				mvprintw(15, 34, "Exit Game.");
				break;
			case 4:
				erase();
				print_snake();
				mvprintw(12, 28, "Play Classic Snake Game.");
				mvprintw(13, 30, "Have Fun with Snake.");
				mvprintw(14, 24, "Show All Scores of Classic Mode.");
				attron(A_STANDOUT);
				mvprintw(15, 34, "Exit Game.");
				attroff(A_STANDOUT);
				break;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x1, -0x4(%rbp)
callq 0x2270
callq 0x21b0
callq 0x2090
movq 0x6403(%rip), %rax      # 0xcfd8
movq (%rax), %rdi
movl $0x1, %esi
callq 0x20c0
callq 0x21d0
xorl %edi, %edi
callq 0x2130
callq 0x6ae0
movq 0x63de(%rip), %rax      # 0xcfd8
movq (%rax), %rdi
movl $0x10000, %esi          # imm = 0x10000
xorl %eax, %eax
movl %eax, %edx
callq 0x20e0
movl $0xc, %edi
movl $0x1c, %esi
leaq 0x1656(%rip), %rdx      # 0x8272
movb $0x0, %al
callq 0x2220
movq 0x63ae(%rip), %rax      # 0xcfd8
movq (%rax), %rdi
movl $0x10000, %esi          # imm = 0x10000
xorl %eax, %eax
movl %eax, %edx
callq 0x2210
movl $0xd, %edi
movl $0x1e, %esi
leaq 0x163f(%rip), %rdx      # 0x828b
movb $0x0, %al
callq 0x2220
movl $0xe, %edi
movl $0x18, %esi
leaq 0x163c(%rip), %rdx      # 0x82a0
movb $0x0, %al
callq 0x2220
movl $0xf, %edi
movl $0x22, %esi
leaq 0x1645(%rip), %rdx      # 0x82c1
movb $0x0, %al
callq 0x2220
movq 0x634e(%rip), %rax      # 0xcfd8
movq (%rax), %rdi
callq 0x20b0
movl %eax, -0x8(%rbp)
cmpl $0xa, -0x8(%rbp)
jne 0x6ca4
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
cmpl $0x103, -0x8(%rbp)      # imm = 0x103
jne 0x6cc7
cmpl $0x1, -0x4(%rbp)
jle 0x6cbe
movl -0x4(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x6cc5
movl $0x4, -0x4(%rbp)
jmp 0x6cec
cmpl $0x102, -0x8(%rbp)      # imm = 0x102
jne 0x6cea
cmpl $0x4, -0x4(%rbp)
jge 0x6ce1
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x6ce8
movl $0x1, -0x4(%rbp)
jmp 0x6cea
jmp 0x6cec
jmp 0x6cee
movl -0x4(%rbp), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x10(%rbp)
subl $0x3, %eax
ja 0x6f8d
movq -0x10(%rbp), %rax
leaq 0x13a3(%rip), %rcx      # 0x80b0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
callq 0x21b0
callq 0x6ae0
movq 0x62b1(%rip), %rax      # 0xcfd8
movq (%rax), %rdi
movl $0x10000, %esi          # imm = 0x10000
xorl %eax, %eax
movl %eax, %edx
callq 0x20e0
movl $0xc, %edi
movl $0x1c, %esi
leaq 0x1529(%rip), %rdx      # 0x8272
movb $0x0, %al
callq 0x2220
movq 0x6281(%rip), %rax      # 0xcfd8
movq (%rax), %rdi
movl $0x10000, %esi          # imm = 0x10000
xorl %eax, %eax
movl %eax, %edx
callq 0x2210
movl $0xd, %edi
movl $0x1e, %esi
leaq 0x1512(%rip), %rdx      # 0x828b
movb $0x0, %al
callq 0x2220
movl $0xe, %edi
movl $0x18, %esi
leaq 0x150f(%rip), %rdx      # 0x82a0
movb $0x0, %al
callq 0x2220
movl $0xf, %edi
movl $0x22, %esi
leaq 0x1518(%rip), %rdx      # 0x82c1
movb $0x0, %al
callq 0x2220
jmp 0x6f8d
callq 0x21b0
callq 0x6ae0
movl $0xc, %edi
movl $0x1c, %esi
leaq 0x14a2(%rip), %rdx      # 0x8272
movb $0x0, %al
callq 0x2220
movq 0x61fa(%rip), %rax      # 0xcfd8
movq (%rax), %rdi
movl $0x10000, %esi          # imm = 0x10000
xorl %eax, %eax
movl %eax, %edx
callq 0x20e0
movl $0xd, %edi
movl $0x1e, %esi
leaq 0x148b(%rip), %rdx      # 0x828b
movb $0x0, %al
callq 0x2220
movq 0x61ca(%rip), %rax      # 0xcfd8
movq (%rax), %rdi
movl $0x10000, %esi          # imm = 0x10000
xorl %eax, %eax
movl %eax, %edx
callq 0x2210
movl $0xe, %edi
movl $0x18, %esi
leaq 0x1470(%rip), %rdx      # 0x82a0
movb $0x0, %al
callq 0x2220
movl $0xf, %edi
movl $0x22, %esi
leaq 0x1479(%rip), %rdx      # 0x82c1
movb $0x0, %al
callq 0x2220
jmp 0x6f8d
callq 0x21b0
callq 0x6ae0
movl $0xc, %edi
movl $0x1c, %esi
leaq 0x1403(%rip), %rdx      # 0x8272
movb $0x0, %al
callq 0x2220
movl $0xd, %edi
movl $0x1e, %esi
leaq 0x1404(%rip), %rdx      # 0x828b
movb $0x0, %al
callq 0x2220
movq 0x6143(%rip), %rax      # 0xcfd8
movq (%rax), %rdi
movl $0x10000, %esi          # imm = 0x10000
xorl %eax, %eax
movl %eax, %edx
callq 0x20e0
movl $0xe, %edi
movl $0x18, %esi
leaq 0x13e9(%rip), %rdx      # 0x82a0
movb $0x0, %al
callq 0x2220
movq 0x6113(%rip), %rax      # 0xcfd8
movq (%rax), %rdi
movl $0x10000, %esi          # imm = 0x10000
xorl %eax, %eax
movl %eax, %edx
callq 0x2210
movl $0xf, %edi
movl $0x22, %esi
leaq 0x13da(%rip), %rdx      # 0x82c1
movb $0x0, %al
callq 0x2220
jmp 0x6f8d
callq 0x21b0
callq 0x6ae0
movl $0xc, %edi
movl $0x1c, %esi
leaq 0x1364(%rip), %rdx      # 0x8272
movb $0x0, %al
callq 0x2220
movl $0xd, %edi
movl $0x1e, %esi
leaq 0x1365(%rip), %rdx      # 0x828b
movb $0x0, %al
callq 0x2220
movl $0xe, %edi
movl $0x18, %esi
leaq 0x1362(%rip), %rdx      # 0x82a0
movb $0x0, %al
callq 0x2220
movq 0x608c(%rip), %rax      # 0xcfd8
movq (%rax), %rdi
movl $0x10000, %esi          # imm = 0x10000
xorl %eax, %eax
movl %eax, %edx
callq 0x20e0
movl $0xf, %edi
movl $0x22, %esi
leaq 0x1353(%rip), %rdx      # 0x82c1
movb $0x0, %al
callq 0x2220
movq 0x605c(%rip), %rax      # 0xcfd8
movq (%rax), %rdi
movl $0x10000, %esi          # imm = 0x10000
xorl %eax, %eax
movl %eax, %edx
callq 0x2210
jmp 0x6c83
nopw %cs:(%rax,%rax)