// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x0, -0x8(%rbp)
leaq 0x12c2(%rip), %rdi      # 0x3478
movl $0x3, %esi
movl $0x4, %edx
callq 0x1c10
movl %eax, -0x4(%rbp)
cmpl $0x0, -0x4(%rbp)
jne 0x21ef
jmp 0x21d0
movb $0x0, %al
callq 0x2160
leaq 0x129e(%rip), %rdi      # 0x347c
movb $0x0, %al
callq 0x1070
movl $0x1, %edi
callq 0x1140
leaq 0x1282(%rip), %rdi      # 0x3478
movl $0x3, %esi
callq 0x1fc0
movl %eax, -0x4(%rbp)
cmpl $0x0, -0x4(%rbp)
jne 0x222a
jmp 0x220b
movb $0x0, %al
callq 0x2160
leaq 0x127d(%rip), %rdi      # 0x3496
movb $0x0, %al
callq 0x1070
movl $0x1, %edi
callq 0x1140
movb $0x0, %al
callq 0x2160
leaq 0x1278(%rip), %rdi      # 0x34b0
movl $0x6, %esi
movl $0x5, %edx
callq 0x1c10
movl %eax, -0x4(%rbp)
cmpl $0x0, -0x4(%rbp)
jne 0x2271
jmp 0x2252
movb $0x0, %al
callq 0x2160
leaq 0x1257(%rip), %rdi      # 0x34b7
movb $0x0, %al
callq 0x1070
movl $0x1, %edi
callq 0x1140
leaq 0x125c(%rip), %rdi      # 0x34d4
movl $0x6, %esi
movl $0x4, %edx
callq 0x1c10
movl %eax, -0x4(%rbp)
cmpl $0x0, -0x4(%rbp)
jne 0x22b1
jmp 0x2292
movb $0x0, %al
callq 0x2160
leaq 0x123b(%rip), %rdi      # 0x34db
movb $0x0, %al
callq 0x1070
movl $0x1, %edi
callq 0x1140
leaq 0x121c(%rip), %rdi      # 0x34d4
movl $0x6, %esi
callq 0x1fc0
movl %eax, -0x4(%rbp)
cmpl $0x0, -0x4(%rbp)
jne 0x22ec
jmp 0x22cd
movb $0x0, %al
callq 0x2160
leaq 0x121d(%rip), %rdi      # 0x34f8
movb $0x0, %al
callq 0x1070
movl $0x1, %edi
callq 0x1140
leaq 0x11bd(%rip), %rdi      # 0x34b0
movl $0x6, %esi
callq 0x1fc0
movl %eax, -0x4(%rbp)
cmpl $0x0, -0x4(%rbp)
jne 0x2327
jmp 0x2308
movb $0x0, %al
callq 0x2160
leaq 0x11ff(%rip), %rdi      # 0x3515
movb $0x0, %al
callq 0x1070
movl $0x1, %edi
callq 0x1140
leaq 0x1204(%rip), %rdi      # 0x3532
movl $0x2, %esi
movl $0x2, %edx
callq 0x1c10
movl %eax, -0x4(%rbp)
cmpl $0x0, -0x4(%rbp)
jne 0x2367
jmp 0x2348
movb $0x0, %al
callq 0x2160
leaq 0x11df(%rip), %rdi      # 0x3535
movb $0x0, %al
callq 0x1070
movl $0x1, %edi
callq 0x1140
leaq 0x11e0(%rip), %rdi      # 0x354e
movl $0x2, %esi
movl $0x2, %edx
callq 0x1c10
movl %eax, -0x4(%rbp)
cmpl $0x0, -0x4(%rbp)
jne 0x23a7
jmp 0x2388
movb $0x0, %al
callq 0x2160
leaq 0x11bb(%rip), %rdi      # 0x3551
movb $0x0, %al
callq 0x1070
movl $0x1, %edi
callq 0x1140
movb $0x0, %al
callq 0x2160
leaq 0x11b5(%rip), %rdi      # 0x356a
movb $0x0, %al
callq 0x1070
leaq 0x116f(%rip), %rdi      # 0x3532
movl $0x2, %esi
leaq -0x8(%rbp), %rdx
callq 0x15c0
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %esi
leaq 0x119d(%rip), %rdi      # 0x357b
movb $0x0, %al
callq 0x1070
cmpl $0x0, -0x4(%rbp)
jne 0x240c
jmp 0x23ed
movb $0x0, %al
callq 0x2160
leaq 0x118a(%rip), %rdi      # 0x3585
movb $0x0, %al
callq 0x1070
movl $0x1, %edi
callq 0x1140
cmpl $0x2, -0x8(%rbp)
je 0x2433
jmp 0x2414
movb $0x0, %al
callq 0x2160
leaq 0x117a(%rip), %rdi      # 0x359c
movb $0x0, %al
callq 0x1070
movl $0x1, %edi
callq 0x1140
leaq 0x117b(%rip), %rdi      # 0x35b5
movl $0x2, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x15c0
movl %eax, -0x4(%rbp)
cmpl $0x0, -0x4(%rbp)
je 0x2472
jmp 0x2453
movb $0x0, %al
callq 0x2160
leaq 0x1157(%rip), %rdi      # 0x35b8
movb $0x0, %al
callq 0x1070
movl $0x1, %edi
callq 0x1140
movl $0x0, -0x8(%rbp)
leaq 0x10ce(%rip), %rdi      # 0x354e
movl $0x2, %esi
leaq -0x8(%rbp), %rdx
callq 0x15c0
movl %eax, -0x4(%rbp)
cmpl $0x0, -0x4(%rbp)
jne 0x24b8
jmp 0x2499
movb $0x0, %al
callq 0x2160
leaq 0x1125(%rip), %rdi      # 0x35cc
movb $0x0, %al
callq 0x1070
movl $0x1, %edi
callq 0x1140
cmpl $0x2, -0x8(%rbp)
je 0x24df
jmp 0x24c0
movb $0x0, %al
callq 0x2160
leaq 0x1115(%rip), %rdi      # 0x35e3
movb $0x0, %al
callq 0x1070
movl $0x1, %edi
callq 0x1140
movl $0x0, -0x8(%rbp)
leaq 0x110f(%rip), %rdi      # 0x35fc
movl $0x2, %esi
callq 0x1fc0
movl %eax, -0x4(%rbp)
cmpl $0x0, -0x4(%rbp)
je 0x2521
jmp 0x2502
movb $0x0, %al
callq 0x2160
leaq 0x10ef(%rip), %rdi      # 0x35ff
movb $0x0, %al
callq 0x1070
movl $0x1, %edi
callq 0x1140
leaq 0x1026(%rip), %rdi      # 0x354e
movl $0x2, %esi
callq 0x1fc0
movl %eax, -0x4(%rbp)
cmpl $0x0, -0x4(%rbp)
jne 0x255c
jmp 0x253d
movb $0x0, %al
callq 0x2160
leaq 0x10ca(%rip), %rdi      # 0x3615
movb $0x0, %al
callq 0x1070
movl $0x1, %edi
callq 0x1140
leaq 0xfcf(%rip), %rdi       # 0x3532
movl $0x2, %esi
leaq -0x8(%rbp), %rdx
callq 0x15c0
movl %eax, -0x4(%rbp)
cmpl $0x0, -0x4(%rbp)
jne 0x259b
jmp 0x257c
movb $0x0, %al
callq 0x2160
leaq 0xffb(%rip), %rdi       # 0x3585
movb $0x0, %al
callq 0x1070
movl $0x1, %edi
callq 0x1140
cmpl $0x2, -0x8(%rbp)
je 0x25c2
jmp 0x25a3
movb $0x0, %al
callq 0x2160
leaq 0xfeb(%rip), %rdi       # 0x359c
movb $0x0, %al
callq 0x1070
movl $0x1, %edi
callq 0x1140
movl $0x0, -0x8(%rbp)
leaq 0xf62(%rip), %rdi       # 0x3532
movl $0x2, %esi
callq 0x1fc0
movl %eax, -0x4(%rbp)
cmpl $0x0, -0x4(%rbp)
jne 0x2604
jmp 0x25e5
movb $0x0, %al
callq 0x2160
leaq 0x1040(%rip), %rdi      # 0x3633
movb $0x0, %al
callq 0x1070
movl $0x1, %edi
callq 0x1140
leaq 0x1046(%rip), %rdi      # 0x3651
movb $0x0, %al
callq 0x1070
movb $0x0, %al
callq 0x2160
leaq 0x104e(%rip), %rdi      # 0x366e
movb $0x0, %al
callq 0x1070
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nop