// File: /workspace/github_cpp_makefile_star2_O1/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 0x85a3
movq 0x28(%rax), %rcx
testl %ecx, %ecx
jle 0x84fa
movq 0x20(%rax), %rdx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
xorl %esi, %esi
movsbl (%rdx,%rsi), %edi
addl $-0x30, %edi
cmpl $0xa, %edi
jae 0x85b8
incq %rsi
cmpq %rsi, %rcx
jne 0x84e2
movq 0x20(%rax), %rbx
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 0x861f
movslq %eax, %rcx
cmpq %rax, %rcx
jne 0x862b
movl (%r14), %ecx
cmpl $0x22, %ecx
je 0x862b
testl %ecx, %ecx
jne 0x854b
movl %r12d, (%r14)
movq 0x9dc6(%rip), %rdx      # 0x12318
movq 0x9db7(%rip), %rcx      # 0x12310
subq %rcx, %rdx
shrq $0x3, %rdx
testl %edx, %edx
setne %bl
je 0x85fa
movl %edx, %edx
movq %rdx, %rsi
negq %rsi
movl $0x1, %r8d
movq -0x8(%rcx,%r8,8), %rdi
testq %rdi, %rdi
je 0x858b
cmpl %eax, (%rdi)
je 0x860c
cmpq %rdx, %r8
setb %bl
leaq (%rsi,%r8), %rdi
incq %rdi
incq %r8
cmpq $0x1, %rdi
jne 0x8579
jmp 0x85fa
movq 0x9a26(%rip), %rbx      # 0x11fd0
leaq 0x63a6(%rip), %rsi      # 0xe957
movl $0x15, %edx
jmp 0x85cb
movq 0x9a11(%rip), %rbx      # 0x11fd0
leaq 0x63a7(%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, %eax       # imm = 0xFFFFFFFF
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, %esi
callq 0x6e49
xorl %eax, %eax
testb $0x1, %bl
je 0x85fa
jmp 0x85ff
leaq 0x6435(%rip), %rdi      # 0xea5b
callq 0x3190
leaq 0x6429(%rip), %rdi      # 0xea5b
callq 0x33f0
movq %rax, %rbx
jmp 0x8648
movq %rax, %rbx
cmpl $0x0, (%r14)
jne 0x8648
movl %r12d, (%r14)
cmpl $0x2, %edx
jne 0x86a9
movq %rbx, %rdi
callq 0x3360
leaq -0x30(%rbp), %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0x34e0
movq 0x9955(%rip), %rax      # 0x11fc0
addq $0x10, %rax
movq %rax, (%r14)
movq %rbx, %rdi
callq 0x3120
movq 0x994f(%rip), %rdi      # 0x11fd0
leaq 0x62e5(%rip), %rsi      # 0xe96d
movl $0x17, %edx
callq 0x3300
movq 0x9937(%rip), %rdi      # 0x11fd0
callq 0x3140
leaq -0x30(%rbp), %rdi
callq 0x34d0
jmp 0x870c
cmpl $0x1, %edx
jne 0x873a
movq %rbx, %rdi
callq 0x3360
leaq -0x30(%rbp), %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0x34e0
movq 0x98f8(%rip), %rax      # 0x11fc8
addq $0x10, %rax
movq %rax, (%r14)
movq %rbx, %rdi
callq 0x3120
movq 0x98ea(%rip), %rdi      # 0x11fd0
leaq 0x6280(%rip), %rsi      # 0xe96d
movl $0x17, %edx
callq 0x3300
movq 0x98d2(%rip), %rdi      # 0x11fd0
callq 0x3140
leaq -0x30(%rbp), %rdi
callq 0x33e0
callq 0x34a0
jmp 0x85fa
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x33e0
callq 0x34a0
jmp 0x873a
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x34d0
callq 0x34a0
movq %rbx, %rdi
callq 0x3530
movq %rax, %rdi
callq 0x9dcc