// File: /workspace/github_c_makefile_star2_O2/S01den[P]Lost_CavernRL/interface.c
// Function: printScreenUser
void printScreenUser(WINDOW *win, Player player, int powerUsed, char diseaseName[20], unsigned int disease, unsigned int nbrEnnemiesKilled)
{
	const char *powers[] = {"Way of life", "Way of power", "Way of protection"};
	wborder(win, '|', '|', '-', '-', '+', '+', '+', '+');
	wattron(win,A_UNDERLINE);
	mvwprintw(win,2,(30-strlen(player.name))/2,"%s",player.name);
	wattroff(win,A_UNDERLINE);

	if(powerUsed)
	{
		wattron(win,COLOR_PAIR(197));
		mvwprintw(win,3,5,"%s",powers[player.power]);
		wattroff(win,COLOR_PAIR(197));
	}
	else
	{
		wattron(win,COLOR_PAIR(47));
		mvwprintw(win,3,5,"%s",powers[player.power]);
		wattroff(win,COLOR_PAIR(47));		
	}

	switch(player.state)
	{
		case 0:
			wattron(win,COLOR_PAIR(197));
			mvwprintw(win,4,5,"          ");
			wattroff(win,COLOR_PAIR(197));		
			break;
		case 1:
			wattron(win,COLOR_PAIR(197));
			mvwprintw(win,4,5,"(ON FIRE)");
			wattroff(win,COLOR_PAIR(197));		
			break;
		case 2:
			wattron(win,COLOR_PAIR(197));
			mvwprintw(win,4,5,"(PARALYSED)");
			wattroff(win,COLOR_PAIR(197));		
			break;
		case 3:
			wattron(win,COLOR_PAIR(197));
			mvwprintw(win,4,5,"(STONE)");
			wattroff(win,COLOR_PAIR(197));		
			break;
		case 4:
			wattron(win,COLOR_PAIR(47));
			mvwprintw(win,4,5,"(BOOSTED)");
			wattroff(win,COLOR_PAIR(47));		
			break;
	}

	printBar(win,"LIFE",player.life,6,2,249);
	printBar(win,diseaseName,disease,7,2,248);

	if(disease <= 20)
	{
		mvwprintw(win,8,9,"(STADE 1)");
	}
	if(disease > 20 && disease <= 50)
	{
		mvwprintw(win,8,9,"(STADE 2)");
	}
	if(disease > 50 && disease <= 75)
	{
		mvwprintw(win,8,9,"(STADE 3)");
	}
	if(disease > 75 && disease <= 100)
	{
		mvwprintw(win,8,9,"(STADE 4)");
	}

	mvwprintw(win,10,2,"strength  Hate   Agility");
	mvwprintw(win,11,2," %d         %d      %d  ",player.strength,player.hate,player.agility);
	mvwprintw(win,13,2,"Souls taken: %d",nbrEnnemiesKilled);

	wrefresh(win);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, 0x4(%rsp)
movl %ecx, %r15d
movq %rdx, %r12
movl %esi, %r13d
movq %rdi, %rbx
leaq 0x40(%rsp), %r14
subq $0x8, %rsp
pushq $0x2b
popq %r9
pushq $0x7c
popq %rdx
pushq $0x2d
popq %rcx
movl %edx, %esi
movl %ecx, %r8d
pushq %r9
pushq %r9
pushq %r9
callq 0x1120
addq $0x20, %rsp
movq %rbx, %rdi
movl $0x20000, %esi          # imm = 0x20000
xorl %edx, %edx
callq 0x11c0
movq %r14, %rdi
callq 0x10f0
pushq $0x1e
popq %rdx
subq %rax, %rdx
shrq %rdx
leaq 0x7e5f(%rip), %rbp      # 0xe319
pushq $0x2
popq %rsi
movq %rbx, %rdi
movq %rbp, %rcx
movq %r14, %r8
xorl %eax, %eax
callq 0x1070
movq %rbx, %rdi
movl $0x20000, %esi          # imm = 0x20000
xorl %edx, %edx
callq 0x1060
testl %r13d, %r13d
movl $0x2f00, %eax           # imm = 0x2F00
movl $0xc500, %r13d          # imm = 0xC500
cmovel %eax, %r13d
movq %rbx, %rdi
movl %r13d, %esi
xorl %edx, %edx
callq 0x11c0
movslq 0x1c(%r14), %rax
leaq 0x7be6(%rip), %rcx      # 0xe0ec
movslq (%rcx,%rax,4), %r8
addq %rcx, %r8
pushq $0x3
popq %rsi
pushq $0x5
popq %rdx
movq %rbx, %rdi
movq %rbp, %rcx
xorl %eax, %eax
callq 0x1070
movq %rbx, %rdi
movl %r13d, %esi
xorl %edx, %edx
callq 0x1060
movl 0x30(%r14), %eax
cmpq $0x4, %rax
ja 0x657a
leaq 0x7bea(%rip), %rcx      # 0xe128
movl (%rcx,%rax,4), %ebp
leaq 0x7bf4(%rip), %rcx      # 0xe13c
movslq (%rcx,%rax,4), %r13
addq %rcx, %r13
movq %rbx, %rdi
movl %ebp, %esi
xorl %edx, %edx
callq 0x11c0
pushq $0x4
popq %rsi
pushq $0x5
popq %rdx
movq %rbx, %rdi
movq %r13, %rcx
xorl %eax, %eax
callq 0x1070
movq %rbx, %rdi
movl %ebp, %esi
xorl %edx, %edx
callq 0x1060
movl 0x10(%r14), %edx
leaq 0x7c1e(%rip), %rsi      # 0xe1a3
pushq $0x6
popq %rcx
pushq $0x2
popq %rbp
movq %rbx, %rdi
movl %ebp, %r8d
movl $0xf9, %r9d
callq 0x667f
pushq $0x7
popq %rcx
movq %rbx, %rdi
movq %r12, %rsi
movl %r15d, %edx
movl %ebp, %r8d
movl $0xf8, %r9d
callq 0x667f
cmpl $0x15, %r15d
jae 0x65c5
leaq 0x7be5(%rip), %rcx      # 0xe1a8
jmp 0x65fa
leal -0x15(%r15), %eax
cmpl $0x1e, %eax
jae 0x65d7
leaq 0x7bdd(%rip), %rcx      # 0xe1b2
jmp 0x65fa
leal -0x33(%r15), %eax
cmpl $0x19, %eax
jae 0x65e9
leaq 0x7bd5(%rip), %rcx      # 0xe1bc
jmp 0x65fa
addl $-0x4c, %r15d
cmpl $0x18, %r15d
ja 0x660a
leaq 0x7bcc(%rip), %rcx      # 0xe1c6
pushq $0x8
popq %rsi
pushq $0x9
popq %rdx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1070
leaq 0x7bbf(%rip), %rcx      # 0xe1d0
pushq $0xa
popq %rsi
pushq $0x2
popq %rbp
movq %rbx, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0x1070
movl 0x28(%r14), %r9d
movl 0x20(%r14), %r8d
movl 0x24(%r14), %r10d
subq $0x8, %rsp
leaq 0x7baf(%rip), %rcx      # 0xe1e9
pushq $0xb
popq %rsi
movq %rbx, %rdi
movl %ebp, %edx
xorl %eax, %eax
pushq %r10
callq 0x1070
popq %rcx
popq %rdx
leaq 0x7bae(%rip), %rcx      # 0xe202
pushq $0xd
popq %rsi
movq %rbx, %rdi
movl %ebp, %edx
movl 0x4(%rsp), %r8d
xorl %eax, %eax
callq 0x1070
movq %rbx, %rdi
callq 0x1100
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq