// File: /workspace/github_c_makefile_star2_O0/JulStrat[P]bams/tests/test_bisect.c
// Function: do_bisect_min_max
TEST
do_bisect_min_max()
{
    size_t i, j;

    for (i = 0; i < 4; i++) {
        for (j = 0; j < ARR_SZ; j++) {
            arint[j] = rand();
        }
        qsort(&arint[0], ARR_SZ, sizeof (int), cmp_int);

        /*
         * min 
         */
        ASSERT_EQ(lfind_gt
                  (&arint[0], &arint[0], ARR_SZ, sizeof (int), cmp_int),
                  bisect_right(&arint[0], &arint[0], ARR_SZ, sizeof (int),
                               cmp_int));

        ASSERT_EQ(lfind_ge
                  (&arint[0], &arint[0], ARR_SZ, sizeof (int), cmp_int),
                  bisect_left(&arint[0], &arint[0], ARR_SZ, sizeof (int),
                              cmp_int));

        /*
         * max 
         */
        ASSERT_EQ(lfind_gt
                  (&arint[ARR_SZ - 1], &arint[0], ARR_SZ, sizeof (int),
                   cmp_int), bisect_right(&arint[ARR_SZ - 1], &arint[0],
                                          ARR_SZ, sizeof (int), cmp_int));

        ASSERT_EQ(lfind_ge
                  (&arint[ARR_SZ - 1], &arint[0], ARR_SZ, sizeof (int),
                   cmp_int), bisect_left(&arint[ARR_SZ - 1], &arint[0],
                                         ARR_SZ, sizeof (int), cmp_int));
    }

    PASS();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq $0x0, -0x10(%rbp)
cmpq $0x4, -0x10(%rbp)
jae 0x3313
movq $0x0, -0x18(%rbp)
cmpq $0xfffff, -0x18(%rbp)   # imm = 0xFFFFF
jae 0x3020
callq 0x1130
movl %eax, %edx
movq -0x18(%rbp), %rcx
leaq 0x40e1(%rip), %rax      # 0x70f0
movl %edx, (%rax,%rcx,4)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x2ff3
leaq 0x40c9(%rip), %rdi      # 0x70f0
movl $0xfffff, %esi          # imm = 0xFFFFF
movl $0x4, %edx
leaq -0x1b48(%rip), %rcx     # 0x14f0
callq 0x1050
movl 0x4040f1(%rip), %eax    # 0x407134
addl $0x1, %eax
movl %eax, 0x4040e8(%rip)    # 0x407134
leaq 0x409d(%rip), %rsi      # 0x70f0
movl $0xfffff, %edx          # imm = 0xFFFFF
movl $0x4, %ecx
leaq -0x1b74(%rip), %r8      # 0x14f0
movq %rsi, %rdi
callq 0x15d0
movq %rax, -0x20(%rbp)
leaq 0x4079(%rip), %rsi      # 0x70f0
movl $0xfffff, %edx          # imm = 0xFFFFF
movl $0x4, %ecx
leaq -0x1b98(%rip), %r8      # 0x14f0
movq %rsi, %rdi
callq 0x13a0
movq %rax, %rcx
movq -0x20(%rbp), %rax
cmpq %rcx, %rax
je 0x30e4
jmp 0x309e
leaq 0x133e(%rip), %rax      # 0x43e3
movq %rax, 0x404094(%rip)    # 0x407140
movl $0x7e, 0x404082(%rip)   # 0x407138
leaq 0x1423(%rip), %rax      # 0x44e0
movq %rax, 0x404084(%rip)    # 0x407148
movzbl 0x404025(%rip), %eax    # 0x4070f0
andl $0x4, %eax
cmpl $0x0, %eax
je 0x30d8
callq 0x1030
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3327
jmp 0x30e6
jmp 0x30e8
movl 0x404046(%rip), %eax    # 0x407134
addl $0x1, %eax
movl %eax, 0x40403d(%rip)    # 0x407134
leaq 0x3ff2(%rip), %rsi      # 0x70f0
movl $0xfffff, %edx          # imm = 0xFFFFF
movl $0x4, %ecx
leaq -0x1c1f(%rip), %r8      # 0x14f0
movq %rsi, %rdi
callq 0x1540
movq %rax, -0x28(%rbp)
leaq 0x3fce(%rip), %rsi      # 0x70f0
movl $0xfffff, %edx          # imm = 0xFFFFF
movl $0x4, %ecx
leaq -0x1c43(%rip), %r8      # 0x14f0
movq %rsi, %rdi
callq 0x1250
movq %rax, %rcx
movq -0x28(%rbp), %rax
cmpq %rcx, %rax
je 0x318f
jmp 0x3149
leaq 0x1293(%rip), %rax      # 0x43e3
movq %rax, 0x403fe9(%rip)    # 0x407140
movl $0x83, 0x403fd7(%rip)   # 0x407138
leaq 0x13fc(%rip), %rax      # 0x4564
movq %rax, 0x403fd9(%rip)    # 0x407148
movzbl 0x403f7a(%rip), %eax    # 0x4070f0
andl $0x4, %eax
cmpl $0x0, %eax
je 0x3183
callq 0x1030
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3327
jmp 0x3191
jmp 0x3193
movl 0x403f9b(%rip), %eax    # 0x407134
addl $0x1, %eax
movl %eax, 0x403f92(%rip)    # 0x407134
leaq 0x3f47(%rip), %rsi      # 0x70f0
movq %rsi, %rdi
addq $0x3ffff8, %rdi         # imm = 0x3FFFF8
movl $0xfffff, %edx          # imm = 0xFFFFF
movl $0x4, %ecx
leaq -0x1cd4(%rip), %r8      # 0x14f0
callq 0x15d0
movq %rax, -0x30(%rbp)
leaq 0x3f1c(%rip), %rsi      # 0x70f0
movq %rsi, %rdi
addq $0x3ffff8, %rdi         # imm = 0x3FFFF8
movl $0xfffff, %edx          # imm = 0xFFFFF
movl $0x4, %ecx
leaq -0x1cff(%rip), %r8      # 0x14f0
callq 0x13a0
movq %rax, %rcx
movq -0x30(%rbp), %rax
cmpq %rcx, %rax
je 0x3248
jmp 0x3202
leaq 0x11da(%rip), %rax      # 0x43e3
movq %rax, 0x403f30(%rip)    # 0x407140
movl $0x8b, 0x403f1e(%rip)   # 0x407138
leaq 0x13c6(%rip), %rax      # 0x45e7
movq %rax, 0x403f20(%rip)    # 0x407148
movzbl 0x403ec1(%rip), %eax    # 0x4070f0
andl $0x4, %eax
cmpl $0x0, %eax
je 0x323c
callq 0x1030
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3327
jmp 0x324a
jmp 0x324c
movl 0x403ee2(%rip), %eax    # 0x407134
addl $0x1, %eax
movl %eax, 0x403ed9(%rip)    # 0x407134
leaq 0x3e8e(%rip), %rsi      # 0x70f0
movq %rsi, %rdi
addq $0x3ffff8, %rdi         # imm = 0x3FFFF8
movl $0xfffff, %edx          # imm = 0xFFFFF
movl $0x4, %ecx
leaq -0x1d8d(%rip), %r8      # 0x14f0
callq 0x1540
movq %rax, -0x38(%rbp)
leaq 0x3e63(%rip), %rsi      # 0x70f0
movq %rsi, %rdi
addq $0x3ffff8, %rdi         # imm = 0x3FFFF8
movl $0xfffff, %edx          # imm = 0xFFFFF
movl $0x4, %ecx
leaq -0x1db8(%rip), %r8      # 0x14f0
callq 0x1250
movq %rax, %rcx
movq -0x38(%rbp), %rax
cmpq %rcx, %rax
je 0x32fe
jmp 0x32bb
leaq 0x1121(%rip), %rax      # 0x43e3
movq %rax, 0x403e77(%rip)    # 0x407140
movl $0x90, 0x403e65(%rip)   # 0x407138
leaq 0x13a3(%rip), %rax      # 0x467d
movq %rax, 0x403e67(%rip)    # 0x407148
movzbl 0x403e08(%rip), %eax    # 0x4070f0
andl $0x4, %eax
cmpl $0x0, %eax
je 0x32f5
callq 0x1030
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3327
jmp 0x3300
jmp 0x3302
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x2fe0
jmp 0x3315
movq $0x0, 0x403e28(%rip) # 0x407148
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq