// File: /workspace/github_c_makefile_star2_O3/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 0x891f(%rip), %rcx      # 0x102e7
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 0x88ff(%rip), %rcx      # 0x102f1
movq %r15, %rdi
movl $0x2, %esi
movl $0x1, %edx
movl %r13d, %r8d
xorl %eax, %eax
callq 0x1070
leaq 0x88fb(%rip), %rcx      # 0x1030b
movq %r15, %rdi
movl $0x3, %esi
movl $0x1, %edx
movl %r12d, %r8d
xorl %eax, %eax
callq 0x1070
leaq 0x88ee(%rip), %rcx      # 0x1031c
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 0x7ed5
xorl %ebx, %ebx
movq %r14, 0x8(%rsp)
movl (%r14,%rbx,8), %eax
incl %eax
cmpl $0x4, %eax
ja 0x7ed5
leaq 0x868d(%rip), %rcx      # 0x10100
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leal 0x6(%rbx), %esi
movq %r15, %rdi
movl $0x1, %edx
leaq 0x779d(%rip), %rcx      # 0xf22b
xorl %eax, %eax
callq 0x1070
jmp 0x7ec9
movl 0x4(%r14,%rbx,8), %eax
decl %eax
cmpl $0x5, %eax
ja 0x7ec9
leaq 0x8663(%rip), %rcx      # 0x10114
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 0x887d(%rip), %rcx      # 0x1035c
xorl %eax, %eax
callq 0x1070
movq %r15, %rdi
movl $0x2f00, %esi           # imm = 0x2F00
jmp 0x7ec2
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 0x7cc6
cmpl $0x2, %eax
je 0x7c92
cmpl $0x1, %eax
jne 0x7ec9
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 0x87e4(%rip), %rcx      # 0x10331
movq %r13, %r9
xorl %eax, %eax
callq 0x1070
jmp 0x7e19
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 0x7c5f
leaq 0x85a0(%rip), %rax      # 0x1014c
movslq (%rax,%rbp,4), %r9
addq %rax, %r9
leal 0x6(%rbx), %esi
movq %r15, %rdi
movl $0x1, %edx
leaq 0x878c(%rip), %rcx      # 0x10351
xorl %eax, %eax
callq 0x1070
jmp 0x7c78
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 0x7d5b
cmpl $0x2, %eax
je 0x7cfa
cmpl $0x1, %eax
jne 0x7ec9
movq %r15, %rdi
movl $0x1600, %esi           # imm = 0x1600
xorl %edx, %edx
callq 0x11c0
leaq 0x8709(%rip), %rcx      # 0x10325
testl %ebp, %ebp
je 0x7c27
leaq 0x8704(%rip), %rcx      # 0x1032b
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 0x8707(%rip), %rcx      # 0x10357
movq %r13, %r8
xorl %eax, %eax
callq 0x1070
jmp 0x7e19
leal 0x6(%rbx), %esi
movq %r15, %rdi
movl $0x1, %edx
leaq 0x86cb(%rip), %rcx      # 0x1033c
xorl %eax, %eax
callq 0x1070
movq %r14, %r12
movq %r15, %rdi
movl %r13d, %esi
xorl %edx, %edx
callq 0x1060
movq 0x8(%rsp), %r14
jmp 0x7ec9
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 0x867a(%rip), %rcx      # 0x10331
movq %r13, %r9
xorl %eax, %eax
callq 0x1070
jmp 0x7d4e
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 0x8646(%rip), %rcx      # 0x10331
movq %r13, %r9
xorl %eax, %eax
callq 0x1070
jmp 0x7eba
movq %r15, %rdi
movl $0xa600, %esi           # imm = 0xA600
xorl %edx, %edx
callq 0x11c0
leaq 0x8615(%rip), %rcx      # 0x10325
testl %ebp, %ebp
je 0x7d1b
leaq 0x8610(%rip), %rcx      # 0x1032b
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 0x8613(%rip), %rcx      # 0x10357
movq %r13, %r8
xorl %eax, %eax
callq 0x1070
movq %r15, %rdi
movl $0xa600, %esi           # imm = 0xA600
jmp 0x7ec2
movq %r15, %rdi
movl $0xc00, %esi            # imm = 0xC00
xorl %edx, %edx
callq 0x11c0
leaq 0x85b4(%rip), %rcx      # 0x10325
testl %ebp, %ebp
je 0x7d7c
leaq 0x85af(%rip), %rcx      # 0x1032b
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 0x85b2(%rip), %rcx      # 0x10357
movq %r13, %r8
xorl %eax, %eax
callq 0x1070
jmp 0x7eba
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 0x85d7(%rip), %rcx      # 0x103b0
xorl %eax, %eax
callq 0x1070
movq %r15, %rdi
movl $0xf500, %esi           # imm = 0xF500
jmp 0x7ec2
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 0x8570(%rip), %rcx      # 0x10382
xorl %eax, %eax
callq 0x1070
movq %r15, %rdi
movl $0x1600, %esi           # imm = 0x1600
jmp 0x7ec2
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 0x854d(%rip), %rcx      # 0x10398
xorl %eax, %eax
callq 0x1070
movq %r15, %rdi
movl $0x1700, %esi           # imm = 0x1700
jmp 0x7ec2
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 0x84f2(%rip), %rcx      # 0x10373
xorl %eax, %eax
callq 0x1070
movq %r15, %rdi
movl $0x7c00, %esi           # imm = 0x7C00
jmp 0x7ec2
movq %r15, %rdi
movl $0xc00, %esi            # imm = 0xC00
xorl %edx, %edx
callq 0x11c0
leal 0x6(%rbx), %esi
movq %r15, %rdi
movl $0x1, %edx
leaq 0x8511(%rip), %rcx      # 0x103c4
xorl %eax, %eax
callq 0x1070
movq %r15, %rdi
movl $0xc00, %esi            # imm = 0xC00
xorl %edx, %edx
callq 0x1060
incq %rbx
cmpq %rbx, %r12
jne 0x7a5d
movq %r15, %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1100