// File: /workspace/github_c_makefile_star2_O2/millimat[P]Soft-Heap/run-tests.c
// Function: main
static void forwards_test(int elems[], int results[][2]) {
  printf("----------FORWARDS TEST----------\n");
  printf("Inserting integers 0 to %d into a soft heap...\n", N_ELEMENTS - 1);
  softheap *P = makeheap_empty(EPSILON);
  for(int i = 0; i < N_ELEMENTS; i++) {
    elems[i] = i;
    insert(P, i);
  }
  
  int ckey_corruptions = 0, pos_corruptions = 0;
  printf("Extracting elements with ckeys...\n");
  for(int i = 0; i < N_ELEMENTS; i++) {
    results[i][0] = extract_min_with_ckey(P, &results[i][1]);
    if(results[i][0] < results[i][1]) ckey_corruptions++;
    if(results[i][0] != elems[i]) pos_corruptions++;
  }

  report_corruptions(ckey_corruptions, pos_corruptions, N_ELEMENTS);  
  free(P);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc00008, %rsp         # imm = 0xC00008
leaq 0xf67(%rip), %rdi       # 0x218b
callq 0x1050
leaq 0xde8(%rip), %rdi       # 0x2018
xorl %r14d, %r14d
movl $0xfffff, %esi          # imm = 0xFFFFF
xorl %eax, %eax
callq 0x1070
movsd 0xdc1(%rip), %xmm0      # 0x2008
callq 0x16b0
movq %rax, %rbx
cmpq $0x100000, %r14         # imm = 0x100000
je 0x126c
movl %r14d, (%rsp,%r14,4)
movq %rbx, %rdi
movl %r14d, %esi
callq 0x1822
incq %r14
jmp 0x124f
leaq 0xfbb(%rip), %rdi       # 0x222e
callq 0x1050
xorl %ebp, %ebp
movq %rsp, %r12
pushq $0x4
popq %r13
xorl %r14d, %r14d
cmpq $0x800004, %r13         # imm = 0x800004
je 0x12c7
leaq (%rsp,%r13), %r15
addq $0x400000, %r15         # imm = 0x400000
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1a67
movl %eax, -0x4(%r15)
xorl %ecx, %ecx
cmpl (%r15), %eax
setl %cl
addl %ecx, %ebp
xorl %ecx, %ecx
cmpl (%r12), %eax
setne %cl
addl %ecx, %r14d
addq $0x4, %r12
addq $0x8, %r13
jmp 0x1284
movl %ebp, %edi
movl %r14d, %esi
callq 0x163d
movq %rbx, %rdi
callq 0x1030
leaq 0xecd(%rip), %rdi       # 0x21ad
callq 0x1050
leaq 0xde4(%rip), %rdi       # 0x20d0
movl $0xfffff, %ebp          # imm = 0xFFFFF
movl $0xfffff, %esi          # imm = 0xFFFFF
xorl %eax, %eax
callq 0x1070
movsd 0xd03(%rip), %xmm0      # 0x2008
callq 0x16b0
movq %rax, %rbx
testl %ebp, %ebp
js 0x1324
movl %ebp, %eax
movl %ebp, (%rsp,%rax,4)
movq %rbx, %rdi
movl %ebp, %esi
callq 0x1822
decl %ebp
jmp 0x130d
leaq 0xf03(%rip), %rdi       # 0x222e
callq 0x1050
xorl %ebp, %ebp
movq %rsp, %r12
pushq $0x4
popq %r13
xorl %r14d, %r14d
cmpq $0x800004, %r13         # imm = 0x800004
je 0x137f
leaq (%rsp,%r13), %r15
addq $0x400000, %r15         # imm = 0x400000
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1a67
movl %eax, -0x4(%r15)
xorl %ecx, %ecx
cmpl (%r15), %eax
setl %cl
addl %ecx, %ebp
xorl %ecx, %ecx
cmpl (%r12), %eax
setne %cl
addl %ecx, %r14d
addq $0x4, %r12
addq $0x8, %r13
jmp 0x133c
movl %ebp, %edi
movl %r14d, %esi
callq 0x163d
movq %rbx, %rdi
callq 0x1030
leaq 0xe38(%rip), %rdi       # 0x21d0
callq 0x1050
leaq 0xd6d(%rip), %rdi       # 0x2111
xorl %r14d, %r14d
movl $0x445, %ebp            # imm = 0x445
movl $0x577, %esi            # imm = 0x577
movl $0x445, %edx            # imm = 0x445
movl $0xfffff, %ecx          # imm = 0xFFFFF
xorl %eax, %eax
callq 0x1070
movsd 0xc3e(%rip), %xmm0      # 0x2008
callq 0x16b0
movq %rax, %rbx
xorl %r15d, %r15d
movl %r14d, %eax
xorl %edx, %edx
divl %ebp
cmpq $0x100000, %r15         # imm = 0x100000
je 0x13ff
movl %edx, (%rsp,%r15,4)
movq %rbx, %rdi
movl %edx, %esi
callq 0x1822
incq %r15
addl $0x577, %r14d           # imm = 0x577
jmp 0x13d5
leaq 0xe0b(%rip), %rdi       # 0x2211
callq 0x1050
leaq 0x26f(%rip), %rcx       # 0x1681
movq %rsp, %r14
pushq $0x4
popq %r15
movl $0x100000, %esi         # imm = 0x100000
movq %r14, %rdi
movq %r15, %rdx
callq 0x1060
leaq 0xdfe(%rip), %rdi       # 0x222e
callq 0x1050
xorl %ebp, %ebp
xorl %r12d, %r12d
cmpq $0x800004, %r15         # imm = 0x800004
je 0x147d
leaq (%rsp,%r15), %r13
addq $0x400000, %r13         # imm = 0x400000
movq %rbx, %rdi
movq %r13, %rsi
callq 0x1a67
movl %eax, -0x4(%r13)
xorl %ecx, %ecx
cmpl (%r13), %eax
setl %cl
addl %ecx, %ebp
xorl %ecx, %ecx
cmpl (%r14), %eax
setne %cl
addl %ecx, %r12d
addq $0x4, %r14
addq $0x8, %r15
jmp 0x143a
movl %ebp, %edi
movl %r12d, %esi
callq 0x163d
movq %rbx, %rdi
callq 0x1030
xorl %r14d, %r14d
xorl %edi, %edi
callq 0x10b0
movl %eax, %edi
callq 0x10a0
leaq 0xd4a(%rip), %rdi       # 0x21f1
callq 0x1050
leaq 0xca6(%rip), %rdi       # 0x2159
movl $0x100000, %esi         # imm = 0x100000
xorl %eax, %eax
callq 0x1070
movsd 0xb41(%rip), %xmm0      # 0x2008
callq 0x16b0
movq %rax, %rbx
cmpq $0x100000, %r14         # imm = 0x100000
je 0x14f0
callq 0x1100
movl %eax, (%rsp,%r14,4)
movq %rbx, %rdi
movl %eax, %esi
callq 0x1822
incq %r14
jmp 0x14cf
leaq 0xd1a(%rip), %rdi       # 0x2211
callq 0x1050
leaq 0x17e(%rip), %rcx       # 0x1681
movq %rsp, %r14
pushq $0x4
popq %r15
movl $0x100000, %esi         # imm = 0x100000
movq %r14, %rdi
movq %r15, %rdx
callq 0x1060
leaq 0xd0d(%rip), %rdi       # 0x222e
callq 0x1050
xorl %ebp, %ebp
xorl %r12d, %r12d
cmpq $0x800004, %r15         # imm = 0x800004
je 0x156e
leaq (%rsp,%r15), %r13
addq $0x400000, %r13         # imm = 0x400000
movq %rbx, %rdi
movq %r13, %rsi
callq 0x1a67
movl %eax, -0x4(%r13)
xorl %ecx, %ecx
cmpl (%r13), %eax
setl %cl
addl %ecx, %ebp
xorl %ecx, %ecx
cmpl (%r14), %eax
setne %cl
addl %ecx, %r12d
addq $0x4, %r14
addq $0x8, %r15
jmp 0x152b
movl %ebp, %edi
movl %r12d, %esi
callq 0x163d
movq %rbx, %rdi
callq 0x1030
leaq 0xcc9(%rip), %rdi       # 0x2250
callq 0x1050
leaq 0xcdf(%rip), %rdi       # 0x2272
callq 0x1050
xorl %r12d, %r12d
xorl %edi, %edi
callq 0x10b0
movl %eax, %edi
callq 0x10a0
movq 0x2a30(%rip), %r13      # 0x3fe0
pushq $0xa
popq %rbp
xorl %r14d, %r14d
cmpl $0x64, %r14d
je 0x161d
movsd 0xa4c(%rip), %xmm0      # 0x2010
callq 0x16b0
movq %rax, %r15
movl %r12d, %ebx
subl $0x1, %ebx
jb 0x15e5
callq 0x1100
movq %r15, %rdi
movl %eax, %esi
callq 0x1822
jmp 0x15cf
movq %r15, %rdi
callq 0x1799
pushq $0x2e
popq %rdi
callq 0x1040
movq (%r13), %rdi
callq 0x10d0
movl %r14d, %eax
xorl %edx, %edx
divl %ebp
cmpl $0x9, %edx
jne 0x1611
movl %ebp, %edi
callq 0x1040
incl %r14d
addl $0x28f5, %r12d          # imm = 0x28F5
jmp 0x15b6
leaq 0xcb1(%rip), %rdi       # 0x22d5
callq 0x1050
xorl %eax, %eax
addq $0xc00008, %rsp         # imm = 0xC00008
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq