// File: /workspace/github_cpp_makefile_star2_O1/mh0fm4[P]SCDC/src/components/dataprov/dataprov_pool.cc
// Function: scdc_dataprov_pool::dataset_open_read_state(scdc_data*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
scdc_dataset *scdc_dataprov_pool::dataset_open_read_state(scdc_data *incoming, scdc_result &result)
{
  SCDC_TRACE("dataset_open_read_state:");

  char *buf;
  scdcint_t buf_size;
  const char *end;

  while (1)
  {
    buf = incoming->get_read_pos_buf();
    buf_size = incoming->get_read_pos_buf_size();
    end = memchr(buf, '|', buf_size);

    if (end) break;

    incoming->do_next();
  }

  scdc_dataprov *dataprov = 0;

  string dataprov_str(buf, end - buf);
  sscanf(dataprov_str.c_str(), "%p", &dataprov);

  incoming->inc_read_pos(end - buf + 1);

  if (!exists(dataprov))
  {
    result = "data provider not available";
    SCDC_FAIL(__func__ << ": " << result);
    return 0;
  }

  return dataprov->dataset_open_read_state(incoming, result);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, 0x8(%rsp)
movq %rsi, %r14
movq %rdi, %r15
movq 0x20(%rsi), %rdx
movq 0x28(%rsi), %rax
movq 0x8(%rsi), %r12
addq %rax, %r12
subq %rax, %rdx
movq %r12, %rdi
movl $0x7c, %esi
callq 0xb5b0
testq %rax, %rax
jne 0x1e795
movq 0x38(%r14), %rax
testq %rax, %rax
je 0x1e787
movq %r14, %rdi
callq *%rax
movq 0x20(%r14), %rdx
movq 0x28(%r14), %rax
movq 0x8(%r14), %r12
jmp 0x1e761
leaq 0x30(%rsp), %r13
movq $0x0, (%r13)
movq %rax, %rbx
subq %r12, %rbx
leaq 0x20(%rsp), %rcx
movq %rcx, -0x10(%rcx)
leaq 0x10(%rsp), %rbp
movq %rbp, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x1bee6
movq (%rbp), %rdi
leaq 0x4ad11(%rip), %rsi     # 0x694e0
movq %r13, %rdx
xorl %eax, %eax
callq 0xb4e0
movq 0x28(%r14), %rax
addq %rbx, %rax
incq %rax
movq %rax, 0x28(%r14)
movq (%r13), %r12
movq 0x18(%r15), %rax
addq $0x8, %r15
cmpq %r15, %rax
setne %cl
je 0x1e80b
cmpq %r12, 0x40(%rax)
je 0x1e80b
movq %rax, %rdi
callq 0xb350
jmp 0x1e7f3
testb %cl, %cl
je 0x1e829
movq (%r12), %rax
movq %r12, %rdi
movq %r14, %rsi
movq 0x8(%rsp), %rdx
callq *0x48(%rax)
movq %rax, %rbx
jmp 0x1e905
movq 0x8(%rsp), %rbx
movq 0x8(%rbx), %rdx
leaq 0x4bcd8(%rip), %rcx     # 0x6a511
movl $0x1b, %r8d
movq %rbx, %rdi
xorl %esi, %esi
callq 0xb870
leaq 0x6dd20(%rip), %r15     # 0x8c570
movq (%r15), %rdi
cmpq $0x0, 0x8(%rdi)
je 0x1e903
addq $0x20, %rdi
callq 0xb7d0
movq (%r15), %rax
movq 0x8(%rax), %r14
leaq 0x4b913(%rip), %rsi     # 0x6a188
movl $0xb, %edx
movq %r14, %rdi
callq 0xb5f0
leaq 0x4bc0c(%rip), %rsi     # 0x6a495
movl $0xf, %edx
movq %r14, %rdi
callq 0xb5f0
leaq 0x4bc90(%rip), %rsi     # 0x6a52d
movl $0x17, %edx
movq %r14, %rdi
callq 0xb5f0
leaq 0x4f1f2(%rip), %rsi     # 0x6daa3
movl $0x2, %edx
movq %r14, %rdi
callq 0xb5f0
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
movq %r14, %rdi
callq 0xb5f0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0xb4d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0xb050
movq %rax, %rdi
callq 0xb340
movq (%r15), %rdi
addq $0x20, %rdi
callq 0xb3b0
xorl %ebx, %ebx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x1e921
movq 0x20(%rsp), %rsi
incq %rsi
callq 0xb510
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x1e952
movq 0x20(%rsp), %rsi
incq %rsi
callq 0xb510
movq %rbx, %rdi
callq 0xb9c0