// File: mh0fm4[P]SCDC/src/components/dataprov/dataprov_hook.cc
// Function: scdc_dataprov_hook::dataset_open(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
scdc_dataset *scdc_dataprov_hook::dataset_open(std::string &path, scdc_result &result)
{
  SCDC_TRACE("dataset_open: path: '" << path << "'");

  scdc_dataset_hook *dataset_hook = 0;
  void *dataset_hook_dataset = 0;

  if (hook_arg.hook.dataset_open)
  {
    scdc_result_t res = SCDC_RESULT_INIT_EMPTY;
    dataset_hook_dataset = hook_arg.hook.dataset_open(dataprov, path.c_str(), &res);
    result = SCDC_RESULT_STR(&res);

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

  /* unset path to prevent a further cd command */
  path.clear();

  dataset_hook = new scdc_dataset_hook(this, dataset_hook_dataset);

do_return:
  SCDC_TRACE("dataset_open: return: " << dataset_hook);

  return dataset_hook;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x260, %rsp            # imm = 0x260
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x248(%rbp)
jmp 0x78b24
movq -0x248(%rbp), %rax
movq $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
cmpq $0x0, 0x80(%rax)
je 0x78c75
leaq -0x230(%rbp), %rdi
xorl %esi, %esi
movl $0x208, %edx            # imm = 0x208
callq 0xc350
movq -0x248(%rbp), %rax
movq $0x200, -0x230(%rbp) # imm = 0x200
movq 0x80(%rax), %rcx
movq %rcx, -0x250(%rbp)
movq 0xb8(%rax), %rax
movq %rax, -0x258(%rbp)
movq -0x10(%rbp), %rdi
callq 0xc260
movq -0x258(%rbp), %rdi
movq %rax, %rsi
movq -0x250(%rbp), %rax
leaq -0x230(%rbp), %rdx
callq *%rax
movq %rax, -0x28(%rbp)
leaq -0x230(%rbp), %rsi
addq $0x8, %rsi
movq -0x18(%rbp), %rdi
callq 0xc920
cmpq $0x0, -0x28(%rbp)
jne 0x78c73
jmp 0x78bd2
leaq 0x5bacf(%rip), %rax     # 0xd46a8
movq (%rax), %rdi
callq 0x257e0
cmpq $0x0, %rax
je 0x78c6f
leaq 0x5bab6(%rip), %rax     # 0xd46a8
movq (%rax), %rdi
callq 0x25800
leaq 0x5baa7(%rip), %rax     # 0xd46a8
movq (%rax), %rdi
callq 0x257e0
movq %rax, %rdi
leaq 0x2d59d(%rip), %rsi     # 0xa61b0
callq 0xc670
movq %rax, %rdi
leaq 0x2fc70(%rip), %rsi     # 0xa8892
callq 0xc670
movq %rax, %rdi
leaq 0x2d8d8(%rip), %rsi     # 0xa6509
callq 0xc670
movq %rax, %rdi
leaq 0x2fcd5(%rip), %rsi     # 0xa8915
callq 0xc670
movq %rax, %rdi
movq -0x18(%rbp), %rsi
callq 0xc5b0
movq %rax, %rdi
movq 0x5b365(%rip), %rsi     # 0xd3fc0
callq 0xc6d0
leaq 0x5ba41(%rip), %rax     # 0xd46a8
movq (%rax), %rdi
callq 0x25820
jmp 0x78c71
jmp 0x78cb2
jmp 0x78c75
movq -0x10(%rbp), %rdi
callq 0xc8f0
movl $0x40, %edi
callq 0xc690
movq -0x248(%rbp), %rsi
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x260(%rbp)
movq -0x28(%rbp), %rdx
callq 0x79b50
jmp 0x78ca7
movq -0x260(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x78cb4
jmp 0x78cb6
movq -0x20(%rbp), %rax
addq $0x260, %rsp            # imm = 0x260
popq %rbp
retq
movq -0x260(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x238(%rbp)
movl %eax, -0x23c(%rbp)
movl $0x40, %esi
callq 0xc6a0
movq -0x238(%rbp), %rdi
callq 0xcba0
nopw %cs:(%rax,%rax)