// File: /workspace/github_cpp_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movb 0x10904(%rip), %al      # 0x21320
movb 0x108fe(%rip), %r10b    # 0x21321
movb 0x108f8(%rip), %r9b     # 0x21322
movb 0x108f2(%rip), %r8b     # 0x21323
movb 0x108ec(%rip), %dil     # 0x21324
movb 0x108e6(%rip), %sil     # 0x21325
movb 0x108e1(%rip), %cl      # 0x21326
movb %cl, -0x2(%rsp)
movb 0x108d8(%rip), %cl      # 0x21327
movb %cl, -0x1(%rsp)
movq 0xb59e6(%rip), %r14     # 0xc6440
movq (%r14), %rbx
xorl %r11d, %r11d
movl $0x8, %r15d
movq (%rbx,%r15), %rcx
subq -0x8(%rbx,%r15), %rcx
shrq $0x3, %rcx
addl %ecx, %r11d
addq $0x18, %r15
cmpq $0x50, %r15
jne 0x10a66
movq 0x18(%r14), %r15
xorl %ebx, %ebx
movl $0x8, %r12d
movq (%r15,%r12), %rcx
subq -0x8(%r15,%r12), %rcx
shrq $0x3, %rcx
addl %ecx, %ebx
addq $0x18, %r12
cmpq $0x50, %r12
jne 0x10a8c
movq 0x30(%r14), %r15
xorl %ebp, %ebp
movl $0x8, %r12d
movq (%r15,%r12), %rcx
subq -0x8(%r15,%r12), %rcx
shrq $0x3, %rcx
addl %ecx, %ebp
addq $0x18, %r12
cmpq $0x50, %r12
jne 0x10ab1
movq 0x48(%r14), %r12
xorl %r15d, %r15d
movl $0x8, %r13d
movq (%r12,%r13), %rcx
subq -0x8(%r12,%r13), %rcx
shrq $0x3, %rcx
addl %ecx, %r15d
addq $0x18, %r13
cmpq $0x50, %r13
jne 0x10ad7
movq 0x60(%r14), %r13
xorl %r12d, %r12d
movl $0x8, %ecx
movq (%r13,%rcx), %rdx
subq -0x8(%r13,%rcx), %rdx
shrq $0x3, %rdx
addl %edx, %r12d
addq $0x18, %rcx
cmpq $0x50, %rcx
jne 0x10afd
movq 0x78(%r14), %r14
xorl %r13d, %r13d
movl $0x8, %ecx
movq (%r14,%rcx), %rdx
subq -0x8(%r14,%rcx), %rdx
shrq $0x3, %rdx
addl %edx, %r13d
addq $0x18, %rcx
cmpq $0x50, %rcx
jne 0x10b24
testb %al, %al
movl $0xfffffc18, %eax       # imm = 0xFFFFFC18
movl $0x3e8, %r14d           # imm = 0x3E8
cmovnel %eax, %r14d
imull $0x64, %r11d, %r11d
imull $0x190, %ebx, %eax      # imm = 0x190
addl %ebp, %r15d
addl %r12d, %r15d
addl %r13d, %r15d
imull $0x32, %r15d, %ebx
leal -0x32(%r14), %ecx
addl $0x32, %r14d
testb %r10b, %r10b
cmovel %ecx, %r14d
leal -0x4b(%r14), %ecx
addl $0x4b, %r14d
testb %r9b, %r9b
cmovel %ecx, %r14d
leal -0x64(%r14), %ecx
addl $0x64, %r14d
testb %r8b, %r8b
cmovel %ecx, %r14d
leal -0xc8(%r14), %ecx
addl $0xc8, %r14d
testb %dil, %dil
cmovel %ecx, %r14d
leal 0x190(%r14), %ecx
addl $0xfffffe70, %r14d      # imm = 0xFFFFFE70
testb %sil, %sil
cmovnel %ecx, %r14d
leal -0x258(%r14), %ecx
addl $0x258, %r14d           # imm = 0x258
cmpb $0x0, -0x2(%rsp)
cmovel %ecx, %r14d
leal -0x320(%r14), %ecx
addl $0x320, %r14d           # imm = 0x320
cmpb $0x0, -0x1(%rsp)
movl 0x5d5fb(%rip), %edx     # 0x6e1e8
leal (%rdx,%rdx,4), %edx
movl 0x5d5f6(%rip), %esi     # 0x6e1ec
leal (%rsi,%rsi,2), %esi
movl 0x5d5f1(%rip), %edi     # 0x6e1f0
leal (%rdi,%rdi,4), %edi
leal (%rdi,%rdi,4), %edi
cmovel %ecx, %r14d
addl %r11d, %eax
addl %ebx, %eax
addl %edx, %eax
addl %esi, %eax
addl %edi, %eax
addl %r14d, %eax
subl 0x106f7(%rip), %eax     # 0x21314
imull 0x106e8(%rip), %eax     # 0x2130c
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq