// File: /workspace/github_c_makefile_star2_O1/stevenmherring[P]DNS/main.c
// Function: self_tests
int self_tests() {
  int rv;
  int32_t ip = 0;

  rv = insert ("abc", 3, 4);
  if (!rv) die ("Failed to insert key abc\n");

  rv = delete("abc", 3);
  if (!rv) die ("Failed to delete key abc\n");
  print();

  rv = insert ("google", 6, 5);
  if (!rv) die ("Failed to insert key google\n");

  rv = insert ("goggle", 6, 4);
  if (!rv) die ("Failed to insert key goggle\n");

  rv = delete("goggle", 6);
  if (!rv) die ("Failed to delete key goggle\n");

  rv = delete("google", 6);
  if (!rv) die ("Failed to delete key google\n");

  rv = insert ("ab", 2, 2);
  if (!rv) die ("Failed to insert key ab\n");

  rv = insert("bb", 2, 2);
  if (!rv) die ("Failed to insert key bb\n");

  print();
  printf("So far so good\n\n");

  rv = search("ab", 2, &ip);
  printf("Rv is %d\n", rv);
  if (!rv) die ("Failed to find key ab\n");
  if (ip != 2) die ("Found bad IP for key ab\n");

  rv = search("aa", 2, NULL);
  if (rv) die ("Found bogus key aa\n");

  ip = 0;

  rv = search("bb", 2, &ip);
  if (!rv) die ("Failed to find key bb\n");
  if (ip != 2) die ("Found bad IP for key bb\n");

  ip = 0;

  rv = delete("cb", 2);
  if (rv) die ("deleted bogus key cb\n");

  rv = delete("bb", 2);
  if (!rv) die ("Failed to delete real key bb\n");

  rv = search("ab", 2, &ip);
  if (!rv) die ("Failed to find key ab\n");
  if (ip != 2) die ("Found bad IP for key ab\n");

  ip = 0;

  rv = delete("ab", 2);
  if (!rv) die ("Failed to delete real key ab\n");

  printf("End of self-tests, tree is:\n");
  print();
  printf("End of self-tests\n");

  return 0;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movl $0x0, 0xc(%rsp)
leaq 0x192b(%rip), %rdi      # 0x35bb
movl $0x3, %esi
movl $0x4, %edx
callq 0x18a0
testl %eax, %eax
je 0x1ed6
leaq 0x190d(%rip), %rdi      # 0x35bb
movl $0x3, %esi
callq 0x1b06
movl %eax, %ebx
xorl %eax, %eax
callq 0x1c4c
testl %ebx, %ebx
je 0x1ee9
leaq 0x1958(%rip), %rdi      # 0x3628
movl $0x6, %esi
movl $0x5, %edx
callq 0x18a0
testl %eax, %eax
je 0x1ef5
leaq 0x191e(%rip), %rdi      # 0x360c
movl $0x6, %esi
movl $0x4, %edx
callq 0x18a0
testl %eax, %eax
je 0x1f08
leaq 0x1900(%rip), %rdi      # 0x360c
movl $0x6, %esi
callq 0x1b06
testl %eax, %eax
je 0x1f1b
leaq 0x1903(%rip), %rdi      # 0x3628
movl $0x6, %esi
callq 0x1b06
testl %eax, %eax
je 0x1f2e
leaq 0x1977(%rip), %rdi      # 0x36b5
movl $0x2, %esi
movl $0x2, %edx
callq 0x18a0
testl %eax, %eax
je 0x1f3e
leaq 0x1926(%rip), %rdi      # 0x3682
movl $0x2, %esi
movl $0x2, %edx
callq 0x18a0
movl %eax, %ebx
xorl %eax, %eax
callq 0x1c4c
testl %ebx, %ebx
je 0x1f4e
leaq 0x18dc(%rip), %rdi      # 0x365f
callq 0x1070
leaq 0x1926(%rip), %rdi      # 0x36b5
leaq 0xc(%rsp), %rdx
movl $0x2, %esi
callq 0x1464
movl %eax, %ebx
leaq 0x1667(%rip), %rdi      # 0x340e
movl %eax, %esi
xorl %eax, %eax
callq 0x1080
testl %ebx, %ebx
je 0x1eb0
cmpl $0x2, 0xc(%rsp)
jne 0x1ec3
leaq 0x1976(%rip), %rdi      # 0x3740
movl $0x2, %esi
xorl %edx, %edx
callq 0x1464
testl %eax, %eax
jne 0x1f57
leaq 0xc(%rsp), %rdx
movl $0x0, (%rdx)
leaq 0x1892(%rip), %rdi      # 0x3682
movl $0x2, %esi
callq 0x1464
testl %eax, %eax
je 0x1f67
cmpl $0x2, 0xc(%rsp)
jne 0x1f77
movl $0x0, 0xc(%rsp)
leaq 0x18f9(%rip), %rdi      # 0x3715
movl $0x2, %esi
callq 0x1b06
testl %eax, %eax
jne 0x1f87
leaq 0x184d(%rip), %rdi      # 0x3682
movl $0x2, %esi
callq 0x1b06
testl %eax, %eax
je 0x1f97
leaq 0x1867(%rip), %rdi      # 0x36b5
leaq 0xc(%rsp), %rdx
movl $0x2, %esi
callq 0x1464
testl %eax, %eax
je 0x1eb0
cmpl $0x2, 0xc(%rsp)
jne 0x1ec3
movl $0x0, 0xc(%rsp)
leaq 0x183e(%rip), %rdi      # 0x36b5
movl $0x2, %esi
callq 0x1b06
testl %eax, %eax
je 0x1fa7
leaq 0x1845(%rip), %rdi      # 0x36d5
callq 0x1070
xorl %eax, %eax
callq 0x1c4c
leaq 0x184e(%rip), %rdi      # 0x36f1
callq 0x1070
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
retq
xorl %eax, %eax
callq 0x1c4c
leaq 0x17e4(%rip), %rdi      # 0x36a2
jmp 0x1fb5
xorl %eax, %eax
callq 0x1c4c
leaq 0x1872(%rip), %rdi      # 0x3743
jmp 0x1fb5
xorl %eax, %eax
callq 0x1c4c
leaq 0x16a9(%rip), %rdi      # 0x358d
jmp 0x1fb5
leaq 0x16b6(%rip), %rdi      # 0x35a6
jmp 0x1fb5
xorl %eax, %eax
callq 0x1c4c
leaq 0x16bc(%rip), %rdi      # 0x35bf
jmp 0x1fb5
xorl %eax, %eax
callq 0x1c4c
leaq 0x16c5(%rip), %rdi      # 0x35db
jmp 0x1fb5
xorl %eax, %eax
callq 0x1c4c
leaq 0x16ce(%rip), %rdi      # 0x35f7
jmp 0x1fb5
xorl %eax, %eax
callq 0x1c4c
leaq 0x16d7(%rip), %rdi      # 0x3613
jmp 0x1fb5
xorl %eax, %eax
callq 0x1c4c
leaq 0x16e3(%rip), %rdi      # 0x362f
jmp 0x1fb5
leaq 0x16f2(%rip), %rdi      # 0x3647
jmp 0x1fb5
xorl %eax, %eax
callq 0x1c4c
leaq 0x17cb(%rip), %rdi      # 0x3730
jmp 0x1fb5
xorl %eax, %eax
callq 0x1c4c
leaq 0x16fa(%rip), %rdi      # 0x366f
jmp 0x1fb5
xorl %eax, %eax
callq 0x1c4c
leaq 0x1793(%rip), %rdi      # 0x3718
jmp 0x1fb5
xorl %eax, %eax
callq 0x1c4c
leaq 0x176e(%rip), %rdi      # 0x3703
jmp 0x1fb5
xorl %eax, %eax
callq 0x1c4c
leaq 0x16e0(%rip), %rdi      # 0x3685
jmp 0x1fb5
xorl %eax, %eax
callq 0x1c4c
leaq 0x1703(%rip), %rdi      # 0x36b8
callq 0x1070
movl $0x1, %edi
callq 0x1140