// File: /workspace/github_cpp_makefile_star2_O1/mh0fm4[P]SCDC/src/components/dataprov/dataprov_jobrun.cc
// Function: build_cmd(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, 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&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
static void build_cmd(const std::string &format, const char *run_time, const std::string &jobid, const std::string &params, const scdc_dataprov_jobrun_res_t &res, std::string &cmd)
{
  cmd = format;

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

  /* replace $PARAMS$ first so that all following placeholders are also replaced in the params string */
  string_replace_all(cmd, "$PARAMS$", params);

  string_replace_all(cmd, "$RUN_TIME$", run_time);
  string_replace_all(cmd, "$JOBID$", jobid);

  stringstream nodes, nprocs, nthrds, npt, tpn;

  /* - $NODES$ = '<node0>,<node1>,...',
     - $NT$ bzw. $NTHRDS$ = '<nt0>,<nt1>,...',
     - $NP$ bzw. $NPROCS$ = '<np0>,<np1>,...',
     - $NPT$ = '<node0>:<np0>:<nt0>,<node1>:<np1>:<nt1>,...'
     - $TPN$ = '<nt0>:<np0>:<node0>,<nt1>:<np1>:<node1>,...' */

  for (scdc_dataprov_jobrun_res_t::const_iterator i = res.begin(); i != res.end(); ++i)
  {
    if (i != res.begin())
    {
      nodes << ",";
      nprocs << ",";
      nthrds << ",";
      npt << ",";
      tpn << ",";
    }

    nodes << i->node;
    nprocs << i->np;
    nthrds << i->nt;
    npt << i->node << ":" << i->np << ":" << i->nt;
    tpn << i->nt << ":" << i->np << ":" << i->node;
  }

  SCDC_TRACE(__func__ << ": nodes: '" << nodes.str() << "'");
  SCDC_TRACE(__func__ << ": nprocs: '" << nprocs.str() << "'");
  SCDC_TRACE(__func__ << ": nthrds: '" << nthrds.str() << "'");
  SCDC_TRACE(__func__ << ": npt: '" << npt.str() << "'");
  SCDC_TRACE(__func__ << ": tpn: '" << tpn.str() << "'");

  string_replace_all(cmd, "$NODES$", nodes.str());
  string_replace_all(cmd, "$NP$", nprocs.str());
  string_replace_all(cmd, "$NPROCS$", nprocs.str());
  string_replace_all(cmd, "$NT$", nthrds.str());
  string_replace_all(cmd, "$NTHRDS$", nthrds.str());
  string_replace_all(cmd, "$NPT$", npt.str());
  string_replace_all(cmd, "$TPN$", tpn.str());
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x7f8, %rsp            # imm = 0x7F8
movq %r8, %r13
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %rsi
movq %r8, %rdi
callq 0xb2c0
leaq 0x60(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x1baf3(%rip), %rsi     # 0x6d1f2
leaq 0x1baf4(%rip), %rdx     # 0x6d1fa
leaq 0x50(%rsp), %rdi
callq 0x1bee6
leaq 0x50(%rsp), %rsi
movq %r13, %rdi
movq %r15, %rdx
callq 0x52b4a
movq 0x50(%rsp), %rdi
cmpq %r12, %rdi
je 0x51737
movq 0x60(%rsp), %rsi
incq %rsi
callq 0xb510
leaq 0x50(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x1bab5(%rip), %rsi     # 0x6d1fb
leaq 0x1bab8(%rip), %rdx     # 0x6d205
callq 0x1bee6
leaq 0x1e8(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x1b702(%rip), %rsi     # 0x6ce67
leaq 0x1b6fe(%rip), %rdx     # 0x6ce6a
leaq 0x1d8(%rsp), %rdi
callq 0x1bee6
leaq 0x50(%rsp), %rsi
leaq 0x1d8(%rsp), %rdx
movq %r13, %rdi
callq 0x52b4a
movq 0x1d8(%rsp), %rdi
cmpq %r15, %rdi
je 0x517ab
movq 0x1e8(%rsp), %rsi
incq %rsi
callq 0xb510
movq 0x50(%rsp), %rdi
cmpq %r12, %rdi
je 0x517c2
movq 0x60(%rsp), %rsi
incq %rsi
callq 0xb510
leaq 0x50(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x1ba35(%rip), %rsi     # 0x6d206
leaq 0x1ba35(%rip), %rdx     # 0x6d20d
callq 0x1bee6
leaq 0x50(%rsp), %rsi
movq %r13, %rdi
movq %rbx, %rdx
callq 0x52b4a
movq 0x50(%rsp), %rdi
cmpq %r12, %rdi
je 0x51804
movq 0x60(%rsp), %rsi
incq %rsi
callq 0xb510
leaq 0x50(%rsp), %rdi
callq 0xb360
leaq 0x1d8(%rsp), %rdi
callq 0xb360
leaq 0x4e8(%rsp), %rdi
callq 0xb360
leaq 0x360(%rsp), %rdi
callq 0xb360
movq %r13, 0x48(%rsp)
leaq 0x670(%rsp), %rdi
callq 0xb360
movq (%r14), %rbp
cmpq 0x8(%r14), %rbp
je 0x519b3
leaq 0x680(%rsp), %rbx
leaq 0x18ae1(%rip), %r15     # 0x6a344
leaq 0x19027(%rip), %r12     # 0x6a891
cmpq (%r14), %rbp
je 0x518d0
movl $0x1, %edx
leaq 0x60(%rsp), %rdi
movq %r12, %rsi
callq 0xb5f0
movl $0x1, %edx
leaq 0x1e8(%rsp), %rdi
movq %r12, %rsi
callq 0xb5f0
movl $0x1, %edx
leaq 0x4f8(%rsp), %rdi
movq %r12, %rsi
callq 0xb5f0
movl $0x1, %edx
leaq 0x370(%rsp), %rdi
movq %r12, %rsi
callq 0xb5f0
movl $0x1, %edx
movq %rbx, %rdi
movq %r12, %rsi
callq 0xb5f0
movq (%rbp), %rsi
movq 0x8(%rbp), %rdx
leaq 0x60(%rsp), %rdi
callq 0xb5f0
movq 0x20(%rbp), %rsi
leaq 0x1e8(%rsp), %rdi
callq 0xb1d0
movq 0x28(%rbp), %rsi
leaq 0x4f8(%rsp), %rdi
callq 0xb1d0
movq (%rbp), %rsi
movq 0x8(%rbp), %rdx
leaq 0x370(%rsp), %rdi
callq 0xb5f0
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0xb5f0
movq 0x20(%rbp), %rsi
movq %r13, %rdi
callq 0xb1d0
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0xb5f0
movq 0x28(%rbp), %rsi
movq %r13, %rdi
callq 0xb1d0
movq 0x28(%rbp), %rsi
movq %rbx, %rdi
callq 0xb1d0
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0xb5f0
movq 0x20(%rbp), %rsi
movq %r13, %rdi
callq 0xb1d0
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0xb5f0
movq (%rbp), %rsi
movq 0x8(%rbp), %rdx
movq %r13, %rdi
callq 0xb5f0
addq $0x30, %rbp
cmpq 0x8(%r14), %rbp
jne 0x5186a
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x1b84b(%rip), %rsi     # 0x6d20e
leaq 0x1b84b(%rip), %rdx     # 0x6d215
leaq 0x8(%rsp), %rdi
callq 0x1bee6
leaq 0x68(%rsp), %rsi
leaq 0x28(%rsp), %rdi
callq 0xb8c0
movq 0x48(%rsp), %r12
leaq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdx
movq %r12, %rdi
callq 0x52b4a
leaq 0x38(%rsp), %r15
movq -0x10(%r15), %rdi
cmpq %r15, %rdi
je 0x51a15
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xb510
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x51a2c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb510
leaq 0x8(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x1b7db(%rip), %rsi     # 0x6d216
leaq 0x1b7d8(%rip), %rdx     # 0x6d21a
callq 0x1bee6
leaq 0x1f0(%rsp), %rbx
leaq 0x28(%rsp), %rdi
movq %rbx, %rsi
callq 0xb8c0
leaq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdx
movq %r12, %rdi
callq 0x52b4a
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x51a85
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xb510
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x51a9c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb510
leaq 0x8(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x1b770(%rip), %rsi     # 0x6d21b
leaq 0x1b771(%rip), %rdx     # 0x6d223
callq 0x1bee6
leaq 0x28(%rsp), %rdi
movq %rbx, %rsi
callq 0xb8c0
leaq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdx
movq %r12, %rdi
callq 0x52b4a
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x51aed
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xb510
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x51b04
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb510
leaq 0x8(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x1b711(%rip), %rsi     # 0x6d224
leaq 0x1b70e(%rip), %rdx     # 0x6d228
callq 0x1bee6
leaq 0x500(%rsp), %rbx
leaq 0x28(%rsp), %rdi
movq %rbx, %rsi
callq 0xb8c0
leaq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdx
movq %r12, %rdi
callq 0x52b4a
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x51b5d
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xb510
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x51b74
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb510
leaq 0x8(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x1b6a6(%rip), %rsi     # 0x6d229
leaq 0x1b6a7(%rip), %rdx     # 0x6d231
callq 0x1bee6
leaq 0x28(%rsp), %rdi
movq %rbx, %rsi
callq 0xb8c0
leaq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdx
movq %r12, %rdi
callq 0x52b4a
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x51bc5
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xb510
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x51bdc
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb510
leaq 0x8(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x1b647(%rip), %rsi     # 0x6d232
leaq 0x1b645(%rip), %rdx     # 0x6d237
callq 0x1bee6
leaq 0x378(%rsp), %rsi
leaq 0x28(%rsp), %rdi
callq 0xb8c0
leaq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdx
movq %r12, %rdi
callq 0x52b4a
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x51c32
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xb510
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x51c49
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb510
leaq 0x8(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x1b5e0(%rip), %rsi     # 0x6d238
leaq 0x1b5de(%rip), %rdx     # 0x6d23d
callq 0x1bee6
leaq 0x688(%rsp), %rsi
leaq 0x28(%rsp), %rdi
callq 0xb8c0
leaq 0x8(%rsp), %rsi
leaq 0x28(%rsp), %rdx
movq %r12, %rdi
callq 0x52b4a
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x51c9f
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xb510
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x51cb6
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb510
movq 0x3a2f3(%rip), %rbx     # 0x8bfb0
leaq 0x670(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0xb390
movl $0x80, %r14d
addq %r14, %r15
movq %r15, %rdi
callq 0xb180
leaq 0x360(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0xb390
addq %r14, %r15
movq %r15, %rdi
callq 0xb180
leaq 0x4e8(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0xb390
addq %r14, %r15
movq %r15, %rdi
callq 0xb180
leaq 0x1d8(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0xb390
addq %r14, %r15
movq %r15, %rdi
callq 0xb180
leaq 0x50(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0xb390
addq %r14, %r15
movq %r15, %rdi
callq 0xb180
addq $0x7f8, %rsp            # imm = 0x7F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x51d95
jmp 0x51dcb
jmp 0x51e62
jmp 0x51d95
jmp 0x51dcb
jmp 0x51e62
jmp 0x51d95
jmp 0x51dcb
jmp 0x51e62
jmp 0x51d95
jmp 0x51dcb
jmp 0x51e62
jmp 0x51d95
jmp 0x51dcb
jmp 0x51e62
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x51dce
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xb510
jmp 0x51dce
jmp 0x51dcb
jmp 0x51e62
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x51da2
jmp 0x51dce
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x51e65
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb510
jmp 0x51e65
jmp 0x51e62
movq %rax, %rbx
jmp 0x51e86
movq %rax, %rbx
jmp 0x51ea7
movq %rax, %rbx
jmp 0x51ec8
movq %rax, %rbx
jmp 0x51ee9
jmp 0x51e37
jmp 0x51e5a
movq %rax, %rbx
movq 0x1d8(%rsp), %rdi
cmpq %r15, %rdi
je 0x51e3a
movq 0x1e8(%rsp), %rsi
incq %rsi
callq 0xb510
jmp 0x51e3a
jmp 0x51e37
jmp 0x51e5a
movq %rax, %rbx
movq 0x50(%rsp), %rdi
cmpq %r12, %rdi
je 0x51f07
movq 0x60(%rsp), %rsi
incq %rsi
callq 0xb510
jmp 0x51f07
movq %rax, %rbx
jmp 0x51f07
movq %rax, %rbx
movq 0x3a144(%rip), %rsi     # 0x8bfb0
leaq 0x670(%rsp), %rdi
callq 0xb390
leaq 0x6f0(%rsp), %rdi
callq 0xb180
movq 0x3a123(%rip), %rsi     # 0x8bfb0
leaq 0x360(%rsp), %rdi
callq 0xb390
leaq 0x3e0(%rsp), %rdi
callq 0xb180
movq 0x3a102(%rip), %rsi     # 0x8bfb0
leaq 0x4e8(%rsp), %rdi
callq 0xb390
leaq 0x568(%rsp), %rdi
callq 0xb180
movq 0x3a0e1(%rip), %rsi     # 0x8bfb0
leaq 0x1d8(%rsp), %rdi
callq 0xb390
leaq 0x258(%rsp), %rdi
callq 0xb180
movq 0x3a0c0(%rip), %rsi     # 0x8bfb0
leaq 0x50(%rsp), %rdi
callq 0xb390
leaq 0xd0(%rsp), %rdi
callq 0xb180
movq %rbx, %rdi
callq 0xb9c0
nop