// File: /workspace/github_cpp_makefile_star2_O3/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 0x25168
movq %rax, %r15
leaq 0x68(%rbx), %rdx
movl $0xf, %esi
movq %rax, %rdi
movl $0x1, %ecx
callq 0x4c232
testq %rax, %rax
je 0x4b36e
movq %rbx, %rdi
xorl %esi, %esi
movq %r15, %rdx
movq %r12, %rcx
callq 0x35e3a
testb %al, %al
je 0x4b407
movq 0xa8(%rbx), %rax
testq %rax, %rax
je 0x4b35c
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 0x4b35c
leaq 0x4129d(%rip), %r15     # 0x8c570
movq (%r15), %rdi
cmpq $0x0, 0x8(%rdi)
je 0x4b35c
addq $0x20, %rdi
callq 0xb7d0
movq (%r15), %rax
movq 0x8(%rax), %r14
leaq 0x1eeb4(%rip), %rsi     # 0x6a1a8
movl $0xb, %edx
movq %r14, %rdi
callq 0xb5f0
leaq 0x2158a(%rip), %rsi     # 0x6c892
movl $0xf, %edx
movq %r14, %rdi
callq 0xb5f0
leaq 0x215a3(%rip), %rsi     # 0x6c8bf
movl $0x2e, %edx
movq %r14, %rdi
callq 0xb5f0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0xb4d0
movsbl %al, %esi
movq %r14, %rdi
callq 0xb050
movq %rax, %rdi
callq 0xb340
movq (%r15), %rdi
addq $0x20, %rdi
callq 0xb3b0
movq 0x58(%rbx), %rax
movq $0x0, (%rax)
movb $0x1, %al
jmp 0x4b4ac
leaq 0x411fb(%rip), %r15     # 0x8c570
movq (%r15), %rdi
cmpq $0x0, 0x18(%rdi)
je 0x4b4a2
addq $0x20, %rdi
callq 0xb7d0
movq (%r15), %rax
movq 0x18(%rax), %r14
leaq 0x1f10e(%rip), %rsi     # 0x6a4a8
movl $0xc, %edx
movq %r14, %rdi
callq 0xb5f0
leaq 0x214e4(%rip), %rsi     # 0x6c892
movl $0xf, %edx
movq %r14, %rdi
callq 0xb5f0
leaq 0x214e0(%rip), %rsi     # 0x6c8a2
movl $0x1c, %edx
movq %r14, %rdi
callq 0xb5f0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0xb4d0
movsbl %al, %esi
movq %r14, %rdi
callq 0xb050
movq %rax, %rdi
callq 0xb340
movq (%r15), %rdi
addq $0x20, %rdi
callq 0xb3b0
jmp 0x4b4a2
leaq 0x41162(%rip), %r15     # 0x8c570
movq (%r15), %rdi
cmpq $0x0, 0x8(%rdi)
je 0x4b497
addq $0x20, %rdi
callq 0xb7d0
movq (%r15), %rax
movq 0x8(%rax), %r14
leaq 0x1ed79(%rip), %rsi     # 0x6a1a8
movl $0xb, %edx
movq %r14, %rdi
callq 0xb5f0
leaq 0x2144f(%rip), %rsi     # 0x6c892
movl $0xf, %edx
movq %r14, %rdi
callq 0xb5f0
leaq 0x206f6(%rip), %rsi     # 0x6bb4d
movl $0x12, %edx
movq %r14, %rdi
callq 0xb5f0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0xb4d0
movsbl %al, %esi
movq %r14, %rdi
callq 0xb050
movq %rax, %rdi
callq 0xb340
movq (%r15), %rdi
addq $0x20, %rdi
callq 0xb3b0
movq 0x58(%rbx), %rax
movq $0x0, (%rax)
movq %rbx, %rdi
callq 0x2675c
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq