// File: /workspace/github_cpp_makefile_star2_O3/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 0x1b112(%rip), %rsi     # 0x6ba3d
movq %rdx, %rdi
callq 0xb110
testl %eax, %eax
je 0x5096c
leaq 0x1c72a(%rip), %rsi     # 0x6d068
movq %r13, %rdi
callq 0xb110
testl %eax, %eax
je 0x509e9
leaq 0x1c582(%rip), %rsi     # 0x6ced7
movq %r13, %rdi
callq 0xb110
testl %eax, %eax
je 0x50a43
xorl %eax, %eax
jmp 0x51022
leaq 0x158(%rbx), %r12
movq %r12, %rdi
callq 0xb7d0
leaq 0x8(%rsp), %r13
movq %r13, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x511a6
movq (%r13), %rdx
leaq 0x1bb03(%rip), %rsi     # 0x6c49c
leaq 0x70(%rsp), %rdi
xorl %eax, %eax
callq 0x2d46f
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x509c3
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb510
movq (%r15), %rsi
xorl %edi, %edi
xorl %edx, %edx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x1ab07
movq %rbx, %rdi
callq 0x2d55f
movq %r12, %rdi
callq 0xb3b0
jmp 0x51020
leaq 0x48(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x511a6
leaq 0x1b32d(%rip), %rcx     # 0x6bd30
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 0x50ee0
movq %rdx, 0x28(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x38(%rsp)
jmp 0x50ee7
leaq 0x3bb26(%rip), %r13     # 0x8c570
movq (%r13), %rdi
cmpq $0x0, 0x8(%rdi)
je 0x50bb2
addq $0x20, %rdi
callq 0xb7d0
movq (%r13), %rax
movq 0x8(%rax), %rdi
movq %rdi, 0x68(%rsp)
leaq 0x1a4e2(%rip), %rsi     # 0x6af58
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 0x1a4d3(%rip), %rsi     # 0x6af8b
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 0x1be38
movq (%r13), %rsi
movq 0x8(%r13), %rdx
movq 0x68(%rsp), %rdi
callq 0xb5f0
movq %rax, %r13
leaq 0x1c308(%rip), %rsi     # 0x6ce1c
movl $0x18, %edx
movq %rax, %rdi
callq 0xb5f0
leaq 0x1c54a(%rip), %rsi     # 0x6d072
movl $0x16, %edx
movq %r13, %rdi
callq 0xb5f0
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %r13, %rdi
callq 0xb5f0
movq %rax, %r13
leaq 0x1b885(%rip), %rsi     # 0x6c3d3
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 0x50b9f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb510
leaq 0x3b9ca(%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 0x1bd28
movq (%r14), %rsi
leaq 0x28(%rsp), %rdi
leaq 0x6(%rsp), %rdx
callq 0x1bd28
movq (%r15), %rsi
leaq 0x48(%rsp), %rdi
leaq 0x5(%rsp), %rdx
callq 0x1bd28
leaq 0x70(%rsp), %rdi
leaq 0x28(%rsp), %rsi
leaq 0x48(%rsp), %rdx
leaq 0x8(%rsp), %r8
movq %r12, %rcx
callq 0x5125e
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x50c36
movq 0x58(%rsp), %rsi
incq %rsi
callq 0xb510
leaq 0x38(%rsp), %r12
movq -0x10(%r12), %rdi
cmpq %r12, %rdi
je 0x50c52
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xb510
leaq 0x80(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x50c73
movq 0x80(%rsp), %rsi
incq %rsi
callq 0xb510
leaq 0x70(%rsp), %rdi
callq 0xb360
cmpb $0x1, 0x290(%rbx)
jne 0x50cba
leaq 0x80(%rsp), %rdi
leaq 0x1c3f4(%rip), %rax     # 0x6d089
leaq 0x1c3fe(%rip), %rsi     # 0x6d09a
cmpb $0x0, 0x291(%rbx)
cmovneq %rax, %rsi
movl $0x10, %eax
movl $0xa, %edx
cmovneq %rax, %rdx
callq 0xb5f0
cmpq $0x0, 0x298(%rbx)
jle 0x50d03
leaq 0x80(%rsp), %r15
leaq 0x1c3d2(%rip), %rsi     # 0x6d0a5
movl $0x6, %edx
movq %r15, %rdi
callq 0xb5f0
movq 0x298(%rbx), %rsi
movq %r15, %rdi
callq 0xb1d0
leaq 0x1c3e5(%rip), %rsi     # 0x6d0db
movl $0x2, %edx
movq %rax, %rdi
callq 0xb5f0
cmpb $0x1, 0x292(%rbx)
jne 0x50d25
leaq 0x80(%rsp), %rdi
leaq 0x1c391(%rip), %rsi     # 0x6d0ac
movl $0x31, %edx
callq 0xb5f0
leaq 0x80(%rsp), %r15
leaq 0x1affc(%rip), %rsi     # 0x6bd30
movl $0x3, %edx
movq %r15, %rdi
callq 0xb5f0
leaq 0x28(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x511a6
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq %r15, %rdi
callq 0xb5f0
movq %rax, %r14
leaq 0x1c36e(%rip), %rsi     # 0x6d0db
movl $0x2, %edx
movq %rax, %rdi
callq 0xb5f0
leaq 0x1c35d(%rip), %rsi     # 0x6d0de
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 0x1c336(%rip), %rsi     # 0x6d0e0
movl $0x7, %edx
movq %rax, %rdi
callq 0xb5f0
movzbl 0x293(%rbx), %eax
leaq 0x1c323(%rip), %rcx     # 0x6d0e8
leaq 0x1c32f(%rip), %rsi     # 0x6d0fb
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 0x50dfc
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xb510
cmpb $0x1, 0x292(%rbx)
jne 0x50e19
leaq 0x1c304(%rip), %rsi     # 0x6d110
movl $0x1e, %edx
movq %r15, %rdi
callq 0xb5f0
cmpq $0x0, 0x2a0(%rbx)
jle 0x50e5a
leaq 0x1c27b(%rip), %rsi     # 0x6d0a5
movl $0x6, %edx
movq %r15, %rdi
callq 0xb5f0
movq 0x2a0(%rbx), %rsi
movq %r15, %rdi
callq 0xb1d0
leaq 0x1c28e(%rip), %rsi     # 0x6d0db
movl $0x2, %edx
movq %rax, %rdi
callq 0xb5f0
cmpb $0x1, 0x290(%rbx)
jne 0x50e77
leaq 0x1c2c5(%rip), %rsi     # 0x6d12f
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 0x50eaa
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xb510
movq 0x3b0ff(%rip), %rsi     # 0x8bfb0
leaq 0x70(%rsp), %rdi
callq 0xb390
leaq 0xf0(%rsp), %rdi
callq 0xb180
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x51020
movq 0x18(%rsp), %rsi
jmp 0x51018
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 0x1c163(%rip), %rsi     # 0x6d06d
callq 0xba60
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x50f37
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x50f3f
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 0x50f94
movq %rdx, 0x70(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x80(%rsp)
jmp 0x50f9b
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 0x50fca
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb510
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x50fe1
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xb510
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x50ffc
movq 0x58(%rsp), %rsi
incq %rsi
callq 0xb510
movq 0x70(%rsp), %rdi
callq 0xb410
movq 0x70(%rsp), %rdi
cmpq %r15, %rdi
je 0x51020
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 0x5114a
jmp 0x51166
jmp 0x51166
jmp 0x510b2
movq %rax, %rbx
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x51068
movq 0x58(%rsp), %rsi
incq %rsi
callq 0xb510
jmp 0x51068
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x51088
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xb510
jmp 0x51088
movq %rax, %rbx
leaq 0x80(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x51187
movq 0x80(%rsp), %rsi
incq %rsi
callq 0xb510
jmp 0x51187
movq %rax, %rbx
jmp 0x51187
movq %rax, %rbx
movq 0x70(%rsp), %rdi
cmpq %r15, %rdi
je 0x5119e
movq 0x80(%rsp), %rsi
jmp 0x51196
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x510f7
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb510
jmp 0x510f7
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x51113
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xb510
jmp 0x51113
movq %rax, %rbx
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5119e
movq 0x58(%rsp), %rsi
jmp 0x51196
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
jmp 0x51143
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
jne 0x51191
jmp 0x5119e
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x51169
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xb510
jmp 0x51169
movq %rax, %rbx
movq 0x3ae40(%rip), %rsi     # 0x8bfb0
leaq 0x70(%rsp), %rdi
callq 0xb390
leaq 0xf0(%rsp), %rdi
callq 0xb180
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x5119e
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb510
movq %rbx, %rdi
callq 0xb9c0