// File: /workspace/github_c_makefile_star2_O3/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
movl $0x2b, %eax
movl $0x7c, %esi
movl $0x7c, %edx
movl $0x2d, %ecx
movl $0x2d, %r8d
movl $0x2b, %r9d
pushq %rax
pushq %rax
pushq %rax
callq 0x1120
addq $0x20, %rsp
movq %rbx, %rdi
movl $0x20000, %esi          # imm = 0x20000
xorl %edx, %edx
callq 0x11c0
movq %r14, %rdi
callq 0x10f0
movl $0x1e, %edx
subq %rax, %rdx
shrq %rdx
leaq 0x8f93(%rip), %rbp      # 0x10359
movq %rbx, %rdi
movl $0x2, %esi
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 0x8d18(%rip), %rcx      # 0x1012c
movslq (%rcx,%rax,4), %r8
addq %rcx, %r8
movq %rbx, %rdi
movl $0x3, %esi
movl $0x5, %edx
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 0x7490
leaq 0x8d18(%rip), %rcx      # 0x10168
movl (%rcx,%rax,4), %ebp
leaq 0x8d22(%rip), %rcx      # 0x1017c
movslq (%rcx,%rax,4), %r13
addq %rcx, %r13
movq %rbx, %rdi
movl %ebp, %esi
xorl %edx, %edx
callq 0x11c0
movq %rbx, %rdi
movl $0x4, %esi
movl $0x5, %edx
movq %r13, %rcx
xorl %eax, %eax
callq 0x1070
movq %rbx, %rdi
movl %ebp, %esi
xorl %edx, %edx
callq 0x1060
movl 0x10(%r14), %edx
leaq 0x8d48(%rip), %rsi      # 0x101e3
movq %rbx, %rdi
movl $0x6, %ecx
movl $0x2, %r8d
movl $0xf9, %r9d
callq 0x75ae
movq %rbx, %rdi
movq %r12, %rsi
movl %r15d, %edx
movl $0x7, %ecx
movl $0x2, %r8d
movl $0xf8, %r9d
callq 0x75ae
cmpl $0x15, %r15d
jae 0x74e2
leaq 0x8d08(%rip), %rcx      # 0x101e8
jmp 0x7517
leal -0x15(%r15), %eax
cmpl $0x1e, %eax
jae 0x74f4
leaq 0x8d00(%rip), %rcx      # 0x101f2
jmp 0x7517
leal -0x33(%r15), %eax
cmpl $0x19, %eax
jae 0x7506
leaq 0x8cf8(%rip), %rcx      # 0x101fc
jmp 0x7517
addl $-0x4c, %r15d
cmpl $0x18, %r15d
ja 0x752b
leaq 0x8cef(%rip), %rcx      # 0x10206
movq %rbx, %rdi
movl $0x8, %esi
movl $0x9, %edx
xorl %eax, %eax
callq 0x1070
leaq 0x8cde(%rip), %rcx      # 0x10210
movq %rbx, %rdi
movl $0xa, %esi
movl $0x2, %edx
xorl %eax, %eax
callq 0x1070
movl 0x28(%r14), %r9d
movl 0x20(%r14), %r8d
movl 0x24(%r14), %r10d
subq $0x8, %rsp
leaq 0x8ccc(%rip), %rcx      # 0x10229
movq %rbx, %rdi
movl $0xb, %esi
movl $0x2, %edx
xorl %eax, %eax
pushq %r10
callq 0x1070
addq $0x10, %rsp
leaq 0x8cc4(%rip), %rcx      # 0x10242
movq %rbx, %rdi
movl $0xd, %esi
movl $0x2, %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