// File: /workspace/github_c_makefile_star2_O2/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
andl $0x0, 0xc(%rsp)
leaq 0x194a(%rip), %rdi      # 0x35bb
pushq $0x3
popq %rsi
pushq $0x4
popq %rdx
callq 0x189f
testl %eax, %eax
je 0x1e86
leaq 0x1930(%rip), %rdi      # 0x35bb
pushq $0x3
popq %rsi
callq 0x1aec
movl %eax, %ebx
xorl %eax, %eax
callq 0x1c31
testl %ebx, %ebx
je 0x1e99
leaq 0x197d(%rip), %rdi      # 0x3628
pushq $0x6
popq %rsi
pushq $0x5
popq %rdx
callq 0x189f
testl %eax, %eax
je 0x1ea5
leaq 0x1947(%rip), %rdi      # 0x360c
pushq $0x6
popq %rsi
pushq $0x4
popq %rdx
callq 0x189f
testl %eax, %eax
je 0x1eb8
leaq 0x192d(%rip), %rdi      # 0x360c
pushq $0x6
popq %rsi
callq 0x1aec
testl %eax, %eax
je 0x1ecb
leaq 0x1932(%rip), %rdi      # 0x3628
pushq $0x6
popq %rsi
callq 0x1aec
testl %eax, %eax
je 0x1ede
leaq 0x19a8(%rip), %rdi      # 0x36b5
pushq $0x2
popq %rsi
pushq $0x2
popq %rdx
callq 0x189f
testl %eax, %eax
je 0x1eee
leaq 0x195b(%rip), %rdi      # 0x3682
pushq $0x2
popq %rsi
pushq $0x2
popq %rdx
callq 0x189f
movl %eax, %ebx
xorl %eax, %eax
callq 0x1c31
testl %ebx, %ebx
je 0x1efe
leaq 0x1915(%rip), %rdi      # 0x365f
callq 0x1070
leaq 0x195f(%rip), %rdi      # 0x36b5
pushq $0x2
popq %rsi
leaq 0xc(%rsp), %rdx
callq 0x144b
movl %eax, %ebx
leaq 0x16a2(%rip), %rdi      # 0x340e
movl %eax, %esi
xorl %eax, %eax
callq 0x1080
testl %ebx, %ebx
je 0x1e60
cmpl $0x2, 0xc(%rsp)
jne 0x1e73
leaq 0x19b1(%rip), %rdi      # 0x3740
pushq $0x2
popq %rsi
xorl %edx, %edx
callq 0x144b
testl %eax, %eax
jne 0x1f07
leaq 0xc(%rsp), %rdx
andl $0x0, (%rdx)
leaq 0x18d2(%rip), %rdi      # 0x3682
pushq $0x2
popq %rsi
callq 0x144b
testl %eax, %eax
je 0x1f17
cmpl $0x2, 0xc(%rsp)
jne 0x1f27
andl $0x0, 0xc(%rsp)
leaq 0x193e(%rip), %rdi      # 0x3715
pushq $0x2
popq %rsi
callq 0x1aec
testl %eax, %eax
jne 0x1f37
leaq 0x1894(%rip), %rdi      # 0x3682
pushq $0x2
popq %rsi
callq 0x1aec
testl %eax, %eax
je 0x1f47
leaq 0x18b0(%rip), %rdi      # 0x36b5
pushq $0x2
popq %rsi
leaq 0xc(%rsp), %rdx
callq 0x144b
testl %eax, %eax
je 0x1e60
cmpl $0x2, 0xc(%rsp)
jne 0x1e73
andl $0x0, 0xc(%rsp)
leaq 0x188c(%rip), %rdi      # 0x36b5
pushq $0x2
popq %rsi
callq 0x1aec
testl %eax, %eax
je 0x1f57
leaq 0x1895(%rip), %rdi      # 0x36d5
callq 0x1070
xorl %eax, %eax
callq 0x1c31
leaq 0x189e(%rip), %rdi      # 0x36f1
callq 0x1070
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
retq
xorl %eax, %eax
callq 0x1c31
leaq 0x1834(%rip), %rdi      # 0x36a2
jmp 0x1f65
xorl %eax, %eax
callq 0x1c31
leaq 0x18c2(%rip), %rdi      # 0x3743
jmp 0x1f65
xorl %eax, %eax
callq 0x1c31
leaq 0x16f9(%rip), %rdi      # 0x358d
jmp 0x1f65
leaq 0x1706(%rip), %rdi      # 0x35a6
jmp 0x1f65
xorl %eax, %eax
callq 0x1c31
leaq 0x170c(%rip), %rdi      # 0x35bf
jmp 0x1f65
xorl %eax, %eax
callq 0x1c31
leaq 0x1715(%rip), %rdi      # 0x35db
jmp 0x1f65
xorl %eax, %eax
callq 0x1c31
leaq 0x171e(%rip), %rdi      # 0x35f7
jmp 0x1f65
xorl %eax, %eax
callq 0x1c31
leaq 0x1727(%rip), %rdi      # 0x3613
jmp 0x1f65
xorl %eax, %eax
callq 0x1c31
leaq 0x1733(%rip), %rdi      # 0x362f
jmp 0x1f65
leaq 0x1742(%rip), %rdi      # 0x3647
jmp 0x1f65
xorl %eax, %eax
callq 0x1c31
leaq 0x181b(%rip), %rdi      # 0x3730
jmp 0x1f65
xorl %eax, %eax
callq 0x1c31
leaq 0x174a(%rip), %rdi      # 0x366f
jmp 0x1f65
xorl %eax, %eax
callq 0x1c31
leaq 0x17e3(%rip), %rdi      # 0x3718
jmp 0x1f65
xorl %eax, %eax
callq 0x1c31
leaq 0x17be(%rip), %rdi      # 0x3703
jmp 0x1f65
xorl %eax, %eax
callq 0x1c31
leaq 0x1730(%rip), %rdi      # 0x3685
jmp 0x1f65
xorl %eax, %eax
callq 0x1c31
leaq 0x1753(%rip), %rdi      # 0x36b8
callq 0x1070
pushq $0x1
popq %rdi
callq 0x1140