// File: /workspace/github_cpp_makefile_star2_O3/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 0x1d0a0
leaq 0x50(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%r15), %rsi
movq 0x8(%r15), %rdx
addq %rsi, %rdx
leaq 0x40(%rsp), %rdi
callq 0x1d0a0
leaq 0x80(%rsp), %rdi
leaq 0x40(%rsp), %rdx
movl $0x2f, %esi
callq 0x37a30
movq 0x40(%rsp), %rdi
cmpq %r12, %rdi
je 0x35ffa
movq 0x50(%rsp), %rsi
incq %rsi
callq 0xb510
movq %rsp, %rdi
leaq 0x80(%rsp), %rsi
callq 0x1b878
leaq 0x35d06(%rip), %rsi     # 0x6bd17
movq %rsp, %r15
movq %r15, %rdi
callq 0xb110
movl %eax, %ebp
movq (%r15), %rdi
leaq 0x10(%rsp), %r13
cmpq %r13, %rdi
je 0x36038
movq 0x10(%rsp), %rsi
incq %rsi
callq 0xb510
testl %ebp, %ebp
je 0x3611f
movq (%r14), %rax
leaq 0x20(%rsp), %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq *0x38(%rax)
movq %rax, %r15
testq %rax, %rax
jne 0x3618c
leaq 0x5650c(%rip), %r15     # 0x8c570
movq (%r15), %rdi
cmpq $0x0, 0x8(%rdi)
je 0x36117
addq $0x20, %rdi
callq 0xb7d0
movq (%r15), %rax
movq 0x8(%rax), %r14
leaq 0x3411f(%rip), %rsi     # 0x6a1a8
movl $0xb, %edx
movq %r14, %rdi
callq 0xb5f0
leaq 0x35bf3(%rip), %rsi     # 0x6bc90
movl $0xa, %edx
movq %r14, %rdi
callq 0xb5f0
leaq 0x35c6d(%rip), %rsi     # 0x6bd1e
movl $0x11, %edx
movq %r14, %rdi
callq 0xb5f0
leaq 0x34451(%rip), %rsi     # 0x6a516
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
jmp 0x362dd
leaq 0x80(%rsp), %rsi
movl 0x18(%rsi), %edx
movq %rsp, %rdi
callq 0x1f068
leaq 0x20(%rsp), %rdi
movq %rsp, %r15
movq %r15, %rsi
callq 0xb670
movq (%r15), %rdi
cmpq %r13, %rdi
je 0x36157
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 0x5479c(%rip), %rax     # 0x8a920
movq %rax, (%r15)
movb $0x1, 0x10(%r15)
cmpq $0x0, 0x28(%rsp)
je 0x362dd
leaq 0x35b91(%rip), %rsi     # 0x6bd30
movq %rsp, %rdi
leaq 0x20(%rsp), %rdx
callq 0x1b7aa
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 0x362c7
leaq 0x563a2(%rip), %rbp     # 0x8c570
movq (%rbp), %rdi
cmpq $0x0, 0x8(%rdi)
je 0x36284
addq $0x20, %rdi
callq 0xb7d0
movq (%rbp), %rax
movq 0x8(%rax), %r12
leaq 0x33fb3(%rip), %rsi     # 0x6a1a8
movl $0xb, %edx
movq %r12, %rdi
callq 0xb5f0
leaq 0x35a87(%rip), %rsi     # 0x6bc90
movl $0xa, %edx
movq %r12, %rdi
callq 0xb5f0
leaq 0x35b01(%rip), %rsi     # 0x6bd1e
movl $0x11, %edx
movq %r12, %rdi
callq 0xb5f0
leaq 0x35b03(%rip), %rsi     # 0x6bd34
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 0x362c4
movq 0x70(%rsp), %rsi
incq %rsi
callq 0xb510
xorl %r15d, %r15d
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x362dd
movq 0x10(%rsp), %rsi
incq %rsi
callq 0xb510
leaq 0x80(%rsp), %rdi
callq 0x1bad0
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x36306
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 0x36361
movq 0x70(%rsp), %rsi
incq %rsi
callq 0xb510
jmp 0x36361
jmp 0x36379
jmp 0x36379
jmp 0x36379
movq %rax, %rbx
movq 0x40(%rsp), %rdi
cmpq %r12, %rdi
je 0x36389
movq 0x50(%rsp), %rsi
incq %rsi
callq 0xb510
jmp 0x36389
movq %rax, %rbx
jmp 0x36389
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x3637c
movq 0x10(%rsp), %rsi
incq %rsi
callq 0xb510
jmp 0x3637c
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x1bad0
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x363a5
movq 0x30(%rsp), %rsi
incq %rsi
callq 0xb510
movq %rbx, %rdi
callq 0xb9c0
nop