// File: /workspace/github_cpp_makefile_star2_O3/brandoncanaday[P]1730sh/1730sh.cpp
// Function: bg_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 bg_builtin(const vector<string> & args) {
  if(args.size() != 2) {
    cout << "1730sh: Usage: bg JID" << endl;
  } else {
    pid_t JID;
    bool isNumber = true;
    for(int i = 0, size = args[1].size(); i < size; i++) {
      if(!isdigit(args[1][i])) { // if (number[i] > '9' || number[i] < '0')
	isNumber = false;
	break;
      } // if
    } // for
    if(isNumber) {
      try {
	JID = stoi(args[1],0,10);
	for(unsigned int i = 0, s = current_jobs.size(); i < s; i++) {
	  if(current_jobs[i] != nullptr) {
	    if(current_jobs[i]->getJID() == JID) {
	      put_job_in_background(current_jobs[i],true);
	      return 0;
	    } // if
	  } // if
	} // for	
      } catch(invalid_argument invalidargument) {
	cout << "1730sh: bg: Invalid JID" << endl;
      } catch(out_of_range outofrange) {
	cout << "1730sh: bg: Invalid JID" << endl;
      } // try/catch
    } else {
      cout << "1730sh: bg: Invalid JID" << endl;
    } // if/else
  } // if/else
  return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq (%rdi), %rax
movq 0x8(%rdi), %rcx
subq %rax, %rcx
cmpq $0x40, %rcx
jne 0x8595
movq 0x20(%rax), %rbx
movq 0x28(%rax), %rax
testl %eax, %eax
jle 0x850f
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
xorl %ecx, %ecx
movsbl (%rbx,%rcx), %edx
addl $-0x30, %edx
cmpl $0xa, %edx
jae 0x85aa
incq %rcx
cmpq %rcx, %rax
jne 0x84f7
callq 0x3060
movq %rax, %r14
movl (%rax), %r12d
movl $0x0, (%rax)
leaq -0x30(%rbp), %r15
movq %rbx, %rdi
movq %r15, %rsi
movl $0xa, %edx
callq 0x33b0
cmpq %rbx, (%r15)
je 0x860e
movslq %eax, %rcx
cmpq %rax, %rcx
jne 0x861a
movl (%r14), %ecx
cmpl $0x22, %ecx
je 0x861a
testl %ecx, %ecx
jne 0x855c
movl %r12d, (%r14)
movq 0x9db5(%rip), %rdx      # 0x12318
movq 0x9da6(%rip), %rcx      # 0x12310
subq %rcx, %rdx
shrq $0x3, %rdx
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %edx, %edx
je 0x85f1
movl %edx, %edx
xorl %esi, %esi
movq (%rcx,%rsi,8), %rdi
testq %rdi, %rdi
je 0x858b
cmpl %eax, (%rdi)
je 0x8600
incq %rsi
cmpq %rsi, %rdx
jne 0x857e
jmp 0x85f1
movq 0x9a34(%rip), %rbx      # 0x11fd0
leaq 0x63b4(%rip), %rsi      # 0xe957
movl $0x15, %edx
jmp 0x85bd
movq 0x9a1f(%rip), %rbx      # 0x11fd0
leaq 0x63b5(%rip), %rsi      # 0xe96d
movl $0x17, %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, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
xorl %ebx, %ebx
movl $0x1, %esi
callq 0x6e4c
jmp 0x85f1
leaq 0x6446(%rip), %rdi      # 0xea5b
callq 0x3190
leaq 0x643a(%rip), %rdi      # 0xea5b
callq 0x33f0
movq %rax, %rbx
jmp 0x8637
movq %rax, %rbx
cmpl $0x0, (%r14)
jne 0x8637
movl %r12d, (%r14)
cmpl $0x2, %edx
jne 0x8698
movq %rbx, %rdi
callq 0x3360
leaq -0x30(%rbp), %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0x34e0
movq 0x9966(%rip), %rax      # 0x11fc0
addq $0x10, %rax
movq %rax, (%r14)
movq %rbx, %rdi
callq 0x3120
movq 0x9960(%rip), %rdi      # 0x11fd0
leaq 0x62f6(%rip), %rsi      # 0xe96d
movl $0x17, %edx
callq 0x3300
movq 0x9948(%rip), %rdi      # 0x11fd0
callq 0x3140
leaq -0x30(%rbp), %rdi
callq 0x34d0
jmp 0x86fb
cmpl $0x1, %edx
jne 0x8729
movq %rbx, %rdi
callq 0x3360
leaq -0x30(%rbp), %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0x34e0
movq 0x9909(%rip), %rax      # 0x11fc8
addq $0x10, %rax
movq %rax, (%r14)
movq %rbx, %rdi
callq 0x3120
movq 0x98fb(%rip), %rdi      # 0x11fd0
leaq 0x6291(%rip), %rsi      # 0xe96d
movl $0x17, %edx
callq 0x3300
movq 0x98e3(%rip), %rdi      # 0x11fd0
callq 0x3140
leaq -0x30(%rbp), %rdi
callq 0x33e0
callq 0x34a0
jmp 0x85ec
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x33e0
callq 0x34a0
jmp 0x8729
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x34d0
callq 0x34a0
movq %rbx, %rdi
callq 0x3530
movq %rax, %rdi
callq 0x9d7a