// File: mh0fm4[P]SCDC/src/components/dataprov/dataprov_hook.cc
// Function: scdc_dataprov_hook::open(char const*, scdc_args*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
bool scdc_dataprov_hook::open(const char *conf, scdc_args *args, scdc_result &result)
{
  SCDC_TRACE("open: '" << conf << "'");

  bool ret = true;

  args = open_args_init(args);

  if (args->get<scdc_args_dataprov_hook_t>(SCDC_ARGS_TYPE_DATAPROV_HOOK, &hook_arg, true) == SCDC_ARG_REF_NULL)
  {
    SCDC_ERROR("open: getting hook functions");
    ret = false;
    goto do_quit;
  }

  if (!scdc_dataprov::open(0, args, result))
  {
    SCDC_FAIL("open: opening base");
    ret = false;

  } else
  {
    if (hook_arg.hook_open_intern)
    {
      scdcint_t ret;

      dataprov = hook_arg.hook_open_intern(hook_arg.intern_data, conf, args->get_args(), &ret);

      if (ret != SCDC_SUCCESS)
      {
        SCDC_FAIL("open: opening data provider with hook function");
        ret = false;
        goto do_close;
      }
    }

do_close:
    if (!ret) scdc_dataprov::close(result);
  }

  SCDC_TRACE("open: dataprov: '" << dataprov << "'");

  open_args_clear();

do_quit:
  if (!ret) open_args_release();

  return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
jmp 0x78752
movq -0x38(%rbp), %rdi
movb $0x1, -0x21(%rbp)
movq -0x18(%rbp), %rsi
callq 0x390c0
movq -0x38(%rbp), %rdx
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
addq $0x68, %rdx
movl $0xf, %esi
movl $0x1, %ecx
callq 0x79a90
cmpq $0x0, %rax
jne 0x78817
jmp 0x7878e
leaq 0x5bf13(%rip), %rax     # 0xd46a8
movq (%rax), %rdi
callq 0x2e8e0
cmpq $0x0, %rax
je 0x7880c
leaq 0x5befe(%rip), %rax     # 0xd46a8
movq (%rax), %rdi
callq 0x2e900
leaq 0x5beef(%rip), %rax     # 0xd46a8
movq (%rax), %rdi
callq 0x2e8e0
movq %rax, %rdi
leaq 0x2dcdd(%rip), %rsi     # 0xa64a8
callq 0xc670
movq %rax, %rdi
leaq 0x300b8(%rip), %rsi     # 0xa8892
callq 0xc670
movq %rax, %rdi
leaq 0x300b9(%rip), %rsi     # 0xa88a2
callq 0xc670
movq %rax, %rdi
movq 0x5b7c8(%rip), %rsi     # 0xd3fc0
callq 0xc6d0
leaq 0x5bea4(%rip), %rax     # 0xd46a8
movq (%rax), %rdi
callq 0x2e920
jmp 0x7880e
movb $0x0, -0x21(%rbp)
jmp 0x789dc
movq -0x38(%rbp), %rdi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
xorl %eax, %eax
movl %eax, %esi
callq 0x5dee0
testb $0x1, %al
jne 0x788bf
jmp 0x78836
leaq 0x5be6b(%rip), %rax     # 0xd46a8
movq (%rax), %rdi
callq 0x257e0
cmpq $0x0, %rax
je 0x788b4
leaq 0x5be56(%rip), %rax     # 0xd46a8
movq (%rax), %rdi
callq 0x25800
leaq 0x5be47(%rip), %rax     # 0xd46a8
movq (%rax), %rdi
callq 0x257e0
movq %rax, %rdi
leaq 0x2d93d(%rip), %rsi     # 0xa61b0
callq 0xc670
movq %rax, %rdi
leaq 0x30010(%rip), %rsi     # 0xa8892
callq 0xc670
movq %rax, %rdi
leaq 0x2f274(%rip), %rsi     # 0xa7b05
callq 0xc670
movq %rax, %rdi
movq 0x5b720(%rip), %rsi     # 0xd3fc0
callq 0xc6d0
leaq 0x5bdfc(%rip), %rax     # 0xd46a8
movq (%rax), %rdi
callq 0x25820
jmp 0x788b6
movb $0x0, -0x21(%rbp)
jmp 0x789cf
movq -0x38(%rbp), %rax
cmpq $0x0, 0xa8(%rax)
je 0x789b8
movq -0x38(%rbp), %rax
movq 0xa8(%rax), %rcx
movq %rcx, -0x40(%rbp)
movq 0xb0(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rdi
callq 0x79b20
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq %rax, %rdx
movq -0x40(%rbp), %rax
leaq -0x30(%rbp), %rcx
callq *%rax
movq %rax, %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0xb8(%rax)
cmpq $0x1, -0x30(%rbp)
je 0x789b6
jmp 0x7892c
leaq 0x5bd75(%rip), %rax     # 0xd46a8
movq (%rax), %rdi
callq 0x257e0
cmpq $0x0, %rax
je 0x789aa
leaq 0x5bd60(%rip), %rax     # 0xd46a8
movq (%rax), %rdi
callq 0x25800
leaq 0x5bd51(%rip), %rax     # 0xd46a8
movq (%rax), %rdi
callq 0x257e0
movq %rax, %rdi
leaq 0x2d847(%rip), %rsi     # 0xa61b0
callq 0xc670
movq %rax, %rdi
leaq 0x2ff1a(%rip), %rsi     # 0xa8892
callq 0xc670
movq %rax, %rdi
leaq 0x2ff38(%rip), %rsi     # 0xa88bf
callq 0xc670
movq %rax, %rdi
movq 0x5b62a(%rip), %rsi     # 0xd3fc0
callq 0xc6d0
leaq 0x5bd06(%rip), %rax     # 0xd46a8
movq (%rax), %rdi
callq 0x25820
jmp 0x789ac
movq $0x0, -0x30(%rbp)
jmp 0x789ba
jmp 0x789b8
jmp 0x789ba
testb $0x1, -0x21(%rbp)
jne 0x789cd
movq -0x38(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x5e090
jmp 0x789cf
jmp 0x789d1
jmp 0x789d3
movq -0x38(%rbp), %rdi
callq 0x79b30
testb $0x1, -0x21(%rbp)
jne 0x789eb
movq -0x38(%rbp), %rdi
callq 0x3abc0
movb -0x21(%rbp), %al
andb $0x1, %al
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)