// File: /workspace/github_cpp_makefile_star2_O3/mh0fm4[P]SCDC/src/components/dataprov/dataprov_jobrun.cc
// Function: scdc_dataprov_jobrun::nodes_config(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, long long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, scdc_config_result&)
bool scdc_dataprov_jobrun::nodes_config(const std::string &cmd, scdcint_t param, std::string &val, scdc_config_result &result)
{
  SCDC_TRACE(__func__ << ": cmd: '" << cmd << "', param: '" << param << "', val: '" << val << "', result: '" << result << "'");

  bool ret = false;

  if (param == 0) /* nodes */
  {
    if (cmd == "put")
    {
      stringlist sl(':', val);

      string nodeid, s;
      scdc_dataprov_jobrun_node_t node(1, 1, 1.0);

      sl.front_pop(nodeid);

      if (sl.front_pop(s) && s != "") stringstream(s) >> node.cores;

      if (sl.front_pop(s) && s != "") stringstream(s) >> node.performance;

      if (sl.front_pop(s) && s != "") stringstream(s) >> node.max_parallel_jobs;
      else node.max_parallel_jobs = node.cores;

      ret = add_node(nodeid, node);

    } else if (cmd == "get")
    {
      nodes_t::iterator nodes_begin, nodes_end;

      if (val == "") { nodes_begin = nodes.begin(); nodes_end = nodes.end(); }
      else
      {
        nodes_begin = nodes_end = nodes.find(val);
        ++nodes_end;
      }

      for (nodes_t::iterator i = nodes_begin; i != nodes_end; ++i)
      {
        char s[64], *ps = s;
        sprintf(s, "%s:%" scdcint_fmt ":%f:%" scdcint_fmt, i->first.c_str(), i->second.cores, i->second.performance, i->second.max_parallel_jobs);
        ret = scdc_dataprov_config::get<char *>(result, "nodes", ps);
      }
      
    } else if (cmd == "rm")
    {
      ret = del_node(val);
    }

  } else if (param == 1) /* cores */
  {
    if (cmd == "put")
    {
      string nodeid;
      scdcint_t cores;

      ret = scdc_dataprov_config::put<string>(result, "cores", val, nodeid)
         && scdc_dataprov_config::put<scdcint_t>(result, "cores", val, cores)
         && set_node(nodeid, cores, -1, -1);

    } else if (cmd == "get")
    {
      scdc_dataprov_jobrun_node_t node;

      if (val == "") ret = scdc_dataprov_config::get<scdcint_t>(result, "cores", total_cores);
      else
      {
        if (get_node(val, node)) ret = scdc_dataprov_config::get<scdcint_t>(result, "cores", node.cores);
        else ret = scdc_dataprov_config::fail(result, "cores", "getting node " + val + " failed");
      }
    }

  } else if (param == 2) /* max_parallel_jobs */
  {
    if (cmd == "put")
    {
      string nodeid;
      scdcint_t max_parallel_jobs;

      ret = scdc_dataprov_config::put<string>(result, "max_parallel_jobs", val, nodeid)
         && scdc_dataprov_config::put<scdcint_t>(result, "max_parallel_jobs", val, max_parallel_jobs)
         && set_node(nodeid, -1, max_parallel_jobs, -1);

    } else if (cmd == "get")
    {
      scdc_dataprov_jobrun_node_t node;

      if (val == "") ret = scdc_dataprov_config::get<scdcint_t>(result, "max_parallel_jobs", max_parallel_jobs);
      else
      {
        if (get_node(val, node)) ret = scdc_dataprov_config::get<scdcint_t>(result, "max_parallel_jobs", node.max_parallel_jobs);
        else ret = scdc_dataprov_config::fail(result, "max_parallel_jobs", "getting node " + val + " failed");
      }
    }

  } else if (param == 3) /* performance */
  {
    if (cmd == "put")
    {
      string nodeid;
      double performance;

      ret = scdc_dataprov_config::put<string>(result, "performance", val, nodeid)
         && scdc_dataprov_config::put<double>(result, "performance", val, performance)
         && set_node(nodeid, -1, -1, performance);

    } else if (cmd == "get")
    {
      scdc_dataprov_jobrun_node_t node;

      if (get_node(val, node)) ret = scdc_dataprov_config::get<double>(result, "performance", node.performance);
      else ret = scdc_dataprov_config::fail(result, "performance", "getting node " + val + " failed");
    }
  }

  return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
cmpq $0x3, %rdx
ja 0x4d993
movq %r8, %rbp
movq %rcx, %r15
movq %rsi, %r12
movq %rdi, %r13
leaq 0x1f216(%rip), %rax     # 0x6ca48
movslq (%rax,%rdx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x1d2c9(%rip), %rsi     # 0x6ab0b
movq %r12, %rdi
callq 0xb110
testl %eax, %eax
je 0x4da98
leaq 0x1d32a(%rip), %rsi     # 0x6ab83
movq %r12, %rdi
callq 0xb110
testl %eax, %eax
je 0x4dd8c
leaq 0x1ecbf(%rip), %rsi     # 0x6c52f
movq %r12, %rdi
callq 0xb110
testl %eax, %eax
jne 0x4d993
movq %r13, %rdi
movq %r15, %rsi
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4ca3a
leaq 0x1d268(%rip), %rsi     # 0x6ab0b
movq %r12, %rdi
callq 0xb110
testl %eax, %eax
je 0x4d99a
leaq 0x1d2c9(%rip), %rsi     # 0x6ab83
movq %r12, %rdi
callq 0xb110
testl %eax, %eax
jne 0x4d993
leaq 0x1dc5c(%rip), %rsi     # 0x6b52d
movq %r15, %rdi
callq 0xb110
testl %eax, %eax
je 0x4de66
leaq 0x48(%rsp), %rdx
movq %r13, %rdi
movq %r15, %rsi
callq 0x4e674
testb %al, %al
je 0x4df14
leaq 0x50(%rsp), %rdx
leaq 0x1fae2(%rip), %rsi     # 0x6d3e7
jmp 0x4de03
leaq 0x1d1fa(%rip), %rsi     # 0x6ab0b
movq %r12, %rdi
callq 0xb110
testl %eax, %eax
je 0x4da19
leaq 0x1d25b(%rip), %rsi     # 0x6ab83
movq %r12, %rdi
callq 0xb110
testl %eax, %eax
jne 0x4d993
leaq 0x48(%rsp), %rdx
movq %r13, %rdi
movq %r15, %rsi
callq 0x4e674
testb %al, %al
je 0x4de0b
leaq 0x58(%rsp), %rdx
leaq 0x1f1ba(%rip), %rsi     # 0x6cb12
movq %rbp, %rdi
callq 0x53e1c
jmp 0x4defe
leaq 0x1d19f(%rip), %rsi     # 0x6ab0b
movq %r12, %rdi
callq 0xb110
testl %eax, %eax
je 0x4dc95
leaq 0x1d200(%rip), %rsi     # 0x6ab83
movq %r12, %rdi
callq 0xb110
testl %eax, %eax
je 0x4ddc8
xorl %ebx, %ebx
jmp 0x4df00
leaq 0xb0(%rsp), %r14
movq %r14, -0x10(%r14)
movq $0x0, -0x8(%r14)
movb $0x0, (%r14)
leaq 0x1fa2e(%rip), %rsi     # 0x6d3e7
leaq 0xa0(%rsp), %rcx
movq %rbp, %rdi
movq %r15, %rdx
callq 0x22322
testb %al, %al
je 0x4dd0b
leaq 0x1fa0c(%rip), %rsi     # 0x6d3e7
movq %rsp, %rcx
movq %rbp, %rdi
movq %r15, %rdx
callq 0x53bee
testb %al, %al
je 0x4dd0b
movq (%rsp), %rcx
leaq 0xa0(%rsp), %rsi
movsd 0x1b9cb(%rip), %xmm0    # 0x693d0
movq %r13, %rdi
movq $-0x1, %rdx
callq 0x4e75c
jmp 0x4dd07
leaq 0xb0(%rsp), %r14
movq %r14, -0x10(%r14)
movq $0x0, -0x8(%r14)
movb $0x0, (%r14)
leaq 0x1f0da(%rip), %rsi     # 0x6cb12
leaq 0xa0(%rsp), %rcx
movq %rbp, %rdi
movq %r15, %rdx
callq 0x22322
testb %al, %al
je 0x4dd0b
leaq 0x1f0b8(%rip), %rsi     # 0x6cb12
movq %rsp, %rcx
movq %rbp, %rdi
movq %r15, %rdx
callq 0x53d6e
testb %al, %al
je 0x4dd0b
movsd (%rsp), %xmm0
leaq 0xa0(%rsp), %rsi
movq %r13, %rdi
movq $-0x1, %rdx
movq $-0x1, %rcx
callq 0x4e75c
jmp 0x4dd07
leaq 0x90(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
leaq 0x80(%rsp), %rbx
movq %rbx, %rdi
callq 0x1d0a0
movq %rsp, %rdi
movl $0x3a, %esi
movq %rbx, %rdx
callq 0x37a30
movq 0x80(%rsp), %rdi
cmpq %r14, %rdi
je 0x4daeb
movq 0x90(%rsp), %rsi
incq %rsi
callq 0xb510
leaq 0x58(%rsp), %r14
movq %r14, -0x10(%r14)
xorl %eax, %eax
movq %rax, -0x8(%r14)
movb %al, (%r14)
leaq 0x38(%rsp), %r15
movq %r15, -0x10(%r15)
movq %rax, -0x8(%r15)
movb %al, (%r15)
movl $0x1, %eax
movq %rax, 0x68(%rsp)
movq %rax, 0x70(%rsp)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, 0x78(%rsp)
movq %rsp, %rdi
leaq 0x48(%rsp), %rsi
callq 0x1bb16
movq %rsp, %rdi
leaq 0x28(%rsp), %rsi
callq 0x1bb16
testb %al, %al
je 0x4dba8
leaq 0x1d9dd(%rip), %rsi     # 0x6b52d
leaq 0x28(%rsp), %rdi
callq 0xb110
testl %eax, %eax
je 0x4dba8
leaq 0xa0(%rsp), %rdi
leaq 0x28(%rsp), %rsi
movl $0x18, %edx
callq 0xb8d0
leaq 0xa0(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0xb750
movq 0x3e422(%rip), %rsi     # 0x8bfb0
leaq 0xa0(%rsp), %rdi
callq 0xb390
leaq 0x120(%rsp), %rdi
callq 0xb180
movq %rsp, %rdi
leaq 0x28(%rsp), %rsi
callq 0x1bb16
testb %al, %al
je 0x4dc18
leaq 0x1d96d(%rip), %rsi     # 0x6b52d
leaq 0x28(%rsp), %rdi
callq 0xb110
testl %eax, %eax
je 0x4dc18
leaq 0xa0(%rsp), %rdi
leaq 0x28(%rsp), %rsi
movl $0x18, %edx
callq 0xb8d0
leaq 0x78(%rsp), %rsi
leaq 0xa0(%rsp), %rdi
callq 0xb310
movq 0x3e3b2(%rip), %rsi     # 0x8bfb0
leaq 0xa0(%rsp), %rdi
callq 0xb390
leaq 0x120(%rsp), %rdi
callq 0xb180
movq %rsp, %rdi
leaq 0x28(%rsp), %rsi
callq 0x1bb16
testb %al, %al
je 0x4dd33
leaq 0x1d8f9(%rip), %rsi     # 0x6b52d
leaq 0x28(%rsp), %rdi
callq 0xb110
testl %eax, %eax
je 0x4dd33
leaq 0xa0(%rsp), %rdi
leaq 0x28(%rsp), %rsi
movl $0x18, %edx
callq 0xb8d0
leaq 0x70(%rsp), %rsi
leaq 0xa0(%rsp), %rdi
callq 0xb750
movq 0x3e33a(%rip), %rsi     # 0x8bfb0
leaq 0xa0(%rsp), %rdi
callq 0xb390
leaq 0x120(%rsp), %rdi
callq 0xb180
jmp 0x4dd3d
leaq 0xb0(%rsp), %r14
movq %r14, -0x10(%r14)
movq $0x0, -0x8(%r14)
movb $0x0, (%r14)
leaq 0x1ee58(%rip), %rsi     # 0x6cb0c
leaq 0xa0(%rsp), %rcx
movq %rbp, %rdi
movq %r15, %rdx
callq 0x22322
testb %al, %al
je 0x4dd0b
leaq 0x1ee3a(%rip), %rsi     # 0x6cb0c
movq %rsp, %rcx
movq %rbp, %rdi
movq %r15, %rdx
callq 0x53bee
testb %al, %al
je 0x4dd0b
movq (%rsp), %rdx
leaq 0xa0(%rsp), %rsi
movsd 0x1b6d8(%rip), %xmm0    # 0x693d0
movq %r13, %rdi
movq $-0x1, %rcx
callq 0x4e75c
movl %eax, %ebx
jmp 0x4dd0d
xorl %ebx, %ebx
movq 0xa0(%rsp), %rdi
cmpq %r14, %rdi
je 0x4df00
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0xb510
jmp 0x4df00
movq 0x68(%rsp), %rax
movq %rax, 0x70(%rsp)
leaq 0x48(%rsp), %rsi
leaq 0x68(%rsp), %rdx
movq %r13, %rdi
callq 0x4c6f6
movl %eax, %ebx
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x4dd68
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xb510
movq 0x48(%rsp), %rdi
cmpq %r14, %rdi
je 0x4dd7f
movq 0x58(%rsp), %rsi
incq %rsi
callq 0xb510
movq %rsp, %rdi
callq 0x1bad0
jmp 0x4df00
leaq 0x1d79a(%rip), %rsi     # 0x6b52d
movq %r15, %rdi
callq 0xb110
testl %eax, %eax
je 0x4de76
addq $0x88, %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0x55d7e
movq %rax, %r15
movq %rax, %rdi
callq 0xb350
movq %rax, %r13
jmp 0x4de84
leaq 0x1d75e(%rip), %rsi     # 0x6b52d
movq %r15, %rdi
callq 0xb110
testl %eax, %eax
je 0x4dee5
leaq 0x48(%rsp), %rdx
movq %r13, %rdi
movq %r15, %rsi
callq 0x4e674
testb %al, %al
je 0x4df6f
leaq 0x1ed0e(%rip), %rsi     # 0x6cb0c
leaq 0x48(%rsp), %rdx
movq %rbp, %rdi
jmp 0x4def9
leaq 0x1ef23(%rip), %rsi     # 0x6cd35
movq %rsp, %rbx
movq %rbx, %rdi
movq %r15, %rdx
callq 0x1b7aa
leaq 0x1e0da(%rip), %rsi     # 0x6bf01
movq %rbx, %rdi
callq 0xba60
leaq 0xb0(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x4dfc7
movq %rdx, 0xa0(%rsp)
movq (%rcx), %rsi
movq %rsi, 0xb0(%rsp)
jmp 0x4dfd1
addq $0xc0, %r13
leaq 0x1f573(%rip), %rsi     # 0x6d3e7
jmp 0x4def3
movq 0xa0(%r13), %r15
addq $0x90, %r13
cmpq %r13, %r15
je 0x4d993
leaq 0xa0(%rsp), %r12
movq %rsp, %r14
movq %r12, (%rsp)
movq 0x20(%r15), %rdx
movq 0x40(%r15), %rcx
movsd 0x50(%r15), %xmm0
movq 0x48(%r15), %r8
movq %r12, %rdi
leaq 0x1ee6d(%rip), %rsi     # 0x6cd25
movb $0x1, %al
callq 0xb0d0
movq %rbp, %rdi
leaq 0x1ec3d(%rip), %rsi     # 0x6cb06
movq %r14, %rdx
callq 0x53ae2
movl %eax, %ebx
movq %r15, %rdi
callq 0xb350
movq %rax, %r15
cmpq %r13, %rax
jne 0x4de98
jmp 0x4df00
addq $0xb8, %r13
leaq 0x1ec19(%rip), %rsi     # 0x6cb0c
movq %rbp, %rdi
movq %r13, %rdx
callq 0x53c9c
movl %eax, %ebx
movl %ebx, %eax
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1ee1a(%rip), %rsi     # 0x6cd35
movq %rsp, %rbx
movq %rbx, %rdi
movq %r15, %rdx
callq 0x1b7aa
leaq 0x1dfd1(%rip), %rsi     # 0x6bf01
movq %rbx, %rdi
callq 0xba60
leaq 0xb0(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x4dffd
movq %rdx, 0xa0(%rsp)
movq (%rcx), %rsi
movq %rsi, 0xb0(%rsp)
jmp 0x4e007
leaq 0x1edbf(%rip), %rsi     # 0x6cd35
movq %rsp, %rbx
movq %rbx, %rdi
movq %r15, %rdx
callq 0x1b7aa
leaq 0x1df76(%rip), %rsi     # 0x6bf01
movq %rbx, %rdi
callq 0xba60
leaq 0xb0(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x4e033
movq %rdx, 0xa0(%rsp)
movq (%rcx), %rsi
movq %rsi, 0xb0(%rsp)
jmp 0x4e03d
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq %r14, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0xa8(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x1eb1f(%rip), %rsi     # 0x6cb12
movq %rbp, %rdi
callq 0x226b6
jmp 0x4e067
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq %r14, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0xa8(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x1f3be(%rip), %rsi     # 0x6d3e7
movq %rbp, %rdi
callq 0x226b6
jmp 0x4e067
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq %r14, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0xa8(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x1eaad(%rip), %rsi     # 0x6cb0c
movq %rbp, %rdi
callq 0x226b6
movl %eax, %ebx
movq 0xa0(%rsp), %rdi
cmpq %r14, %rdi
je 0x4e086
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0xb510
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4df00
movq 0x10(%rsp), %rsi
jmp 0x4dd26
jmp 0x4e0e3
jmp 0x4e0e3
jmp 0x4e105
jmp 0x4e105
jmp 0x4e0b8
jmp 0x4e161
jmp 0x4e0b8
jmp 0x4e161
movq %rax, %rbx
movq 0x3deee(%rip), %rsi     # 0x8bfb0
leaq 0xa0(%rsp), %rdi
callq 0xb390
leaq 0x120(%rsp), %rdi
callq 0xb180
jmp 0x4e164
jmp 0x4e161
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
cmpq %r14, %rdi
je 0x4e108
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0xb510
jmp 0x4e108
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4e19a
movq 0x10(%rsp), %rsi
jmp 0x4e157
movq %rax, %rbx
movq 0x80(%rsp), %rdi
cmpq %r14, %rdi
je 0x4e19a
movq 0x90(%rsp), %rsi
jmp 0x4e157
jmp 0x4e13f
jmp 0x4e13f
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
cmpq %r14, %rdi
je 0x4e19a
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0xb510
jmp 0x4e19a
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x4e17b
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xb510
movq 0x48(%rsp), %rdi
cmpq %r14, %rdi
je 0x4e192
movq 0x58(%rsp), %rsi
incq %rsi
callq 0xb510
movq %rsp, %rdi
callq 0x1bad0
movq %rbx, %rdi
callq 0xb9c0