// File: essarrdee[P]mutantaliens/mutantaliens.cpp
// Function: init_items()
void init_items()
{
	for(int i=0;i<WAVELENGTHS;i++)
	{rm_devices[i] = NULL;}
	ammo[PISTOL] = 60-difficulty;
	ammo[RIFLE] = 160 - 4*difficulty;
	ammo[CANNON] = 30-difficulty;
	dev_inv = std::vector<std::vector<std::vector<item*>>>(DEVICE_TYPES,(std::vector<std::vector<item*>>(DEVICE_CONFIGURATIONS)));
	item* dev;
	for(int i=0;i<5;i++)
	{
		dev = add_device(LOW_EXPLOSIVE,-1,-1,true);
		device_to_inventory(dev);
	}
	for(int i=0;i<3;i++)
	{
		dev = add_device(HIGH_EXPLOSIVE,-1,-1,true);
		device_to_inventory(dev);
	}
	for(int i=rand()%3+1;i<5;i++)
	{
		dev = add_device(HOLOGRAM_PROJECTOR,-1,-1,true);
		device_to_inventory(dev);
	}
	for(int i=rand()%3+1;i<5;i++)
	{
		dev = add_device(NOISE_GENERATOR,-1,-1,true);
		device_to_inventory(dev);
	}
	for(int i=rand()%3+1;i<5;i++)
	{
		dev = add_device(SCENT_GENERATOR,-1,-1,true);
		device_to_inventory(dev);
	}
	for(int i=rand()%3+1;i<5;i++)
	{
		dev = add_device(BRAIN_SLICE,-1,-1,true);
		device_to_inventory(dev);
	}
}

// Assembly:
subq $0x88, %rsp
movl $0x0, 0x84(%rsp)
cmpl $0x5, 0x84(%rsp)
jge 0x13eb6
movslq 0x84(%rsp), %rcx
leaq 0xa0635(%rip), %rax     # 0xb44d0
movq $0x0, (%rax,%rcx,8)
movl 0x84(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x84(%rsp)
jmp 0x13e82
movl 0x274c0(%rip), %ecx     # 0x3b37c
movl $0x3c, %eax
subl %ecx, %eax
movl %eax, 0x7438f(%rip)     # 0x88258
movl 0x274ad(%rip), %ecx     # 0x3b37c
shll $0x2, %ecx
movl $0xa0, %eax
subl %ecx, %eax
movl %eax, 0x7437d(%rip)     # 0x8825c
movl 0x27497(%rip), %ecx     # 0x3b37c
movl $0x1e, %eax
subl %ecx, %eax
movl %eax, 0x7436e(%rip)     # 0x88260
leaq 0x4f(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x21190
movq 0x10(%rsp), %rdx
leaq 0x50(%rsp), %rdi
movl $0x3, %esi
callq 0x211a0
jmp 0x13f17
leaq 0x3b(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x21220
movq 0x8(%rsp), %rcx
leaq 0x68(%rsp), %rdi
movl $0x6, %esi
leaq 0x50(%rsp), %rdx
callq 0x21230
jmp 0x13f41
leaq 0xcc568(%rip), %rdi     # 0xe04b0
leaq 0x68(%rsp), %rsi
callq 0x212b0
leaq 0x68(%rsp), %rdi
callq 0x208e0
leaq 0x3b(%rsp), %rdi
callq 0x212f0
leaq 0x50(%rsp), %rdi
callq 0x21300
leaq 0x4f(%rsp), %rdi
callq 0x21360
movl $0x0, 0x2c(%rsp)
cmpl $0x5, 0x2c(%rsp)
jge 0x13ff9
xorl %edi, %edi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x1, %ecx
movl %edx, %esi
callq 0x139b0
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rdi
callq 0xfc70
movl 0x2c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c(%rsp)
jmp 0x13f82
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x40(%rsp)
movl %eax, 0x3c(%rsp)
jmp 0x13fea
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x40(%rsp)
movl %eax, 0x3c(%rsp)
leaq 0x3b(%rsp), %rdi
callq 0x212f0
leaq 0x50(%rsp), %rdi
callq 0x21300
leaq 0x4f(%rsp), %rdi
callq 0x21360
jmp 0x14173
movl $0x0, 0x28(%rsp)
cmpl $0x3, 0x28(%rsp)
jge 0x14037
movl $0x1, %ecx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl %ecx, %edi
movl %edx, %esi
callq 0x139b0
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rdi
callq 0xfc70
movl 0x28(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x28(%rsp)
jmp 0x14001
callq 0x50b0
movl $0x3, %ecx
cltd
idivl %ecx
addl $0x1, %edx
movl %edx, 0x24(%rsp)
cmpl $0x5, 0x24(%rsp)
jge 0x14084
movl $0x2, %edi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x1, %ecx
movl %edx, %esi
callq 0x139b0
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rdi
callq 0xfc70
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
jmp 0x1404b
callq 0x50b0
movl $0x3, %ecx
cltd
idivl %ecx
addl $0x1, %edx
movl %edx, 0x20(%rsp)
cmpl $0x5, 0x20(%rsp)
jge 0x140d1
movl $0x3, %edi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x1, %ecx
movl %edx, %esi
callq 0x139b0
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rdi
callq 0xfc70
movl 0x20(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x20(%rsp)
jmp 0x14098
callq 0x50b0
movl $0x3, %ecx
cltd
idivl %ecx
addl $0x1, %edx
movl %edx, 0x1c(%rsp)
cmpl $0x5, 0x1c(%rsp)
jge 0x1411e
movl $0x4, %edi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x1, %ecx
movl %edx, %esi
callq 0x139b0
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rdi
callq 0xfc70
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x140e5
callq 0x50b0
movl $0x3, %ecx
cltd
idivl %ecx
addl $0x1, %edx
movl %edx, 0x18(%rsp)
cmpl $0x5, 0x18(%rsp)
jge 0x1416b
movl $0x5, %edi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl $0x1, %ecx
movl %edx, %esi
callq 0x139b0
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rdi
callq 0xfc70
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0x14132
addq $0x88, %rsp
retq
movq 0x40(%rsp), %rdi
callq 0x5480
nopl (%rax)