// File: isimplyexcel[P]text-based-game/Engine.cpp
// Function: Engine::action(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&)
void Engine::action(std::vector<std::string>& container){
	//	welcome user to the car
	std::cout << "Welcome to the " << this->getCarName() << "!" << std::endl;

	if(!actionTaken){
		//	Apply the emergency brakes
		std::cout << "The train will derail soon! You must " << this->getActionName() << " in order"
				  << " to stop the train." << std::endl;
	  	std::cout << "1) " << this->getActionName() << "." << std::endl;
	  	std::cout << "Enter your choice: " << std::endl;

	    int stopTrain = validate(1,1);

	    if(this->checkKey(container, "an emergency brake key")){
	    	std::cout << "You used the emergency brake key and stopped the train from derailing!" << std::endl;
	    	actionTaken = true;

	    	//	receive award and win game
	    	this->findItem(container);
	    }
	    else{
	    	std::cout << "You need the emergency brake key in order to stop the train!" << std::endl;
	    }
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq 0xa72b(%rip), %rdi      # 0xcfd0
leaq 0x67c4(%rip), %rsi      # 0x9070
callq 0x21a0
movq -0xd0(%rbp), %rsi
movq %rax, -0xc8(%rbp)
leaq -0x30(%rbp), %rdi
movq %rdi, -0xc0(%rbp)
callq 0x7e80
movq -0xc8(%rbp), %rdi
movq -0xc0(%rbp), %rsi
callq 0x2190
movq %rax, -0xb8(%rbp)
jmp 0x28eb
movq -0xb8(%rbp), %rdi
leaq 0x6e56(%rip), %rsi      # 0x974f
callq 0x21a0
movq %rax, -0xd8(%rbp)
jmp 0x2907
movq -0xd8(%rbp), %rdi
movq 0xa6ab(%rip), %rsi      # 0xcfc0
callq 0x21d0
jmp 0x291c
leaq -0x30(%rbp), %rdi
callq 0x2100
movq -0xd0(%rbp), %rax
testb $0x1, 0x28(%rax)
jne 0x2bf2
movq 0xa693(%rip), %rdi      # 0xcfd0
leaq 0x673c(%rip), %rsi      # 0x9080
callq 0x21a0
movq -0xd0(%rbp), %rsi
movq %rax, -0xf0(%rbp)
leaq -0x60(%rbp), %rdi
movq %rdi, -0xe8(%rbp)
callq 0x7eb0
movq -0xf0(%rbp), %rdi
movq -0xe8(%rbp), %rsi
callq 0x2190
movq %rax, -0xe0(%rbp)
jmp 0x2983
movq -0xe0(%rbp), %rdi
leaq 0x6715(%rip), %rsi      # 0x90a6
callq 0x21a0
movq %rax, -0xf8(%rbp)
jmp 0x299f
movq -0xf8(%rbp), %rdi
leaq 0x6703(%rip), %rsi      # 0x90b0
callq 0x21a0
movq %rax, -0x100(%rbp)
jmp 0x29bb
movq -0x100(%rbp), %rdi
movq 0xa5f7(%rip), %rsi      # 0xcfc0
callq 0x21d0
jmp 0x29d0
leaq -0x60(%rbp), %rdi
callq 0x2100
movq 0xa5f0(%rip), %rdi      # 0xcfd0
leaq 0x66dd(%rip), %rsi      # 0x90c4
callq 0x21a0
movq -0xd0(%rbp), %rsi
movq %rax, -0x118(%rbp)
leaq -0x80(%rbp), %rdi
movq %rdi, -0x110(%rbp)
callq 0x7eb0
movq -0x118(%rbp), %rdi
movq -0x110(%rbp), %rsi
callq 0x2190
movq %rax, -0x108(%rbp)
jmp 0x2a26
movq -0x108(%rbp), %rdi
leaq 0x689e(%rip), %rsi      # 0x92d2
callq 0x21a0
movq %rax, -0x120(%rbp)
jmp 0x2a42
movq -0x120(%rbp), %rdi
movq 0xa570(%rip), %rsi      # 0xcfc0
callq 0x21d0
jmp 0x2a57
leaq -0x80(%rbp), %rdi
callq 0x2100
movq 0xa569(%rip), %rdi      # 0xcfd0
leaq 0x65d5(%rip), %rsi      # 0x9043
callq 0x21a0
movq %rax, %rdi
movq 0xa543(%rip), %rsi      # 0xcfc0
callq 0x21d0
movl $0x1, %esi
movl %esi, %edi
callq 0x7f10
movl %eax, -0x84(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x130(%rbp)
leaq -0xa9(%rbp), %rdi
movq %rdi, -0x128(%rbp)
callq 0x22d0
movq -0x128(%rbp), %rdx
leaq 0x6608(%rip), %rsi      # 0x90c8
leaq -0xa8(%rbp), %rdi
callq 0x3290
jmp 0x2ace
movq -0x130(%rbp), %rsi
movq -0xd0(%rbp), %rdi
leaq -0xa8(%rbp), %rdx
callq 0x2c10
movb %al, -0x131(%rbp)
jmp 0x2af0
leaq -0xa8(%rbp), %rdi
callq 0x2100
leaq -0xa9(%rbp), %rdi
callq 0x21f0
movb -0x131(%rbp), %al
testb $0x1, %al
jne 0x2b17
jmp 0x2bce
movq 0xa4b2(%rip), %rdi      # 0xcfd0
leaq 0x65ba(%rip), %rsi      # 0x90df
callq 0x21a0
movq %rax, %rdi
movq 0xa48c(%rip), %rsi      # 0xcfc0
callq 0x21d0
movq -0xd0(%rbp), %rdi
movb $0x1, 0x28(%rdi)
movq -0x10(%rbp), %rsi
callq 0x2d60
jmp 0x2bf0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x2100
jmp 0x2bfb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x2100
jmp 0x2bfb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x2100
jmp 0x2bfb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x2bc0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x2100
leaq -0xa9(%rbp), %rdi
callq 0x21f0
jmp 0x2bfb
movq 0xa3fb(%rip), %rdi      # 0xcfd0
leaq 0x654a(%rip), %rsi      # 0x9126
callq 0x21a0
movq %rax, %rdi
movq 0xa3d5(%rip), %rsi      # 0xcfc0
callq 0x21d0
jmp 0x2bf2
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0x22c0
nopw %cs:(%rax,%rax)