// File: /workspace/github_cpp_makefile_star2_O3/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 0x8(%rsi), %r13
movq 0x20(%rsi), %rbp
movq 0x28(%rsi), %rbx
leaq (%rbx,%r13), %r12
movq %rbp, %rdx
subq %rbx, %rdx
movq %r12, %rdi
movl $0x7c, %esi
callq 0xb5b0
testq %rax, %rax
jne 0x1e689
movq 0x38(%r14), %rax
testq %rax, %rax
je 0x1e651
movq %r14, %rdi
callq *%rax
movq 0x8(%r14), %r13
movq 0x20(%r14), %rbp
movq 0x28(%r14), %rbx
jmp 0x1e651
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 0x1be38
movq (%rbp), %rdi
leaq 0x4ae3d(%rip), %rsi     # 0x69500
movq %r13, %rdx
xorl %eax, %eax
callq 0xb4e0
movq 0x28(%r14), %rax
addq %rbx, %rax
incq %rax
movq %rax, 0x28(%r14)
movq 0x18(%r15), %rax
addq $0x8, %r15
cmpq %r15, %rax
movq 0x8(%rsp), %rbx
je 0x1e709
movq 0x30(%rsp), %r12
cmpq %r12, 0x40(%rax)
je 0x1e7e2
movq %rax, %rdi
callq 0xb350
cmpq %r15, %rax
jne 0x1e6f2
movq 0x8(%rbx), %rdx
leaq 0x4be1d(%rip), %rcx     # 0x6a531
movl $0x1b, %r8d
movq %rbx, %rdi
xorl %esi, %esi
callq 0xb870
leaq 0x6de45(%rip), %r15     # 0x8c570
movq (%r15), %rdi
cmpq $0x0, 0x8(%rdi)
je 0x1e7de
addq $0x20, %rdi
callq 0xb7d0
movq (%r15), %rax
movq 0x8(%rax), %r14
leaq 0x4ba58(%rip), %rsi     # 0x6a1a8
movl $0xb, %edx
movq %r14, %rdi
callq 0xb5f0
leaq 0x4bd51(%rip), %rsi     # 0x6a4b5
movl $0xf, %edx
movq %r14, %rdi
callq 0xb5f0
leaq 0x4bdd5(%rip), %rsi     # 0x6a54d
movl $0x17, %edx
movq %r14, %rdi
callq 0xb5f0
leaq 0x4f387(%rip), %rsi     # 0x6db13
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
jmp 0x1e7f5
movq (%r12), %rax
movq %r12, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq *0x48(%rax)
movq %rax, %rbx
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x1e811
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 0x1e842
movq 0x20(%rsp), %rsi
incq %rsi
callq 0xb510
movq %rbx, %rdi
callq 0xb9c0