// File: /workspace/github_cpp_makefile_star2_O3/brandoncanaday[P]1730sh/1730sh.cpp
// Function: callBuiltIn(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, 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>>>> const&, Input*)
void callBuiltIn(string & command, const vector<string>& args, Input * job) {
  if(command == "cd") { // changes current working dir
    last_exit_status = (cd_builtin(args) == -1) ? EXIT_FAILURE : EXIT_SUCCESS;
  } else if(command == "exit") { // exits shell with specified status
    int status;
    last_exit_status = ((status = exit_builtin(args)) != -1) ? status : EXIT_FAILURE;
    delete job;
    if(status != -1) {
      for(unsigned int i = 0, s = current_jobs.size(); i < s; i++) {
	if(current_jobs[i] != nullptr) delete current_jobs[i]; current_jobs[i] = nullptr;
      } // for
      exit(status);
    } // if
  } else if(command == "help") { // prints built-in command options
    last_exit_status = (help_builtin(args) == -1) ? EXIT_FAILURE : EXIT_SUCCESS;
  } else if(command == "bg") { // puts and resumes job in background
    last_exit_status = (bg_builtin(args) == -1) ? EXIT_FAILURE : EXIT_SUCCESS;
  } else if(command == "fg") { // puts and resumes job in foreground
    last_exit_status = (fg_builtin(args) == -1) ? EXIT_FAILURE : EXIT_SUCCESS;
  } else if(command == "export") { // changes env variables
    last_exit_status = (export_builtin(args) == -1) ? EXIT_FAILURE : EXIT_SUCCESS;
  } else if(command == "jobs") { // prints status of currently running jobs
    last_exit_status = (jobs_builtin(args) == -1) ? EXIT_FAILURE : EXIT_SUCCESS;
  } else if(command == "kill") { // sends specified signal to specified pid/pgid
    last_exit_status = (kill_builtin(args) == -1) ? EXIT_FAILURE : EXIT_SUCCESS;
  } // if/else
  delete job;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x7833(%rip), %rsi      # 0xe144
callq 0x30b0
testl %eax, %eax
je 0x69cc
leaq 0x7822(%rip), %rsi      # 0xe147
movq %r15, %rdi
callq 0x30b0
testl %eax, %eax
je 0x69d9
leaq 0x7877(%rip), %rsi      # 0xe1b3
movq %r15, %rdi
callq 0x30b0
testl %eax, %eax
je 0x6a7a
leaq 0x77f9(%rip), %rsi      # 0xe14c
movq %r15, %rdi
callq 0x30b0
testl %eax, %eax
je 0x6a84
leaq 0x77e5(%rip), %rsi      # 0xe14f
movq %r15, %rdi
callq 0x30b0
testl %eax, %eax
je 0x6a8e
leaq 0x77d1(%rip), %rsi      # 0xe152
movq %r15, %rdi
callq 0x30b0
testl %eax, %eax
je 0x6a98
leaq 0x7ffc(%rip), %rsi      # 0xe994
movq %r15, %rdi
callq 0x30b0
testl %eax, %eax
je 0x6aa2
leaq 0x77aa(%rip), %rsi      # 0xe159
movq %r15, %rdi
callq 0x30b0
testl %eax, %eax
jne 0x6ab8
movq %r14, %rdi
callq 0x90fc
jmp 0x6aaa
movq %r14, %rdi
callq 0x740d
jmp 0x6aaa
movq %r14, %rdi
callq 0x7aa4
movl %eax, %r14d
cmpl $-0x1, %eax
movl $0x1, %eax
cmovnel %r14d, %eax
movl %eax, 0xb90e(%rip)      # 0x12304
testq %rbx, %rbx
je 0x6a03
movq %rbx, %rdi
callq 0x9b6a
movl $0xe8, %esi
movq %rbx, %rdi
callq 0x32c0
cmpl $-0x1, %r14d
je 0x6ab8
movq 0xb8f7(%rip), %rax      # 0x12318
subq 0xb8e8(%rip), %rax      # 0x12310
shrq $0x3, %rax
testl %eax, %eax
je 0x6a72
movl %eax, %r15d
xorl %r12d, %r12d
movq 0xb8d3(%rip), %rax      # 0x12310
movq (%rax,%r12,8), %rbx
testq %rbx, %rbx
je 0x6a62
movq %rbx, %rdi
callq 0x9b6a
movl $0xe8, %esi
movq %rbx, %rdi
callq 0x32c0
movq 0xb8ae(%rip), %rax      # 0x12310
movq $0x0, (%rax,%r12,8)
incq %r12
cmpq %r12, %r15
jne 0x6a36
movl %r14d, %edi
callq 0x3330
movq %r14, %rdi
callq 0x7d94
jmp 0x6aaa
movq %r14, %rdi
callq 0x84c1
jmp 0x6aaa
movq %r14, %rdi
callq 0x8739
jmp 0x6aaa
movq %r14, %rdi
callq 0x89b1
jmp 0x6aaa
movq %r14, %rdi
callq 0x8e6b
xorl %ecx, %ecx
cmpl $-0x1, %eax
sete %cl
movl %ecx, 0xb84c(%rip)      # 0x12304
testq %rbx, %rbx
je 0x6ac5
movq %rbx, %rdi
callq 0x9b6a
movl $0xe8, %esi
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x32c0