// File: /workspace/github_c_makefile_star2_O0/JulStrat[P]bams/bams.c
// Function: bams_equal
void *
bams_equal(const BAMS * set, const void *key, size_t *key_num)
{
    SET_NODE *curr;
    size_t key_size;
    char *low, *high;
    char *r = NULL;
    size_t equal = 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_left(key, curr->keys, curr->length,
                                   key_size, set->compare);
        high = (char *) bisect_right(key, curr->keys, curr->length,
                                     key_size, set->compare);
        assert(high >= low);
        if (high > low) {
            r = realloc(r, equal + high - low);
            assert(NULL != r);
            memcpy(r + equal, low, high - low);
            equal += high - low;
        }

        curr = curr->next;
    }
    *key_num = (size_t) (equal / key_size);

    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, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
xorl %eax, %eax
cmpq -0x8(%rbp), %rax
je 0x2b2e
jmp 0x2b4d
leaq 0x193d(%rip), %rdi      # 0x4472
leaq 0x18f0(%rip), %rsi      # 0x442c
movl $0x16f, %edx            # imm = 0x16F
leaq 0x1ad6(%rip), %rcx      # 0x461e
callq 0x1050
xorl %eax, %eax
cmpq -0x10(%rbp), %rax
je 0x2b57
jmp 0x2b76
leaq 0x1946(%rip), %rdi      # 0x44a4
leaq 0x18c7(%rip), %rsi      # 0x442c
movl $0x170, %edx            # imm = 0x170
leaq 0x1aad(%rip), %rcx      # 0x461e
callq 0x1050
xorl %eax, %eax
cmpq -0x18(%rbp), %rax
je 0x2b80
jmp 0x2b9f
leaq 0x1a87(%rip), %rdi      # 0x460e
leaq 0x189e(%rip), %rsi      # 0x442c
movl $0x171, %edx            # imm = 0x171
leaq 0x1a84(%rip), %rcx      # 0x461e
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 0x2bd0
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 0x2cf2
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 -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, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x30(%rbp), %rax
jb 0x2c45
jmp 0x2c64
leaq 0x194c(%rip), %rdi      # 0x4598
leaq 0x17d9(%rip), %rsi      # 0x442c
movl $0x180, %edx            # imm = 0x180
leaq 0x19bf(%rip), %rcx      # 0x461e
callq 0x1050
movq -0x38(%rbp), %rax
cmpq -0x30(%rbp), %rax
jbe 0x2ce2
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %rsi
addq -0x38(%rbp), %rsi
movq -0x30(%rbp), %rax
subq %rax, %rsi
callq 0x10a0
movq %rax, -0x40(%rbp)
xorl %eax, %eax
cmpq -0x40(%rbp), %rax
je 0x2c94
jmp 0x2cb3
leaq 0x19ba(%rip), %rdi      # 0x4655
leaq 0x178a(%rip), %rsi      # 0x442c
movl $0x183, %edx            # imm = 0x183
leaq 0x1970(%rip), %rcx      # 0x461e
callq 0x1050
movq -0x40(%rbp), %rdi
addq -0x48(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq -0x30(%rbp), %rax
subq %rax, %rdx
callq 0x1070
movq -0x38(%rbp), %rax
movq -0x30(%rbp), %rcx
subq %rcx, %rax
addq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x2bdb
movq -0x48(%rbp), %rax
xorl %ecx, %ecx
movl %ecx, %edx
divq -0x28(%rbp)
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x40(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)