// File: /workspace/github_c_makefile_star2_O3/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 0x5dae(%rip), %rcx      # 0x111da
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 0x5d86(%rip), %rcx      # 0x111eb
movq %rbx, %rdi
movl $0x3, %esi
movl $0x1, %edx
xorl %eax, %eax
callq 0x1070
decl %r14d
cmpl $0x8, %r14d
ja 0xb54a
leaq 0x563b(%rip), %rax      # 0x10ac8
movslq (%rax,%r14,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x5d6b(%rip), %rcx      # 0x11208
jmp 0xb551
leaq 0x5da3(%rip), %rcx      # 0x1124c
jmp 0xb551
movq %rbx, %rdi
movl $0x2f00, %esi           # imm = 0x2F00
xorl %edx, %edx
callq 0x11c0
leaq 0x5d67(%rip), %rcx      # 0x1122b
movq %rbx, %rdi
movl $0x3, %esi
movl $0x1e, %edx
xorl %eax, %eax
callq 0x1070
movq %rbx, %rdi
movl $0x2f00, %esi           # imm = 0x2F00
jmp 0xb52f
leaq 0x5d50(%rip), %rcx      # 0x11239
jmp 0xb551
leaq 0x5d74(%rip), %rcx      # 0x11266
jmp 0xb551
leaq 0x5d1e(%rip), %rcx      # 0x11219
jmp 0xb551
movq %rbx, %rdi
movl $0xc500, %esi           # imm = 0xC500
xorl %edx, %edx
callq 0x11c0
leaq 0x5d46(%rip), %rcx      # 0x11259
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 0xb565
leaq 0x5d1f(%rip), %rcx      # 0x1125e
jmp 0xb551
leaq 0x5d27(%rip), %rcx      # 0x1126f
jmp 0xb551
leaq 0x5d29(%rip), %rcx      # 0x1127a
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 0x5d07(%rip), %rcx      # 0x11285
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