// File: /workspace/github_cpp_makefile_star2_O1/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 0x783c(%rip), %rsi      # 0xe144
callq 0x30b0
testl %eax, %eax
je 0x69c3
leaq 0x782b(%rip), %rsi      # 0xe147
movq %r15, %rdi
callq 0x30b0
testl %eax, %eax
je 0x69d0
leaq 0x7880(%rip), %rsi      # 0xe1b3
movq %r15, %rdi
callq 0x30b0
testl %eax, %eax
je 0x6a71
leaq 0x7802(%rip), %rsi      # 0xe14c
movq %r15, %rdi
callq 0x30b0
testl %eax, %eax
je 0x6a7b
leaq 0x77ee(%rip), %rsi      # 0xe14f
movq %r15, %rdi
callq 0x30b0
testl %eax, %eax
je 0x6a85
leaq 0x77da(%rip), %rsi      # 0xe152
movq %r15, %rdi
callq 0x30b0
testl %eax, %eax
je 0x6a8f
leaq 0x8005(%rip), %rsi      # 0xe994
movq %r15, %rdi
callq 0x30b0
testl %eax, %eax
je 0x6a99
leaq 0x77b3(%rip), %rsi      # 0xe159
movq %r15, %rdi
callq 0x30b0
testl %eax, %eax
jne 0x6aaf
movq %r14, %rdi
callq 0x9136
jmp 0x6aa1
movq %r14, %rdi
callq 0x73f3
jmp 0x6aa1
movq %r14, %rdi
callq 0x7a8a
movl %eax, %r14d
cmpl $-0x1, %eax
movl $0x1, %eax
cmovnel %r14d, %eax
movl %eax, 0xb917(%rip)      # 0x12304
testq %rbx, %rbx
je 0x6a07
movq %rbx, %rdi
callq 0x9bc0
movl $0xe8, %esi
movq %rbx, %rdi
callq 0x32c0
cmpl $-0x1, %r14d
je 0x6aaf
movq 0xb900(%rip), %rax      # 0x12318
subq 0xb8f1(%rip), %rax      # 0x12310
shrq $0x3, %rax
testl %eax, %eax
je 0x6a69
movl %eax, %r15d
xorl %r12d, %r12d
movq 0xb8dc(%rip), %rax      # 0x12310
movq (%rax,%r12,8), %rbx
testq %rbx, %rbx
je 0x6a52
movq %rbx, %rdi
callq 0x9bc0
movl $0xe8, %esi
movq %rbx, %rdi
callq 0x32c0
movq 0xb8b7(%rip), %rax      # 0x12310
movq $0x0, (%rax,%r12,8)
incq %r12
cmpq %r12, %r15
jne 0x6a2d
movl %r14d, %edi
callq 0x3330
movq %r14, %rdi
callq 0x7d7e
jmp 0x6aa1
movq %r14, %rdi
callq 0x84ab
jmp 0x6aa1
movq %r14, %rdi
callq 0x874a
jmp 0x6aa1
movq %r14, %rdi
callq 0x89e9
jmp 0x6aa1
movq %r14, %rdi
callq 0x8ea1
xorl %ecx, %ecx
cmpl $-0x1, %eax
sete %cl
movl %ecx, 0xb855(%rip)      # 0x12304
testq %rbx, %rbx
je 0x6ad1
movq %rbx, %rdi
callq 0x9bc0
movl $0xe8, %esi
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x32c0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq