// File: /workspace/github_c_makefile_star2_O3/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 0x18ff(%rip), %rdi      # 0x35bb
movl $0x3, %esi
movl $0x4, %edx
callq 0x18a1
testl %eax, %eax
je 0x1f02
leaq 0x18e1(%rip), %rdi      # 0x35bb
movl $0x3, %esi
callq 0x1b32
movl %eax, %ebx
xorl %eax, %eax
callq 0x1c77
testl %ebx, %ebx
je 0x1f15
leaq 0x192c(%rip), %rdi      # 0x3628
movl $0x6, %esi
movl $0x5, %edx
callq 0x18a1
testl %eax, %eax
je 0x1f21
leaq 0x18f2(%rip), %rdi      # 0x360c
movl $0x6, %esi
movl $0x4, %edx
callq 0x18a1
testl %eax, %eax
je 0x1f34
leaq 0x18d4(%rip), %rdi      # 0x360c
movl $0x6, %esi
callq 0x1b32
testl %eax, %eax
je 0x1f47
leaq 0x18d7(%rip), %rdi      # 0x3628
movl $0x6, %esi
callq 0x1b32
testl %eax, %eax
je 0x1f5a
leaq 0x194b(%rip), %rdi      # 0x36b5
movl $0x2, %esi
movl $0x2, %edx
callq 0x18a1
testl %eax, %eax
je 0x1f6a
leaq 0x18fa(%rip), %rdi      # 0x3682
movl $0x2, %esi
movl $0x2, %edx
callq 0x18a1
movl %eax, %ebx
xorl %eax, %eax
callq 0x1c77
testl %ebx, %ebx
je 0x1f7a
leaq 0x18b0(%rip), %rdi      # 0x365f
callq 0x1070
leaq 0x18fa(%rip), %rdi      # 0x36b5
leaq 0xc(%rsp), %rdx
movl $0x2, %esi
callq 0x1462
movl %eax, %ebx
leaq 0x163b(%rip), %rdi      # 0x340e
movl %eax, %esi
xorl %eax, %eax
callq 0x1080
testl %ebx, %ebx
je 0x1edc
cmpl $0x2, 0xc(%rsp)
jne 0x1eef
leaq 0x194a(%rip), %rdi      # 0x3740
movl $0x2, %esi
xorl %edx, %edx
callq 0x1462
testl %eax, %eax
jne 0x1f83
leaq 0xc(%rsp), %rdx
movl $0x0, (%rdx)
leaq 0x1866(%rip), %rdi      # 0x3682
movl $0x2, %esi
callq 0x1462
testl %eax, %eax
je 0x1f93
cmpl $0x2, 0xc(%rsp)
jne 0x1fa3
movl $0x0, 0xc(%rsp)
leaq 0x18cd(%rip), %rdi      # 0x3715
movl $0x2, %esi
callq 0x1b32
testl %eax, %eax
jne 0x1fb3
leaq 0x1821(%rip), %rdi      # 0x3682
movl $0x2, %esi
callq 0x1b32
testl %eax, %eax
je 0x1fc3
leaq 0x183b(%rip), %rdi      # 0x36b5
leaq 0xc(%rsp), %rdx
movl $0x2, %esi
callq 0x1462
testl %eax, %eax
je 0x1edc
cmpl $0x2, 0xc(%rsp)
jne 0x1eef
movl $0x0, 0xc(%rsp)
leaq 0x1812(%rip), %rdi      # 0x36b5
movl $0x2, %esi
callq 0x1b32
testl %eax, %eax
je 0x1fd3
leaq 0x1819(%rip), %rdi      # 0x36d5
callq 0x1070
xorl %eax, %eax
callq 0x1c77
leaq 0x1822(%rip), %rdi      # 0x36f1
callq 0x1070
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
retq
xorl %eax, %eax
callq 0x1c77
leaq 0x17b8(%rip), %rdi      # 0x36a2
jmp 0x1fe1
xorl %eax, %eax
callq 0x1c77
leaq 0x1846(%rip), %rdi      # 0x3743
jmp 0x1fe1
xorl %eax, %eax
callq 0x1c77
leaq 0x167d(%rip), %rdi      # 0x358d
jmp 0x1fe1
leaq 0x168a(%rip), %rdi      # 0x35a6
jmp 0x1fe1
xorl %eax, %eax
callq 0x1c77
leaq 0x1690(%rip), %rdi      # 0x35bf
jmp 0x1fe1
xorl %eax, %eax
callq 0x1c77
leaq 0x1699(%rip), %rdi      # 0x35db
jmp 0x1fe1
xorl %eax, %eax
callq 0x1c77
leaq 0x16a2(%rip), %rdi      # 0x35f7
jmp 0x1fe1
xorl %eax, %eax
callq 0x1c77
leaq 0x16ab(%rip), %rdi      # 0x3613
jmp 0x1fe1
xorl %eax, %eax
callq 0x1c77
leaq 0x16b7(%rip), %rdi      # 0x362f
jmp 0x1fe1
leaq 0x16c6(%rip), %rdi      # 0x3647
jmp 0x1fe1
xorl %eax, %eax
callq 0x1c77
leaq 0x179f(%rip), %rdi      # 0x3730
jmp 0x1fe1
xorl %eax, %eax
callq 0x1c77
leaq 0x16ce(%rip), %rdi      # 0x366f
jmp 0x1fe1
xorl %eax, %eax
callq 0x1c77
leaq 0x1767(%rip), %rdi      # 0x3718
jmp 0x1fe1
xorl %eax, %eax
callq 0x1c77
leaq 0x1742(%rip), %rdi      # 0x3703
jmp 0x1fe1
xorl %eax, %eax
callq 0x1c77
leaq 0x16b4(%rip), %rdi      # 0x3685
jmp 0x1fe1
xorl %eax, %eax
callq 0x1c77
leaq 0x16d7(%rip), %rdi      # 0x36b8
callq 0x1070
movl $0x1, %edi
callq 0x1140