// File: dnegovan[P]Intruder-On-Donnar-V/Game.cpp
// Function: Game::parasiteSpreads()
bool Game::parasiteSpreads()
{
    //spread to next person in the chain if they're alive
    if (!bridge->getOccupant()->getInfected()
        && bridge->getOccupant()->getAlive())
    {
        bridge->getOccupant()->setInfected(true);
        markNelson.crewInfected++;
        return true;
    }
    else if (!lounge->getOccupant()->getInfected()
             && lounge->getOccupant()->getAlive())
    {
        lounge->getOccupant()->setInfected(true);
        markNelson.crewInfected++;
        return true;
    }
    else if (!crewQ->getOccupant()->getInfected()
             && crewQ->getOccupant()->getAlive())
    {
        crewQ->getOccupant()->setInfected(true);
        markNelson.crewInfected++;
        return true;
    }
    else if (!engineering->getOccupant()->getInfected()
              && engineering->getOccupant()->getAlive())
    {
        engineering->getOccupant()->setInfected(true);
        markNelson.crewInfected++;
        return true;
    }
    //you are the last one, so game over - trigger appropriate ending
    else if (markNelson.crewDead == 0)
    {
        markNelson.state = PLAYER_AND_CREW_INFECTED;
        return false;
    }
    else if (markNelson.crewDead == 1)
    {
        markNelson.state = KILLED_PERSON_INFECTED_ANYWAY;
        return false;
    }
    else
    {
        markNelson.state = KILLED_PEOPLE_INFECTED_ANYWAY;
        return false;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq 0xc8(%rax), %rdi
callq 0x1d030
movq %rax, %rdi
callq 0x16050
testb $0x1, %al
jne 0x1bbed
movq -0x18(%rbp), %rax
movq 0xc8(%rax), %rdi
callq 0x1d030
movq %rax, %rdi
callq 0x16010
testb $0x1, %al
jne 0x1bbba
jmp 0x1bbed
movq -0x18(%rbp), %rax
movq 0xc8(%rax), %rdi
callq 0x1d030
movq %rax, %rdi
movl $0x1, %esi
callq 0x16030
movq -0x18(%rbp), %rax
movl 0x24(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x24(%rax)
movb $0x1, -0x1(%rbp)
jmp 0x1bd76
movq -0x18(%rbp), %rax
movq 0xd8(%rax), %rdi
callq 0x1d030
movq %rax, %rdi
callq 0x16050
testb $0x1, %al
jne 0x1bc5a
movq -0x18(%rbp), %rax
movq 0xd8(%rax), %rdi
callq 0x1d030
movq %rax, %rdi
callq 0x16010
testb $0x1, %al
jne 0x1bc27
jmp 0x1bc5a
movq -0x18(%rbp), %rax
movq 0xd8(%rax), %rdi
callq 0x1d030
movq %rax, %rdi
movl $0x1, %esi
callq 0x16030
movq -0x18(%rbp), %rax
movl 0x24(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x24(%rax)
movb $0x1, -0x1(%rbp)
jmp 0x1bd76
movq -0x18(%rbp), %rax
movq 0xe8(%rax), %rdi
callq 0x1d030
movq %rax, %rdi
callq 0x16050
testb $0x1, %al
jne 0x1bcc7
movq -0x18(%rbp), %rax
movq 0xe8(%rax), %rdi
callq 0x1d030
movq %rax, %rdi
callq 0x16010
testb $0x1, %al
jne 0x1bc94
jmp 0x1bcc7
movq -0x18(%rbp), %rax
movq 0xe8(%rax), %rdi
callq 0x1d030
movq %rax, %rdi
movl $0x1, %esi
callq 0x16030
movq -0x18(%rbp), %rax
movl 0x24(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x24(%rax)
movb $0x1, -0x1(%rbp)
jmp 0x1bd76
movq -0x18(%rbp), %rax
movq 0xf0(%rax), %rdi
callq 0x1d030
movq %rax, %rdi
callq 0x16050
testb $0x1, %al
jne 0x1bd31
movq -0x18(%rbp), %rax
movq 0xf0(%rax), %rdi
callq 0x1d030
movq %rax, %rdi
callq 0x16010
testb $0x1, %al
jne 0x1bd01
jmp 0x1bd31
movq -0x18(%rbp), %rax
movq 0xf0(%rax), %rdi
callq 0x1d030
movq %rax, %rdi
movl $0x1, %esi
callq 0x16030
movq -0x18(%rbp), %rax
movl 0x24(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x24(%rax)
movb $0x1, -0x1(%rbp)
jmp 0x1bd76
movq -0x18(%rbp), %rax
cmpl $0x0, 0x20(%rax)
jne 0x1bd4c
movq -0x18(%rbp), %rax
movl $0xe, 0x30(%rax)
movb $0x0, -0x1(%rbp)
jmp 0x1bd76
movq -0x18(%rbp), %rax
cmpl $0x1, 0x20(%rax)
jne 0x1bd67
movq -0x18(%rbp), %rax
movl $0x10, 0x30(%rax)
movb $0x0, -0x1(%rbp)
jmp 0x1bd76
movq -0x18(%rbp), %rax
movl $0xf, 0x30(%rax)
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)