// File: /workspace/github_c_makefile_star2_O2/S01den[P]Lost_CavernRL/interface.c
// Function: printInventory
void printInventory(WINDOW *win, int component, int exoticBlood, int gem, Player player, Inventory inventory[], Drug drugList[], Weapons listWeapons[], Armor listArmors[])
{
	char *typeOfDrugs[] = {"VACCIN","STEROID","ANTIDOTE","STIMULANT","HALLUCINOGEN","MEDIPAC","NEUROPARALYSANT"};
	int i = 0;

	wborder(win, '|', '|', '-', '-', '+', '+', '+', '+');
	wattron(win,A_UNDERLINE);
	mvwprintw(win,1,1,"Inventory");
	wattroff(win,A_UNDERLINE);
	mvwprintw(win,2,1,"Electronic components: %d",component);
	mvwprintw(win,3,1,"Exotic blood: %d",exoticBlood);
	mvwprintw(win,4,1,"Gems: %d",gem);

	for(i = 0; i < player.inventorySize; i++)
	{
		if(inventory[i].type == -1)
		{
			mvwprintw(win,6+i,1,"                    ");
		}
		else if(inventory[i].type == 0)
		{
			Weapons weaponHold = listWeapons[inventory[i].object];
			switch(weaponHold.rarity)
			{
				case 1:
					wattron(win,COLOR_PAIR(22));
					if(weaponHold.type == 0)
						mvwprintw(win,6+i,1,"%c) /",49+i);
					else
						mvwprintw(win,6+i,1,"%c) ;",49+i);
					mvwprintw(win, 6+i,2,": %s",weaponHold.name);
					wattroff(win, COLOR_PAIR(22));
					break;
				case 2:
					wattron(win,COLOR_PAIR(166));
					if(weaponHold.type == 0)
						mvwprintw(win,6+i,1,"%c) /",49+i);
					else
						mvwprintw(win,6+i,1,"%c) ;",49+i);
					mvwprintw(win, 6+i,2,": %s",weaponHold.name);
					wattroff(win, COLOR_PAIR(166));
					break;
				case 3:
					wattron(win,COLOR_PAIR(12));
					if(weaponHold.type == 0)
						mvwprintw(win,6+i,1,"%c) /",49+i);
					else
						mvwprintw(win,6+i,1,"%c) ;",49+i);
					mvwprintw(win, 6+i,2,": %s",weaponHold.name);
					wattroff(win, COLOR_PAIR(12));
					break;
			}
		}
		else if(inventory[i].type == 1)
		{
			Armor armorHold = listArmors[inventory[i].object];
			switch(armorHold.rarity)
			{
				case 1:
					wattron(win,COLOR_PAIR(22));
					mvwprintw(win,6+i,1,"%c) ] : %s", 49+i, armorHold.name);
					wattroff(win, COLOR_PAIR(22));
					break;
				case 2:
					wattron(win,COLOR_PAIR(166));
					mvwprintw(win,6+i,1,"%c) ] : %s", 49+i, armorHold.name);
					wattroff(win, COLOR_PAIR(166));
					break;
				case 3:
					wattron(win,COLOR_PAIR(12));
					mvwprintw(win,6+i,1,"%c) ] : %s", 49+i, armorHold.name);
					wattroff(win, COLOR_PAIR(12));
					break;
			}
		}
		else if(inventory[i].type == 2)
		{
			int colorDrug = drugList[inventory[i].object].color;
			int discovered = drugList[inventory[i].object].discovered;
			int typeDrugUsed = drugList[inventory[i].object].type;

			wattron(win,COLOR_PAIR(colorDrug));
			if(discovered == 0)
			{
				mvwprintw(win, 6+i,1,"%c) ! : UNKNOWN DRUG", 49+i);
			}
			else
			{
				mvwprintw(win,6+i,1,"%c) ! : %s", 49+i, typeOfDrugs[typeDrugUsed]);
			}
			wattroff(win,COLOR_PAIR(colorDrug));
		}
		else if(inventory[i].type == 3)
		{
			switch(inventory[i].object)
			{
				case 1:
					wattron(win,COLOR_PAIR(47));
					mvwprintw(win,6+i,1,"%c) * : NUCLEAR CHARGE",49+i);
					wattroff(win,COLOR_PAIR(47));
					break;
				case 2:
					wattron(win,COLOR_PAIR(124));
					mvwprintw(win,6+i,1,"%c) ~ : SHIELD",49+i);
					wattroff(win,COLOR_PAIR(124));
					break;
				case 3:
					wattron(win,COLOR_PAIR(22));
					mvwprintw(win,6+i,1,"%c) = : ELECTRIC TRAP",49+i);
					wattroff(win,COLOR_PAIR(22));
					break;
				case 4:
					wattron(win,COLOR_PAIR(23));
					mvwprintw(win,6+i,1,"%c) = : PARALYSING TRAP",49+i);
					wattroff(win,COLOR_PAIR(23));
					break;
				case 5:
					wattron(win,COLOR_PAIR(COLOR_LAVA));
					mvwprintw(win,6+i,1,"%c) * : LAVA BUCKET",49+i);
					wattroff(win,COLOR_PAIR(COLOR_LAVA));
					break;
				case 6:
					wattron(win,COLOR_PAIR(12));
					mvwprintw(win,6+i,1,"THE CLONE CAPSULE");
					wattroff(win,COLOR_PAIR(12));	
					break;
				default:
					break;
			}
		}
		else
		{
			break;
		}
	}

	wrefresh(win);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, 0x18(%rsp)
movq %r8, %r14
movl %ecx, %ebp
movl %edx, %r13d
movl %esi, %r12d
movq %rdi, %r15
movq 0xa8(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0xa0(%rsp), %rax
movq %rax, 0x8(%rsp)
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 %r15, %rdi
movl $0x20000, %esi          # imm = 0x20000
xorl %edx, %edx
callq 0x11c0
leaq 0x7848(%rip), %rcx      # 0xe2a7
pushq $0x1
popq %rbx
movq %r15, %rdi
movl %ebx, %esi
movl %ebx, %edx
xorl %eax, %eax
callq 0x1070
movq %r15, %rdi
movl $0x20000, %esi          # imm = 0x20000
xorl %edx, %edx
callq 0x1060
leaq 0x782b(%rip), %rcx      # 0xe2b1
pushq $0x2
popq %rsi
movq %r15, %rdi
movl %ebx, %edx
movl %r12d, %r8d
xorl %eax, %eax
callq 0x1070
leaq 0x782c(%rip), %rcx      # 0xe2cb
pushq $0x3
popq %rsi
movq %r15, %rdi
movl %ebx, %edx
movl %r13d, %r8d
xorl %eax, %eax
callq 0x1070
leaq 0x7824(%rip), %rcx      # 0xe2dc
pushq $0x4
popq %rsi
movq %r15, %rdi
movl %ebx, %edx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x1070
movslq 0x9c(%rsp), %rax
movq %rax, 0x20(%rsp)
xorl %ebp, %ebp
movq %r14, (%rsp)
cmpq 0x20(%rsp), %rbp
jge 0x6f2f
movl (%r14,%rbp,8), %eax
incl %eax
cmpl $0x4, %eax
ja 0x6f2f
leaq 0x75c2(%rip), %rcx      # 0xe0c0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leal 0x6(%rbp), %esi
movq %r15, %rdi
movl %ebx, %edx
leaq 0x66d5(%rip), %rcx      # 0xd1eb
xorl %eax, %eax
callq 0x1070
jmp 0x6f27
movl 0x4(%r14,%rbp,8), %eax
decl %eax
cmpl $0x5, %eax
ja 0x6f27
leaq 0x759b(%rip), %rcx      # 0xe0d4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %r15, %rdi
movl $0x2f00, %esi           # imm = 0x2F00
xorl %edx, %edx
callq 0x11c0
leal 0x6(%rbp), %esi
leal 0x31(%rbp), %r8d
movq %r15, %rdi
movl %ebx, %edx
leaq 0x77b8(%rip), %rcx      # 0xe31c
xorl %eax, %eax
callq 0x1070
movq %r15, %rdi
movl $0x2f00, %esi           # imm = 0x2F00
jmp 0x6f20
movslq 0x4(%r14,%rbp,8), %rax
imulq $0x30, %rax, %rax
movq 0x10(%rsp), %rcx
movq (%rcx,%rax), %r12
movl 0x24(%rcx,%rax), %eax
cmpl $0x3, %eax
je 0x6d38
cmpl $0x2, %eax
je 0x6d07
cmpl $0x1, %eax
jne 0x6f27
movq %r15, %rdi
movl $0x1600, %esi           # imm = 0x1600
xorl %edx, %edx
callq 0x11c0
leal 0x6(%rbp), %esi
leal 0x31(%rbp), %r8d
movq %r15, %rdi
movl %ebx, %edx
leaq 0x7726(%rip), %rcx      # 0xe2f1
movq %r12, %r9
xorl %eax, %eax
callq 0x1070
jmp 0x6e80
movq %r14, %rax
movl %ebx, %r14d
movslq 0x4(%rax,%rbp,8), %rax
imulq $0x1c, %rax, %rax
movq 0x18(%rsp), %rdx
movl 0x8(%rdx,%rax), %ecx
movslq (%rdx,%rax), %r13
shll $0x8, %ecx
movzwl %cx, %r12d
movl 0x10(%rdx,%rax), %ebx
movq %r15, %rdi
movl %r12d, %esi
xorl %edx, %edx
callq 0x11c0
leaq 0x6(%rbp), %rsi
testl %ebx, %ebx
je 0x6cd6
leaq 0x74eb(%rip), %rax      # 0xe10c
movslq (%rax,%r13,4), %r9
addq %rax, %r9
leal 0x31(%rbp), %r8d
movq %r15, %rdi
movl %r14d, %ebx
movl %r14d, %edx
leaq 0x76d5(%rip), %rcx      # 0xe311
xorl %eax, %eax
callq 0x1070
jmp 0x6cf1
movslq 0x4(%r14,%rbp,8), %rax
shlq $0x6, %rax
movq 0x8(%rsp), %rcx
movq (%rcx,%rax), %r12
movl 0x24(%rcx,%rax), %r13d
movl 0x30(%rcx,%rax), %eax
cmpl $0x3, %eax
je 0x6dc9
cmpl $0x2, %eax
je 0x6d69
cmpl $0x1, %eax
jne 0x6f27
movq %r15, %rdi
movl $0x1600, %esi           # imm = 0x1600
xorl %edx, %edx
callq 0x11c0
leaq 0x7651(%rip), %rcx      # 0xe2e5
testl %r13d, %r13d
je 0x6ca0
leaq 0x764b(%rip), %rcx      # 0xe2eb
leal 0x6(%rbp), %r13d
leal 0x31(%rbp), %r8d
movq %r15, %rdi
movl %r13d, %esi
movl %ebx, %edx
xorl %eax, %eax
callq 0x1070
movq %r15, %rdi
movl %r13d, %esi
pushq $0x2
popq %rdx
leaq 0x7650(%rip), %rcx      # 0xe317
movq %r12, %r8
xorl %eax, %eax
callq 0x1070
jmp 0x6e80
leal 0x31(%rbp), %r8d
movq %r15, %rdi
movl %r14d, %ebx
movl %r14d, %edx
leaq 0x7612(%rip), %rcx      # 0xe2fc
xorl %eax, %eax
callq 0x1070
movq %r15, %rdi
movl %r12d, %esi
xorl %edx, %edx
callq 0x1060
movq (%rsp), %r14
jmp 0x6f27
movq %r15, %rdi
movl $0xa600, %esi           # imm = 0xA600
xorl %edx, %edx
callq 0x11c0
leal 0x6(%rbp), %esi
leal 0x31(%rbp), %r8d
movq %r15, %rdi
movl %ebx, %edx
leaq 0x75c8(%rip), %rcx      # 0xe2f1
movq %r12, %r9
xorl %eax, %eax
callq 0x1070
jmp 0x6dbc
movq %r15, %rdi
movl $0xc00, %esi            # imm = 0xC00
xorl %edx, %edx
callq 0x11c0
leal 0x6(%rbp), %esi
leal 0x31(%rbp), %r8d
movq %r15, %rdi
movl %ebx, %edx
leaq 0x7597(%rip), %rcx      # 0xe2f1
movq %r12, %r9
xorl %eax, %eax
callq 0x1070
jmp 0x6f18
movq %r15, %rdi
movl $0xa600, %esi           # imm = 0xA600
xorl %edx, %edx
callq 0x11c0
leaq 0x7566(%rip), %rcx      # 0xe2e5
testl %r13d, %r13d
je 0x6d8b
leaq 0x7560(%rip), %rcx      # 0xe2eb
leal 0x6(%rbp), %r13d
leal 0x31(%rbp), %r8d
movq %r15, %rdi
movl %r13d, %esi
movl %ebx, %edx
xorl %eax, %eax
callq 0x1070
movq %r15, %rdi
movl %r13d, %esi
pushq $0x2
popq %rdx
leaq 0x7565(%rip), %rcx      # 0xe317
movq %r12, %r8
xorl %eax, %eax
callq 0x1070
movq %r15, %rdi
movl $0xa600, %esi           # imm = 0xA600
jmp 0x6f20
movq %r15, %rdi
movl $0xc00, %esi            # imm = 0xC00
xorl %edx, %edx
callq 0x11c0
leaq 0x7506(%rip), %rcx      # 0xe2e5
testl %r13d, %r13d
je 0x6deb
leaq 0x7500(%rip), %rcx      # 0xe2eb
leal 0x6(%rbp), %r13d
leal 0x31(%rbp), %r8d
movq %r15, %rdi
movl %r13d, %esi
movl %ebx, %edx
xorl %eax, %eax
callq 0x1070
movq %r15, %rdi
movl %r13d, %esi
pushq $0x2
popq %rdx
leaq 0x7505(%rip), %rcx      # 0xe317
movq %r12, %r8
xorl %eax, %eax
callq 0x1070
jmp 0x6f18
movq %r15, %rdi
movl $0xf500, %esi           # imm = 0xF500
xorl %edx, %edx
callq 0x11c0
leal 0x6(%rbp), %esi
leal 0x31(%rbp), %r8d
movq %r15, %rdi
movl %ebx, %edx
leaq 0x752d(%rip), %rcx      # 0xe370
xorl %eax, %eax
callq 0x1070
movq %r15, %rdi
movl $0xf500, %esi           # imm = 0xF500
jmp 0x6f20
movq %r15, %rdi
movl $0x1600, %esi           # imm = 0x1600
xorl %edx, %edx
callq 0x11c0
leal 0x6(%rbp), %esi
leal 0x31(%rbp), %r8d
movq %r15, %rdi
movl %ebx, %edx
leaq 0x74c9(%rip), %rcx      # 0xe342
xorl %eax, %eax
callq 0x1070
movq %r15, %rdi
movl $0x1600, %esi           # imm = 0x1600
jmp 0x6f20
movq %r15, %rdi
movl $0x1700, %esi           # imm = 0x1700
xorl %edx, %edx
callq 0x11c0
leal 0x6(%rbp), %esi
leal 0x31(%rbp), %r8d
movq %r15, %rdi
movl %ebx, %edx
leaq 0x74a9(%rip), %rcx      # 0xe358
xorl %eax, %eax
callq 0x1070
movq %r15, %rdi
movl $0x1700, %esi           # imm = 0x1700
jmp 0x6f20
movq %r15, %rdi
movl $0x7c00, %esi           # imm = 0x7C00
xorl %edx, %edx
callq 0x11c0
leal 0x6(%rbp), %esi
leal 0x31(%rbp), %r8d
movq %r15, %rdi
movl %ebx, %edx
leaq 0x7451(%rip), %rcx      # 0xe333
xorl %eax, %eax
callq 0x1070
movq %r15, %rdi
movl $0x7c00, %esi           # imm = 0x7C00
jmp 0x6f20
movq %r15, %rdi
movl $0xc00, %esi            # imm = 0xC00
xorl %edx, %edx
callq 0x11c0
leal 0x6(%rbp), %esi
movq %r15, %rdi
movl %ebx, %edx
leaq 0x7473(%rip), %rcx      # 0xe384
xorl %eax, %eax
callq 0x1070
movq %r15, %rdi
movl $0xc00, %esi            # imm = 0xC00
xorl %edx, %edx
callq 0x1060
incq %rbp
jmp 0x6add
movq %r15, %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1100