// File: /workspace/github_cpp_makefile_star2_O3/mh0fm4[P]SCDC/src/components/compcoup/compcoup_transport.cc
// Function: scdc_compcoup_transport::dataset_open(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
scdc_dataset *scdc_compcoup_transport::dataset_open(const string &path, scdc_result &result)
{
  SCDC_TRACE("dataset_open: path: '" << path << "'");

  if (!transport_connection->acquire())
  {
    result = "acquiring connection failed";
    SCDC_FAIL(__func__ << ": " << result);
    return 0;
  }

  bool ret = true;

  /* send request: DATASET_OPEN <path> */

  ret = ret && scdc_dataset_transport::write_delim(transport_connection, "DATASET_OPEN", -1, default_delim);
  ret = ret && scdc_dataset_transport::write_string(transport_connection, path);

  ret = ret && transport->send_outgoing(transport_connection);

  if (!ret)
  {
    result = "sending open request failed";
    SCDC_FAIL(__func__ << ": " << result);
    transport_connection->release();
    return 0;
  }

  /* read answer: DATASET_OPEN (OK|FAILED) (STATE <state>|NOSTATE) RESULT <string> */

  string s;

  ret = ret && scdc_dataset_transport::read_delim(transport_connection, &s, default_delim);
  SCDC_ASSERT(s == "DATASET_OPEN");

  scdc_dataset_transport *dataset_transport = 0;

  ret = ret && scdc_dataset_transport::read_delim(transport_connection, &s, default_delim);
  if (s == "OK")
  {
    dataset_transport = new scdc_dataset_transport();

    dataset_transport->set_compcoup_transport(this);
    dataset_transport->set_transport_connection(transport_connection);

  } else
  {
    SCDC_ASSERT(s == "FAILED");
  }

  ret = ret && scdc_dataset_transport::read_delim(transport_connection, &s, default_delim);
  if (s == "STATE")
  {
    ret = ret && dataset_transport->read_state();

  } else
  {
    SCDC_ASSERT(s == "NOSTATE");
  }

  ret = ret && scdc_dataset_transport::read_delim(transport_connection, &s, default_delim);
  SCDC_ASSERT(s == "RESULT");
  ret = ret && scdc_dataset_transport::read_string(transport_connection, &result);

  if (!ret)
  {
    result = "reading open answer failed";
    SCDC_FAIL(__func__ << ": " << result);
    delete dataset_transport;
    transport_connection->release();
    return 0;
  }

  if (!dataset_transport)
  {
    result = "creating local dataset failed";
    SCDC_FAIL(__func__ << ": " << result);
  }

  transport_connection->release();

  return dataset_transport;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
callq 0x5f3b8
testb %al, %al
je 0x62b46
movq 0x18(%rbx), %rdi
leaq 0xb4a1(%rip), %rsi      # 0x6de84
movq $-0x1, %rdx
movl $0x20, %ecx
callq 0x6638a
testb %al, %al
je 0x62c26
movq 0x18(%rbx), %rdi
movq (%r15), %rsi
movq 0x8(%r15), %rdx
callq 0x66d5a
testb %al, %al
je 0x62c26
movq 0x10(%rbx), %rdi
movq 0x18(%rbx), %rsi
movq (%rdi), %rax
callq *0xd0(%rax)
testb %al, %al
je 0x62c26
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq 0x18(%rbx), %rdi
leaq 0x8(%rsp), %rsi
movl $0x20, %edx
xorl %ecx, %ecx
callq 0x66504
movl %eax, %ebp
leaq 0xb425(%rip), %rsi      # 0x6de84
leaq 0x8(%rsp), %rdi
callq 0xb110
testl %eax, %eax
je 0x62b21
leaq 0x29af8(%rip), %r12     # 0x8c570
movq (%r12), %rdi
cmpq $0x0, 0x18(%rdi)
je 0x62b21
addq $0x20, %rdi
callq 0xb7d0
movq (%r12), %rax
movq 0x18(%rax), %r15
leaq 0x7aca(%rip), %rsi      # 0x6a569
movl $0xd, %edx
movq %r15, %rdi
callq 0xb5f0
leaq 0xb3fa(%rip), %rsi      # 0x6dead
movl $0x1e, %edx
movq %r15, %rdi
callq 0xb5f0
leaq 0x789d(%rip), %rsi      # 0x6a364
movl $0x1, %edx
movq %r15, %rdi
callq 0xb5f0
movq %r15, %rdi
movl $0x220, %esi            # imm = 0x220
callq 0xb9a0
movq %rax, %r15
leaq 0xb3e1(%rip), %rsi      # 0x6decc
movl $0x16, %edx
movq %rax, %rdi
callq 0xb5f0
leaq 0x9401(%rip), %rsi      # 0x6bf00
movl $0x8, %edx
movq %r15, %rdi
callq 0xb5f0
movq %r15, %rdi
callq 0xb250
movq (%r12), %rdi
addq $0x20, %rdi
callq 0xb3b0
testb %bpl, %bpl
je 0x62d1c
movq 0x18(%rbx), %rdi
leaq 0x8(%rsp), %rsi
movl $0x20, %edx
xorl %ecx, %ecx
callq 0x66504
movl %eax, %ebp
jmp 0x62d1e
movq 0x8(%r14), %rdx
leaq 0xb302(%rip), %rcx      # 0x6de53
xorl %r15d, %r15d
movl $0x1b, %r8d
movq %r14, %rdi
xorl %esi, %esi
callq 0xb870
leaq 0x29a05(%rip), %r12     # 0x8c570
movq (%r12), %rdi
cmpq $0x0, 0x8(%rdi)
je 0x62d0a
addq $0x20, %rdi
callq 0xb7d0
movq (%r12), %rax
movq 0x8(%rax), %rbx
leaq 0x7616(%rip), %rsi      # 0x6a1a8
movl $0xb, %edx
movq %rbx, %rdi
callq 0xb5f0
leaq 0xb2c9(%rip), %rsi      # 0x6de6f
movl $0x14, %edx
movq %rbx, %rdi
callq 0xb5f0
leaq 0x794f(%rip), %rsi      # 0x6a509
movl $0xc, %edx
movq %rbx, %rdi
callq 0xb5f0
leaq 0xaf45(%rip), %rsi      # 0x6db13
movl $0x2, %edx
movq %rbx, %rdi
callq 0xb5f0
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %rbx, %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 (%r12), %rdi
addq $0x20, %rdi
callq 0xb3b0
jmp 0x62d07
movq 0x8(%r14), %rdx
leaq 0xb260(%rip), %rcx      # 0x6de91
movl $0x1b, %r8d
movq %r14, %rdi
xorl %esi, %esi
callq 0xb870
leaq 0x29928(%rip), %r12     # 0x8c570
movq (%r12), %rdi
cmpq $0x0, 0x8(%rdi)
je 0x62cfe
addq $0x20, %rdi
callq 0xb7d0
movq (%r12), %rax
movq 0x8(%rax), %r15
leaq 0x7539(%rip), %rsi      # 0x6a1a8
movl $0xb, %edx
movq %r15, %rdi
callq 0xb5f0
leaq 0xb1ec(%rip), %rsi      # 0x6de6f
movl $0x14, %edx
movq %r15, %rdi
callq 0xb5f0
leaq 0x7872(%rip), %rsi      # 0x6a509
movl $0xc, %edx
movq %r15, %rdi
callq 0xb5f0
leaq 0xae68(%rip), %rsi      # 0x6db13
movl $0x2, %edx
movq %r15, %rdi
callq 0xb5f0
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %r15, %rdi
callq 0xb5f0
movq %rax, %r14
movq (%rax), %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 (%r12), %rdi
addq $0x20, %rdi
callq 0xb3b0
movq 0x18(%rbx), %rdi
callq 0x5f3c4
xorl %r15d, %r15d
movq %r15, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %ebp, %ebp
leaq 0x682f(%rip), %rsi      # 0x69554
leaq 0x8(%rsp), %rdi
callq 0xb110
testl %eax, %eax
je 0x62e05
leaq 0xb1a5(%rip), %rsi      # 0x6dee3
leaq 0x8(%rsp), %rdi
callq 0xb110
testl %eax, %eax
je 0x62e00
leaq 0x29819(%rip), %r12     # 0x8c570
movq (%r12), %rdi
cmpq $0x0, 0x18(%rdi)
je 0x62e00
addq $0x20, %rdi
callq 0xb7d0
movq (%r12), %rax
movq 0x18(%rax), %r15
leaq 0x77eb(%rip), %rsi      # 0x6a569
movl $0xd, %edx
movq %r15, %rdi
callq 0xb5f0
leaq 0xb11b(%rip), %rsi      # 0x6dead
movl $0x1e, %edx
movq %r15, %rdi
callq 0xb5f0
leaq 0x75be(%rip), %rsi      # 0x6a364
movl $0x1, %edx
movq %r15, %rdi
callq 0xb5f0
movq %r15, %rdi
movl $0x22e, %esi            # imm = 0x22E
callq 0xb9a0
movq %rax, %r15
leaq 0xb120(%rip), %rsi      # 0x6deea
movl $0x10, %edx
movq %rax, %rdi
callq 0xb5f0
leaq 0x9122(%rip), %rsi      # 0x6bf00
movl $0x8, %edx
movq %r15, %rdi
callq 0xb5f0
movq %r15, %rdi
callq 0xb250
movq (%r12), %rdi
addq $0x20, %rdi
callq 0xb3b0
xorl %r15d, %r15d
jmp 0x62e55
movl $0x68, %edi
callq 0xb500
movq %rax, %r15
xorl %eax, %eax
movq %rax, 0x8(%r15)
movb %al, 0x10(%r15)
leaq 0x28(%r15), %rcx
movq %rcx, 0x18(%r15)
movq %rax, 0x20(%r15)
movb %al, 0x28(%r15)
leaq 0x28e8d(%rip), %rcx     # 0x8bcc0
movq %rcx, (%r15)
movq %r15, %rcx
addq $0x48, %rcx
movq %rcx, 0x38(%r15)
movq %rax, 0x40(%r15)
movb %al, 0x48(%r15)
movq %rbx, 0x58(%r15)
movq 0x18(%rbx), %rax
movq %rax, 0x60(%r15)
testb %bpl, %bpl
je 0x62e9e
movq 0x18(%rbx), %rdi
leaq 0x8(%rsp), %rsi
movl $0x20, %edx
xorl %ecx, %ecx
callq 0x66504
movl %eax, %ebp
leaq 0xb085(%rip), %rsi      # 0x6defd
leaq 0x8(%rsp), %rdi
callq 0xb110
testl %eax, %eax
jne 0x62eb9
testb %bpl, %bpl
je 0x62fa0
movq %r15, %rdi
callq 0x66638
movl %eax, %ebp
jmp 0x62f82
leaq 0xb058(%rip), %rsi      # 0x6defd
leaq 0x8(%rsp), %rdi
callq 0xb110
xorl %ebp, %ebp
testl %eax, %eax
je 0x62fa2
leaq 0xb03b(%rip), %rsi      # 0x6defb
leaq 0x8(%rsp), %rdi
callq 0xb110
testl %eax, %eax
je 0x62f82
leaq 0x29697(%rip), %r13     # 0x8c570
movq (%r13), %rdi
cmpq $0x0, 0x18(%rdi)
je 0x62f82
addq $0x20, %rdi
callq 0xb7d0
movq (%r13), %rax
movq 0x18(%rax), %r12
leaq 0x7669(%rip), %rsi      # 0x6a569
movl $0xd, %edx
movq %r12, %rdi
callq 0xb5f0
leaq 0xaf99(%rip), %rsi      # 0x6dead
movl $0x1e, %edx
movq %r12, %rdi
callq 0xb5f0
leaq 0x743c(%rip), %rsi      # 0x6a364
movl $0x1, %edx
movq %r12, %rdi
callq 0xb5f0
movq %r12, %rdi
movl $0x238, %esi            # imm = 0x238
callq 0xb9a0
movq %rax, %r12
leaq 0xafb7(%rip), %rsi      # 0x6df03
movl $0x11, %edx
movq %rax, %rdi
callq 0xb5f0
leaq 0x8fa0(%rip), %rsi      # 0x6bf00
movl $0x8, %edx
movq %r12, %rdi
callq 0xb5f0
movq %r12, %rdi
callq 0xb250
movq (%r13), %rdi
addq $0x20, %rdi
callq 0xb3b0
testb %bpl, %bpl
je 0x62fa0
movq 0x18(%rbx), %rdi
leaq 0x8(%rsp), %rsi
movl $0x20, %edx
xorl %ecx, %ecx
callq 0x66504
movl %eax, %ebp
jmp 0x62fa2
xorl %ebp, %ebp
leaq 0xaf6c(%rip), %rsi      # 0x6df15
leaq 0x8(%rsp), %rdi
callq 0xb110
testl %eax, %eax
je 0x6306b
leaq 0x295ae(%rip), %r13     # 0x8c570
movq (%r13), %rdi
cmpq $0x0, 0x18(%rdi)
je 0x6306b
addq $0x20, %rdi
callq 0xb7d0
movq (%r13), %rax
movq 0x18(%rax), %r12
leaq 0x7580(%rip), %rsi      # 0x6a569
movl $0xd, %edx
movq %r12, %rdi
callq 0xb5f0
leaq 0xaeb0(%rip), %rsi      # 0x6dead
movl $0x1e, %edx
movq %r12, %rdi
callq 0xb5f0
leaq 0x7353(%rip), %rsi      # 0x6a364
movl $0x1, %edx
movq %r12, %rdi
callq 0xb5f0
movq %r12, %rdi
movl $0x23c, %esi            # imm = 0x23C
callq 0xb9a0
movq %rax, %r12
leaq 0xaee7(%rip), %rsi      # 0x6df1c
movl $0x10, %edx
movq %rax, %rdi
callq 0xb5f0
leaq 0x8eb7(%rip), %rsi      # 0x6bf00
movl $0x8, %edx
movq %r12, %rdi
callq 0xb5f0
movq %r12, %rdi
callq 0xb250
movq (%r13), %rdi
addq $0x20, %rdi
callq 0xb3b0
testb %bpl, %bpl
je 0x63149
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0x667ca
testb %al, %al
je 0x63149
testq %r15, %r15
jne 0x6313b
leaq 0xaeb0(%rip), %rsi      # 0x6df48
movq %r14, %rdi
callq 0xb720
leaq 0x294c9(%rip), %r13     # 0x8c570
movq (%r13), %rdi
cmpq $0x0, 0x8(%rdi)
je 0x6313b
addq $0x20, %rdi
callq 0xb7d0
movq (%r13), %rax
movq 0x8(%rax), %r12
leaq 0x70da(%rip), %rsi      # 0x6a1a8
movl $0xb, %edx
movq %r12, %rdi
callq 0xb5f0
leaq 0xad8d(%rip), %rsi      # 0x6de6f
movl $0x14, %edx
movq %r12, %rdi
callq 0xb5f0
leaq 0x7413(%rip), %rsi      # 0x6a509
movl $0xc, %edx
movq %r12, %rdi
callq 0xb5f0
leaq 0xaa09(%rip), %rsi      # 0x6db13
movl $0x2, %edx
movq %r12, %rdi
callq 0xb5f0
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %r12, %rdi
callq 0xb5f0
movq %rax, %rdi
callq 0xb250
movq (%r13), %rdi
addq $0x20, %rdi
callq 0xb3b0
movq 0x18(%rbx), %rdi
callq 0x5f3c4
jmp 0x6323b
movq 0x8(%r14), %rdx
leaq 0xadd9(%rip), %rcx      # 0x6df2d
movl $0x1a, %r8d
movq %r14, %rdi
xorl %esi, %esi
callq 0xb870
leaq 0x29405(%rip), %rbp     # 0x8c570
movq (%rbp), %rdi
cmpq $0x0, 0x8(%rdi)
je 0x63221
addq $0x20, %rdi
callq 0xb7d0
movq (%rbp), %rax
movq 0x8(%rax), %r12
leaq 0x7016(%rip), %rsi      # 0x6a1a8
movl $0xb, %edx
movq %r12, %rdi
callq 0xb5f0
leaq 0xacc9(%rip), %rsi      # 0x6de6f
movl $0x14, %edx
movq %r12, %rdi
callq 0xb5f0
leaq 0x734f(%rip), %rsi      # 0x6a509
movl $0xc, %edx
movq %r12, %rdi
callq 0xb5f0
leaq 0xa945(%rip), %rsi      # 0x6db13
movl $0x2, %edx
movq %r12, %rdi
callq 0xb5f0
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %r12, %rdi
callq 0xb5f0
movq %rax, %r14
movq (%rax), %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 (%rbp), %rdi
addq $0x20, %rdi
callq 0xb3b0
testq %r15, %r15
je 0x6322f
movq (%r15), %rax
movq %r15, %rdi
callq *0x8(%rax)
movq 0x18(%rbx), %rdi
callq 0x5f3c4
xorl %r15d, %r15d
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x62d0a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb510
jmp 0x62d0a
jmp 0x63262
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x63281
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb510
movq %rbx, %rdi
callq 0xb9c0
nop