// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/ibkvser.c
// Function: main
int
main(int argc, char ** argv)
{
  if (argc < 6) {
    fprintf(stderr, "Usage: %s <ib-port> <host> <port> <depth> api ...\n", argv[0]);
    kvmap_api_helper_message();
    exit(0);
  }

  struct ib_port * const port = ib_port_create(atoi(argv[1]));
  if (port == NULL) {
    fprintf(stderr, "ib_port_create() failed\n");
    exit(0);
  }

  const char * const host = argv[2];
  const int pn = atoi(argv[3]);
  const u64 depth = strtoull(argv[4], NULL, 10);
  struct kvmap_api * api = NULL;
  struct oalloc * const oa = oalloc_create();
  struct kvmap_mm mm = { .af = (kv_alloc_func)oalloc_alloc, .ap = oa, };
  const int n1 = kvmap_api_helper(argc - 5, argv + 5, &api, &mm, false);
  if (n1 < 0 || api == NULL) {
    fprintf(stderr, "kvmap_api_helper() failed\n");
    exit(0);
  }
  struct worker_info wi;
  wi.api = api;
  wi.port = port;
  wi.depth = depth;
  struct server * const ser = server_create(host, pn, kv_worker, &wi);
  if (ser == NULL) {
    fprintf(stderr, "server_create() failed\n");
    exit(0);
  }
  server_wait(ser);
  kvmap_api_destroy(api);
  oalloc_destroy(oa);
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x6, -0x8(%rbp)
jge 0x683a
movq 0x1c7d2(%rip), %rax     # 0x22fe8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rdx
leaq 0x15835(%rip), %rsi     # 0x1c05c
movb $0x0, %al
callq 0x65e0
callq 0xe710
xorl %edi, %edi
callq 0x6150
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x63c0
movslq %eax, %rdi
callq 0x1a350
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x6879
movq 0x1c787(%rip), %rax     # 0x22fe8
movq (%rax), %rdi
leaq 0x15824(%rip), %rsi     # 0x1c08f
movb $0x0, %al
callq 0x65e0
xorl %edi, %edi
callq 0x6150
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x63c0
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0xa, %edx
callq 0x6560
movq %rax, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
callq 0x9100
movq %rax, -0x40(%rbp)
leaq -0x90(%rbp), %rdi
xorl %esi, %esi
movl $0x50, %edx
callq 0x6080
leaq 0x2896(%rip), %rax      # 0x9170
movq %rax, -0x90(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x88(%rbp)
movl -0x8(%rbp), %edi
subl $0x5, %edi
movq -0x10(%rbp), %rsi
addq $0x28, %rsi
leaq -0x38(%rbp), %rdx
leaq -0x90(%rbp), %rcx
xorl %r8d, %r8d
callq 0xe7f0
movl %eax, -0x94(%rbp)
cmpl $0x0, -0x94(%rbp)
jl 0x6923
cmpq $0x0, -0x38(%rbp)
jne 0x6942
movq 0x1c6be(%rip), %rax     # 0x22fe8
movq (%rax), %rdi
leaq 0x15774(%rip), %rsi     # 0x1c0a8
movb $0x0, %al
callq 0x65e0
xorl %edi, %edi
callq 0x6150
movq -0x38(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x20(%rbp), %rdi
movl -0x24(%rbp), %esi
leaq 0x6f(%rip), %rdx        # 0x69e0
leaq -0xb0(%rbp), %rcx
callq 0xd830
movq %rax, -0xb8(%rbp)
cmpq $0x0, -0xb8(%rbp)
jne 0x69ad
movq 0x1c653(%rip), %rax     # 0x22fe8
movq (%rax), %rdi
leaq 0x15724(%rip), %rsi     # 0x1c0c3
movb $0x0, %al
callq 0x65e0
xorl %edi, %edi
callq 0x6150
movq -0xb8(%rbp), %rdi
callq 0xdbb0
movq -0x38(%rbp), %rdi
callq 0xe6d0
movq -0x40(%rbp), %rdi
callq 0x93d0
xorl %eax, %eax
addq $0xc0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)