// File: /workspace/github_cpp_makefile_star2_O1/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 %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdx, %rbx
movq %rdi, %r14
leaq 0x30(%rsp), %rax
movq %rax, -0x10(%rax)
movq (%rsi), %rax
movq 0x8(%rsi), %rdx
addq %rax, %rdx
leaq 0x20(%rsp), %r15
movq %r15, %rdi
movq %rax, %rsi
callq 0x1d19a
leaq 0x50(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
leaq 0x40(%rsp), %rdi
callq 0x1d19a
leaq 0x80(%rsp), %rdi
leaq 0x40(%rsp), %rdx
movl $0x2f, %esi
callq 0x37d96
movq 0x40(%rsp), %rdi
cmpq %r12, %rdi
je 0x36336
movq 0x50(%rsp), %rsi
incq %rsi
callq 0xb510
movq %rsp, %rdi
leaq 0x80(%rsp), %rsi
callq 0x1b92c
leaq 0x35952(%rip), %rsi     # 0x6bc9f
movq %rsp, %r15
movq %r15, %rdi
callq 0xb110
movl %eax, %ebp
movq (%r15), %rdi
leaq 0x10(%rsp), %r13
cmpq %r13, %rdi
je 0x36374
movq 0x10(%rsp), %rsi
incq %rsi
callq 0xb510
testl %ebp, %ebp
je 0x3638e
movq (%r14), %rax
leaq 0x20(%rsp), %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq *0x38(%rax)
movq %rax, %r15
jmp 0x363fb
leaq 0x80(%rsp), %rsi
movl 0x18(%rsi), %edx
movq %rsp, %rdi
callq 0x1f196
leaq 0x20(%rsp), %rdi
movq %rsp, %r15
movq %r15, %rsi
callq 0xb670
movq (%r15), %rdi
cmpq %r13, %rdi
je 0x363c6
movq 0x10(%rsp), %rsi
incq %rsi
callq 0xb510
movl $0x38, %edi
callq 0xb500
movq %rax, %r15
movq %r14, 0x8(%rax)
addq $0x28, %rax
movq %rax, 0x18(%r15)
movq $0x0, 0x20(%r15)
movb $0x0, 0x28(%r15)
leaq 0x5452d(%rip), %rax     # 0x8a920
movq %rax, (%r15)
movb $0x1, 0x10(%r15)
testq %r15, %r15
je 0x3655e
cmpq $0x0, 0x28(%rsp)
je 0x3661b
leaq 0x358a1(%rip), %rsi     # 0x6bcb8
movq %rsp, %rdi
leaq 0x20(%rsp), %rdx
callq 0x1b85e
movq (%r15), %rax
movq %rsp, %rsi
movq %r15, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
movq %rbx, %r8
callq *0x10(%rax)
testb %al, %al
jne 0x3653f
leaq 0x5612a(%rip), %rbp     # 0x8c570
movq (%rbp), %rdi
cmpq $0x0, 0x8(%rdi)
je 0x364fc
addq $0x20, %rdi
callq 0xb7d0
movq (%rbp), %rax
movq 0x8(%rax), %r12
leaq 0x33d1b(%rip), %rsi     # 0x6a188
movl $0xb, %edx
movq %r12, %rdi
callq 0xb5f0
leaq 0x35797(%rip), %rsi     # 0x6bc18
movl $0xa, %edx
movq %r12, %rdi
callq 0xb5f0
leaq 0x35811(%rip), %rsi     # 0x6bca6
movl $0x11, %edx
movq %r12, %rdi
callq 0xb5f0
leaq 0x35813(%rip), %rsi     # 0x6bcbc
movl $0x18, %edx
movq %r12, %rdi
callq 0xb5f0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r12, %rdi
callq 0xb5f0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0xb4d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0xb050
movq %rax, %rdi
callq 0xb340
movq (%rbp), %rdi
addq $0x20, %rdi
callq 0xb3b0
leaq 0x70(%rsp), %r12
movq %r12, -0x10(%r12)
movq $0x0, -0x8(%r12)
movb $0x0, (%r12)
movq (%r14), %rax
leaq 0x60(%rsp), %rdx
movq %r14, %rdi
movq %r15, %rsi
callq *0x30(%rax)
movq 0x60(%rsp), %rdi
cmpq %r12, %rdi
je 0x3653c
movq 0x70(%rsp), %rsi
incq %rsi
callq 0xb510
xorl %r15d, %r15d
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x3661b
movq 0x10(%rsp), %rsi
incq %rsi
callq 0xb510
jmp 0x3661b
leaq 0x5600b(%rip), %r15     # 0x8c570
movq (%r15), %rdi
cmpq $0x0, 0x8(%rdi)
je 0x36618
addq $0x20, %rdi
callq 0xb7d0
movq (%r15), %rax
movq 0x8(%rax), %r14
leaq 0x33bfe(%rip), %rsi     # 0x6a188
movl $0xb, %edx
movq %r14, %rdi
callq 0xb5f0
leaq 0x3567a(%rip), %rsi     # 0x6bc18
movl $0xa, %edx
movq %r14, %rdi
callq 0xb5f0
leaq 0x356f4(%rip), %rsi     # 0x6bca6
movl $0x11, %edx
movq %r14, %rdi
callq 0xb5f0
leaq 0x33f30(%rip), %rsi     # 0x6a4f6
movl $0x1a, %edx
movq %r14, %rdi
callq 0xb5f0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0xb5f0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0xb4d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0xb050
movq %rax, %rdi
callq 0xb340
movq (%r15), %rdi
addq $0x20, %rdi
callq 0xb3b0
xorl %r15d, %r15d
leaq 0x80(%rsp), %rdi
callq 0x1bb7e
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x36644
movq 0x30(%rsp), %rsi
incq %rsi
callq 0xb510
movq %r15, %rax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x60(%rsp), %rdi
cmpq %r12, %rdi
je 0x3669f
movq 0x70(%rsp), %rsi
incq %rsi
callq 0xb510
jmp 0x3669f
jmp 0x366b7
jmp 0x366b7
jmp 0x366b7
movq %rax, %rbx
movq 0x40(%rsp), %rdi
cmpq %r12, %rdi
je 0x366c7
movq 0x50(%rsp), %rsi
incq %rsi
callq 0xb510
jmp 0x366c7
movq %rax, %rbx
jmp 0x366c7
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x366ba
movq 0x10(%rsp), %rsi
incq %rsi
callq 0xb510
jmp 0x366ba
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x1bb7e
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x366e3
movq 0x30(%rsp), %rsi
incq %rsi
callq 0xb510
movq %rbx, %rdi
callq 0xb9c0
nop