// File: /workspace/github_cpp_makefile_star2_O3/mh0fm4[P]SCDC/src/components/transport/transport.cc
// Function: scdc_transport::start(long long)
bool scdc_transport::start(scdcint_t mode)
{
  SCDC_TRACE("start: running: '" << running << "'");

  if (running)
  {
    SCDC_FAIL("start: already running");
    return false;
  }

  server = new scdc_transport_server_t();

  /* use connection pool */
  if (max_connections > 0) server_connections = new scdc_transport_connection_pool(max_connections, this);

  compcoup_transport->start(mode);

  if (mode == SCDC_NODEPORT_START_LOOP_UNTIL_CANCEL)
  {
    async = false;
    running = true;
    shutdowned = false;
    canceled = false;
    run();

  } else if (mode == SCDC_NODEPORT_START_ASYNC_UNTIL_CANCEL)
  {
    async = true;
    running = true;
    shutdowned = false;
    canceled = false;
    pthread_create(&server->thread, NULL, server_run, this);

  } else
  {
    SCDC_ERROR("mode '" << mode << "' not supported");
    return false;
  }

  return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
cmpb $0x1, 0x29(%rdi)
jne 0x5fbdc
leaq 0x2ca1d(%rip), %r14     # 0x8c570
movq (%r14), %rdi
cmpq $0x0, 0x8(%rdi)
je 0x5fd25
addq $0x20, %rdi
callq 0xb7d0
movq (%r14), %rax
movq 0x8(%rax), %rbx
leaq 0xa630(%rip), %rsi      # 0x6a1a8
movl $0xb, %edx
movq %rbx, %rdi
callq 0xb5f0
leaq 0xe2ec(%rip), %rsi      # 0x6de78
movl $0xb, %edx
movq %rbx, %rdi
callq 0xb5f0
leaq 0xdf1c(%rip), %rsi      # 0x6dabc
movl $0x16, %edx
movq %rbx, %rdi
callq 0xb5f0
movq (%rbx), %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 (%r14), %rdi
jmp 0x5fd1c
movq %rsi, %rbx
movq %rdi, %r14
movl $0x8, %edi
callq 0xb500
movq $0x0, (%rax)
movq %rax, 0x30(%r14)
movq 0x20(%r14), %r12
testq %r12, %r12
jle 0x5fc1f
movl $0x18, %edi
callq 0xb500
movq %rax, %r15
movq %rax, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x5f4c4
movq %r15, 0x38(%r14)
movq 0x8(%r14), %rdi
movq (%rdi), %rax
movq %rbx, %rsi
callq *0x28(%rax)
cmpq $0x4, %rbx
je 0x5fc4b
cmpq $0x1, %rbx
jne 0x5fc6f
movl $0x100, 0x28(%r14)      # imm = 0x100
movq (%r14), %rax
movq %r14, %rdi
callq *0x38(%rax)
jmp 0x5fc68
movl $0x101, 0x28(%r14)      # imm = 0x101
movq 0x30(%r14), %rdi
leaq 0xed(%rip), %rdx        # 0x5fd4b
xorl %esi, %esi
movq %r14, %rcx
callq 0xba00
movb $0x1, %al
jmp 0x5fd27
leaq 0x2c8fa(%rip), %r15     # 0x8c570
movq (%r15), %rdi
cmpq $0x0, 0x18(%rdi)
je 0x5fd25
addq $0x20, %rdi
callq 0xb7d0
movq (%r15), %rax
movq 0x18(%rax), %r14
leaq 0xa80d(%rip), %rsi      # 0x6a4a8
movl $0xc, %edx
movq %r14, %rdi
callq 0xb5f0
leaq 0xe1c9(%rip), %rsi      # 0x6de78
movl $0xb, %edx
movq %r14, %rdi
callq 0xb5f0
leaq 0xe172(%rip), %rsi      # 0x6de35
movl $0x6, %edx
movq %r14, %rdi
callq 0xb5f0
movq %r14, %rdi
movq %rbx, %rsi
callq 0xb1d0
movq %rax, %rbx
leaq 0xddee(%rip), %rsi      # 0x6dad3
movl $0xf, %edx
movq %rax, %rdi
callq 0xb5f0
movq (%rbx), %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 %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
movl $0x18, %esi
movq %r15, %rdi
callq 0xb510
movq %rbx, %rdi
callq 0xb9c0