// File: /workspace/github_c_makefile_star2_O1/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 0x90f7(%rip), %rbp      # 0x102fd
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 0x8e7c(%rip), %rcx      # 0x100d0
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 0x72d0
leaq 0x8e7c(%rip), %rcx      # 0x1010c
movl (%rcx,%rax,4), %ebp
leaq 0x8e86(%rip), %rcx      # 0x10120
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 0x8eac(%rip), %rsi      # 0x10187
movq %rbx, %rdi
movl $0x6, %ecx
movl $0x2, %r8d
movl $0xf9, %r9d
callq 0x7424
movq %rbx, %rdi
movq %r12, %rsi
movl %r15d, %edx
movl $0x7, %ecx
movl $0x2, %r8d
movl $0xf8, %r9d
callq 0x7424
cmpl $0x14, %r15d
ja 0x7334
leaq 0x8e6c(%rip), %rcx      # 0x1018c
movq %rbx, %rdi
movl $0x8, %esi
movl $0x9, %edx
xorl %eax, %eax
callq 0x1070
leal -0x15(%r15), %eax
cmpl $0x1d, %eax
ja 0x7358
leaq 0x8e52(%rip), %rcx      # 0x10196
movq %rbx, %rdi
movl $0x8, %esi
movl $0x9, %edx
xorl %eax, %eax
callq 0x1070
leal -0x33(%r15), %eax
cmpl $0x18, %eax
ja 0x737c
leaq 0x8e38(%rip), %rcx      # 0x101a0
movq %rbx, %rdi
movl $0x8, %esi
movl $0x9, %edx
xorl %eax, %eax
callq 0x1070
addl $-0x4c, %r15d
cmpl $0x18, %r15d
ja 0x73a1
leaq 0x8e1d(%rip), %rcx      # 0x101aa
movq %rbx, %rdi
movl $0x8, %esi
movl $0x9, %edx
xorl %eax, %eax
callq 0x1070
leaq 0x8e0c(%rip), %rcx      # 0x101b4
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 0x8dfa(%rip), %rcx      # 0x101cd
movq %rbx, %rdi
movl $0xb, %esi
movl $0x2, %edx
xorl %eax, %eax
pushq %r10
callq 0x1070
addq $0x10, %rsp
leaq 0x8df2(%rip), %rcx      # 0x101e6
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