// File: /workspace/github_cpp_makefile_star2_O1/mh0fm4[P]SCDC/src/components/dataprov/dataprov_jobrun.cc
// Function: scdc_dataprov_jobrun_system::job_do_run(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::vector<scdc_dataprov_jobrun_res_proc_t, std::allocator<scdc_dataprov_jobrun_res_proc_t>> const&)
bool scdc_dataprov_jobrun_system::job_do_run(const std::string &jobid, const std::string &cmd, const std::string &params, const scdc_dataprov_jobrun_res_t &res)
{
  SCDC_TRACE(__func__ << ": jobid: '" << jobid << ", cmd: '" << cmd << "', params: '" << params << "', res: " << res.size());

  bool ret = true;

  if (cmd == "scdc")
  {
    SCDC_TRACE(__func__ << ": scdc '" << params << "'");

    scdc_dataset_input_t *get_input = NULL;
    scdc_dataset_output_t get_output_, *get_output = &get_output_;

#if LOCK_LIBSCDC
    pthread_mutex_lock(&libscdc_lock);
#endif
    get_output = scdc_dataset_output_create(get_output, "fs", get_workdir(jobid).c_str());
    scdc_dataset_cmd(SCDC_DATASET_NULL, params.c_str(), get_input, get_output);
    scdc_dataset_output_destroy(get_output);
#if LOCK_LIBSCDC
    pthread_mutex_unlock(&libscdc_lock);
#endif

  } else if (cmd == "exec")
  {
    SCDC_TRACE(__func__ << ": exec '" << params << "'");

    string execmd = "cd " + get_workdir(jobid) + " && " + params;

    SCDC_TRACE(__func__ << ": execmd: '" << execmd << "'");

    system(execmd.c_str());

  } else if (cmd == "run")
  {
    SCDC_TRACE(__func__ << ": running '" << params << "'");
    SCDC_INFO("executing run of job '" << jobid << "'");

    string c;

    build_cmd(jobcmd.c_str(), "run", jobid.c_str(), params.c_str(), res, c);

    stringstream ss;
    if (xterm) ss << (xterm_hold?"xterm -hold -e \"":"xterm -e \"");
    if (sleep_before_run > 0) ss << "sleep " << sleep_before_run << "; ";
    if (Xvfb) ss << "Xvfb :77 2>/dev/null & XVFB_PID=$!; DISPLAY=:77; ";
    ss << "cd " << get_workdir(jobid) << "; "
       << "(" << c << ") 2>&1 "
       << (show_output?"| tee run.output; ":"| cat > run.output; ");
    if (Xvfb) ss << "kill ${XVFB_PID} 2>/dev/null; ";
    if (sleep_after_run > 0) ss << "sleep " << sleep_after_run << "; ";
    if (xterm) ss << "exit; \"";

    SCDC_TRACE(__func__ << ": executing '" << ss.str() << "'");
#if USE_SYSTEM_PID
    pid_t pid = system_pid(ss.str().c_str());
    waitpid(pid, NULL, 0);
#else
    system(ss.str().c_str());
#endif

  } else ret = false;

  return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1f8, %rsp            # imm = 0x1F8
movq %r8, %r12
movq %rcx, %r15
movq %rdx, %r13
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x1ac8a(%rip), %rsi     # 0x6ba1d
movq %rdx, %rdi
callq 0xb110
testl %eax, %eax
je 0x50dd4
leaq 0x1c252(%rip), %rsi     # 0x6cff8
movq %r13, %rdi
callq 0xb110
testl %eax, %eax
je 0x50e51
leaq 0x1c0aa(%rip), %rsi     # 0x6ce67
movq %r13, %rdi
callq 0xb110
testl %eax, %eax
je 0x50eab
xorl %eax, %eax
jmp 0x5148a
leaq 0x158(%rbx), %r12
movq %r12, %rdi
callq 0xb7d0
leaq 0x8(%rsp), %r13
movq %r13, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x5160e
movq (%r13), %rdx
leaq 0x1b623(%rip), %rsi     # 0x6c424
leaq 0x70(%rsp), %rdi
xorl %eax, %eax
callq 0x2d6d3
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x50e2b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb510
movq (%r15), %rsi
xorl %edi, %edi
xorl %edx, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x1aba8
movq %rbx, %rdi
callq 0x2d7c3
movq %r12, %rdi
callq 0xb3b0
jmp 0x51488
leaq 0x48(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x5160e
leaq 0x1ae4d(%rip), %rcx     # 0x6bcb8
movl $0x3, %r8d
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0xb5d0
leaq 0x38(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x51348
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x5134f
leaq 0x3b6be(%rip), %r13     # 0x8c570
movq (%r13), %rdi
cmpq $0x0, 0x8(%rdi)
je 0x5101a
addq $0x20, %rdi
callq 0xb7d0
movq (%r13), %rax
movq 0x8(%rax), %rdi
movq %rdi, 0x68(%rsp)
leaq 0x1a05a(%rip), %rsi     # 0x6af38
movl $0xb, %edx
callq 0xb5f0
xorl %edi, %edi
callq 0xb4a0
leaq 0x28(%rsp), %rdi
movq %rax, (%rdi)
callq 0xb3a0
movl 0xc(%rax), %edx
movl 0x10(%rax), %ecx
movl $0x76c, %r8d            # imm = 0x76C
addl 0x14(%rax), %r8d
incl %ecx
movl 0x8(%rax), %r9d
movl (%rax), %r10d
movl 0x4(%rax), %r11d
leaq 0x1a04b(%rip), %rsi     # 0x6af6b
leaq 0x70(%rsp), %rbp
movq %rbp, %rdi
xorl %eax, %eax
pushq %r10
pushq %r11
callq 0xb0d0
addq $0x10, %rsp
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
movq %rbp, %rdi
callq 0xb200
leaq (%rsp,%rax), %rdx
addq $0x70, %rdx
leaq 0x8(%rsp), %r13
movq %r13, %rdi
movq %rbp, %rsi
callq 0x1bee6
movq (%r13), %rsi
movq 0x8(%r13), %rdx
movq 0x68(%rsp), %rdi
callq 0xb5f0
movq %rax, %r13
leaq 0x1be30(%rip), %rsi     # 0x6cdac
movl $0x18, %edx
movq %rax, %rdi
callq 0xb5f0
leaq 0x1c072(%rip), %rsi     # 0x6d002
movl $0x16, %edx
movq %r13, %rdi
callq 0xb5f0
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %r13, %rdi
callq 0xb5f0
movq %rax, %r13
leaq 0x1b3a5(%rip), %rsi     # 0x6c35b
movl $0x1, %edx
movq %rax, %rdi
callq 0xb5f0
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0xb4d0
movsbl %al, %esi
movq %r13, %rdi
callq 0xb050
movq %rax, %rdi
callq 0xb340
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x51007
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb510
leaq 0x3b562(%rip), %rax     # 0x8c570
movq (%rax), %rdi
addq $0x20, %rdi
callq 0xb3b0
leaq 0x18(%rsp), %r13
movq %r13, -0x10(%r13)
movq $0x0, -0x8(%r13)
movb $0x0, (%r13)
movq 0x68(%rbx), %rsi
leaq 0x70(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x1bdd6
movq (%r14), %rsi
leaq 0x28(%rsp), %rdi
leaq 0x6(%rsp), %rdx
callq 0x1bdd6
movq (%r15), %rsi
leaq 0x48(%rsp), %rdi
leaq 0x5(%rsp), %rdx
callq 0x1bdd6
leaq 0x70(%rsp), %rdi
leaq 0x28(%rsp), %rsi
leaq 0x48(%rsp), %rdx
leaq 0x8(%rsp), %r8
movq %r12, %rcx
callq 0x516c6
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5109e
movq 0x58(%rsp), %rsi
incq %rsi
callq 0xb510
leaq 0x38(%rsp), %r12
movq -0x10(%r12), %rdi
cmpq %r12, %rdi
je 0x510ba
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xb510
leaq 0x80(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x510db
movq 0x80(%rsp), %rsi
incq %rsi
callq 0xb510
leaq 0x70(%rsp), %rdi
callq 0xb360
cmpb $0x1, 0x290(%rbx)
jne 0x51122
leaq 0x80(%rsp), %rdi
leaq 0x1bf1c(%rip), %rax     # 0x6d019
leaq 0x1bf26(%rip), %rsi     # 0x6d02a
cmpb $0x0, 0x291(%rbx)
cmovneq %rax, %rsi
movl $0x10, %eax
movl $0xa, %edx
cmovneq %rax, %rdx
callq 0xb5f0
cmpq $0x0, 0x298(%rbx)
jle 0x5116b
leaq 0x80(%rsp), %r15
leaq 0x1befa(%rip), %rsi     # 0x6d035
movl $0x6, %edx
movq %r15, %rdi
callq 0xb5f0
movq 0x298(%rbx), %rsi
movq %r15, %rdi
callq 0xb1d0
leaq 0x1bf0d(%rip), %rsi     # 0x6d06b
movl $0x2, %edx
movq %rax, %rdi
callq 0xb5f0
cmpb $0x1, 0x292(%rbx)
jne 0x5118d
leaq 0x80(%rsp), %rdi
leaq 0x1beb9(%rip), %rsi     # 0x6d03c
movl $0x31, %edx
callq 0xb5f0
leaq 0x80(%rsp), %r15
leaq 0x1ab1c(%rip), %rsi     # 0x6bcb8
movl $0x3, %edx
movq %r15, %rdi
callq 0xb5f0
leaq 0x28(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x5160e
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq %r15, %rdi
callq 0xb5f0
movq %rax, %r14
leaq 0x1be96(%rip), %rsi     # 0x6d06b
movl $0x2, %edx
movq %rax, %rdi
callq 0xb5f0
leaq 0x1be85(%rip), %rsi     # 0x6d06e
movl $0x1, %edx
movq %r14, %rdi
callq 0xb5f0
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %r14, %rdi
callq 0xb5f0
movq %rax, %r14
leaq 0x1be5e(%rip), %rsi     # 0x6d070
movl $0x7, %edx
movq %rax, %rdi
callq 0xb5f0
movzbl 0x293(%rbx), %eax
leaq 0x1be4b(%rip), %rcx     # 0x6d078
leaq 0x1be57(%rip), %rsi     # 0x6d08b
testl %eax, %eax
cmovneq %rcx, %rsi
xorl $0x1, %eax
leaq 0x12(,%rax,2), %rdx
movq %r14, %rdi
callq 0xb5f0
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x51264
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xb510
cmpb $0x1, 0x292(%rbx)
jne 0x51281
leaq 0x1be2c(%rip), %rsi     # 0x6d0a0
movl $0x1e, %edx
movq %r15, %rdi
callq 0xb5f0
cmpq $0x0, 0x2a0(%rbx)
jle 0x512c2
leaq 0x1bda3(%rip), %rsi     # 0x6d035
movl $0x6, %edx
movq %r15, %rdi
callq 0xb5f0
movq 0x2a0(%rbx), %rsi
movq %r15, %rdi
callq 0xb1d0
leaq 0x1bdb6(%rip), %rsi     # 0x6d06b
movl $0x2, %edx
movq %rax, %rdi
callq 0xb5f0
cmpb $0x1, 0x290(%rbx)
jne 0x512df
leaq 0x1bded(%rip), %rsi     # 0x6d0bf
movl $0x7, %edx
movq %r15, %rdi
callq 0xb5f0
leaq 0x88(%rsp), %rsi
leaq 0x28(%rsp), %rdi
callq 0xb8c0
movq 0x28(%rsp), %rdi
callq 0xb410
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x51312
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xb510
movq 0x3ac97(%rip), %rsi     # 0x8bfb0
leaq 0x70(%rsp), %rdi
callq 0xb390
leaq 0xf0(%rsp), %rdi
callq 0xb180
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x51488
movq 0x18(%rsp), %rsi
jmp 0x51480
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
leaq 0x28(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x1bc8b(%rip), %rsi     # 0x6cffd
callq 0xba60
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x5139f
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x513a7
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
leaq 0x8(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
callq 0xb150
leaq 0x80(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x513fc
movq %rdx, 0x70(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x80(%rsp)
jmp 0x51403
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
movq %rdx, 0x78(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x51432
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb510
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x51449
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xb510
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x51464
movq 0x58(%rsp), %rsi
incq %rsi
callq 0xb510
movq 0x70(%rsp), %rdi
callq 0xb410
movq 0x70(%rsp), %rdi
cmpq %r15, %rdi
je 0x51488
movq 0x80(%rsp), %rsi
incq %rsi
callq 0xb510
movb $0x1, %al
addq $0x1f8, %rsp            # imm = 0x1F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x515b2
jmp 0x515ce
jmp 0x515ce
jmp 0x5151a
movq %rax, %rbx
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x514d0
movq 0x58(%rsp), %rsi
incq %rsi
callq 0xb510
jmp 0x514d0
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x514f0
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xb510
jmp 0x514f0
movq %rax, %rbx
leaq 0x80(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x515ef
movq 0x80(%rsp), %rsi
incq %rsi
callq 0xb510
jmp 0x515ef
movq %rax, %rbx
jmp 0x515ef
movq %rax, %rbx
movq 0x70(%rsp), %rdi
cmpq %r15, %rdi
je 0x51606
movq 0x80(%rsp), %rsi
jmp 0x515fe
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x5155f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb510
jmp 0x5155f
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x5157b
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xb510
jmp 0x5157b
movq %rax, %rbx
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x51606
movq 0x58(%rsp), %rsi
jmp 0x515fe
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
jmp 0x515ab
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
jne 0x515f9
jmp 0x51606
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x515d1
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xb510
jmp 0x515d1
movq %rax, %rbx
movq 0x3a9d8(%rip), %rsi     # 0x8bfb0
leaq 0x70(%rsp), %rdi
callq 0xb390
leaq 0xf0(%rsp), %rdi
callq 0xb180
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x51606
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb510
movq %rbx, %rdi
callq 0xb9c0