// File: 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
subq $0x100, %rsp            # imm = 0x100
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0xb7a0
cmpq $0x1, %rax
je 0xa155
movq 0x11e93(%rip), %rdi     # 0x1bfc8
leaq 0xb849(%rip), %rsi      # 0x15985
callq 0x32e0
movq %rax, %rdi
movq 0x11e5d(%rip), %rsi     # 0x1bfa8
callq 0x3330
jmp 0xa42f
movq 0x11e6c(%rip), %rdi     # 0x1bfc8
leaq 0x1a8d(%rip), %rsi      # 0xbbf0
callq 0x30f0
movq %rax, -0x98(%rbp)
movl $0x8, %edi
callq 0xbc20
movq -0x98(%rbp), %rdi
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %esi
callq 0x3360
movq %rax, %rdi
leaq 0xb7ec(%rip), %rsi      # 0x15981
callq 0x32e0
movq %rax, -0x90(%rbp)
movl $0xd, %edi
callq 0xbc20
movq -0x90(%rbp), %rdi
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %esi
callq 0x3360
movq %rax, %rdi
leaq 0xb7d2(%rip), %rsi      # 0x15999
callq 0x32e0
movq %rax, %rdi
leaq 0xb2be(%rip), %rsi      # 0x15494
callq 0x32e0
movq %rax, %rdi
movq 0x11dc3(%rip), %rsi     # 0x1bfa8
callq 0x3330
movl $0x0, -0x1c(%rbp)
leaq 0x12168(%rip), %rdi     # 0x1c360
callq 0xb910
movl %eax, -0x20(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x20(%rbp), %eax
jae 0xa426
movl -0x1c(%rbp), %eax
movl %eax, %esi
leaq 0x12148(%rip), %rdi     # 0x1c360
callq 0xb930
cmpq $0x0, (%rax)
je 0xa416
movl -0x1c(%rbp), %eax
movl %eax, %esi
leaq 0x1212d(%rip), %rdi     # 0x1c360
movq %rdi, -0xb0(%rbp)
callq 0xb930
movq (%rax), %rdi
callq 0xb500
movq -0xb0(%rbp), %rdi
movl %eax, -0x24(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, %esi
callq 0xb930
movq (%rax), %rdi
callq 0xbc40
movq %rax, -0xa8(%rbp)
leaq -0x49(%rbp), %rdi
movq %rdi, -0xa0(%rbp)
callq 0x3590
movq -0xa8(%rbp), %rsi
movq -0xa0(%rbp), %rdx
leaq -0x48(%rbp), %rdi
callq 0x3440
jmp 0xa293
leaq -0x49(%rbp), %rdi
callq 0x3340
movl -0x1c(%rbp), %eax
movl %eax, %esi
leaq 0x120b8(%rip), %rdi     # 0x1c360
callq 0xb930
movq (%rax), %rdi
callq 0xbaa0
movq %rax, -0xb8(%rbp)
jmp 0xa2be
movq -0xb8(%rbp), %rsi
leaq -0x80(%rbp), %rdi
callq 0x3140
jmp 0xa2d0
movq 0x11cf1(%rip), %rdi     # 0x1bfc8
leaq 0x1912(%rip), %rsi      # 0xbbf0
callq 0x30f0
movq %rax, -0xc0(%rbp)
jmp 0xa2ec
movl $0x8, %edi
callq 0xbc20
movl %eax, -0xc4(%rbp)
jmp 0xa2fe
movq -0xc0(%rbp), %rdi
movl -0xc4(%rbp), %eax
movl %eax, -0x84(%rbp)
movl -0x84(%rbp), %esi
callq 0x3360
movq %rax, -0xd0(%rbp)
jmp 0xa325
movq -0xd0(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x3570
movq %rax, -0xd8(%rbp)
jmp 0xa33d
movl $0xd, %edi
callq 0xbc20
movl %eax, -0xdc(%rbp)
jmp 0xa34f
movq -0xd8(%rbp), %rdi
movl -0xdc(%rbp), %eax
movl %eax, -0x88(%rbp)
movl -0x88(%rbp), %esi
callq 0x3360
movq %rax, -0xe8(%rbp)
jmp 0xa376
movq -0xe8(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x32a0
movq %rax, -0xf0(%rbp)
jmp 0xa38f
movq -0xf0(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x32a0
movq %rax, -0xf8(%rbp)
jmp 0xa3a8
movq -0xf8(%rbp), %rdi
movq 0x11bf2(%rip), %rsi     # 0x1bfa8
callq 0x3330
jmp 0xa3bd
leaq -0x80(%rbp), %rdi
callq 0x31e0
leaq -0x48(%rbp), %rdi
callq 0x31e0
jmp 0xa416
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x49(%rbp), %rdi
callq 0x3340
jmp 0xa442
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0xa40b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x31e0
leaq -0x48(%rbp), %rdi
callq 0x31e0
jmp 0xa442
jmp 0xa418
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xa200
movl $0x0, -0x4(%rbp)
jmp 0xa436
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
movq -0x58(%rbp), %rdi
callq 0x3580
nopl (%rax,%rax)