// File: /workspace/github_cpp_makefile_star2_O1/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 0x5f888
testb %al, %al
je 0x6300e
movq 0x18(%rbx), %rdi
leaq 0xaf69(%rip), %rsi      # 0x6de14
movq $-0x1, %rdx
movl $0x20, %ecx
callq 0x668c4
testb %al, %al
je 0x630ee
movq 0x18(%rbx), %rdi
movq (%r15), %rsi
movq 0x8(%r15), %rdx
callq 0x66f58
testb %al, %al
je 0x630ee
movq 0x10(%rbx), %rdi
movq 0x18(%rbx), %rsi
movq (%rdi), %rax
callq *0xd0(%rax)
testb %al, %al
je 0x630ee
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 0x669b2
movl %eax, %ebp
leaq 0xaeed(%rip), %rsi      # 0x6de14
leaq 0x8(%rsp), %rdi
callq 0xb110
testl %eax, %eax
je 0x62fe9
leaq 0x29630(%rip), %r12     # 0x8c570
movq (%r12), %rdi
cmpq $0x0, 0x18(%rdi)
je 0x62fe9
addq $0x20, %rdi
callq 0xb7d0
movq (%r12), %rax
movq 0x18(%rax), %r15
leaq 0x75e2(%rip), %rsi      # 0x6a549
movl $0xd, %edx
movq %r15, %rdi
callq 0xb5f0
leaq 0xaec2(%rip), %rsi      # 0x6de3d
movl $0x1e, %edx
movq %r15, %rdi
callq 0xb5f0
leaq 0x73b5(%rip), %rsi      # 0x6a344
movl $0x1, %edx
movq %r15, %rdi
callq 0xb5f0
movq %r15, %rdi
movl $0x220, %esi            # imm = 0x220
callq 0xb9a0
movq %rax, %r15
leaq 0xaea9(%rip), %rsi      # 0x6de5c
movl $0x16, %edx
movq %rax, %rdi
callq 0xb5f0
leaq 0x8ec1(%rip), %rsi      # 0x6be88
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 0x631e4
movq 0x18(%rbx), %rdi
leaq 0x8(%rsp), %rsi
movl $0x20, %edx
xorl %ecx, %ecx
callq 0x669b2
movl %eax, %ebp
jmp 0x631e6
movq 0x8(%r14), %rdx
leaq 0xadca(%rip), %rcx      # 0x6dde3
xorl %r15d, %r15d
movl $0x1b, %r8d
movq %r14, %rdi
xorl %esi, %esi
callq 0xb870
leaq 0x2953d(%rip), %r12     # 0x8c570
movq (%r12), %rdi
cmpq $0x0, 0x8(%rdi)
je 0x631d2
addq $0x20, %rdi
callq 0xb7d0
movq (%r12), %rax
movq 0x8(%rax), %rbx
leaq 0x712e(%rip), %rsi      # 0x6a188
movl $0xb, %edx
movq %rbx, %rdi
callq 0xb5f0
leaq 0xad91(%rip), %rsi      # 0x6ddff
movl $0x14, %edx
movq %rbx, %rdi
callq 0xb5f0
leaq 0x7467(%rip), %rsi      # 0x6a4e9
movl $0xc, %edx
movq %rbx, %rdi
callq 0xb5f0
leaq 0xaa0d(%rip), %rsi      # 0x6daa3
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 0x631cf
movq 0x8(%r14), %rdx
leaq 0xad28(%rip), %rcx      # 0x6de21
movl $0x1b, %r8d
movq %r14, %rdi
xorl %esi, %esi
callq 0xb870
leaq 0x29460(%rip), %r12     # 0x8c570
movq (%r12), %rdi
cmpq $0x0, 0x8(%rdi)
je 0x631c6
addq $0x20, %rdi
callq 0xb7d0
movq (%r12), %rax
movq 0x8(%rax), %r15
leaq 0x7051(%rip), %rsi      # 0x6a188
movl $0xb, %edx
movq %r15, %rdi
callq 0xb5f0
leaq 0xacb4(%rip), %rsi      # 0x6ddff
movl $0x14, %edx
movq %r15, %rdi
callq 0xb5f0
leaq 0x738a(%rip), %rsi      # 0x6a4e9
movl $0xc, %edx
movq %r15, %rdi
callq 0xb5f0
leaq 0xa930(%rip), %rsi      # 0x6daa3
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 0x5f894
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 0x6347(%rip), %rsi      # 0x69534
leaq 0x8(%rsp), %rdi
callq 0xb110
testl %eax, %eax
je 0x632cd
leaq 0xac6d(%rip), %rsi      # 0x6de73
leaq 0x8(%rsp), %rdi
callq 0xb110
testl %eax, %eax
je 0x632c8
leaq 0x29351(%rip), %r12     # 0x8c570
movq (%r12), %rdi
cmpq $0x0, 0x18(%rdi)
je 0x632c8
addq $0x20, %rdi
callq 0xb7d0
movq (%r12), %rax
movq 0x18(%rax), %r15
leaq 0x7303(%rip), %rsi      # 0x6a549
movl $0xd, %edx
movq %r15, %rdi
callq 0xb5f0
leaq 0xabe3(%rip), %rsi      # 0x6de3d
movl $0x1e, %edx
movq %r15, %rdi
callq 0xb5f0
leaq 0x70d6(%rip), %rsi      # 0x6a344
movl $0x1, %edx
movq %r15, %rdi
callq 0xb5f0
movq %r15, %rdi
movl $0x22e, %esi            # imm = 0x22E
callq 0xb9a0
movq %rax, %r15
leaq 0xabe8(%rip), %rsi      # 0x6de7a
movl $0x10, %edx
movq %rax, %rdi
callq 0xb5f0
leaq 0x8be2(%rip), %rsi      # 0x6be88
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 0x63325
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 0x289c5(%rip), %rcx     # 0x8bcc0
movq %rcx, (%r15)
movq %r15, %rcx
addq $0x48, %rcx
movq %rcx, 0x38(%r15)
movq %rax, 0x40(%r15)
movb %al, 0x48(%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x58(%r15)
movq %rbx, 0x58(%r15)
movq 0x18(%rbx), %rax
movq %rax, 0x60(%r15)
testb %bpl, %bpl
je 0x63343
movq 0x18(%rbx), %rdi
leaq 0x8(%rsp), %rsi
movl $0x20, %edx
xorl %ecx, %ecx
callq 0x669b2
movl %eax, %ebp
jmp 0x63345
xorl %ebp, %ebp
leaq 0xab41(%rip), %rsi      # 0x6de8d
leaq 0x8(%rsp), %rdi
callq 0xb110
testl %eax, %eax
je 0x63429
leaq 0xab26(%rip), %rsi      # 0x6de8b
leaq 0x8(%rsp), %rdi
callq 0xb110
testl %eax, %eax
je 0x63438
leaq 0x291f2(%rip), %r13     # 0x8c570
movq (%r13), %rdi
cmpq $0x0, 0x18(%rdi)
je 0x63438
addq $0x20, %rdi
callq 0xb7d0
movq (%r13), %rax
movq 0x18(%rax), %r12
leaq 0x71a4(%rip), %rsi      # 0x6a549
movl $0xd, %edx
movq %r12, %rdi
callq 0xb5f0
leaq 0xaa84(%rip), %rsi      # 0x6de3d
movl $0x1e, %edx
movq %r12, %rdi
callq 0xb5f0
leaq 0x6f77(%rip), %rsi      # 0x6a344
movl $0x1, %edx
movq %r12, %rdi
callq 0xb5f0
movq %r12, %rdi
movl $0x238, %esi            # imm = 0x238
callq 0xb9a0
movq %rax, %r12
leaq 0xaaa2(%rip), %rsi      # 0x6de93
movl $0x11, %edx
movq %rax, %rdi
callq 0xb5f0
leaq 0x8a83(%rip), %rsi      # 0x6be88
movl $0x8, %edx
movq %r12, %rdi
callq 0xb5f0
movq %r12, %rdi
callq 0xb250
movq (%r13), %rdi
addq $0x20, %rdi
callq 0xb3b0
jmp 0x63438
testb %bpl, %bpl
je 0x63456
movq %r15, %rdi
callq 0x66b04
movl %eax, %ebp
testb %bpl, %bpl
je 0x63456
movq 0x18(%rbx), %rdi
leaq 0x8(%rsp), %rsi
movl $0x20, %edx
xorl %ecx, %ecx
callq 0x669b2
movl %eax, %ebp
jmp 0x63458
xorl %ebp, %ebp
leaq 0xaa46(%rip), %rsi      # 0x6dea5
leaq 0x8(%rsp), %rdi
callq 0xb110
testl %eax, %eax
je 0x63521
leaq 0x290f8(%rip), %r13     # 0x8c570
movq (%r13), %rdi
cmpq $0x0, 0x18(%rdi)
je 0x63521
addq $0x20, %rdi
callq 0xb7d0
movq (%r13), %rax
movq 0x18(%rax), %r12
leaq 0x70aa(%rip), %rsi      # 0x6a549
movl $0xd, %edx
movq %r12, %rdi
callq 0xb5f0
leaq 0xa98a(%rip), %rsi      # 0x6de3d
movl $0x1e, %edx
movq %r12, %rdi
callq 0xb5f0
leaq 0x6e7d(%rip), %rsi      # 0x6a344
movl $0x1, %edx
movq %r12, %rdi
callq 0xb5f0
movq %r12, %rdi
movl $0x23c, %esi            # imm = 0x23C
callq 0xb9a0
movq %rax, %r12
leaq 0xa9c1(%rip), %rsi      # 0x6deac
movl $0x10, %edx
movq %rax, %rdi
callq 0xb5f0
leaq 0x8989(%rip), %rsi      # 0x6be88
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 0x635ff
movq 0x18(%rbx), %rdi
movq %r14, %rsi
callq 0x66c34
testb %al, %al
je 0x635ff
testq %r15, %r15
jne 0x635f1
leaq 0xa98a(%rip), %rsi      # 0x6ded8
movq %r14, %rdi
callq 0xb720
leaq 0x29013(%rip), %r13     # 0x8c570
movq (%r13), %rdi
cmpq $0x0, 0x8(%rdi)
je 0x635f1
addq $0x20, %rdi
callq 0xb7d0
movq (%r13), %rax
movq 0x8(%rax), %r12
leaq 0x6c04(%rip), %rsi      # 0x6a188
movl $0xb, %edx
movq %r12, %rdi
callq 0xb5f0
leaq 0xa867(%rip), %rsi      # 0x6ddff
movl $0x14, %edx
movq %r12, %rdi
callq 0xb5f0
leaq 0x6f3d(%rip), %rsi      # 0x6a4e9
movl $0xc, %edx
movq %r12, %rdi
callq 0xb5f0
leaq 0xa4e3(%rip), %rsi      # 0x6daa3
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 0x5f894
jmp 0x636f1
movq 0x8(%r14), %rdx
leaq 0xa8b3(%rip), %rcx      # 0x6debd
movl $0x1a, %r8d
movq %r14, %rdi
xorl %esi, %esi
callq 0xb870
leaq 0x28f4f(%rip), %rbp     # 0x8c570
movq (%rbp), %rdi
cmpq $0x0, 0x8(%rdi)
je 0x636d7
addq $0x20, %rdi
callq 0xb7d0
movq (%rbp), %rax
movq 0x8(%rax), %r12
leaq 0x6b40(%rip), %rsi      # 0x6a188
movl $0xb, %edx
movq %r12, %rdi
callq 0xb5f0
leaq 0xa7a3(%rip), %rsi      # 0x6ddff
movl $0x14, %edx
movq %r12, %rdi
callq 0xb5f0
leaq 0x6e79(%rip), %rsi      # 0x6a4e9
movl $0xc, %edx
movq %r12, %rdi
callq 0xb5f0
leaq 0xa41f(%rip), %rsi      # 0x6daa3
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 0x636e5
movq (%r15), %rax
movq %r15, %rdi
callq *0x8(%rax)
movq 0x18(%rbx), %rdi
callq 0x5f894
xorl %r15d, %r15d
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x631d2
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb510
jmp 0x631d2
jmp 0x63718
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x63737
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb510
movq %rbx, %rdi
callq 0xb9c0
nop