// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r12
movq %rsi, %r14
movq %rdi, %rbx
movq %rdx, %rsi
callq 0x20a4e
movq %rax, %r15
leaq 0x68(%rbx), %rdx
pushq $0xf
popq %rsi
pushq $0x1
popq %rcx
movq %rax, %rdi
callq 0x3bae0
testq %rax, %rax
je 0x3aff4
movq %rbx, %rdi
xorl %esi, %esi
movq %r15, %rdx
movq %r12, %rcx
callq 0x2deba
testb %al, %al
je 0x3b059
movq 0xa8(%rbx), %rax
testq %rax, %rax
je 0x3afe5
movq 0xb0(%rbx), %rdi
movq %rsp, %r12
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
callq *%rax
movq %rax, 0xb8(%rbx)
cmpq $0x1, (%r12)
je 0x3afe5
leaq 0x3a5f3(%rip), %r14     # 0x75580
movq (%r14), %rdi
cmpq $0x0, 0x8(%rdi)
je 0x3afe5
addq $0x20, %rdi
callq 0xb800
movq (%r14), %rax
movq 0x8(%rax), %rdi
leaq 0x161da(%rip), %rsi     # 0x51188
callq 0xb520
leaq 0x18868(%rip), %rsi     # 0x53822
movq %rax, %rdi
callq 0xb520
leaq 0x18886(%rip), %rsi     # 0x5384f
movq %rax, %rdi
callq 0xb520
movq %rax, %rdi
callq 0xb270
movq (%r14), %rdi
addq $0x20, %rdi
callq 0xb3e0
movq 0x58(%rbx), %rax
andq $0x0, (%rax)
movb $0x1, %al
jmp 0x3b0ca
leaq 0x3a585(%rip), %r14     # 0x75580
movq (%r14), %rdi
cmpq $0x0, 0x18(%rdi)
je 0x3b0c0
addq $0x20, %rdi
callq 0xb800
movq (%r14), %rax
movq 0x18(%rax), %rdi
leaq 0x16468(%rip), %rsi     # 0x51488
callq 0xb520
leaq 0x187f6(%rip), %rsi     # 0x53822
movq %rax, %rdi
callq 0xb520
leaq 0x187f7(%rip), %rsi     # 0x53832
movq %rax, %rdi
callq 0xb520
movq %rax, %rdi
callq 0xb270
movq (%r14), %rdi
addq $0x20, %rdi
callq 0xb3e0
jmp 0x3b0c0
leaq 0x3a520(%rip), %r14     # 0x75580
movq (%r14), %rdi
cmpq $0x0, 0x8(%rdi)
je 0x3b0b8
addq $0x20, %rdi
callq 0xb800
movq (%r14), %rax
movq 0x8(%rax), %rdi
leaq 0x16107(%rip), %rsi     # 0x51188
callq 0xb520
leaq 0x18795(%rip), %rsi     # 0x53822
movq %rax, %rdi
callq 0xb520
leaq 0x17a41(%rip), %rsi     # 0x52add
movq %rax, %rdi
callq 0xb520
movq %rax, %rdi
callq 0xb270
movq (%r14), %rdi
addq $0x20, %rdi
callq 0xb3e0
movq 0x58(%rbx), %rax
andq $0x0, (%rax)
movq %rbx, %rdi
callq 0x21786
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq