// File: /workspace/github_cpp_makefile_star2_O2/mh0fm4[P]SCDC/src/components/dataprov/dataprov.cc
// Function: scdc_dataprov::dataset_path_open(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>>&)
scdc_dataset *scdc_dataprov::dataset_path_open(const std::string &path, scdc_result &result)
{
  SCDC_TRACE(__func__ << ": path: '" << path << "'");

  scdc_dataset *dataset = 0;

  string p = path;
  stringlist pl('/', p);

  if (pl.front_pop() == SCDC_DATAPROV_CONFIG_STR)
  {
    p = pl.conflate();
    dataset = config_open(p, result);

  } else
  {
    dataset = dataset_open(p, result);
  }

  if (!dataset)
  {
    SCDC_FAIL(__func__ << ": opening dataset failed: " << result);
    goto do_return;
  }

  if (!p.empty())
  {
    string cd_cmd = "cd " + p;
    
    if (!dataset->do_cmd(cd_cmd, 0, 0, result))
    {
      SCDC_FAIL(__func__ << ": changing path failed: " << result);
      string r;
      dataset_path_close(dataset, r);
      dataset = 0;
    }
  }

do_return:
  SCDC_TRACE(__func__ << ": return: " << dataset << ", result: '" << result << "'");

  return dataset;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xb0, %rsp
movq %rdx, %rbx
movq %rdi, %r14
leaq 0x28(%rsp), %r15
movq %r15, %rdi
callq 0xb750
leaq 0x68(%rsp), %rdi
movq %r15, %rsi
callq 0xb750
leaq 0x88(%rsp), %rdi
pushq $0x2f
popq %rsi
leaq 0x68(%rsp), %rdx
callq 0x2f05c
leaq 0x68(%rsp), %rdi
callq 0xb230
leaq 0x8(%rsp), %rdi
leaq 0x88(%rsp), %rsi
callq 0x19ba0
leaq 0x24cb6(%rip), %rsi     # 0x52ca7
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x19be0
movl %eax, %ebp
movq %r15, %rdi
callq 0xb230
testb %bpl, %bpl
je 0x2e046
leaq 0x8(%rsp), %rdi
leaq 0x88(%rsp), %rsi
callq 0x1ca32
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %r15
movq %r15, %rsi
callq 0xb690
movq %r15, %rdi
callq 0xb230
movq %r14, %rdi
callq 0x2e25a
movq %rax, %r15
jmp 0x2e063
movq (%r14), %rax
leaq 0x28(%rsp), %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq *0x38(%rax)
movq %rax, %r15
testq %rax, %rax
je 0x2e159
cmpq $0x0, 0x30(%rsp)
je 0x2e1d5
leaq 0x24c4a(%rip), %rsi     # 0x52cc0
leaq 0x8(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0x19ae2
movq (%r15), %rax
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
movq %rbx, %r8
callq *0x10(%rax)
testb %al, %al
jne 0x2e14d
leaq 0x474d7(%rip), %r12     # 0x75580
movq (%r12), %rdi
cmpq $0x0, 0x8(%rdi)
je 0x2e11e
addq $0x20, %rdi
callq 0xb800
movq (%r12), %rax
movq 0x8(%rax), %rdi
leaq 0x230bc(%rip), %rsi     # 0x51188
callq 0xb520
leaq 0x24b48(%rip), %rsi     # 0x52c20
movq %rax, %rdi
callq 0xb520
leaq 0x24bc7(%rip), %rsi     # 0x52cae
movq %rax, %rdi
callq 0xb520
leaq 0x24bce(%rip), %rsi     # 0x52cc4
movq %rax, %rdi
callq 0xb520
movq %rax, %rdi
movq %rbx, %rsi
callq 0xb490
movq %rax, %rdi
callq 0xb270
movq (%r12), %rdi
addq $0x20, %rdi
callq 0xb3e0
leaq 0x58(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq (%r14), %rax
leaq 0x48(%rsp), %rdx
movq %r14, %rdi
movq %r15, %rsi
callq *0x30(%rax)
leaq 0x48(%rsp), %rdi
callq 0xb230
xorl %r15d, %r15d
leaq 0x8(%rsp), %rdi
callq 0xb230
jmp 0x2e1d5
leaq 0x47420(%rip), %r14     # 0x75580
movq (%r14), %rdi
cmpq $0x0, 0x8(%rdi)
je 0x2e1d2
addq $0x20, %rdi
callq 0xb800
movq (%r14), %rax
movq 0x8(%rax), %rdi
leaq 0x23007(%rip), %rsi     # 0x51188
callq 0xb520
leaq 0x24a93(%rip), %rsi     # 0x52c20
movq %rax, %rdi
callq 0xb520
leaq 0x24b12(%rip), %rsi     # 0x52cae
movq %rax, %rdi
callq 0xb520
leaq 0x2334b(%rip), %rsi     # 0x514f6
movq %rax, %rdi
callq 0xb520
movq %rax, %rdi
movq %rbx, %rsi
callq 0xb490
movq %rax, %rdi
callq 0xb270
movq (%r14), %rdi
addq $0x20, %rdi
callq 0xb3e0
xorl %r15d, %r15d
leaq 0x88(%rsp), %rdi
callq 0x19ef4
leaq 0x28(%rsp), %rdi
callq 0xb230
movq %r15, %rax
addq $0xb0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0xb230
jmp 0x2e22b
jmp 0x2e237
jmp 0x2e237
jmp 0x2e237
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0xb230
jmp 0x2e247
movq %rax, %rbx
jmp 0x2e247
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xb230
jmp 0x2e23a
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x19ef4
leaq 0x28(%rsp), %rdi
callq 0xb230
movq %rbx, %rdi
callq 0xb9a0
nop