// File: /workspace/github_cpp_makefile_star2_O2/mh0fm4[P]SCDC/test/bench/simpat/simpat_srv.c
// Function: main
int main(int argc, char *argv[])
{
  /* scdc.log_init("log_FILE", sys.stdout, sys.stderr)*/

  scdc_init(SCDC_INIT_DEFAULT);

  simpat_init();

  scdc_nodeport_t np = SCDC_NODEPORT_NULL;

  if (argc <= 1)
  {
    SIMPAT_TRACE("setup: none");

  } else if (strcmp(argv[1], "uds") == 0)
  {
    SIMPAT_TRACE("setup: UDS");

    const char *socketname = (argc <= 2)?"simpat":argv[2];

    np = scdc_nodeport_open("uds:socketname:max_connections", socketname, 2);

  } else if (strcmp(argv[1], "tcp") == 0)
  {
    SIMPAT_TRACE("setup: TCP");

    np = scdc_nodeport_open("tcp:max_connections", 2);

  } else if (strcmp(argv[1], "mpi") == 0)
  {
    SIMPAT_TRACE("setup: MPI");

    np = scdc_nodeport_open("mpi");

  } else SIMPAT_TRACE("unknown mode: %s", argv[1]);

  SIMPAT_TRACE("start");
  scdc_nodeport_start(np, SCDC_NODEPORT_START_ASYNC_UNTIL_CANCEL);

  printf("Press <ENTER> to quit!\n");
  getchar();

  SIMPAT_TRACE("stop");
  scdc_nodeport_stop(np);

  SIMPAT_TRACE("release");
  scdc_nodeport_close(np);

  simpat_release();

  scdc_release();

  /*scdc.log_release()*/

  return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x39321(%rip), %rdi     # 0x4550d
xorl %eax, %eax
callq 0xc3c1
xorl %eax, %eax
callq 0xc37c
cmpl $0x1, %ebp
jg 0xc21c
leaq 0x37dfe(%rip), %rdi     # 0x44004
xorl %ebx, %ebx
xorl %eax, %eax
callq 0xb070
pushq $0xa
popq %rdi
callq 0xb770
jmp 0xc2f9
movq 0x8(%rbx), %r14
leaq 0x39809(%rip), %rsi     # 0x45a30
movq %r14, %rdi
callq 0xb780
testl %eax, %eax
je 0xc26e
leaq 0x397ed(%rip), %rsi     # 0x45a27
movq %r14, %rdi
callq 0xb780
testl %eax, %eax
je 0xc292
leaq 0x37e4c(%rip), %rsi     # 0x44099
movq %r14, %rdi
callq 0xb780
testl %eax, %eax
je 0xc2d2
leaq 0x37e5b(%rip), %rdi     # 0x440bb
xorl %ebx, %ebx
movq %r14, %rsi
xorl %eax, %eax
callq 0xb070
jmp 0xc20f
leaq 0x37dae(%rip), %rdi     # 0x44023
xorl %eax, %eax
callq 0xb070
pushq $0xa
popq %rdi
callq 0xb770
cmpl $0x2, %ebp
jne 0xc2bb
leaq 0x37db1(%rip), %rsi     # 0x44041
jmp 0xc2bf
leaq 0x37dce(%rip), %rdi     # 0x44067
xorl %eax, %eax
callq 0xb070
pushq $0xa
popq %rdi
callq 0xb770
leaq 0x37dd6(%rip), %rdi     # 0x44085
pushq $0x2
popq %rsi
xorl %eax, %eax
callq 0xc8ba
jmp 0xc2f6
movq 0x10(%rbx), %rsi
leaq 0x37d82(%rip), %rdi     # 0x44048
pushq $0x2
popq %rdx
xorl %eax, %eax
callq 0xc8ba
jmp 0xc2f6
leaq 0x37dc4(%rip), %rdi     # 0x4409d
xorl %eax, %eax
callq 0xb070
pushq $0xa
popq %rdi
callq 0xb770
leaq 0x37daa(%rip), %rdi     # 0x44099
xorl %eax, %eax
callq 0xc8ba
movq %rax, %rbx
leaq 0x37ddf(%rip), %rdi     # 0x440df
xorl %eax, %eax
callq 0xb070
pushq $0xa
popq %rbp
movl %ebp, %edi
callq 0xb770
pushq $0x4
popq %rsi
movq %rbx, %rdi
callq 0xc994
leaq 0x37e08(%rip), %rdi     # 0x4412b
callq 0xb860
callq 0xb760
leaq 0x37dc4(%rip), %rdi     # 0x440f8
xorl %eax, %eax
callq 0xb070
movl %ebp, %edi
callq 0xb770
movq %rbx, %rdi
callq 0xc9c3
leaq 0x37dbf(%rip), %rdi     # 0x44110
xorl %eax, %eax
callq 0xb070
movl %ebp, %edi
callq 0xb770
movq %rbx, %rdi
callq 0xc972
xorl %eax, %eax
callq 0xc39b
callq 0xc4d6
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
nop