// File: /workspace/github_c_makefile_star2_O0/JulStrat[P]bams/bams.c
// Function: bams_great
void *
bams_great(const BAMS * set, const void *key, size_t *key_num)
{
    SET_NODE *curr;
    size_t key_size;
    char *low, *high;
    char *r = NULL;
    char *t;
    size_t great = 0;
    const void *tkey;

    assert(NULL != set);
    assert(NULL != key);
    assert(NULL != key_num);

    curr = set->head;
    key_size = set->key_size;

    if (set->type == COPY_POINTER) {
        POINTER_ADDR(key, tkey);
    }

    *key_num = 0;
    while (NULL != curr) {
        low = (char *) bisect_right(key, curr->keys, curr->length,
                                    key_size, set->compare);
        high = (char *) curr->keys + curr->length * key_size;
        assert(high >= low);
        great = (size_t) ((high - low) / key_size);
        if (great > 0) {
            t = merge_into(r, *key_num, low, great,
                           key_size, set->compare);
            /*
             * free(r); 
             */
            r = t;
            *key_num += great;
        }
        curr = curr->next;
    }

    return r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x40(%rbp)
movq $0x0, -0x50(%rbp)
xorl %eax, %eax
cmpq -0x8(%rbp), %rax
je 0x2d4e
jmp 0x2d6d
leaq 0x171d(%rip), %rdi      # 0x4472
leaq 0x16d0(%rip), %rsi      # 0x442c
movl $0x19a, %edx            # imm = 0x19A
leaq 0x18f7(%rip), %rcx      # 0x465f
callq 0x1050
xorl %eax, %eax
cmpq -0x10(%rbp), %rax
je 0x2d77
jmp 0x2d96
leaq 0x1726(%rip), %rdi      # 0x44a4
leaq 0x16a7(%rip), %rsi      # 0x442c
movl $0x19b, %edx            # imm = 0x19B
leaq 0x18ce(%rip), %rcx      # 0x465f
callq 0x1050
xorl %eax, %eax
cmpq -0x18(%rbp), %rax
je 0x2da0
jmp 0x2dbf
leaq 0x1867(%rip), %rdi      # 0x460e
leaq 0x167e(%rip), %rsi      # 0x442c
movl $0x19c, %edx            # imm = 0x19C
leaq 0x18a5(%rip), %rcx      # 0x465f
callq 0x1050
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x20(%rax)
jne 0x2df0
movq -0x10(%rbp), %rax
movq %rax, -0x58(%rbp)
leaq -0x58(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
movq $0x0, (%rax)
xorl %eax, %eax
cmpq -0x20(%rbp), %rax
je 0x2ee3
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x28(%rbp), %rcx
movq -0x8(%rbp), %rax
movq 0x8(%rax), %r8
callq 0x1e30
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x20(%rbp), %rcx
movq 0x8(%rcx), %rcx
imulq -0x28(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x30(%rbp), %rax
jb 0x2e58
jmp 0x2e77
leaq 0x1739(%rip), %rdi      # 0x4598
leaq 0x15c6(%rip), %rsi      # 0x442c
movl $0x1aa, %edx            # imm = 0x1AA
leaq 0x17ed(%rip), %rcx      # 0x465f
callq 0x1050
movq -0x38(%rbp), %rax
movq -0x30(%rbp), %rcx
subq %rcx, %rax
xorl %ecx, %ecx
movl %ecx, %edx
divq -0x28(%rbp)
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
jbe 0x2ed3
movq -0x40(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
movq -0x30(%rbp), %rdx
movq -0x50(%rbp), %rcx
movq -0x28(%rbp), %r8
movq -0x8(%rbp), %rax
movq 0x8(%rax), %r9
callq 0x1ac0
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x50(%rbp), %rcx
movq -0x18(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x2dfb
movq -0x40(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)