// File: 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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x9867a
movq -0x30(%rbp), %rax
testb $0x1, 0x29(%rax)
je 0x98713
jmp 0x9868a
leaq 0x3c017(%rip), %rax     # 0xd46a8
movq (%rax), %rdi
callq 0x257e0
cmpq $0x0, %rax
je 0x98708
leaq 0x3c002(%rip), %rax     # 0xd46a8
movq (%rax), %rdi
callq 0x25800
leaq 0x3bff3(%rip), %rax     # 0xd46a8
movq (%rax), %rdi
callq 0x257e0
movq %rax, %rdi
leaq 0xdae9(%rip), %rsi      # 0xa61b0
callq 0xc670
movq %rax, %rdi
leaq 0x1177a(%rip), %rsi     # 0xa9e50
callq 0xc670
movq %rax, %rdi
leaq 0x113af(%rip), %rsi     # 0xa9a94
callq 0xc670
movq %rax, %rdi
movq 0x3b8cc(%rip), %rsi     # 0xd3fc0
callq 0xc6d0
leaq 0x3bfa8(%rip), %rax     # 0xd46a8
movq (%rax), %rdi
callq 0x25820
jmp 0x9870a
movb $0x0, -0x1(%rbp)
jmp 0x988ac
movl $0x8, %edi
callq 0xc690
movq %rax, %rdi
movq %rdi, -0x38(%rbp)
xorl %esi, %esi
movl $0x8, %edx
callq 0xc350
movq -0x38(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x30(%rax)
cmpq $0x0, 0x20(%rax)
jle 0x98793
movl $0x18, %edi
callq 0xc690
movq -0x30(%rbp), %rdx
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x40(%rbp)
movq 0x20(%rdx), %rsi
callq 0x97cf0
jmp 0x98766
movq -0x30(%rbp), %rax
movq -0x40(%rbp), %rcx
movq %rcx, 0x38(%rax)
jmp 0x98793
movq -0x40(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x18, %esi
callq 0xc6a0
jmp 0x988b7
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x18(%rbp), %rsi
movq (%rdi), %rax
callq *0x28(%rax)
cmpq $0x1, -0x18(%rbp)
jne 0x987cb
movq -0x30(%rbp), %rdi
movb $0x0, 0x28(%rdi)
movb $0x1, 0x29(%rdi)
movb $0x0, 0x2a(%rdi)
movb $0x0, 0x2b(%rdi)
movq (%rdi), %rax
callq *0x38(%rax)
jmp 0x988a8
cmpq $0x4, -0x18(%rbp)
jne 0x987ff
movq -0x30(%rbp), %rcx
movb $0x1, 0x28(%rcx)
movb $0x1, 0x29(%rcx)
movb $0x0, 0x2a(%rcx)
movb $0x0, 0x2b(%rcx)
movq 0x30(%rcx), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq 0xcb(%rip), %rdx        # 0x988c0
callq 0xcc20
jmp 0x988a6
jmp 0x98801
leaq 0x3bea0(%rip), %rax     # 0xd46a8
movq (%rax), %rdi
callq 0x2e8e0
cmpq $0x0, %rax
je 0x9889e
leaq 0x3be87(%rip), %rax     # 0xd46a8
movq (%rax), %rdi
callq 0x2e900
leaq 0x3be78(%rip), %rax     # 0xd46a8
movq (%rax), %rdi
callq 0x2e8e0
movq %rax, %rdi
leaq 0xdc66(%rip), %rsi      # 0xa64a8
callq 0xc670
movq %rax, %rdi
leaq 0x115ff(%rip), %rsi     # 0xa9e50
callq 0xc670
movq %rax, %rdi
leaq 0x115ad(%rip), %rsi     # 0xa9e0d
callq 0xc670
movq %rax, %rdi
movq -0x18(%rbp), %rsi
callq 0xc340
movq %rax, %rdi
leaq 0x11230(%rip), %rsi     # 0xa9aab
callq 0xc670
movq %rax, %rdi
movq 0x3b736(%rip), %rsi     # 0xd3fc0
callq 0xc6d0
leaq 0x3be12(%rip), %rax     # 0xd46a8
movq (%rax), %rdi
callq 0x2e920
jmp 0x988a0
movb $0x0, -0x1(%rbp)
jmp 0x988ac
jmp 0x988a8
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
movq -0x20(%rbp), %rdi
callq 0xcba0