// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rcx, %r12
movq %rsi, %r14
movq %rdi, %rbx
movq %rdx, %rsi
callq 0x25258
movq %rax, %r15
leaq 0x68(%rbx), %rdx
movl $0xf, %esi
movq %rax, %rdi
movl $0x1, %ecx
callq 0x4c726
testq %rax, %rax
je 0x4b8b6
movq %rbx, %rdi
xorl %esi, %esi
movq %r15, %rdx
movq %r12, %rcx
callq 0x36176
movl %eax, %ebp
testb %al, %al
je 0x4b94d
movq 0xa8(%rbx), %rax
testq %rax, %rax
je 0x4b9dd
movq 0xb0(%rbx), %rdi
leaq 0x8(%rsp), %r12
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
callq *%rax
movq %rax, 0xb8(%rbx)
cmpq $0x1, (%r12)
je 0x4b9dd
leaq 0x40d51(%rip), %r15     # 0x8c570
movq (%r15), %rdi
cmpq $0x0, 0x8(%rdi)
je 0x4b8a8
addq $0x20, %rdi
callq 0xb7d0
movq (%r15), %rax
movq 0x8(%rax), %r14
leaq 0x1e948(%rip), %rsi     # 0x6a188
movl $0xb, %edx
movq %r14, %rdi
callq 0xb5f0
leaq 0x20fc6(%rip), %rsi     # 0x6c81a
movl $0xf, %edx
movq %r14, %rdi
callq 0xb5f0
leaq 0x20fdf(%rip), %rsi     # 0x6c847
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 $0x0, 0x8(%rsp)
jmp 0x4b9dd
leaq 0x40cb3(%rip), %r15     # 0x8c570
movq (%r15), %rdi
cmpq $0x0, 0x18(%rdi)
je 0x4b946
addq $0x20, %rdi
callq 0xb7d0
movq (%r15), %rax
movq 0x18(%rax), %r14
leaq 0x1ebaa(%rip), %rsi     # 0x6a488
movl $0xc, %edx
movq %r14, %rdi
callq 0xb5f0
leaq 0x20f28(%rip), %rsi     # 0x6c81a
movl $0xf, %edx
movq %r14, %rdi
callq 0xb5f0
leaq 0x20f24(%rip), %rsi     # 0x6c82a
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
xorl %ebp, %ebp
jmp 0x4b9e8
leaq 0x40c1c(%rip), %r15     # 0x8c570
movq (%r15), %rdi
cmpq $0x0, 0x8(%rdi)
je 0x4b9dd
addq $0x20, %rdi
callq 0xb7d0
movq (%r15), %rax
movq 0x8(%rax), %r14
leaq 0x1e813(%rip), %rsi     # 0x6a188
movl $0xb, %edx
movq %r14, %rdi
callq 0xb5f0
leaq 0x20e91(%rip), %rsi     # 0x6c81a
movl $0xf, %edx
movq %r14, %rdi
callq 0xb5f0
leaq 0x20190(%rip), %rsi     # 0x6bb2d
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)
testb %bpl, %bpl
jne 0x4b9f5
movq %rbx, %rdi
callq 0x268bc
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq