// File: /workspace/github_cpp_makefile_star2_O2/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 0x5c92(%rip), %rsi      # 0xb144
callq 0x7653
testb %al, %al
je 0x54d3
movq %r14, %rdi
callq 0x5f6d
xorl %ecx, %ecx
cmpl $-0x1, %eax
sete %cl
movl %ecx, 0xae0b(%rip)      # 0x102dc
jmp 0x5525
leaq 0x5c6d(%rip), %rsi      # 0xb147
movq %r15, %rdi
callq 0x7653
testb %al, %al
je 0x5547
movq %r14, %rdi
callq 0x633f
movl %eax, %r14d
cmpl $-0x1, %eax
pushq $0x1
popq %rax
cmovnel %r14d, %eax
movl %eax, 0xaddb(%rip)      # 0x102dc
testq %rbx, %rbx
je 0x550e
movq %rbx, %rdi
callq 0x7664
movl $0xe8, %esi
movq %rbx, %rdi
callq 0x32a0
cmpl $-0x1, %r14d
jne 0x560b
testq %rbx, %rbx
je 0x5532
movq %rbx, %rdi
callq 0x7664
movl $0xe8, %esi
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x32a0
leaq 0x5c65(%rip), %rsi      # 0xb1b3
movq %r15, %rdi
callq 0x7653
testb %al, %al
je 0x5567
movq %r14, %rdi
callq 0x64f1
jmp 0x54c3
leaq 0x5bde(%rip), %rsi      # 0xb14c
movq %r15, %rdi
callq 0x7653
testb %al, %al
je 0x5587
movq %r14, %rdi
callq 0x67a6
jmp 0x54c3
leaq 0x5bc1(%rip), %rsi      # 0xb14f
movq %r15, %rdi
callq 0x7653
testb %al, %al
je 0x55a7
movq %r14, %rdi
callq 0x6936
jmp 0x54c3
leaq 0x5ba4(%rip), %rsi      # 0xb152
movq %r15, %rdi
callq 0x7653
testb %al, %al
je 0x55c7
movq %r14, %rdi
callq 0x6ac6
jmp 0x54c3
leaq 0x63c6(%rip), %rsi      # 0xb994
movq %r15, %rdi
callq 0x7653
testb %al, %al
je 0x55e7
movq %r14, %rdi
callq 0x6d14
jmp 0x54c3
leaq 0x5b6b(%rip), %rsi      # 0xb159
movq %r15, %rdi
callq 0x7653
testb %al, %al
je 0x5525
movq %r14, %rdi
callq 0x6ed7
jmp 0x54c3
movq 0xacde(%rip), %rax      # 0x102f0
subq 0xaccf(%rip), %rax      # 0x102e8
shrq $0x3, %rax
movl %eax, %r15d
xorl %r12d, %r12d
cmpq %r12, %r15
je 0x565e
movq 0xacb9(%rip), %rax      # 0x102e8
movq (%rax,%r12,8), %rbx
testq %rbx, %rbx
je 0x5654
movq %rbx, %rdi
callq 0x7664
movl $0xe8, %esi
movq %rbx, %rdi
callq 0x32a0
movq 0xac94(%rip), %rax      # 0x102e8
andq $0x0, (%rax,%r12,8)
incq %r12
jmp 0x5623
movl %r14d, %edi
callq 0x32f0