// File: brandoncanaday[P]1730sh/1730sh.cpp
// Function: nice_exec(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>>>>, int**, int)
void nice_exec(vector<string> strargs, int** pipes, int numPipes) {
  vector<char *> cstrargs = mk_cstrvec(strargs);
  execvp(cstrargs.at(0), &cstrargs.at(0));
  // only makes it here if execvp fails
  cout << "1730sh: " << cstrargs.at(0) << ": command not found" << endl;
  // close pipes
  for(int i = 0; i < numPipes; i++) {
    close_pipe(pipes[i],false);
  } // for
  // delete dynamically-allocated members of current_jobs vector<Input*>
  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; } // if
  } // for
  // delete dynamically-allocated pipes
  deletePipes(pipes,numPipes);
  dl_cstrvec(cstrargs);
  exit(EXIT_FAILURE);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rsi, %rax
movq %rdi, %rsi
movq %rsi, -0x8(%rbp)
movq %rax, -0x10(%rbp)
movl %edx, -0x14(%rbp)
leaq -0x30(%rbp), %rdi
movq %rdi, -0x58(%rbp)
callq 0x81a0
movq -0x58(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xb850
movq %rax, -0x50(%rbp)
jmp 0x7b3c
movq -0x50(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x68(%rbp)
xorl %eax, %eax
movl %eax, %esi
leaq -0x30(%rbp), %rdi
callq 0xb850
movq %rax, -0x60(%rbp)
jmp 0x7b5a
movq -0x60(%rbp), %rsi
movq -0x68(%rbp), %rdi
callq 0x3240
movq 0x1445a(%rip), %rdi     # 0x1bfc8
leaq 0xc4f1(%rip), %rsi      # 0x14066
callq 0x32e0
movq %rax, -0x70(%rbp)
jmp 0x7b80
xorl %eax, %eax
movl %eax, %esi
leaq -0x30(%rbp), %rdi
callq 0xb850
movq %rax, -0x78(%rbp)
jmp 0x7b93
movq -0x70(%rbp), %rdi
movq -0x78(%rbp), %rax
movq (%rax), %rsi
callq 0x32e0
movq %rax, -0x80(%rbp)
jmp 0x7ba9
movq -0x80(%rbp), %rdi
leaq 0xc4bb(%rip), %rsi      # 0x1406f
callq 0x32e0
movq %rax, -0x88(%rbp)
jmp 0x7bc2
movq -0x88(%rbp), %rdi
movq 0x143d8(%rip), %rsi     # 0x1bfa8
callq 0x3330
jmp 0x7bd7
movl $0x0, -0x40(%rbp)
movl -0x40(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x7c22
movq -0x10(%rbp), %rax
movslq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
xorl %esi, %esi
callq 0x7cf0
jmp 0x7bfb
jmp 0x7bfd
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x7bde
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x30(%rbp), %rdi
callq 0xb890
jmp 0x7ce0
movl $0x0, -0x44(%rbp)
leaq 0x14730(%rip), %rdi     # 0x1c360
callq 0xb910
movl %eax, -0x48(%rbp)
movl -0x44(%rbp), %eax
cmpl -0x48(%rbp), %eax
jae 0x7cbd
movl -0x44(%rbp), %eax
movl %eax, %esi
leaq 0x14714(%rip), %rdi     # 0x1c360
callq 0xb930
cmpq $0x0, (%rax)
je 0x7cad
movl -0x44(%rbp), %eax
movl %eax, %esi
leaq 0x146fd(%rip), %rdi     # 0x1c360
callq 0xb930
movq (%rax), %rax
movq %rax, -0x90(%rbp)
cmpq $0x0, %rax
je 0x7c95
movq -0x90(%rbp), %rdi
callq 0xb3c0
movq -0x90(%rbp), %rdi
movl $0xe8, %esi
callq 0x3300
movl -0x44(%rbp), %eax
movl %eax, %esi
leaq 0x146bf(%rip), %rdi     # 0x1c360
callq 0xb930
movq $0x0, (%rax)
jmp 0x7caf
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x7c38
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x7e30
jmp 0x7ccb
leaq -0x30(%rbp), %rdi
callq 0x82e0
jmp 0x7cd6
movl $0x1, %edi
callq 0x3390
movq -0x38(%rbp), %rdi
callq 0x3580
nopl (%rax)