// File: /workspace/github_cpp_makefile_star2_O1/mh0fm4[P]SCDC/src/components/compcoup/compcoup_transport.cc
// Function: scdc_compcoup_transport::on_dataset_open(scdc_transport_connection_t*)
void scdc_compcoup_transport::on_dataset_open(scdc_transport_connection_t *conn)
{
  SCDC_TRACE("on_dataset_open:");

  SCDC_ASSERT(dataprovs);

  /* read request: DATASET_OPEN <path> */

  string path;
  scdc_dataset_transport::read_string(conn, &path);
  SCDC_TRACE("on_dataset_open: path: '" << path << "'");

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

  scdc_dataset_transport::write_delim(conn, "DATASET_OPEN", -1, default_delim);

  scdc_result result;

  scdc_dataset *dataset = dataprovs->dataset_open(path, result);

  if (dataset)
  {
    scdc_dataset_transport::write_delim(conn, "OK", -1, default_delim);

    scdc_dataset_transport::write_delim(conn, "STATE", -1, default_delim);
    scdc_dataset_transport::write_state_begin(conn);
    dataprovs->dataset_close_write_state(dataset, conn->get_outgoing(), result);
    scdc_dataset_transport::write_state_end(conn);

  } else
  {
    SCDC_FAIL("on_dataset_open: failed");
    scdc_dataset_transport::write_delim(conn, "FAILED", -1, default_delim);

    scdc_dataset_transport::write_delim(conn, "NOSTATE", -1, default_delim);
  }

  scdc_dataset_transport::write_delim(conn, "RESULT", -1, default_delim);
  scdc_dataset_transport::write_string(conn, result.c_str(), result.size());

  transport->send_outgoing(conn);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
movq %rdi, %r14
cmpq $0x0, 0x8(%rdi)
jne 0x65150
leaq 0x274e8(%rip), %r12     # 0x8c570
movq (%r12), %rdi
cmpq $0x0, 0x18(%rdi)
je 0x65150
addq $0x20, %rdi
callq 0xb7d0
movq (%r12), %rax
movq 0x18(%rax), %r15
leaq 0x549a(%rip), %rsi      # 0x6a549
movl $0xd, %edx
movq %r15, %rdi
callq 0xb5f0
leaq 0x8d7a(%rip), %rsi      # 0x6de3d
movl $0x1e, %edx
movq %r15, %rdi
callq 0xb5f0
leaq 0x526d(%rip), %rsi      # 0x6a344
movl $0x1, %edx
movq %r15, %rdi
callq 0xb5f0
movq %r15, %rdi
movl $0x4c0, %esi            # imm = 0x4C0
callq 0xb9a0
movq %rax, %r15
leaq 0x92b6(%rip), %rsi      # 0x6e3b1
movl $0xc, %edx
movq %rax, %rdi
callq 0xb5f0
leaq 0x6d79(%rip), %rsi      # 0x6be88
movl $0x8, %edx
movq %r15, %rdi
callq 0xb5f0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0xb4d0
movsbl %al, %esi
movq %r15, %rdi
callq 0xb050
movq %rax, %rdi
callq 0xb340
movq (%r12), %rdi
addq $0x20, %rdi
callq 0xb3b0
leaq 0x38(%rsp), %r12
movq %r12, -0x10(%r12)
movq $0x0, -0x8(%r12)
movb $0x0, (%r12)
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0x66c34
leaq 0x8c98(%rip), %rsi      # 0x6de14
movq %rbx, %rdi
movq $-0x1, %rdx
movl $0x20, %ecx
callq 0x668c4
leaq 0x18(%rsp), %r13
movq %r13, -0x10(%r13)
movq $0x0, -0x8(%r13)
movb $0x0, (%r13)
movq 0x8(%r14), %rdi
leaq 0x28(%rsp), %rsi
leaq 0x8(%rsp), %rdx
callq 0x1e3de
movq %rax, %r15
testq %rax, %rax
je 0x6522d
leaq 0x436c(%rip), %rsi      # 0x69534
movq %rbx, %rdi
movq $-0x1, %rdx
movl $0x20, %ecx
callq 0x668c4
leaq 0x8caa(%rip), %rsi      # 0x6de8d
movq %rbx, %rdi
movq $-0x1, %rdx
movl $0x20, %ecx
callq 0x668c4
leaq 0x9305(%rip), %rsi      # 0x6e503
movl $0x1, %edx
movq %rbx, %rdi
callq 0x672f6
movq 0x8(%r14), %rdi
leaq 0x70(%rbx), %rdx
leaq 0x8(%rsp), %rcx
movq %r15, %rsi
callq 0x1e95a
movq %rbx, %rdi
callq 0x66f26
jmp 0x652fa
leaq 0x2733c(%rip), %rbp     # 0x8c570
movq (%rbp), %rdi
cmpq $0x0, 0x8(%rdi)
je 0x652c4
addq $0x20, %rdi
callq 0xb7d0
movq (%rbp), %rax
movq 0x8(%rax), %r15
leaq 0x4f2d(%rip), %rsi      # 0x6a188
movl $0xb, %edx
movq %r15, %rdi
callq 0xb5f0
leaq 0x8b90(%rip), %rsi      # 0x6ddff
movl $0x14, %edx
movq %r15, %rdi
callq 0xb5f0
leaq 0x913b(%rip), %rsi      # 0x6e3be
movl $0x17, %edx
movq %r15, %rdi
callq 0xb5f0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0xb4d0
movsbl %al, %esi
movq %r15, %rdi
callq 0xb050
movq %rax, %rdi
callq 0xb340
movq (%rbp), %rdi
addq $0x20, %rdi
callq 0xb3b0
leaq 0x8ba8(%rip), %rsi      # 0x6de73
movq %rbx, %rdi
movq $-0x1, %rdx
movl $0x20, %ecx
callq 0x668c4
leaq 0x8ba5(%rip), %rsi      # 0x6de8b
movq %rbx, %rdi
movq $-0x1, %rdx
movl $0x20, %ecx
callq 0x668c4
leaq 0x8ba4(%rip), %rsi      # 0x6dea5
movq %rbx, %rdi
movq $-0x1, %rdx
movl $0x20, %ecx
callq 0x668c4
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x66f58
movq 0x10(%r14), %rdi
movq (%rdi), %rax
movq %rbx, %rsi
callq *0xd0(%rax)
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x6534e
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb510
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x65365
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xb510
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x65393
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x65393
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xb510
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x653aa
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xb510
movq %rbx, %rdi
callq 0xb9c0