// File: /workspace/github_cpp_makefile_star2_O3/brandoncanaday[P]1730sh/1730sh.cpp
// Function: jobs_builtin(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&)
int jobs_builtin(const vector<string> & args) {
  if(args.size() != 1) {
    cout << "1730sh: Usage: jobs" << endl;
  } else {
    cout << std::left << setw(8) << "JID" << setw(13) << "STATUS" << "COMMAND" << endl;
    for(unsigned int i = 0, s = current_jobs.size(); i < s; i++) {
      if(current_jobs[i] != nullptr) {
	pid_t JID = current_jobs[i]->getJID();
	string status = current_jobs[i]->getStatus();
	string command = current_jobs[i]->getShellInput();
	cout << std::left << setw(8) << JID << setw(13) << status << command << endl;
      } // if
    } // for
    return 0;
  } // if/else
  return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq 0x8(%rdi), %rax
subq (%rdi), %rax
movq 0x9146(%rip), %rbx      # 0x11fd0
cmpq $0x20, %rax
jne 0x906b
movq (%rbx), %rax
movq -0x18(%rax), %rcx
movl $0xffffff4f, %esi       # imm = 0xFFFFFF4F
movl 0x18(%rbx,%rcx), %edx
andl %esi, %edx
orl $0x20, %edx
movl %edx, 0x18(%rbx,%rcx)
movq -0x18(%rax), %rax
movq $0x8, 0x10(%rbx,%rax)
leaq 0x5ac0(%rip), %rsi      # 0xe981
movl $0x3, %edx
movq %rbx, %rdi
callq 0x3300
movq (%rbx), %rax
movq -0x18(%rax), %rax
movq $0xd, 0x10(%rbx,%rax)
leaq 0x5ab4(%rip), %rsi      # 0xe999
movl $0x6, %edx
movq %rbx, %rdi
callq 0x3300
leaq 0x559b(%rip), %rsi      # 0xe494
movl $0x7, %edx
movq %rbx, %rdi
callq 0x3300
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31b0
movq 0x93e4(%rip), %rax      # 0x12318
subq 0x93d5(%rip), %rax      # 0x12310
shrq $0x3, %rax
testl %eax, %eax
je 0x9067
movl %eax, %r14d
xorl %r13d, %r13d
leaq -0x48(%rbp), %r15
movq 0x93b8(%rip), %rax      # 0x12310
movq (%rax,%r13,8), %rax
testq %rax, %rax
je 0x905b
movl (%rax), %r12d
movq 0x8(%rax), %rsi
leaq -0x68(%rbp), %rdi
movq %r15, %rdx
callq 0x3110
movq 0x9391(%rip), %rax      # 0x12310
movq (%rax,%r13,8), %rax
leaq -0x38(%rbp), %rcx
movq %rcx, -0x48(%rbp)
movq 0x10(%rax), %rsi
movq 0x18(%rax), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x9f52
movq (%rbx), %rax
movq -0x18(%rax), %rcx
movl 0x18(%rbx,%rcx), %edx
movl $0xffffff4f, %esi       # imm = 0xFFFFFF4F
andl %esi, %edx
orl $0x20, %edx
movl %edx, 0x18(%rbx,%rcx)
movq -0x18(%rax), %rax
movq $0x8, 0x10(%rbx,%rax)
movq %rbx, %rdi
movl %r12d, %esi
callq 0x3510
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0xd, 0x10(%rax,%rcx)
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
movq %rax, %rdi
callq 0x3300
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq %rax, %rdi
callq 0x3300
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %r12, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31b0
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x9042
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x32c0
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x905b
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x32c0
incq %r13
cmpq %r13, %r14
jne 0x8f51
xorl %eax, %eax
jmp 0x90ab
leaq 0x5913(%rip), %rsi      # 0xe985
movl $0x13, %edx
movq %rbx, %rdi
callq 0x3300
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3290
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31b0
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x90db
movq %rax, %rbx
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x90db
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x32c0
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x90f4
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x32c0
movq %rbx, %rdi
callq 0x3530