// File: essarrdee[P]mutantaliens/mutantaliens.cpp
// Function: calculate_score()
int calculate_score()
{
	int score = 0;
	score += died ? -1000 : 1000;
	score += left_ship ? 50 : -50;
	score += ran ? 75 : -75;
	score += entered_building_destroyed_transmitter ? 100 : -100;
	score += destroyed_transmitter ? 200 : -200;
	score += returned_to_ship ? 400 : -400;
	score += closed_doors ? 600 : -600;
	score += left_planet ? 800 : -800;

	score += count_inv_devices(LOW_EXPLOSIVE)*100;
	score += count_inv_devices(HIGH_EXPLOSIVE)*400;
	score += count_inv_devices(HOLOGRAM_PROJECTOR)*50;
	score += count_inv_devices(NOISE_GENERATOR)*50;
	score += count_inv_devices(SCENT_GENERATOR)*50;
	score += count_inv_devices(BRAIN_SLICE)*50;

	score += ammo[PISTOL]*5;
	score += ammo[RIFLE]*3;
	score += ammo[CANNON]*25;
	score -= turn_count;
	score *= difficulty;
	return score;
}

// Assembly:
pushq %rax
movl $0x0, 0x4(%rsp)
movb 0x23241(%rip), %dl      # 0x3b390
movl $0x3e8, %eax            # imm = 0x3E8
movl $0xfffffc18, %ecx       # imm = 0xFFFFFC18
testb $0x1, %dl
cmovnel %ecx, %eax
addl 0x4(%rsp), %eax
movl %eax, 0x4(%rsp)
movb 0x23224(%rip), %dl      # 0x3b391
movl $0xffffffce, %eax       # imm = 0xFFFFFFCE
movl $0x32, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
addl 0x4(%rsp), %eax
movl %eax, 0x4(%rsp)
movb 0x23207(%rip), %dl      # 0x3b392
movl $0xffffffb5, %eax       # imm = 0xFFFFFFB5
movl $0x4b, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
addl 0x4(%rsp), %eax
movl %eax, 0x4(%rsp)
movb 0x231ea(%rip), %dl      # 0x3b393
movl $0xffffff9c, %eax       # imm = 0xFFFFFF9C
movl $0x64, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
addl 0x4(%rsp), %eax
movl %eax, 0x4(%rsp)
movb 0x231cd(%rip), %dl      # 0x3b394
movl $0xffffff38, %eax       # imm = 0xFFFFFF38
movl $0xc8, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
addl 0x4(%rsp), %eax
movl %eax, 0x4(%rsp)
movb 0x231b0(%rip), %dl      # 0x3b395
movl $0xfffffe70, %eax       # imm = 0xFFFFFE70
movl $0x190, %ecx            # imm = 0x190
testb $0x1, %dl
cmovnel %ecx, %eax
addl 0x4(%rsp), %eax
movl %eax, 0x4(%rsp)
movb 0x23193(%rip), %dl      # 0x3b396
movl $0xfffffda8, %eax       # imm = 0xFFFFFDA8
movl $0x258, %ecx            # imm = 0x258
testb $0x1, %dl
cmovnel %ecx, %eax
addl 0x4(%rsp), %eax
movl %eax, 0x4(%rsp)
movb 0x23176(%rip), %dl      # 0x3b397
movl $0xfffffce0, %eax       # imm = 0xFFFFFCE0
movl $0x320, %ecx            # imm = 0x320
testb $0x1, %dl
cmovnel %ecx, %eax
addl 0x4(%rsp), %eax
movl %eax, 0x4(%rsp)
xorl %edi, %edi
callq 0xf890
imull $0x64, %eax, %eax
addl 0x4(%rsp), %eax
movl %eax, 0x4(%rsp)
movl $0x1, %edi
callq 0xf890
imull $0x190, %eax, %eax      # imm = 0x190
addl 0x4(%rsp), %eax
movl %eax, 0x4(%rsp)
movl $0x2, %edi
callq 0xf890
imull $0x32, %eax, %eax
addl 0x4(%rsp), %eax
movl %eax, 0x4(%rsp)
movl $0x3, %edi
callq 0xf890
imull $0x32, %eax, %eax
addl 0x4(%rsp), %eax
movl %eax, 0x4(%rsp)
movl $0x4, %edi
callq 0xf890
imull $0x32, %eax, %eax
addl 0x4(%rsp), %eax
movl %eax, 0x4(%rsp)
movl $0x5, %edi
callq 0xf890
imull $0x32, %eax, %eax
addl 0x4(%rsp), %eax
movl %eax, 0x4(%rsp)
imull $0x5, 0x6ff9a(%rip), %eax # 0x88258
addl 0x4(%rsp), %eax
movl %eax, 0x4(%rsp)
imull $0x3, 0x6ff8f(%rip), %eax # 0x8825c
addl 0x4(%rsp), %eax
movl %eax, 0x4(%rsp)
imull $0x19, 0x6ff84(%rip), %eax # 0x88260
addl 0x4(%rsp), %eax
movl %eax, 0x4(%rsp)
movl 0x2309a(%rip), %ecx     # 0x3b384
movl 0x4(%rsp), %eax
subl %ecx, %eax
movl %eax, 0x4(%rsp)
movl 0x23082(%rip), %eax     # 0x3b37c
imull 0x4(%rsp), %eax
movl %eax, 0x4(%rsp)
movl 0x4(%rsp), %eax
popq %rcx
retq
nopl (%rax)