// File: mh0fm4[P]SCDC/src/lib/scdc/scdc.cc
// Function: scdc_dataset_open_intern
scdc_dataset_t scdc_dataset_open_intern(const char *uri, scdc_args_t *args)
{
  SCDC_TRACE(__func__ << ": uri: '" << uri << "'");

  scdc_dataset_t dataset = new _scdc_dataset_t;

  string sscheme, sauthority, spath;
  split_uri(uri, -1, &sscheme, &sauthority, &spath);

  scdc_args xargs(args);

  dataset->nodeconn = scdc_main_context.data->nodeconns.open(sscheme.c_str(), sauthority.c_str(), &xargs);

  if (!dataset->nodeconn)
  {
    SCDC_TRACE(__func__ << ": failed: open connection failed");
    delete dataset;
    return SCDC_DATASET_NULL;
  }

  scdc_result result;
  dataset->dataset = dataset->nodeconn->dataset_open(spath, result);
  SCDC_RESULT_SET_STR(scdc_main_context.data->result, result.c_str());

  SCDC_TRACE(__func__ << ": result: '" << result << "'");

  if (!dataset->dataset)
  {
    SCDC_FAIL(__func__ << ": failed");
    scdc_main_context.data->nodeconns.close(dataset->nodeconn);
    delete dataset;
    return SCDC_DATASET_NULL;
  }

#if SCDC_DEBUG
  scdc_main_context.data->datasets.insert(dataset);
#endif

  SCDC_TRACE(__func__ << ": return '" << dataset << "'");

/*  SCDC_INFO("opening dataset " << dataset << " with uri '" << uri << "'");*/

  return dataset;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1a0, %rsp            # imm = 0x1A0
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
jmp 0x22a95
movl $0x20, %edi
callq 0xc690
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x108(%rbp)
callq 0x25730
jmp 0x22ab3
movq -0x108(%rbp), %rax
movq %rax, -0x20(%rbp)
leaq -0x50(%rbp), %rdi
movq %rdi, -0x120(%rbp)
callq 0xc960
leaq -0x70(%rbp), %rdi
movq %rdi, -0x118(%rbp)
callq 0xc960
leaq -0x90(%rbp), %rdi
movq %rdi, -0x110(%rbp)
callq 0xc960
movq -0x120(%rbp), %rdx
movq -0x118(%rbp), %rcx
movq -0x110(%rbp), %r8
movq -0x10(%rbp), %rdi
movq $-0x1, %rsi
callq 0x2a760
jmp 0x22b18
movq -0x18(%rbp), %rsi
leaq -0xc8(%rbp), %rdi
callq 0x25660
jmp 0x22b2a
movq 0xb1bef(%rip), %rax     # 0xd4720
addq $0x98, %rax
movq %rax, -0x138(%rbp)
leaq -0x50(%rbp), %rdi
callq 0xc260
movq %rax, -0x130(%rbp)
leaq -0x70(%rbp), %rdi
callq 0xc260
movq -0x138(%rbp), %rdi
movq -0x130(%rbp), %rsi
movq %rax, %rdx
leaq -0xc8(%rbp), %rcx
callq 0x506e0
movq %rax, -0x128(%rbp)
jmp 0x22b7d
movq -0x128(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x22c28
jmp 0x22b9b
jmp 0x22b9d
jmp 0x22b9f
movq -0x20(%rbp), %rax
movq %rax, -0x140(%rbp)
cmpq $0x0, %rax
je 0x22bcd
movq -0x140(%rbp), %rdi
callq 0x25780
movq -0x140(%rbp), %rdi
movl $0x20, %esi
callq 0xc6a0
movq $0x0, -0x8(%rbp)
movl $0x1, -0xcc(%rbp)
jmp 0x22e7f
movq -0x108(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
movl $0x20, %esi
callq 0xc6a0
jmp 0x22ee0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x22ec2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x22eb6
leaq -0xf0(%rbp), %rdi
movq %rdi, -0x150(%rbp)
callq 0xc960
movq -0x150(%rbp), %rdx
movq -0x20(%rbp), %rax
movq (%rax), %rdi
leaq -0x90(%rbp), %rsi
callq 0x257b0
movq %rax, -0x148(%rbp)
jmp 0x22c5e
movq -0x148(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0xb1aac(%rip), %rax     # 0xd4720
movq (%rax), %rax
addq $0x8, %rax
movq %rax, -0x158(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0xc260
movq -0x158(%rbp), %rdi
movq %rax, %rsi
movq 0xb1a81(%rip), %rax     # 0xd4720
movq (%rax), %rax
movq (%rax), %rdx
subq $0x1, %rdx
callq 0xc320
jmp 0x22cb0
jmp 0x22cb2
movq -0x20(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x22e20
jmp 0x22cc3
movq 0xb19de(%rip), %rdi     # 0xd46a8
callq 0x257e0
movq %rax, -0x160(%rbp)
jmp 0x22cd8
movq -0x160(%rbp), %rax
cmpq $0x0, %rax
je 0x22dbe
movq 0xb19b8(%rip), %rdi     # 0xd46a8
callq 0x25800
jmp 0x22cf7
movq 0xb19aa(%rip), %rdi     # 0xd46a8
callq 0x257e0
movq %rax, -0x168(%rbp)
jmp 0x22d0c
movq -0x168(%rbp), %rdi
leaq 0x83496(%rip), %rsi     # 0xa61b0
callq 0xc670
movq %rax, -0x170(%rbp)
jmp 0x22d28
movq -0x170(%rbp), %rdi
leaq 0x83486(%rip), %rsi     # 0xa61bc
callq 0xc670
movq %rax, -0x178(%rbp)
jmp 0x22d44
movq -0x178(%rbp), %rdi
leaq 0x83474(%rip), %rsi     # 0xa61c6
callq 0xc670
movq %rax, -0x180(%rbp)
jmp 0x22d60
movq -0x180(%rbp), %rdi
leaq 0x876c0(%rip), %rsi     # 0xaa42e
callq 0xc670
movq %rax, -0x188(%rbp)
jmp 0x22d7c
movq -0x188(%rbp), %rdi
movq 0xb1236(%rip), %rsi     # 0xd3fc0
callq 0xc6d0
jmp 0x22d91
movq 0xb1910(%rip), %rdi     # 0xd46a8
callq 0x25820
jmp 0x22d9f
jmp 0x22dbe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0xc3e0
jmp 0x22eb6
jmp 0x22dc0
jmp 0x22dc2
movq 0xb1957(%rip), %rdi     # 0xd4720
addq $0x98, %rdi
movq -0x20(%rbp), %rax
movq (%rax), %rsi
callq 0x50d50
jmp 0x22dde
movq -0x20(%rbp), %rax
movq %rax, -0x190(%rbp)
cmpq $0x0, %rax
je 0x22e0c
movq -0x190(%rbp), %rdi
callq 0x25780
movq -0x190(%rbp), %rdi
movl $0x20, %esi
callq 0xc6a0
movq $0x0, -0x8(%rbp)
movl $0x1, -0xcc(%rbp)
jmp 0x22e73
movq 0xb18f9(%rip), %rdi     # 0xd4720
addq $0x8, %rdi
leaq -0x20(%rbp), %rsi
callq 0x25840
movb %dl, -0x199(%rbp)
movq %rax, -0x198(%rbp)
jmp 0x22e43
movb -0x199(%rbp), %al
movq -0x198(%rbp), %rcx
movq %rcx, -0x100(%rbp)
movb %al, -0xf8(%rbp)
jmp 0x22e5f
jmp 0x22e61
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movl $0x1, -0xcc(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0xc3e0
leaq -0xc8(%rbp), %rdi
callq 0x256b0
leaq -0x90(%rbp), %rdi
callq 0xc3e0
leaq -0x70(%rbp), %rdi
callq 0xc3e0
leaq -0x50(%rbp), %rdi
callq 0xc3e0
movq -0x8(%rbp), %rax
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbp
retq
leaq -0xc8(%rbp), %rdi
callq 0x256b0
leaq -0x90(%rbp), %rdi
callq 0xc3e0
leaq -0x70(%rbp), %rdi
callq 0xc3e0
leaq -0x50(%rbp), %rdi
callq 0xc3e0
movq -0x28(%rbp), %rdi
callq 0xcba0
nopl (%rax)