// File: /workspace/github_cpp_makefile_star2_O1/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 0x4dddf
movq %r8, %rbp
movq %rcx, %r15
movq %rsi, %r12
movq %rdi, %r13
leaq 0x1ed52(%rip), %rax     # 0x6c9d0
movslq (%rax,%rdx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x1ce5d(%rip), %rsi     # 0x6aaeb
movq %r12, %rdi
callq 0xb110
testl %eax, %eax
je 0x4dee4
leaq 0x1cebe(%rip), %rsi     # 0x6ab63
movq %r12, %rdi
callq 0xb110
testl %eax, %eax
je 0x4e1d8
leaq 0x1e7fb(%rip), %rsi     # 0x6c4b7
movq %r12, %rdi
callq 0xb110
testl %eax, %eax
jne 0x4dddf
movq %r13, %rdi
movq %r15, %rsi
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4cf2a
leaq 0x1cdfc(%rip), %rsi     # 0x6aaeb
movq %r12, %rdi
callq 0xb110
testl %eax, %eax
je 0x4dde6
leaq 0x1ce5d(%rip), %rsi     # 0x6ab63
movq %r12, %rdi
callq 0xb110
testl %eax, %eax
jne 0x4dddf
leaq 0x1d7f0(%rip), %rsi     # 0x6b50d
movq %r15, %rdi
callq 0xb110
testl %eax, %eax
je 0x4e2b2
leaq 0x48(%rsp), %rdx
movq %r13, %rdi
movq %r15, %rsi
callq 0x4eaca
testb %al, %al
je 0x4e360
leaq 0x50(%rsp), %rdx
leaq 0x1f626(%rip), %rsi     # 0x6d377
jmp 0x4e24f
leaq 0x1cd8e(%rip), %rsi     # 0x6aaeb
movq %r12, %rdi
callq 0xb110
testl %eax, %eax
je 0x4de65
leaq 0x1cdef(%rip), %rsi     # 0x6ab63
movq %r12, %rdi
callq 0xb110
testl %eax, %eax
jne 0x4dddf
leaq 0x48(%rsp), %rdx
movq %r13, %rdi
movq %r15, %rsi
callq 0x4eaca
testb %al, %al
je 0x4e257
leaq 0x58(%rsp), %rdx
leaq 0x1ecfe(%rip), %rsi     # 0x6caa2
movq %rbp, %rdi
callq 0x5427c
jmp 0x4e34a
leaq 0x1cd33(%rip), %rsi     # 0x6aaeb
movq %r12, %rdi
callq 0xb110
testl %eax, %eax
je 0x4e0e1
leaq 0x1cd94(%rip), %rsi     # 0x6ab63
movq %r12, %rdi
callq 0xb110
testl %eax, %eax
je 0x4e214
xorl %ebx, %ebx
jmp 0x4e34c
leaq 0xb0(%rsp), %r14
movq %r14, -0x10(%r14)
movq $0x0, -0x8(%r14)
movb $0x0, (%r14)
leaq 0x1f572(%rip), %rsi     # 0x6d377
leaq 0xa0(%rsp), %rcx
movq %rbp, %rdi
movq %r15, %rdx
callq 0x22400
testb %al, %al
je 0x4e157
leaq 0x1f550(%rip), %rsi     # 0x6d377
movq %rsp, %rcx
movq %rbp, %rdi
movq %r15, %rdx
callq 0x5404e
testb %al, %al
je 0x4e157
movq (%rsp), %rcx
leaq 0xa0(%rsp), %rsi
movsd 0x1b55f(%rip), %xmm0    # 0x693b0
movq %r13, %rdi
movq $-0x1, %rdx
callq 0x4ebb2
jmp 0x4e153
leaq 0xb0(%rsp), %r14
movq %r14, -0x10(%r14)
movq $0x0, -0x8(%r14)
movb $0x0, (%r14)
leaq 0x1ec1e(%rip), %rsi     # 0x6caa2
leaq 0xa0(%rsp), %rcx
movq %rbp, %rdi
movq %r15, %rdx
callq 0x22400
testb %al, %al
je 0x4e157
leaq 0x1ebfc(%rip), %rsi     # 0x6caa2
movq %rsp, %rcx
movq %rbp, %rdi
movq %r15, %rdx
callq 0x541ce
testb %al, %al
je 0x4e157
movsd (%rsp), %xmm0
leaq 0xa0(%rsp), %rsi
movq %r13, %rdi
movq $-0x1, %rdx
movq $-0x1, %rcx
callq 0x4ebb2
jmp 0x4e153
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 0x1d19a
movq %rsp, %rdi
movl $0x3a, %esi
movq %rbx, %rdx
callq 0x37d96
movq 0x80(%rsp), %rdi
cmpq %r14, %rdi
je 0x4df37
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 0x1bbc4
movq %rsp, %rdi
leaq 0x28(%rsp), %rsi
callq 0x1bbc4
testb %al, %al
je 0x4dff4
leaq 0x1d571(%rip), %rsi     # 0x6b50d
leaq 0x28(%rsp), %rdi
callq 0xb110
testl %eax, %eax
je 0x4dff4
leaq 0xa0(%rsp), %rdi
leaq 0x28(%rsp), %rsi
movl $0x18, %edx
callq 0xb8d0
leaq 0xa0(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0xb750
movq 0x3dfd6(%rip), %rsi     # 0x8bfb0
leaq 0xa0(%rsp), %rdi
callq 0xb390
leaq 0x120(%rsp), %rdi
callq 0xb180
movq %rsp, %rdi
leaq 0x28(%rsp), %rsi
callq 0x1bbc4
testb %al, %al
je 0x4e064
leaq 0x1d501(%rip), %rsi     # 0x6b50d
leaq 0x28(%rsp), %rdi
callq 0xb110
testl %eax, %eax
je 0x4e064
leaq 0xa0(%rsp), %rdi
leaq 0x28(%rsp), %rsi
movl $0x18, %edx
callq 0xb8d0
leaq 0x78(%rsp), %rsi
leaq 0xa0(%rsp), %rdi
callq 0xb310
movq 0x3df66(%rip), %rsi     # 0x8bfb0
leaq 0xa0(%rsp), %rdi
callq 0xb390
leaq 0x120(%rsp), %rdi
callq 0xb180
movq %rsp, %rdi
leaq 0x28(%rsp), %rsi
callq 0x1bbc4
testb %al, %al
je 0x4e17f
leaq 0x1d48d(%rip), %rsi     # 0x6b50d
leaq 0x28(%rsp), %rdi
callq 0xb110
testl %eax, %eax
je 0x4e17f
leaq 0xa0(%rsp), %rdi
leaq 0x28(%rsp), %rsi
movl $0x18, %edx
callq 0xb8d0
leaq 0x70(%rsp), %rsi
leaq 0xa0(%rsp), %rdi
callq 0xb750
movq 0x3deee(%rip), %rsi     # 0x8bfb0
leaq 0xa0(%rsp), %rdi
callq 0xb390
leaq 0x120(%rsp), %rdi
callq 0xb180
jmp 0x4e189
leaq 0xb0(%rsp), %r14
movq %r14, -0x10(%r14)
movq $0x0, -0x8(%r14)
movb $0x0, (%r14)
leaq 0x1e99c(%rip), %rsi     # 0x6ca9c
leaq 0xa0(%rsp), %rcx
movq %rbp, %rdi
movq %r15, %rdx
callq 0x22400
testb %al, %al
je 0x4e157
leaq 0x1e97e(%rip), %rsi     # 0x6ca9c
movq %rsp, %rcx
movq %rbp, %rdi
movq %r15, %rdx
callq 0x5404e
testb %al, %al
je 0x4e157
movq (%rsp), %rdx
leaq 0xa0(%rsp), %rsi
movsd 0x1b26c(%rip), %xmm0    # 0x693b0
movq %r13, %rdi
movq $-0x1, %rcx
callq 0x4ebb2
movl %eax, %ebx
jmp 0x4e159
xorl %ebx, %ebx
movq 0xa0(%rsp), %rdi
cmpq %r14, %rdi
je 0x4e34c
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0xb510
jmp 0x4e34c
movq 0x68(%rsp), %rax
movq %rax, 0x70(%rsp)
leaq 0x48(%rsp), %rsi
leaq 0x68(%rsp), %rdx
movq %r13, %rdi
callq 0x4cbe6
movl %eax, %ebx
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x4e1b4
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xb510
movq 0x48(%rsp), %rdi
cmpq %r14, %rdi
je 0x4e1cb
movq 0x58(%rsp), %rsi
incq %rsi
callq 0xb510
movq %rsp, %rdi
callq 0x1bb7e
jmp 0x4e34c
leaq 0x1d32e(%rip), %rsi     # 0x6b50d
movq %r15, %rdi
callq 0xb110
testl %eax, %eax
je 0x4e2c2
addq $0x88, %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0x561d8
movq %rax, %r15
movq %rax, %rdi
callq 0xb350
movq %rax, %r13
jmp 0x4e2d0
leaq 0x1d2f2(%rip), %rsi     # 0x6b50d
movq %r15, %rdi
callq 0xb110
testl %eax, %eax
je 0x4e331
leaq 0x48(%rsp), %rdx
movq %r13, %rdi
movq %r15, %rsi
callq 0x4eaca
testb %al, %al
je 0x4e3bb
leaq 0x1e852(%rip), %rsi     # 0x6ca9c
leaq 0x48(%rsp), %rdx
movq %rbp, %rdi
jmp 0x4e345
leaq 0x1ea67(%rip), %rsi     # 0x6ccc5
movq %rsp, %rbx
movq %rbx, %rdi
movq %r15, %rdx
callq 0x1b85e
leaq 0x1dc16(%rip), %rsi     # 0x6be89
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 0x4e413
movq %rdx, 0xa0(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xb0(%rsp)
jmp 0x4e41a
addq $0xc0, %r13
leaq 0x1f0b7(%rip), %rsi     # 0x6d377
jmp 0x4e33f
movq 0xa0(%r13), %r15
addq $0x90, %r13
cmpq %r13, %r15
je 0x4dddf
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 0x1e9b1(%rip), %rsi     # 0x6ccb5
movb $0x1, %al
callq 0xb0d0
movq %rbp, %rdi
leaq 0x1e781(%rip), %rsi     # 0x6ca96
movq %r14, %rdx
callq 0x53f42
movl %eax, %ebx
movq %r15, %rdi
callq 0xb350
movq %rax, %r15
cmpq %r13, %rax
jne 0x4e2e4
jmp 0x4e34c
addq $0xb8, %r13
leaq 0x1e75d(%rip), %rsi     # 0x6ca9c
movq %rbp, %rdi
movq %r13, %rdx
callq 0x540fc
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 0x1e95e(%rip), %rsi     # 0x6ccc5
movq %rsp, %rbx
movq %rbx, %rdi
movq %r15, %rdx
callq 0x1b85e
leaq 0x1db0d(%rip), %rsi     # 0x6be89
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 0x4e44e
movq %rdx, 0xa0(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xb0(%rsp)
jmp 0x4e455
leaq 0x1e903(%rip), %rsi     # 0x6ccc5
movq %rsp, %rbx
movq %rbx, %rdi
movq %r15, %rdx
callq 0x1b85e
leaq 0x1dab2(%rip), %rsi     # 0x6be89
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 0x4e489
movq %rdx, 0xa0(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xb0(%rsp)
jmp 0x4e490
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
movq %rdx, 0xa8(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0xa0(%rsp), %rdx
leaq 0x1e65e(%rip), %rsi     # 0x6caa2
movq %rbp, %rdi
callq 0x22794
jmp 0x4e4c2
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
movq %rdx, 0xa8(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0xa0(%rsp), %rdx
leaq 0x1eef8(%rip), %rsi     # 0x6d377
movq %rbp, %rdi
callq 0x22794
jmp 0x4e4c2
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
movq %rdx, 0xa8(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0xa0(%rsp), %rdx
leaq 0x1e5e2(%rip), %rsi     # 0x6ca9c
movq %rbp, %rdi
callq 0x22794
movl %eax, %ebx
movq 0xa0(%rsp), %rdi
cmpq %r14, %rdi
je 0x4e4e1
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0xb510
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4e34c
movq 0x10(%rsp), %rsi
jmp 0x4e172
jmp 0x4e53e
jmp 0x4e53e
jmp 0x4e560
jmp 0x4e560
jmp 0x4e513
jmp 0x4e5bc
jmp 0x4e513
jmp 0x4e5bc
movq %rax, %rbx
movq 0x3da93(%rip), %rsi     # 0x8bfb0
leaq 0xa0(%rsp), %rdi
callq 0xb390
leaq 0x120(%rsp), %rdi
callq 0xb180
jmp 0x4e5bf
jmp 0x4e5bc
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
cmpq %r14, %rdi
je 0x4e563
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0xb510
jmp 0x4e563
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4e5f5
movq 0x10(%rsp), %rsi
jmp 0x4e5b2
movq %rax, %rbx
movq 0x80(%rsp), %rdi
cmpq %r14, %rdi
je 0x4e5f5
movq 0x90(%rsp), %rsi
jmp 0x4e5b2
jmp 0x4e59a
jmp 0x4e59a
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
cmpq %r14, %rdi
je 0x4e5f5
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0xb510
jmp 0x4e5f5
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r15, %rdi
je 0x4e5d6
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xb510
movq 0x48(%rsp), %rdi
cmpq %r14, %rdi
je 0x4e5ed
movq 0x58(%rsp), %rsi
incq %rsi
callq 0xb510
movq %rsp, %rdi
callq 0x1bb7e
movq %rbx, %rdi
callq 0xb9c0
nop