// File: /workspace/github_c_makefile_star2_O0/wuxb45[P]SLB/kvclient.c
// Function: main
int
main(int argc, char ** argv)
{
  struct tcpmap * map = NULL;
  if (argc < 3) {
    printf("Usage: %s <host> <port>\n", argv[0]);
    printf("Use default setting: localhost 9999\n");
    map = tcpmap_create("localhost", 9999);
  } else {
    map = tcpmap_create(argv[1], atoi(argv[2]));
  }

  if (map == NULL) {
    printf("failed\n");
    exit(0);
  }

  struct kv * const kv = malloc(1024);
  struct kv * const out = malloc(1024);

  kv_refill_str(kv, "abc", "123");
  printf("set %c/t\n", tcpmap_set(map, kv) ? 't': 'f');

  kv_refill_str(kv, "hello", "45678");
  printf("set %c/t\n", tcpmap_set(map, kv) ? 't': 'f');

  kv_refill_str(kv, "notthere", "");
  printf("get %c/f\n", tcpmap_get(map, kv, out) ? 't':'f');
  printf("probe %c/f\n", tcpmap_probe(map, kv) ? 't':'f');

  kv_refill_str(kv, "hello", "");
  printf("get %c/t\n", tcpmap_get(map, kv, out) ? 't':'f');

  kv_refill_str(kv, "abc", "");
  printf("get %c/t\n", tcpmap_get(map, kv, out) ? 't':'f');

  kv_refill_str(kv, "abc", "");
  printf("del %c/t\n", tcpmap_del(map, kv) ? 't':'f');

  kv_refill_str(kv, "abc", "");
  printf("get %c/f\n", tcpmap_get(map, kv, out) ? 't':'f');
  free(kv);
  free(out);

  tcpmap_destroy(map);
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
cmpl $0x3, -0x8(%rbp)
jge 0x674e
movq -0x10(%rbp), %rax
movq (%rax), %rsi
leaq 0x138e2(%rip), %rdi     # 0x1a004
movb $0x0, %al
callq 0x61a0
leaq 0x138ed(%rip), %rdi     # 0x1a01d
movb $0x0, %al
callq 0x61a0
leaq 0x13904(%rip), %rdi     # 0x1a042
movl $0x270f, %esi           # imm = 0x270F
callq 0x14320
movq %rax, -0x18(%rbp)
jmp 0x6776
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x64a0
movq -0x30(%rbp), %rdi
movl %eax, %esi
callq 0x14320
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x6792
leaq 0x13dd0(%rip), %rdi     # 0x1a554
movb $0x0, %al
callq 0x61a0
xorl %edi, %edi
callq 0x64f0
movl $0x400, %edi            # imm = 0x400
callq 0x6370
movq %rax, -0x20(%rbp)
movl $0x400, %edi            # imm = 0x400
callq 0x6370
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
leaq 0x13893(%rip), %rsi     # 0x1a04c
leaq 0x13890(%rip), %rdx     # 0x1a050
callq 0xd9a0
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x14680
movb %al, %cl
movl $0x66, %esi
movl $0x74, %eax
testb $0x1, %cl
cmovnel %eax, %esi
leaq 0x13869(%rip), %rdi     # 0x1a054
movb $0x0, %al
callq 0x61a0
movq -0x20(%rbp), %rdi
leaq 0x13861(%rip), %rsi     # 0x1a05e
leaq 0x13860(%rip), %rdx     # 0x1a064
callq 0xd9a0
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x14680
movb %al, %cl
movl $0x66, %esi
movl $0x74, %eax
testb $0x1, %cl
cmovnel %eax, %esi
leaq 0x13825(%rip), %rdi     # 0x1a054
movb $0x0, %al
callq 0x61a0
movq -0x20(%rbp), %rdi
leaq 0x13829(%rip), %rsi     # 0x1a06a
leaq 0x13f11(%rip), %rdx     # 0x1a759
callq 0xd9a0
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x14390
movq %rax, %rcx
movl $0x66, %esi
movl $0x74, %eax
cmpq $0x0, %rcx
cmovnel %eax, %esi
leaq 0x137fa(%rip), %rdi     # 0x1a073
movb $0x0, %al
callq 0x61a0
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x14630
movb %al, %cl
movl $0x66, %esi
movl $0x74, %eax
testb $0x1, %cl
cmovnel %eax, %esi
leaq 0x137d7(%rip), %rdi     # 0x1a07d
movb $0x0, %al
callq 0x61a0
movq -0x20(%rbp), %rdi
leaq 0x137a6(%rip), %rsi     # 0x1a05e
leaq 0x13e9a(%rip), %rdx     # 0x1a759
callq 0xd9a0
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x14390
movq %rax, %rcx
movl $0x66, %esi
movl $0x74, %eax
cmpq $0x0, %rcx
cmovnel %eax, %esi
leaq 0x13799(%rip), %rdi     # 0x1a089
movb $0x0, %al
callq 0x61a0
movq -0x20(%rbp), %rdi
leaq 0x1374a(%rip), %rsi     # 0x1a04c
leaq 0x13e50(%rip), %rdx     # 0x1a759
callq 0xd9a0
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x14390
movq %rax, %rcx
movl $0x66, %esi
movl $0x74, %eax
cmpq $0x0, %rcx
cmovnel %eax, %esi
leaq 0x1374f(%rip), %rdi     # 0x1a089
movb $0x0, %al
callq 0x61a0
movq -0x20(%rbp), %rdi
leaq 0x13700(%rip), %rsi     # 0x1a04c
leaq 0x13e06(%rip), %rdx     # 0x1a759
callq 0xd9a0
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x146d0
movb %al, %cl
movl $0x66, %esi
movl $0x74, %eax
testb $0x1, %cl
cmovnel %eax, %esi
leaq 0x13715(%rip), %rdi     # 0x1a093
movb $0x0, %al
callq 0x61a0
movq -0x20(%rbp), %rdi
leaq 0x136bc(%rip), %rsi     # 0x1a04c
leaq 0x13dc2(%rip), %rdx     # 0x1a759
callq 0xd9a0
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x14390
movq %rax, %rcx
movl $0x66, %esi
movl $0x74, %eax
cmpq $0x0, %rcx
cmovnel %eax, %esi
leaq 0x136ab(%rip), %rdi     # 0x1a073
movb $0x0, %al
callq 0x61a0
movq -0x20(%rbp), %rdi
callq 0x6060
movq -0x28(%rbp), %rdi
callq 0x6060
movq -0x18(%rbp), %rdi
callq 0x147c0
xorl %eax, %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)