// File: /workspace/github_c_makefile_star2_O1/S01den[P]Lost_CavernRL/menu.c
// Function: gameOver
void gameOver(int source, int score, int minimal)
{
	WINDOW *win;
	if(minimal)
		win = newwin(7,50,LONGUEUR/2-2,LARGEUR/2-5);
	else
		win = newwin(7,50,LONGUEUR/2-2,LARGEUR/2+60);
	box(win,0,0);
	wattron(win,COLOR_PAIR(197));
	mvwprintw(win,1,15,"** GAME OVER !**");
	wattroff(win,COLOR_PAIR(197));
	wattron(win,A_BOLD);

	mvwprintw(win,3,1,"You were miserably killed by");
	switch(source)
	{
		case 1:
			mvwprintw(win,3,30,"an electric trap");
			break;
		case 2:
			mvwprintw(win,3,30,"an explosive trap");
			break;
		case 3:
			wattron(win,COLOR_PAIR(47));
			mvwprintw(win,3,30,"radioactivity");
			wattroff(win,COLOR_PAIR(47));
			break;
		case 4:
			mvwprintw(win,3,30,"the divine wrath !");
			break;
		case 5:
			mvwprintw(win,3,30,"your disease");
			break;
		case 6:
			wattron(win,COLOR_PAIR(197));
			mvwprintw(win,3,30,"fire");
			wattroff(win,COLOR_PAIR(197));
			break;
		case 7:
			mvwprintw(win,3,30,"a droid");
			break;
		case 8:
			mvwprintw(win,3,30,"a sentry");
			break;
		case 9:
			mvwprintw(win,3,30,"a guardian");
			break;
		default:
			mvwprintw(win,3,30,"suicide...");
	}
	wattron(win, A_UNDERLINE);
	mvwprintw(win,5,17,"SCORE: %d",score);
	wattroff(win, A_UNDERLINE);
	wrefresh(win);

	int i = 0;
	for(i = 0; i < 1000000000; i++)
	{
		//wait
	}


	wgetch(win);
	wattroff(win,A_BOLD);
	box(win,' ',' ');
	wborder(win, ' ', ' ', ' ',' ',' ',' ',' ',' ');
	wclear(win);
	wrefresh(win);
	delwin(win);	
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movl %edi, %r14d
testl %edx, %edx
movl $0x7d, %eax
movl $0x3c, %ecx
cmovel %eax, %ecx
movl $0x7, %edi
movl $0x32, %esi
movl $0x11, %edx
callq 0x1130
movq %rax, %rbx
subq $0x8, %rsp
xorl %eax, %eax
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq %rax
pushq %rax
pushq %rax
callq 0x1120
addq $0x20, %rsp
movq %rbx, %rdi
movl $0xc500, %esi           # imm = 0xC500
xorl %edx, %edx
callq 0x11c0
leaq 0x5dc3(%rip), %rcx      # 0x110fa
movq %rbx, %rdi
movl $0x1, %esi
movl $0xf, %edx
xorl %eax, %eax
callq 0x1070
movq %rbx, %rdi
movl $0xc500, %esi           # imm = 0xC500
xorl %edx, %edx
callq 0x1060
movq %rbx, %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %edx, %edx
callq 0x11c0
leaq 0x5d9b(%rip), %rcx      # 0x1110b
movq %rbx, %rdi
movl $0x3, %esi
movl $0x1, %edx
xorl %eax, %eax
callq 0x1070
decl %r14d
cmpl $0x8, %r14d
ja 0xb455
leaq 0x564c(%rip), %rax      # 0x109e4
movslq (%rax,%r14,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x5d80(%rip), %rcx      # 0x11128
jmp 0xb45c
leaq 0x5db8(%rip), %rcx      # 0x1116c
jmp 0xb45c
movq %rbx, %rdi
movl $0x2f00, %esi           # imm = 0x2F00
xorl %edx, %edx
callq 0x11c0
leaq 0x5d7c(%rip), %rcx      # 0x1114b
movq %rbx, %rdi
movl $0x3, %esi
movl $0x1e, %edx
xorl %eax, %eax
callq 0x1070
movq %rbx, %rdi
movl $0x2f00, %esi           # imm = 0x2F00
jmp 0xb43a
leaq 0x5d65(%rip), %rcx      # 0x11159
jmp 0xb45c
leaq 0x5d89(%rip), %rcx      # 0x11186
jmp 0xb45c
leaq 0x5d33(%rip), %rcx      # 0x11139
jmp 0xb45c
movq %rbx, %rdi
movl $0xc500, %esi           # imm = 0xC500
xorl %edx, %edx
callq 0x11c0
leaq 0x5d5b(%rip), %rcx      # 0x11179
movq %rbx, %rdi
movl $0x3, %esi
movl $0x1e, %edx
xorl %eax, %eax
callq 0x1070
movq %rbx, %rdi
movl $0xc500, %esi           # imm = 0xC500
xorl %edx, %edx
callq 0x1060
jmp 0xb470
leaq 0x5d34(%rip), %rcx      # 0x1117e
jmp 0xb45c
leaq 0x5d3c(%rip), %rcx      # 0x1118f
jmp 0xb45c
leaq 0x5d3e(%rip), %rcx      # 0x1119a
movq %rbx, %rdi
movl $0x3, %esi
movl $0x1e, %edx
xorl %eax, %eax
callq 0x1070
xorl %r14d, %r14d
movq %rbx, %rdi
movl $0x20000, %esi          # imm = 0x20000
xorl %edx, %edx
callq 0x11c0
leaq 0x5d1c(%rip), %rcx      # 0x111a5
movq %rbx, %rdi
movl $0x5, %esi
movl $0x11, %edx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x1070
movq %rbx, %rdi
movl $0x20000, %esi          # imm = 0x20000
xorl %edx, %edx
callq 0x1060
movq %rbx, %rdi
callq 0x1100
movq %rbx, %rdi
callq 0x11e0
movq %rbx, %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %edx, %edx
callq 0x1060
subq $0x8, %rsp
movl $0x20, %r15d
movq %rbx, %rdi
movl $0x20, %esi
movl $0x20, %edx
movl $0x20, %ecx
movl $0x20, %r8d
xorl %r9d, %r9d
pushq %r14
pushq %r14
pushq %r14
callq 0x1120
addq $0x18, %rsp
movq %rbx, %rdi
movl $0x20, %esi
movl $0x20, %edx
movl $0x20, %ecx
movl $0x20, %r8d
movl $0x20, %r9d
pushq %r15
pushq %r15
pushq %r15
callq 0x1120
addq $0x20, %rsp
movq %rbx, %rdi
callq 0x1030
movq %rbx, %rdi
callq 0x1100
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1110