// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq 0x59d9(%rip), %rdi      # 0x7fd0
leaq 0x2a62(%rip), %rsi      # 0x5060
callq 0x2150
movq %rax, %r15
movq %rsp, %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x4d18
movq %r15, %rdi
movq %r12, %rsi
callq 0x2140
leaq 0x3119(%rip), %rsi      # 0x573f
movq %rax, %rdi
callq 0x2150
movq %rax, %rdi
callq 0x20a0
movq %rsp, %rdi
callq 0x2090
cmpb $0x0, 0x28(%r14)
jne 0x278c
movq 0x5980(%rip), %rdi      # 0x7fd0
leaq 0x2a19(%rip), %rsi      # 0x5070
callq 0x2150
movq %rax, %r15
movq %rsp, %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x4d2a
movq %r15, %rdi
movq %r12, %rsi
callq 0x2140
leaq 0x2a17(%rip), %rsi      # 0x5096
movq %rax, %rdi
callq 0x2150
leaq 0x2a12(%rip), %rsi      # 0x50a0
movq %rax, %rdi
callq 0x2150
movq %rax, %rdi
callq 0x20a0
movq %rsp, %rdi
callq 0x2090
movq 0x5923(%rip), %rdi      # 0x7fd0
leaq 0x2a00(%rip), %rsi      # 0x50b4
callq 0x2150
movq %rax, %r15
movq %rsp, %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x4d2a
movq %r15, %rdi
movq %r12, %rsi
callq 0x2140
leaq 0x2be6(%rip), %rsi      # 0x52c2
movq %rax, %rdi
callq 0x2150
movq %rax, %rdi
callq 0x20a0
movq %rsp, %rdi
callq 0x2090
movq 0x58d5(%rip), %rdi      # 0x7fd0
leaq 0x2941(%rip), %rsi      # 0x5043
callq 0x2150
movq %rax, %rdi
callq 0x20a0
pushq $0x1
popq %rdi
movl %edi, %esi
callq 0x4d50
leaq 0x2998(%rip), %rsi      # 0x50b8
leaq 0x20(%rsp), %rdi
movq %rsp, %rdx
callq 0x2b68
leaq 0x20(%rsp), %rdx
movq %rbx, %rsi
callq 0x27c0
movl %eax, %ebp
leaq 0x20(%rsp), %rdi
callq 0x2090
movq 0x5883(%rip), %rdi      # 0x7fd0
testb %bpl, %bpl
je 0x2778
leaq 0x2976(%rip), %rsi      # 0x50cf
callq 0x2150
movq %rax, %rdi
callq 0x20a0
movb $0x1, 0x28(%r14)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2880
jmp 0x278c
leaq 0x2997(%rip), %rsi      # 0x5116
callq 0x2150
movq %rax, %rdi
callq 0x20a0
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
jmp 0x27b2
movq %rax, %rbx
jmp 0x27b7
jmp 0x27ac
jmp 0x27ac
movq %rax, %rbx
movq %rsp, %rdi
callq 0x2090
movq %rbx, %rdi
callq 0x21e0
nop