// File: /workspace/github_c_makefile_star2_O1/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, 0x20(%rsp)
movq %r8, %r14
movl %ecx, %ebp
movl %edx, %r12d
movl %esi, %r13d
movq %rdi, %r15
movq 0xa8(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0xa0(%rsp), %rax
movq %rax, 0x10(%rsp)
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 %r15, %rdi
movl $0x20000, %esi          # imm = 0x20000
xorl %edx, %edx
callq 0x11c0
leaq 0x8a44(%rip), %rcx      # 0x1028b
movq %r15, %rdi
movl $0x1, %esi
movl $0x1, %edx
xorl %eax, %eax
callq 0x1070
movq %r15, %rdi
movl $0x20000, %esi          # imm = 0x20000
xorl %edx, %edx
callq 0x1060
leaq 0x8a24(%rip), %rcx      # 0x10295
movq %r15, %rdi
movl $0x2, %esi
movl $0x1, %edx
movl %r13d, %r8d
xorl %eax, %eax
callq 0x1070
leaq 0x8a20(%rip), %rcx      # 0x102af
movq %r15, %rdi
movl $0x3, %esi
movl $0x1, %edx
movl %r12d, %r8d
xorl %eax, %eax
callq 0x1070
leaq 0x8a13(%rip), %rcx      # 0x102c0
movq %r15, %rdi
movl $0x4, %esi
movl $0x1, %edx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x1070
movslq 0x9c(%rsp), %r12
testq %r12, %r12
jle 0x7d54
xorl %ebx, %ebx
movq %r14, 0x8(%rsp)
movl (%r14,%rbx,8), %eax
incl %eax
cmpl $0x4, %eax
ja 0x7d54
leaq 0x87b2(%rip), %rcx      # 0x100a4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leal 0x6(%rbx), %esi
movq %r15, %rdi
movl $0x1, %edx
leaq 0x78de(%rip), %rcx      # 0xf1eb
xorl %eax, %eax
callq 0x1070
jmp 0x7d48
movl 0x4(%r14,%rbx,8), %eax
decl %eax
cmpl $0x5, %eax
ja 0x7d48
leaq 0x8788(%rip), %rcx      # 0x100b8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %r15, %rdi
movl $0x2f00, %esi           # imm = 0x2F00
xorl %edx, %edx
callq 0x11c0
leal 0x31(%rbx), %r8d
leal 0x6(%rbx), %esi
movq %r15, %rdi
movl $0x1, %edx
leaq 0x89a2(%rip), %rcx      # 0x10300
xorl %eax, %eax
callq 0x1070
movq %r15, %rdi
movl $0x2f00, %esi           # imm = 0x2F00
jmp 0x7d41
movslq 0x4(%r14,%rbx,8), %rax
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
movq 0x18(%rsp), %rcx
movq (%rcx,%rax), %r13
movl 0x24(%rcx,%rax), %eax
cmpl $0x3, %eax
je 0x7b45
cmpl $0x2, %eax
je 0x7b11
cmpl $0x1, %eax
jne 0x7d48
movq %r15, %rdi
movl $0x1600, %esi           # imm = 0x1600
xorl %edx, %edx
callq 0x11c0
leal 0x31(%rbx), %r8d
leal 0x6(%rbx), %esi
movq %r15, %rdi
movl $0x1, %edx
leaq 0x8909(%rip), %rcx      # 0x102d5
movq %r13, %r9
xorl %eax, %eax
callq 0x1070
jmp 0x7c98
movq %r14, %rax
movq %r12, %r14
movslq 0x4(%rax,%rbx,8), %rax
leaq (%rax,%rax,8), %rcx
leaq (%rcx,%rcx,2), %rcx
addq %rax, %rcx
movq 0x20(%rsp), %rdx
movl 0x8(%rdx,%rcx), %eax
movslq (%rdx,%rcx), %rbp
shll $0x8, %eax
movzwl %ax, %r13d
movl 0x10(%rdx,%rcx), %r12d
movq %r15, %rdi
movl %r13d, %esi
xorl %edx, %edx
callq 0x11c0
leaq 0x31(%rbx), %r8
testl %r12d, %r12d
je 0x7ade
leaq 0x86c5(%rip), %rax      # 0x100f0
movslq (%rax,%rbp,4), %r9
addq %rax, %r9
leal 0x6(%rbx), %esi
movq %r15, %rdi
movl $0x1, %edx
leaq 0x88b1(%rip), %rcx      # 0x102f5
xorl %eax, %eax
callq 0x1070
jmp 0x7af7
movslq 0x4(%r14,%rbx,8), %rax
shlq $0x6, %rax
movq 0x10(%rsp), %rcx
movq (%rcx,%rax), %r13
movl 0x24(%rcx,%rax), %ebp
movl 0x30(%rcx,%rax), %eax
cmpl $0x3, %eax
je 0x7bda
cmpl $0x2, %eax
je 0x7b79
cmpl $0x1, %eax
jne 0x7d48
movq %r15, %rdi
movl $0x1600, %esi           # imm = 0x1600
xorl %edx, %edx
callq 0x11c0
leaq 0x882e(%rip), %rcx      # 0x102c9
testl %ebp, %ebp
je 0x7aa6
leaq 0x8829(%rip), %rcx      # 0x102cf
leal 0x31(%rbx), %r8d
leal 0x6(%rbx), %ebp
movq %r15, %rdi
movl %ebp, %esi
movl $0x1, %edx
xorl %eax, %eax
callq 0x1070
movq %r15, %rdi
movl %ebp, %esi
movl $0x2, %edx
leaq 0x882c(%rip), %rcx      # 0x102fb
movq %r13, %r8
xorl %eax, %eax
callq 0x1070
jmp 0x7c98
leal 0x6(%rbx), %esi
movq %r15, %rdi
movl $0x1, %edx
leaq 0x87f0(%rip), %rcx      # 0x102e0
xorl %eax, %eax
callq 0x1070
movq %r14, %r12
movq %r15, %rdi
movl %r13d, %esi
xorl %edx, %edx
callq 0x1060
movq 0x8(%rsp), %r14
jmp 0x7d48
movq %r15, %rdi
movl $0xa600, %esi           # imm = 0xA600
xorl %edx, %edx
callq 0x11c0
leal 0x31(%rbx), %r8d
leal 0x6(%rbx), %esi
movq %r15, %rdi
movl $0x1, %edx
leaq 0x879f(%rip), %rcx      # 0x102d5
movq %r13, %r9
xorl %eax, %eax
callq 0x1070
jmp 0x7bcd
movq %r15, %rdi
movl $0xc00, %esi            # imm = 0xC00
xorl %edx, %edx
callq 0x11c0
leal 0x31(%rbx), %r8d
leal 0x6(%rbx), %esi
movq %r15, %rdi
movl $0x1, %edx
leaq 0x876b(%rip), %rcx      # 0x102d5
movq %r13, %r9
xorl %eax, %eax
callq 0x1070
jmp 0x7d39
movq %r15, %rdi
movl $0xa600, %esi           # imm = 0xA600
xorl %edx, %edx
callq 0x11c0
leaq 0x873a(%rip), %rcx      # 0x102c9
testl %ebp, %ebp
je 0x7b9a
leaq 0x8735(%rip), %rcx      # 0x102cf
leal 0x31(%rbx), %r8d
leal 0x6(%rbx), %ebp
movq %r15, %rdi
movl %ebp, %esi
movl $0x1, %edx
xorl %eax, %eax
callq 0x1070
movq %r15, %rdi
movl %ebp, %esi
movl $0x2, %edx
leaq 0x8738(%rip), %rcx      # 0x102fb
movq %r13, %r8
xorl %eax, %eax
callq 0x1070
movq %r15, %rdi
movl $0xa600, %esi           # imm = 0xA600
jmp 0x7d41
movq %r15, %rdi
movl $0xc00, %esi            # imm = 0xC00
xorl %edx, %edx
callq 0x11c0
leaq 0x86d9(%rip), %rcx      # 0x102c9
testl %ebp, %ebp
je 0x7bfb
leaq 0x86d4(%rip), %rcx      # 0x102cf
leal 0x31(%rbx), %r8d
leal 0x6(%rbx), %ebp
movq %r15, %rdi
movl %ebp, %esi
movl $0x1, %edx
xorl %eax, %eax
callq 0x1070
movq %r15, %rdi
movl %ebp, %esi
movl $0x2, %edx
leaq 0x86d7(%rip), %rcx      # 0x102fb
movq %r13, %r8
xorl %eax, %eax
callq 0x1070
jmp 0x7d39
movq %r15, %rdi
movl $0xf500, %esi           # imm = 0xF500
xorl %edx, %edx
callq 0x11c0
leal 0x31(%rbx), %r8d
leal 0x6(%rbx), %esi
movq %r15, %rdi
movl $0x1, %edx
leaq 0x86fc(%rip), %rcx      # 0x10354
xorl %eax, %eax
callq 0x1070
movq %r15, %rdi
movl $0xf500, %esi           # imm = 0xF500
jmp 0x7d41
movq %r15, %rdi
movl $0x1600, %esi           # imm = 0x1600
xorl %edx, %edx
callq 0x11c0
leal 0x31(%rbx), %r8d
leal 0x6(%rbx), %esi
movq %r15, %rdi
movl $0x1, %edx
leaq 0x8695(%rip), %rcx      # 0x10326
xorl %eax, %eax
callq 0x1070
movq %r15, %rdi
movl $0x1600, %esi           # imm = 0x1600
jmp 0x7d41
movq %r15, %rdi
movl $0x1700, %esi           # imm = 0x1700
xorl %edx, %edx
callq 0x11c0
leal 0x31(%rbx), %r8d
leal 0x6(%rbx), %esi
movq %r15, %rdi
movl $0x1, %edx
leaq 0x8672(%rip), %rcx      # 0x1033c
xorl %eax, %eax
callq 0x1070
movq %r15, %rdi
movl $0x1700, %esi           # imm = 0x1700
jmp 0x7d41
movq %r15, %rdi
movl $0x7c00, %esi           # imm = 0x7C00
xorl %edx, %edx
callq 0x11c0
leal 0x31(%rbx), %r8d
leal 0x6(%rbx), %esi
movq %r15, %rdi
movl $0x1, %edx
leaq 0x8617(%rip), %rcx      # 0x10317
xorl %eax, %eax
callq 0x1070
movq %r15, %rdi
movl $0x7c00, %esi           # imm = 0x7C00
jmp 0x7d41
movq %r15, %rdi
movl $0xc00, %esi            # imm = 0xC00
xorl %edx, %edx
callq 0x11c0
leal 0x6(%rbx), %esi
movq %r15, %rdi
movl $0x1, %edx
leaq 0x8636(%rip), %rcx      # 0x10368
xorl %eax, %eax
callq 0x1070
movq %r15, %rdi
movl $0xc00, %esi            # imm = 0xC00
xorl %edx, %edx
callq 0x1060
incq %rbx
cmpq %rbx, %r12
jne 0x78dc
movq %r15, %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1100