// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x7d
popq %rax
pushq $0x3c
popq %rcx
cmovel %eax, %ecx
pushq $0x7
popq %rdi
pushq $0x32
popq %rsi
pushq $0x11
popq %rdx
callq 0x1130
movq %rax, %rbx
subq $0x20, %rsp
andl $0x0, 0x10(%rsp)
andl $0x0, 0x8(%rsp)
andl $0x0, (%rsp)
movq %rax, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x1120
addq $0x20, %rsp
movq %rbx, %rdi
movl $0xc500, %esi           # imm = 0xC500
xorl %edx, %edx
callq 0x11c0
leaq 0x535b(%rip), %rcx      # 0xf19a
pushq $0x1
popq %r15
pushq $0xf
popq %rdx
movq %rbx, %rdi
movl %r15d, %esi
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 0x5333(%rip), %rcx      # 0xf1ab
pushq $0x3
popq %rsi
movq %rbx, %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0x1070
decl %r14d
cmpl $0x8, %r14d
ja 0x9f51
leaq 0x4bec(%rip), %rax      # 0xea88
movslq (%rax,%r14,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x531c(%rip), %rcx      # 0xf1c8
jmp 0x9f58
leaq 0x5354(%rip), %rcx      # 0xf20c
jmp 0x9f58
movq %rbx, %rdi
movl $0x2f00, %esi           # imm = 0x2F00
xorl %edx, %edx
callq 0x11c0
leaq 0x5318(%rip), %rcx      # 0xf1eb
pushq $0x3
popq %rsi
pushq $0x1e
popq %rdx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1070
movq %rbx, %rdi
movl $0x2f00, %esi           # imm = 0x2F00
jmp 0x9f36
leaq 0x5305(%rip), %rcx      # 0xf1f9
jmp 0x9f58
leaq 0x5329(%rip), %rcx      # 0xf226
jmp 0x9f58
leaq 0x52d3(%rip), %rcx      # 0xf1d9
jmp 0x9f58
movq %rbx, %rdi
movl $0xc500, %esi           # imm = 0xC500
xorl %edx, %edx
callq 0x11c0
leaq 0x52fb(%rip), %rcx      # 0xf219
pushq $0x3
popq %rsi
pushq $0x1e
popq %rdx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1070
movq %rbx, %rdi
movl $0xc500, %esi           # imm = 0xC500
xorl %edx, %edx
callq 0x1060
jmp 0x9f68
leaq 0x52d8(%rip), %rcx      # 0xf21e
jmp 0x9f58
leaq 0x52e0(%rip), %rcx      # 0xf22f
jmp 0x9f58
leaq 0x52e2(%rip), %rcx      # 0xf23a
pushq $0x3
popq %rsi
pushq $0x1e
popq %rdx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1070
movq %rbx, %rdi
movl $0x20000, %esi          # imm = 0x20000
xorl %edx, %edx
callq 0x11c0
leaq 0x52c7(%rip), %rcx      # 0xf245
pushq $0x5
popq %rsi
pushq $0x11
popq %rdx
movq %rbx, %rdi
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
pushq $0x20
popq %r14
movq %rbx, %rdi
movl %r14d, %esi
movl %r14d, %edx
movl %r14d, %ecx
movl %r14d, %r8d
xorl %r9d, %r9d
pushq $0x0
pushq $0x0
pushq $0x0
callq 0x1120
addq $0x18, %rsp
movq %rbx, %rdi
movl %r14d, %esi
movl %r14d, %edx
movl %r14d, %ecx
movl %r14d, %r8d
movl %r14d, %r9d
pushq %r14
pushq %r14
pushq %r14
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