// File: /workspace/github_c_makefile_star2_O0/S01den[P]Lost_CavernRL/menu.c
// Function: questsMenu
void questsMenu(Quest actQuest[], int nbrQuestAct, Weapons listWeapons[], Armor listArmor[], int nbrTurretKilled, int nbrInfectedKilled, int nbrDroidKilled)
{
	int i = 0;
	int j = 0;
	char *typeRewards[] = {"VAX","LIFE POINTS","COMPONENTS","EXOTIC BLOOD"};

	WINDOW *win;
	win = newwin(20,75,LONGUEUR/2-2,LARGEUR/4-5);
	box(win,0,0);
	for(i = 1; i < 75/2-5; i++)
		mvwprintw(win,1,i,"-");
	for(i = 75/2+4; i < 74; i++)
		mvwprintw(win,1,i,"-");

	wattron(win, A_BOLD);
	mvwprintw(win,1,75/2-4,"QUESTS:");
	wattroff(win, A_BOLD);
	keypad(win, TRUE);

	for(i = 0; i < nbrQuestAct+1; i++)
	{
		for(j = 1; j < 74; j++)
			mvwprintw(win,i*3+6,j,"-");
		if(actQuest[i].isSet == 1)
		{
			if(actQuest[i].typeReward <= 3)
			{
				mvwprintw(win,i*3+2,1,"%s:\n%s\n  Reward: %d (%s)",actQuest[i].name,actQuest[i].description,actQuest[i].reward,typeRewards[actQuest[i].typeReward]);
			}
			else if(actQuest[i].typeReward == 4)
			{
				mvwprintw(win,i*3+2,1,"%s:\n%s\n Reward: %s",actQuest[i].name,actQuest[i].description,listWeapons[actQuest[i].reward].name);
			}
			else if(actQuest[i].typeReward == 5)
			{
				mvwprintw(win,i*3+2,1,"%s:\n%s\n Reward: %s",actQuest[i].name,actQuest[i].description,listArmor[actQuest[i].reward].name);
			}
			else if(actQuest[i].typeReward == 6)
			{
				mvwprintw(win,i*3+2,1,"%s:\n%s\n Reward: a drug",actQuest[i].name,actQuest[i].description);
			}
			if(actQuest[i].indice == 4)
			{
				wattron(win,A_BOLD);
				mvwprintw(win,i*3+5,1,"(%d/5 Killed)",nbrTurretKilled);
				wattroff(win,A_BOLD);
			}
			else if(actQuest[i].indice == 6)
			{
				wattron(win,A_BOLD);
				mvwprintw(win,i*3+5,1,"(%d/5 Killed)",nbrInfectedKilled);
				wattroff(win,A_BOLD);
			}
			else if(actQuest[i].indice == 8)
			{
				wattron(win,A_BOLD);
				mvwprintw(win,i*3+5,1,"(%d/10 Killed)",nbrDroidKilled);
				wattroff(win,A_BOLD);
			}
		}
		for(j = 1; j < 74; j++)
			mvwprintw(win,i*3+6,j,"-");

	}

	wrefresh(win);

	wgetch(win);

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movl 0x10(%rbp), %eax
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movl %r9d, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movl $0x0, -0x30(%rbp)
movq 0xd0b9(%rip), %rax      # 0x1cc60
movq %rax, -0x50(%rbp)
movq 0xd0b6(%rip), %rax      # 0x1cc68
movq %rax, -0x48(%rbp)
movq 0xd0b3(%rip), %rax      # 0x1cc70
movq %rax, -0x40(%rbp)
movq 0xd0b0(%rip), %rax      # 0x1cc78
movq %rax, -0x38(%rbp)
movl $0x14, %edi
movl $0x4b, %esi
movl $0x11, %edx
movl $0x1b, %ecx
callq 0x2130
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdi
xorl %r9d, %r9d
movl %r9d, %esi
movl %r9d, %edx
movl %r9d, %ecx
movl %r9d, %r8d
movl $0x0, (%rsp)
movl $0x0, 0x8(%rsp)
movl $0x0, 0x10(%rsp)
callq 0x2120
movl $0x1, -0x2c(%rbp)
cmpl $0x20, -0x2c(%rbp)
jge 0xfc4a
movq -0x58(%rbp), %rdi
movl -0x2c(%rbp), %edx
movl $0x1, %esi
leaq 0x85af(%rip), %rcx      # 0x181e7
movb $0x0, %al
callq 0x2070
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0xfc1f
movl $0x29, -0x2c(%rbp)
cmpl $0x4a, -0x2c(%rbp)
jge 0xfc7c
movq -0x58(%rbp), %rdi
movl -0x2c(%rbp), %edx
movl $0x1, %esi
leaq 0x857d(%rip), %rcx      # 0x181e7
movb $0x0, %al
callq 0x2070
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0xfc51
movq -0x58(%rbp), %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %eax, %eax
movl %eax, %edx
callq 0x21d0
movq -0x58(%rbp), %rdi
movl $0x1, %esi
movl $0x21, %edx
leaq 0x9ad5(%rip), %rcx      # 0x19778
movb $0x0, %al
callq 0x2070
movq -0x58(%rbp), %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %eax, %eax
movl %eax, %edx
callq 0x2060
movq -0x58(%rbp), %rdi
movl $0x1, %esi
callq 0x2080
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movl -0xc(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jge 0x10081
movl $0x1, -0x30(%rbp)
cmpl $0x4a, -0x30(%rbp)
jge 0xfd16
movq -0x58(%rbp), %rdi
imull $0x3, -0x2c(%rbp), %esi
addl $0x6, %esi
movl -0x30(%rbp), %edx
leaq 0x84e3(%rip), %rcx      # 0x181e7
movb $0x0, %al
callq 0x2070
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0xfce9
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
cmpl $0x1, 0x1c(%rax)
jne 0x1003d
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
cmpl $0x3, 0x10(%rax)
jg 0xfdc0
movq -0x58(%rbp), %rdi
imull $0x3, -0x2c(%rbp), %esi
addl $0x2, %esi
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %r8
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x8(%rax), %r9
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movl 0x14(%rax), %r10d
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movslq 0x10(%rax), %rax
movq -0x50(%rbp,%rax,8), %rax
movl $0x1, %edx
leaq 0x99d5(%rip), %rcx      # 0x19780
movl %r10d, (%rsp)
movq %rax, 0x8(%rsp)
movb $0x0, %al
callq 0x2070
jmp 0xff1f
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
cmpl $0x4, 0x10(%rax)
jne 0xfe42
movq -0x58(%rbp), %rdi
imull $0x3, -0x2c(%rbp), %esi
addl $0x2, %esi
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %r8
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x8(%rax), %r9
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
movslq -0x2c(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
movslq 0x14(%rcx), %rcx
shlq $0x6, %rcx
addq %rcx, %rax
movq (%rax), %rax
movl $0x1, %edx
leaq 0x9967(%rip), %rcx      # 0x19799
movq %rax, (%rsp)
movb $0x0, %al
callq 0x2070
jmp 0xff1d
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
cmpl $0x5, 0x10(%rax)
jne 0xfec1
movq -0x58(%rbp), %rdi
imull $0x3, -0x2c(%rbp), %esi
addl $0x2, %esi
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %r8
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x8(%rax), %r9
movq -0x20(%rbp), %rax
movq -0x8(%rbp), %rcx
movslq -0x2c(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rcx
movslq 0x14(%rcx), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movl $0x1, %edx
leaq 0x98e5(%rip), %rcx      # 0x19799
movq %rax, (%rsp)
movb $0x0, %al
callq 0x2070
jmp 0xff1b
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
cmpl $0x6, 0x10(%rax)
jne 0xff19
movq -0x58(%rbp), %rdi
imull $0x3, -0x2c(%rbp), %esi
addl $0x2, %esi
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %r8
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x8(%rax), %r9
movl $0x1, %edx
leaq 0x989a(%rip), %rcx      # 0x197ac
movb $0x0, %al
callq 0x2070
jmp 0xff1b
jmp 0xff1d
jmp 0xff1f
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
cmpl $0x4, 0x18(%rax)
jne 0xff7f
movq -0x58(%rbp), %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %eax, %eax
movl %eax, %edx
callq 0x21d0
movq -0x58(%rbp), %rdi
imull $0x3, -0x2c(%rbp), %esi
addl $0x5, %esi
movl -0x24(%rbp), %r8d
movl $0x1, %edx
leaq 0x9862(%rip), %rcx      # 0x197c3
movb $0x0, %al
callq 0x2070
movq -0x58(%rbp), %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %eax, %eax
movl %eax, %edx
callq 0x2060
jmp 0x1003b
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
cmpl $0x6, 0x18(%rax)
jne 0xffdc
movq -0x58(%rbp), %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %eax, %eax
movl %eax, %edx
callq 0x21d0
movq -0x58(%rbp), %rdi
imull $0x3, -0x2c(%rbp), %esi
addl $0x5, %esi
movl -0x28(%rbp), %r8d
movl $0x1, %edx
leaq 0x9802(%rip), %rcx      # 0x197c3
movb $0x0, %al
callq 0x2070
movq -0x58(%rbp), %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %eax, %eax
movl %eax, %edx
callq 0x2060
jmp 0x10039
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
cmpl $0x8, 0x18(%rax)
jne 0x10037
movq -0x58(%rbp), %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %eax, %eax
movl %eax, %edx
callq 0x21d0
movq -0x58(%rbp), %rdi
imull $0x3, -0x2c(%rbp), %esi
addl $0x5, %esi
movl 0x10(%rbp), %r8d
movl $0x1, %edx
leaq 0x97b3(%rip), %rcx      # 0x197d1
movb $0x0, %al
callq 0x2070
movq -0x58(%rbp), %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %eax, %eax
movl %eax, %edx
callq 0x2060
jmp 0x10039
jmp 0x1003b
jmp 0x1003d
movl $0x1, -0x30(%rbp)
cmpl $0x4a, -0x30(%rbp)
jge 0x10071
movq -0x58(%rbp), %rdi
imull $0x3, -0x2c(%rbp), %esi
addl $0x6, %esi
movl -0x30(%rbp), %edx
leaq 0x8188(%rip), %rcx      # 0x181e7
movb $0x0, %al
callq 0x2070
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x10044
jmp 0x10073
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0xfcd1
movq -0x58(%rbp), %rdi
callq 0x2100
movq -0x58(%rbp), %rdi
callq 0x21f0
movq -0x58(%rbp), %rdi
movl $0x20, %r8d
xorl %r9d, %r9d
movl %r8d, %esi
movl %r8d, %edx
movl %r8d, %ecx
movl $0x0, (%rsp)
movl $0x0, 0x8(%rsp)
movl $0x0, 0x10(%rsp)
callq 0x2120
movq -0x58(%rbp), %rdi
movl $0x20, %r9d
movl %r9d, %esi
movl %r9d, %edx
movl %r9d, %ecx
movl %r9d, %r8d
movl $0x20, (%rsp)
movl $0x20, 0x8(%rsp)
movl $0x20, 0x10(%rsp)
callq 0x2120
movq -0x58(%rbp), %rdi
callq 0x2030
movq -0x58(%rbp), %rdi
callq 0x2100
movq -0x58(%rbp), %rdi
callq 0x2110
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax,%rax)