// File: /workspace/github_cpp_makefile_star2_O3/mh0fm4[P]SCDC/test/demos/multi/multi_srv.c
// Function: main
int main(int argc, char *argv[])
{
  /* scdc.log_init("log_FILE", sys.stdout, sys.stderr)*/

  scdc_init(SCDC_INIT_DEFAULT);

  scdc_dataprov_t dp_hook = scdc_dataprov_open(MULTI_BASE, "hook", &multidemo_hook);

  scdc_nodeport_t np = SCDC_NODEPORT_NULL;

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

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

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

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

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

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

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

    np = scdc_nodeport_open("mpi");

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

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

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

  MULTI_TRACE("stop");
  scdc_nodeport_stop(np);

  MULTI_TRACE("release");
  scdc_nodeport_close(np);

  scdc_dataprov_close(dp_hook);

  scdc_release();

  /*scdc.log_release()*/

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movl %edi, %ebp
leaq 0x5023e(%rip), %rdi     # 0x5c69d
xorl %eax, %eax
callq 0xc851
leaq 0x4eb97(%rip), %rdi     # 0x5b004
leaq 0x5151c(%rip), %rsi     # 0x5d990
leaq 0x6977d(%rip), %rdx     # 0x75bf8
xorl %eax, %eax
callq 0xcc0b
movq %rax, %rbx
cmpl $0x1, %ebp
jg 0xc4aa
leaq 0x4eb7a(%rip), %rdi     # 0x5b00b
xorl %r14d, %r14d
xorl %eax, %eax
callq 0xb080
movl $0xa, %edi
callq 0xb740
jmp 0xc596
movq 0x8(%r14), %r15
leaq 0x5070b(%rip), %rsi     # 0x5cbc0
movq %r15, %rdi
callq 0xb750
testl %eax, %eax
je 0xc501
leaq 0x506ef(%rip), %rsi     # 0x5cbb7
movq %r15, %rdi
callq 0xb750
testl %eax, %eax
je 0xc527
leaq 0x4ebc1(%rip), %rsi     # 0x5b09c
movq %r15, %rdi
callq 0xb750
testl %eax, %eax
je 0xc56d
leaq 0x4ebcb(%rip), %rdi     # 0x5b0bd
xorl %r14d, %r14d
movq %r15, %rsi
xorl %eax, %eax
callq 0xb080
jmp 0xc49b
leaq 0x4eb21(%rip), %rdi     # 0x5b029
xorl %eax, %eax
callq 0xb080
movl $0xa, %edi
callq 0xb740
cmpl $0x2, %ebp
jne 0xc554
leaq 0x4eb21(%rip), %rsi     # 0x5b046
jmp 0xc558
leaq 0x4eb3d(%rip), %rdi     # 0x5b06b
xorl %eax, %eax
callq 0xb080
movl $0xa, %edi
callq 0xb740
leaq 0x4eb42(%rip), %rdi     # 0x5b088
movl $0x2, %esi
xorl %eax, %eax
callq 0xce13
jmp 0xc593
movq 0x10(%r14), %rsi
leaq 0x4eaed(%rip), %rdi     # 0x5b04c
movl $0x2, %edx
xorl %eax, %eax
callq 0xce13
jmp 0xc593
leaq 0x4eb2c(%rip), %rdi     # 0x5b0a0
xorl %eax, %eax
callq 0xb080
movl $0xa, %edi
callq 0xb740
leaq 0x4eb10(%rip), %rdi     # 0x5b09c
xorl %eax, %eax
callq 0xce13
movq %rax, %r14
leaq 0x4eb43(%rip), %rdi     # 0x5b0e0
xorl %eax, %eax
callq 0xb080
movl $0xa, %edi
callq 0xb740
movl $0x4, %esi
movq %r14, %rdi
callq 0xcf27
leaq 0x4eb67(%rip), %rdi     # 0x5b129
callq 0xb840
callq 0xb730
leaq 0x4eb25(%rip), %rdi     # 0x5b0f8
xorl %eax, %eax
callq 0xb080
movl $0xa, %edi
callq 0xb740
movq %r14, %rdi
callq 0xcf58
leaq 0x4eb1c(%rip), %rdi     # 0x5b10f
xorl %eax, %eax
callq 0xb080
movl $0xa, %edi
callq 0xb740
movq %r14, %rdi
callq 0xcf05
movq %rbx, %rdi
callq 0xcd06
callq 0xc952
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop