// File: /workspace/github_cpp_makefile_star2_O3/mh0fm4[P]SCDC/src/components/dataprov/dataprov_jobrun.cc
// Function: scdc_dataprov_jobrun::job_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::vector<scdc_dataprov_jobrun_res_proc_t, std::allocator<scdc_dataprov_jobrun_res_proc_t>> const&)
bool scdc_dataprov_jobrun::job_run(const std::string &jobid, const std::string &jobcmds, const scdc_dataprov_jobrun_res_t &res)
{
  SCDC_TRACE(__func__ << ": jobid: '" << jobid << "', jobcmds: '" << jobcmds << "', res: " << res.size());

  bool ret = true;

  bool record = false;
  string record_jobcmds;

  stringlist cmds(';', jobcmds);
  string s;
  while (cmds.front_pop(s))
  {
    SCDC_TRACE(__func__ << ": cmd: '" << s << "'");

    stringlist cmd(' ', s);
    string c = cmd.front_pop();
    string p = cmd.conflate();

    if (c == "jobbegin")
    {
      SCDC_TRACE(__func__ << ": begin");

      if (!record) record = true;

    } else if (c == "jobend")
    {
      SCDC_TRACE(__func__ << ": end");

      if (record)
      {
        record = false;

        scdc_dataprov_jobrun_job_t job;

        pthread_mutex_lock(&sched_lock);
        get_job(jobid, job);
        job.jobcmds = record_jobcmds;
        set_job(jobid, job);
        pthread_mutex_unlock(&sched_lock);

        job_schedule(jobid);
      }

    } else if (record)
    {
      SCDC_TRACE(__func__ << ": record: '" << s << "'");

      record_jobcmds += s + ";";

    } else if (c == "jobwait")
    {
      SCDC_TRACE(__func__ << ": wait");

      job_wait_finished(jobid);

    } else
    {
      SCDC_TRACE(__func__ << ": run:");

      ret = job_do_run(jobid, c, p, res);

      SCDC_TRACE(__func__ << ": run: " << ret);
    }
  }

  return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movq %rcx, 0xd0(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdi, 0x10(%rsp)
leaq 0x50(%rsp), %r12
movq %r12, -0x10(%r12)
movq $0x0, -0x8(%r12)
movb $0x0, (%r12)
leaq 0x148(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq (%rdx), %rsi
movq 0x8(%rdx), %rdx
addq %rsi, %rdx
leaq 0x138(%rsp), %rdi
callq 0x1d0a0
leaq 0x158(%rsp), %rdi
leaq 0x138(%rsp), %rdx
movl $0x3b, %esi
callq 0x37a30
movq 0x138(%rsp), %rdi
cmpq %rbx, %rdi
je 0x4f1e5
movq 0x148(%rsp), %rsi
incq %rsi
callq 0xb510
leaq 0x30(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x128(%rsp), %rbx
movq 0x10(%rsp), %rax
addq $0x190, %rax            # imm = 0x190
movq %rax, 0xc8(%rsp)
movb $0x1, 0xf(%rsp)
leaq 0x118(%rsp), %r13
leaq 0x180(%rsp), %rbp
leaq 0xf8(%rsp), %r14
xorl %r12d, %r12d
leaq 0x158(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x1bb16
testb %al, %al
je 0x4f525
movq %rbx, 0x118(%rsp)
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0x1d0a0
movq %rbp, %rdi
movl $0x20, %esi
movq %r13, %rdx
callq 0x37a30
movq 0x118(%rsp), %rdi
cmpq %rbx, %rdi
je 0x4f298
movq 0x128(%rsp), %rsi
incq %rsi
callq 0xb510
movq %r14, %rdi
movq %rbp, %rsi
callq 0x1b878
movl 0x198(%rsp), %edx
leaq 0xd8(%rsp), %rdi
movq %rbp, %rsi
callq 0x1f068
movq %r14, %rdi
leaq 0x1db07(%rip), %rsi     # 0x6cdcb
callq 0xb110
testl %eax, %eax
je 0x4f35e
movq %r14, %rdi
leaq 0x1daf9(%rip), %rsi     # 0x6cdd4
callq 0xb110
testl %eax, %eax
je 0x4f374
testb $0x1, %r12b
je 0x4f483
leaq 0x70(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
addq %rsi, %rdx
leaq 0x60(%rsp), %r15
movq %r15, %rdi
callq 0x1d0a0
movq %r15, %rdi
leaq 0x1dabb(%rip), %rsi     # 0x6cddb
callq 0xba60
movq 0x60(%rsp), %rsi
movq 0x68(%rsp), %rdx
leaq 0x40(%rsp), %rdi
callq 0xb150
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x4f4ce
movq 0x70(%rsp), %rsi
incq %rsi
callq 0xb510
jmp 0x4f4ce
testb $0x1, %r12b
movzbl %r12b, %r12d
movl $0x1, %eax
cmovel %eax, %r12d
jmp 0x4f4ce
testb $0x1, %r12b
je 0x4f4ce
xorps %xmm0, %xmm0
movaps %xmm0, 0x70(%rsp)
movaps %xmm0, 0x60(%rsp)
leaq 0x90(%rsp), %rax
movq %rax, 0x80(%rsp)
xorl %ecx, %ecx
movq %rcx, 0x88(%rsp)
movb %cl, 0x90(%rsp)
leaq 0xb0(%rsp), %rax
movq %rax, 0xa0(%rsp)
movq %rcx, 0xa8(%rsp)
movb %cl, 0xb0(%rsp)
movb $0x1, 0xc0(%rsp)
movq 0xc8(%rsp), %r12
movq %r12, %rdi
callq 0xb7d0
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
leaq 0x60(%rsp), %rdx
callq 0x4edce
leaq 0xa0(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0xb2c0
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
leaq 0x60(%rsp), %rdx
callq 0x4ecbe
movq %r12, %rdi
callq 0xb3b0
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x4f6c2
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x4f459
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0xb510
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x4f47e
movq 0x90(%rsp), %rsi
incq %rsi
callq 0xb510
xorl %r12d, %r12d
jmp 0x4f4ce
movq %r14, %rdi
leaq 0x1d950(%rip), %rsi     # 0x6cddd
callq 0xb110
testl %eax, %eax
je 0x4f4bf
movq 0x10(%rsp), %rdi
movq (%rdi), %rax
movq 0x18(%rsp), %rsi
movq %r14, %rdx
leaq 0xd8(%rsp), %rcx
movq 0xd0(%rsp), %r8
callq *0x70(%rax)
movb %al, 0xf(%rsp)
jmp 0x4f4ce
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x4f728
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
cmpq %rax, %rdi
je 0x4f4f3
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0xb510
movq 0xf8(%rsp), %rdi
leaq 0x108(%rsp), %rax
cmpq %rax, %rdi
je 0x4f518
movq 0x108(%rsp), %rsi
incq %rsi
callq 0xb510
movq %rbp, %rdi
callq 0x1bad0
jmp 0x4f234
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x4f541
movq 0x30(%rsp), %rsi
incq %rsi
callq 0xb510
leaq 0x158(%rsp), %rdi
callq 0x1bad0
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x4f56a
movq 0x50(%rsp), %rsi
incq %rsi
callq 0xb510
movb 0xf(%rsp), %al
andb $0x1, %al
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq 0x138(%rsp), %rdi
cmpq %rbx, %rdi
je 0x4f6a2
movq 0x148(%rsp), %rsi
incq %rsi
callq 0xb510
jmp 0x4f6a2
movq %rax, %r14
jmp 0x4f6a2
jmp 0x4f5bc
jmp 0x4f5b7
movq %rax, %r14
jmp 0x4f5ea
movq %rax, %r14
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x4f5ea
movq 0x70(%rsp), %rsi
incq %rsi
callq 0xb510
jmp 0x4f5ea
movq %rax, %r14
leaq 0x60(%rsp), %rdi
callq 0x53ffe
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
cmpq %rax, %rdi
je 0x4f63d
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0xb510
jmp 0x4f63d
jmp 0x4f671
movq %rax, %r14
jmp 0x4f662
movq %rax, %r14
movq 0x118(%rsp), %rdi
cmpq %rbx, %rdi
je 0x4f674
movq 0x128(%rsp), %rsi
incq %rsi
callq 0xb510
jmp 0x4f674
movq %rax, %r14
movq 0xf8(%rsp), %rdi
leaq 0x108(%rsp), %rax
cmpq %rax, %rdi
je 0x4f662
movq 0x108(%rsp), %rsi
incq %rsi
callq 0xb510
leaq 0x180(%rsp), %rdi
callq 0x1bad0
jmp 0x4f674
movq %rax, %r14
leaq 0x50(%rsp), %r12
leaq 0x30(%rsp), %rax
movq 0x20(%rsp), %rdi
cmpq %rax, %rdi
je 0x4f695
movq 0x30(%rsp), %rsi
incq %rsi
callq 0xb510
leaq 0x158(%rsp), %rdi
callq 0x1bad0
movq 0x40(%rsp), %rdi
cmpq %r12, %rdi
je 0x4f6b9
movq 0x50(%rsp), %rsi
incq %rsi
callq 0xb510
movq %r14, %rdi
callq 0xb9c0
nop