// File: /workspace/github_c_makefile_star2_O0/JulStrat[P]bams/bams.c
// Function: bams_less
void *
bams_less(const BAMS * set, const void *key, size_t *key_num)
{
    SET_NODE *curr;
    size_t key_size;
    char *off;
    char *r = NULL;
    char *t;
    size_t less = 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) {
        off = (char *) bisect_left(key, curr->keys, curr->length,
                                   key_size, set->compare);
        assert(off >= (char *) curr->keys);
        less = (size_t) ((off - (char *) curr->keys) / key_size);
        if (less > 0) {
            t = merge_into(r, *key_num, curr->keys, less,
                           key_size, set->compare);
            /*
             * free(r); 
             */
            r = t;
            *key_num += less;
        }
        curr = curr->next;
    }

    return r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x48(%rbp)
xorl %eax, %eax
cmpq -0x8(%rbp), %rax
je 0x296e
jmp 0x298d
leaq 0x1afd(%rip), %rdi      # 0x4472
leaq 0x1ab0(%rip), %rsi      # 0x442c
movl $0x145, %edx            # imm = 0x145
leaq 0x1c50(%rip), %rcx      # 0x45d8
callq 0x1050
xorl %eax, %eax
cmpq -0x10(%rbp), %rax
je 0x2997
jmp 0x29b6
leaq 0x1b06(%rip), %rdi      # 0x44a4
leaq 0x1a87(%rip), %rsi      # 0x442c
movl $0x146, %edx            # imm = 0x146
leaq 0x1c27(%rip), %rcx      # 0x45d8
callq 0x1050
xorl %eax, %eax
cmpq -0x18(%rbp), %rax
je 0x29c0
jmp 0x29df
leaq 0x1c47(%rip), %rdi      # 0x460e
leaq 0x1a5e(%rip), %rsi      # 0x442c
movl $0x147, %edx            # imm = 0x147
leaq 0x1bfe(%rip), %rcx      # 0x45d8
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 0x2a10
movq -0x10(%rbp), %rax
movq %rax, -0x50(%rbp)
leaq -0x50(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
movq $0x0, (%rax)
xorl %eax, %eax
cmpq -0x20(%rbp), %rax
je 0x2af3
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 0x1ce0
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq -0x20(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jb 0x2a60
jmp 0x2a7f
leaq 0x1ae2(%rip), %rdi      # 0x4549
leaq 0x19be(%rip), %rsi      # 0x442c
movl $0x154, %edx            # imm = 0x154
leaq 0x1b5e(%rip), %rcx      # 0x45d8
callq 0x1050
movq -0x30(%rbp), %rax
movq -0x20(%rbp), %rcx
movq 0x10(%rcx), %rcx
subq %rcx, %rax
xorl %ecx, %ecx
movl %ecx, %edx
divq -0x28(%rbp)
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
jbe 0x2ae3
movq -0x38(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdx
movq -0x48(%rbp), %rcx
movq -0x28(%rbp), %r8
movq -0x8(%rbp), %rax
movq 0x8(%rax), %r9
callq 0x1ac0
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x48(%rbp), %rcx
movq -0x18(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x2a1b
movq -0x38(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)