LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/sam.c
// Function: bam_parse_cigar
ssize_t bam_parse_cigar(const char *in, char **end, bam1_t *b) {
    size_t n_cigar = 0;
    int diff;

    if (!in || !b) {
        hts_log_error("NULL pointer arguments");
        return -1;
    }
    if (end) *end = (char *)in;

    n_cigar = (*in == '*') ? 0 : read_ncigar(in);
    if (!n_cigar && b->core.n_cigar == 0) {
        if (end) *end = (char *)in+1;
        return 0;
    }

    ssize_t cig_diff = n_cigar - b->core.n_cigar;
    if (cig_diff > 0 &&
        possibly_expand_bam_data(b, cig_diff * sizeof(uint32_t)) < 0) {
        hts_log_error("Memory allocation error");
        return -1;
    }

    uint32_t *cig = bam_get_cigar(b);
    if ((uint8_t *)cig != b->data + b->l_data) {
        // Modifying an BAM existing BAM record
        uint8_t  *seq = bam_get_seq(b);
        memmove(cig + n_cigar, seq, (b->data + b->l_data) - seq);
    }

    if (n_cigar) {
        if (!(diff = parse_cigar(in, cig, n_cigar)))
            return -1;
    } else {
        diff = 1; // handle "*"
    }

    b->l_data += cig_diff * sizeof(uint32_t);
    b->core.n_cigar = n_cigar;
    if (end) *end = (char *)in + diff;

    return n_cigar;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
setne %al
testq %rdx, %rdx
setne %cl
testb %cl, %al
je 0x28cb8
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
testq %rsi, %rsi
je 0x28c49
movq %r14, (%rbx)
xorl %ebp, %ebp
cmpb $0x2a, (%r14)
je 0x28c5b
movq %r14, %rdi
callq 0x299f3
movl %eax, %ebp
testl %ebp, %ebp
jne 0x28c6a
cmpl $0x0, 0x14(%r15)
je 0x28d75
movl %ebp, %r13d
movl 0x14(%r15), %eax
movq %r13, %r12
subq %rax, %r12
jle 0x28d00
leaq (,%r12,4), %rax
movslq 0x40(%r15), %rsi
addq %rax, %rsi
setae %al
testq $-0x80000000, %rsi      # imm = 0x80000000
sete %cl
testb %al, %cl
jne 0x28ceb
callq 0x4050
movl $0xc, (%rax)
leaq 0x71f15(%rip), %rsi     # 0x9abc4
leaq 0x71ef6(%rip), %rdx     # 0x9abac
jmp 0x28cc6
leaq 0x71f05(%rip), %rsi     # 0x9abc4
leaq 0x71ecf(%rip), %rdx     # 0x9ab95
movl $0x1, %edi
xorl %eax, %eax
callq 0x14378
movq $-0x1, %r13
movq %r13, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x44(%r15), %eax
cmpq %rax, %rsi
jbe 0x28d00
movq %r15, %rdi
callq 0x23476
testl %eax, %eax
js 0x28ca8
movq 0x38(%r15), %rdx
movzwl 0x12(%r15), %ecx
leaq (%rdx,%rcx), %r8
movslq 0x40(%r15), %rax
cmpq %rax, %rcx
je 0x28d37
addq %rax, %rdx
movl 0x14(%r15), %esi
shll $0x2, %esi
addq %r8, %rsi
leaq (%r8,%r13,4), %rdi
subq %rsi, %rdx
movq %r8, (%rsp)
callq 0x4830
movq (%rsp), %r8
testl %ebp, %ebp
je 0x28d4e
movq %r14, %rdi
movq %r8, %rsi
movl %ebp, %edx
callq 0x29a5e
testl %eax, %eax
jne 0x28d53
jmp 0x28cd2
movl $0x1, %eax
shll $0x2, %r12d
addl %r12d, 0x40(%r15)
movl %ebp, 0x14(%r15)
testq %rbx, %rbx
je 0x28cd9
cltq
addq %rax, %r14
movq %r14, (%rbx)
jmp 0x28cd9
testq %rbx, %rbx
je 0x28d80
incq %r14
movq %r14, (%rbx)
xorl %r13d, %r13d
jmp 0x28cd9
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/sam.c
// Function: sam_parse_cigar
ssize_t sam_parse_cigar(const char *in, char **end, uint32_t **a_cigar, size_t *a_mem) {
    size_t n_cigar = 0;
    int diff;

    if (!in || !a_cigar || !a_mem) {
        hts_log_error("NULL pointer arguments");
        return -1;
    }
    if (end) *end = (char *)in;

    if (*in == '*') {
        if (end) (*end)++;
        return 0;
    }
    n_cigar = read_ncigar(in);
    if (!n_cigar) return 0;
    if (n_cigar > *a_mem) {
        uint32_t *a_tmp = realloc(*a_cigar, n_cigar*sizeof(**a_cigar));
        if (a_tmp) {
            *a_cigar = a_tmp;
            *a_mem = n_cigar;
        } else {
            hts_log_error("Memory allocation error");
            return -1;
        }
    }

    if (!(diff = parse_cigar(in, *a_cigar, n_cigar))) return -1;
    if (end) *end = (char *)in+diff;

    return n_cigar;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r13
testq %rdi, %rdi
setne %al
testq %rdx, %rdx
setne %cl
andb %al, %cl
testq %r13, %r13
setne %al
testb %al, %cl
je 0x2992b
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r14
testq %rsi, %rsi
je 0x2991b
movq %r14, (%rbx)
cmpb $0x2a, (%r14)
jne 0x2994e
testq %rbx, %rbx
je 0x29986
incq (%rbx)
jmp 0x29986
leaq 0x71253(%rip), %rsi     # 0x9ab85
leaq 0x7125c(%rip), %rdx     # 0x9ab95
movl $0x1, %edi
xorl %eax, %eax
callq 0x14378
movq $-0x1, %r15
jmp 0x29989
movq %r14, %rdi
callq 0x299f3
testl %eax, %eax
je 0x29986
movl %eax, %r15d
cmpq %r15, (%r13)
jae 0x299ba
movq (%r12), %rdi
leaq (,%r15,4), %rsi
callq 0x4840
movq %rax, %rbp
testq %rax, %rax
je 0x2999b
movq %rbp, (%r12)
movq %r15, (%r13)
jmp 0x299b5
xorl %r15d, %r15d
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x711e3(%rip), %rsi     # 0x9ab85
leaq 0x71203(%rip), %rdx     # 0x9abac
movl $0x1, %edi
xorl %eax, %eax
callq 0x14378
testq %rbp, %rbp
je 0x29945
testq %rbx, %rbx
sete %bpl
movq (%r12), %rsi
movq %r14, %rdi
movl %r15d, %edx
callq 0x29a5e
testl %eax, %eax
sete %dl
orb %bpl, %dl
xorl %ecx, %ecx
cmpl $0x1, %eax
sbbq %rcx, %rcx
testb %dl, %dl
je 0x299e9
orq %rcx, %r15
jmp 0x29989
cltq
addq %rax, %r14
movq %r14, (%rbx)
jmp 0x29989
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/sam.c
// Function: read_ncigar
static uint32_t read_ncigar(const char *q) {
    uint32_t n_cigar = 0;
    for (; *q && *q != '\t'; ++q)
        if (!isdigit_c(*q)) ++n_cigar;
    if (!n_cigar) {
        hts_log_error("No CIGAR operations");
        return 0;
    }
    if (n_cigar >= 2147483647) {
        hts_log_error("Too many CIGAR operations");
        return 0;
    }

    return n_cigar;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
xorl %ebx, %ebx
movzbl (%r14), %r15d
testl %r15d, %r15d
je 0x29a25
cmpl $0x9, %r15d
je 0x29a25
callq 0x4510
movq (%rax), %rax
movb 0x1(%rax,%r15,2), %al
andb $0x8, %al
cmpb $0x1, %al
adcl $0x0, %ebx
incq %r14
jmp 0x299fd
testl %ebx, %ebx
je 0x29a3a
cmpl $0x7fffffff, %ebx       # imm = 0x7FFFFFFF
jb 0x29a56
leaq 0x71c2c(%rip), %rdx     # 0x9b664
jmp 0x29a41
leaq 0x71c0f(%rip), %rdx     # 0x9b650
leaq 0x71bfc(%rip), %rsi     # 0x9b644
xorl %ebx, %ebx
movl $0x1, %edi
xorl %eax, %eax
callq 0x14378
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/sam.c
// Function: sam_free_sp_bams
static void sam_free_sp_bams(sp_bams *b) {
    if (!b)
        return;

    if (b->bams) {
        int i;
        for (i = 0; i < b->abams; i++) {
            if (b->bams[i].data)
                free(b->bams[i].data);
        }
        free(b->bams);
    }
    free(b);
}

// Assembly:
testq %rdi, %rdi
je 0x29e4f
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpq $0x0, 0x10(%rdi)
je 0x29e42
cmpl $0x0, 0x1c(%rbx)
jle 0x29e39
movl $0x38, %r14d
xorl %r15d, %r15d
movq 0x10(%rbx), %rax
movq (%rax,%r14), %rdi
testq %rdi, %rdi
je 0x29e29
callq 0x45c0
incq %r15
movslq 0x1c(%rbx), %rax
addq $0x50, %r14
cmpq %rax, %r15
jl 0x29e17
movq 0x10(%rbx), %rdi
callq 0x45c0
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x45c0
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/sam.c
// Function: sam_set_thread_pool
int sam_set_thread_pool(htsFile *fp, htsThreadPool *p) {
    if (fp->state)
        return 0;

    if (!(fp->state = sam_state_create(fp)))
        return -1;
    SAM_state *fd = (SAM_state *)fp->state;

    pthread_mutex_init(&fd->lines_m, NULL);
    pthread_mutex_init(&fd->command_m, NULL);
    pthread_cond_init(&fd->command_c, NULL);
    fd->p = p->pool;
    int qsize = p->qsize;
    if (!qsize)
        qsize = 2*hts_tpool_size(fd->p);
    fd->q = hts_tpool_process_init(fd->p, qsize, 0);
    if (!fd->q) {
        sam_state_destroy(fp);
        return -1;
    }

    if (fp->format.compression == bgzf)
        return bgzf_thread_pool(fp->fp.bgzf, p->pool, p->qsize);

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
xorl %ebp, %ebp
cmpq $0x0, 0x40(%rdi)
je 0x29e6d
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rsi, %rbx
movq %rdi, %r14
movl 0x4c(%rdi), %eax
andl $-0x2, %eax
cmpl $0x2, %eax
jne 0x29ea2
movl $0x1, %edi
movl $0xe0, %esi
callq 0x4300
testq %rax, %rax
je 0x29ea2
movq %rax, %r15
movq %rax, 0x40(%r14)
movq %r14, 0xd8(%rax)
jmp 0x29ea5
xorl %r15d, %r15d
movq %r15, 0x40(%r14)
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testq %r15, %r15
je 0x29e60
leaq 0x18(%r15), %rdi
xorl %esi, %esi
callq 0x4780
leaq 0x78(%r15), %rdi
xorl %esi, %esi
callq 0x4780
leaq 0xa0(%r15), %rdi
xorl %esi, %esi
callq 0x45d0
movq (%rbx), %rdi
movq %rdi, 0x8(%r15)
movl 0x8(%rbx), %esi
testl %esi, %esi
jne 0x29eee
callq 0x37f2c
movl %eax, %esi
addl %eax, %esi
movq 0x8(%r15), %rdi
xorl %ebp, %ebp
xorl %edx, %edx
callq 0x3757b
movq %rax, 0x40(%r15)
testq %rax, %rax
je 0x29f28
cmpl $0x2, 0x54(%r14)
jne 0x29e60
movq 0x38(%r14), %rdi
movq (%rbx), %rsi
movl 0x8(%rbx), %edx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xc338
movq %r14, %rdi
callq 0x24c5b
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x29e60
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/sam.c
// Function: sam_set_threads
int sam_set_threads(htsFile *fp, int nthreads) {
    if (nthreads <= 0)
        return 0;

    htsThreadPool p;
    p.pool = hts_tpool_init(nthreads);
    p.qsize = nthreads*2;

    int ret = sam_set_thread_pool(fp, &p);
    if (ret < 0)
        return ret;

    SAM_state *fd = (SAM_state *)fp->state;
    fd->own_pool = 1;

    return 0;
}

// Assembly:
testl %esi, %esi
jle 0x29f7d
pushq %rbp
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebp
movq %rdi, %rbx
movl %esi, %edi
callq 0x378ae
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
addl %ebp, %ebp
movl %ebp, 0x8(%rsi)
movq %rbx, %rdi
callq 0x29e50
testl %eax, %eax
js 0x29f76
movq 0x40(%rbx), %rax
movl $0x1, 0x10(%rax)
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/sam.c
// Function: fastq_state_destroy
void fastq_state_destroy(htsFile *fp) {
    if (fp->state) {
        fastq_state *x = (fastq_state *)fp->state;
        if (x->tags)
            kh_destroy(tag, x->tags);
        ks_free(&x->name);
        ks_free(&x->seq);
        ks_free(&x->qual);
        free(fp->state);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0x40(%rdi), %r15
testq %r15, %r15
je 0x2a00c
movq %rdi, %rbx
movq 0x70(%r15), %r14
testq %r14, %r14
je 0x29fbd
movq 0x18(%r14), %rdi
callq 0x45c0
movq 0x10(%r14), %rdi
callq 0x45c0
movq 0x20(%r14), %rdi
callq 0x45c0
movq %r14, %rdi
callq 0x45c0
movq 0x10(%r15), %rdi
callq 0x45c0
xorl %r14d, %r14d
movq %r14, 0x10(%r15)
xorps %xmm0, %xmm0
movups %xmm0, (%r15)
movq 0x40(%r15), %rdi
callq 0x45c0
movq %r14, 0x40(%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%r15)
movq 0x58(%r15), %rdi
callq 0x45c0
movq %r14, 0x58(%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x48(%r15)
movq 0x40(%rbx), %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x45c0
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/sam.c
// Function: bam_aux_get
uint8_t *bam_aux_get(const bam1_t *b, const char tag[2])
{
    uint8_t *s;
    for (s = bam_aux_first(b); s; s = bam_aux_next(b, s))
        if (s[-2] == tag[0] && s[-1] == tag[1]) {
            // Check the tag value is valid and complete
            uint8_t *e = skip_aux(s, b->data + b->l_data);
            if (e == NULL) goto bad_aux;
            if ((*s == 'Z' || *s == 'H') && *(e - 1) != '\0') goto bad_aux;

            return s;
        }

    // errno now as set by bam_aux_first()/bam_aux_next()
    return NULL;

 bad_aux:
    hts_log_error("Corrupted aux data for read %s flag %d",
                  bam_get_qname(b), b->core.flag);
    errno = EINVAL;
    return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %r14
callq 0x2eb70
testq %rax, %rax
je 0x2c9a4
movq %rax, %rbx
movzbl -0x2(%rbx), %eax
movsbl (%r15), %ecx
cmpl %ecx, %eax
jne 0x2c991
movzbl -0x1(%rbx), %eax
movsbl 0x1(%r15), %ecx
cmpl %ecx, %eax
je 0x2c9af
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2ebbe
movq %rax, %rbx
testq %rax, %rax
jne 0x2c978
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
movq 0x38(%r14), %r15
movslq 0x40(%r14), %rsi
addq %r15, %rsi
movq %rbx, %rdi
callq 0x2da21
testq %rax, %rax
je 0x2c9da
movzbl (%rbx), %ecx
cmpl $0x5a, %ecx
je 0x2c9d4
cmpl $0x48, %ecx
jne 0x2c9a6
cmpb $0x0, -0x1(%rax)
je 0x2c9a6
movzwl 0x10(%r14), %r8d
leaq 0x6e3ae(%rip), %rsi     # 0x9ad94
leaq 0x6e380(%rip), %rdx     # 0x9ad6d
xorl %ebx, %ebx
movl $0x1, %edi
movq %r15, %rcx
xorl %eax, %eax
callq 0x14378
callq 0x4050
movl $0x16, (%rax)
jmp 0x2c9a6
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/sam.c
// Function: skip_aux
static inline uint8_t *skip_aux(uint8_t *s, uint8_t *end)
{
    int size;
    uint32_t n;
    if (s >= end) return end;
    size = aux_type2size(*s); ++s; // skip type
    switch (size) {
    case 'Z':
    case 'H':
        s = memchr(s, 0, end-s);
        return s ? s+1 : end;
    case 'B':
        if (end - s < 5) return NULL;
        size = aux_type2size(*s); ++s;
        n = le_to_u32(s);
        s += 4;
        if (size == 0 || end - s < size * n) return NULL;
        return s + size * n;
    case 0:
        return NULL;
    default:
        if (end - s < size) return NULL;
        return s + size;
    }
}

// Assembly:
pushq %rbx
movq %rsi, %rbx
cmpq %rsi, %rdi
jae 0x2db87
movzbl (%rdi), %eax
movl $0x1, %ecx
cmpl $0x59, %eax
jg 0x2da53
leal -0x41(%rax), %edx
cmpl $0x8, %edx
ja 0x2da87
leaq 0x6c80e(%rip), %rsi     # 0x9a258
movslq (%rsi,%rdx,4), %rdx
addq %rsi, %rdx
jmpq *%rdx
leal -0x63(%rax), %edx
cmpl $0x6, %edx
ja 0x2da72
leaq 0x6c81a(%rip), %rax     # 0x9a27c
movslq (%rax,%rdx,4), %rdx
addq %rax, %rdx
jmpq *%rdx
movl $0x4, %ecx
jmp 0x2da95
cmpl $0x5a, %eax
je 0x2da83
cmpl $0x73, %eax
jne 0x2da8c
movl $0x2, %ecx
jmp 0x2da95
movl %eax, %ecx
jmp 0x2da95
cmpl $0x53, %eax
je 0x2da7c
xorl %ecx, %ecx
jmp 0x2da95
movl $0x8, %ecx
leaq 0x1(%rdi), %rax
cmpl $0x47, %ecx
jg 0x2dae4
testl %ecx, %ecx
je 0x2db85
cmpl $0x42, %ecx
jne 0x2db0b
movq %rbx, %rcx
subq %rax, %rcx
cmpq $0x5, %rcx
jl 0x2db85
movzbl (%rax), %ecx
movl $0x1, %eax
cmpl $0x59, %ecx
jg 0x2db21
leal -0x41(%rcx), %edx
cmpl $0x8, %edx
ja 0x2db55
leaq 0x6c7bd(%rip), %rsi     # 0x9a298
movslq (%rsi,%rdx,4), %rdx
addq %rsi, %rdx
jmpq *%rdx
cmpl $0x5a, %ecx
je 0x2daee
cmpl $0x48, %ecx
jne 0x2db0b
movq %rbx, %rdx
subq %rax, %rdx
movq %rax, %rdi
xorl %esi, %esi
callq 0x4550
leaq 0x1(%rax), %rcx
testq %rax, %rax
cmovneq %rcx, %rbx
jmp 0x2db87
subq %rax, %rbx
movl %ecx, %ecx
addq %rcx, %rax
xorl %edx, %edx
cmpq %rcx, %rbx
cmovgeq %rax, %rdx
movq %rdx, %rbx
jmp 0x2db87
leal -0x63(%rcx), %edx
cmpl $0x6, %edx
ja 0x2db40
leaq 0x6c78c(%rip), %rcx     # 0x9a2bc
movslq (%rcx,%rdx,4), %rdx
addq %rcx, %rdx
jmpq *%rdx
movl $0x4, %eax
jmp 0x2db63
cmpl $0x5a, %ecx
je 0x2db51
cmpl $0x73, %ecx
jne 0x2db5a
movl $0x2, %eax
jmp 0x2db63
movl %ecx, %eax
jmp 0x2db63
cmpl $0x53, %ecx
je 0x2db4a
xorl %eax, %eax
jmp 0x2db63
movl $0x8, %eax
testl %eax, %eax
je 0x2db85
leaq 0x6(%rdi), %rcx
subq %rcx, %rbx
imull 0x2(%rdi), %eax
xorl %ecx, %ecx
cmpq %rax, %rbx
leaq 0x6(%rdi,%rax), %rax
cmovgeq %rax, %rcx
movq %rcx, %rbx
jmp 0x2db87
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/./htslib/kstring.h
// Function: ks_resize
static inline int ks_resize(kstring_t *s, size_t size)
{
	if (s->m < size) {
	    char *tmp;
	    size = (size > (SIZE_MAX>>2)) ? size : size + (size >> 1);
	    tmp = (char*)realloc(s->s, size);
	    if (!tmp)
	        return -1;
	    s->s = tmp;
	    s->m = size;
	}
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
xorl %ebx, %ebx
cmpq %rsi, 0x8(%rdi)
jae 0x2dbdb
movq %rdi, %r14
movq %rsi, %rax
shrq $0x3e, %rax
movq %rsi, %rcx
shrq %rcx
xorl %ebx, %ebx
testq %rax, %rax
movl $0x0, %r15d
cmoveq %rcx, %r15
addq %rsi, %r15
movq 0x10(%rdi), %rdi
movq %r15, %rsi
callq 0x4840
testq %rax, %rax
je 0x2dbd6
movq %rax, 0x10(%r14)
movq %r15, 0x8(%r14)
jmp 0x2dbdb
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/sam.c
// Function: cleanup_sp_lines
static void cleanup_sp_lines(void *arg) {
    sp_lines *gl = (sp_lines *)arg;
    if (!gl) return;

    // Should always be true for lines passed to / from thread workers.
    assert(gl->next == NULL);

    free(gl->data);
    sam_free_sp_bams(gl->bams);
    free(gl);
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x2ea77
movq %rdi, %rbx
cmpq $0x0, (%rdi)
jne 0x2ea79
movq 0x10(%rbx), %rdi
callq 0x45c0
movq 0x28(%rbx), %rdi
callq 0x29df4
movq %rbx, %rdi
popq %rbx
jmp 0x45c0
popq %rbx
retq
leaq 0x6cdc5(%rip), %rdi     # 0x9b845
leaq 0x6c28c(%rip), %rsi     # 0x9ad13
leaq 0x6cdc8(%rip), %rcx     # 0x9b856
movl $0xd5c, %edx            # imm = 0xD5C
callq 0x42f0
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/sam.c
// Function: bam_aux_append
int bam_aux_append(bam1_t *b, const char tag[2], char type, int len, const uint8_t *data)
{
    uint32_t new_len;

    assert(b->l_data >= 0);
    new_len = b->l_data + 3 + len;
    if (new_len > INT32_MAX || new_len < b->l_data) goto nomem;

    if (realloc_bam_data(b, new_len) < 0) return -1;

    b->data[b->l_data] = tag[0];
    b->data[b->l_data + 1] = tag[1];
    b->data[b->l_data + 2] = type;

#ifdef HTS_LITTLE_ENDIAN
    memcpy(b->data + b->l_data + 3, data, len);
#else
    if (aux_to_le(type, b->data + b->l_data + 3, data, len) != 0) {
        errno = EINVAL;
        return -1;
    }
#endif

    b->l_data = new_len;

    return 0;

 nomem:
    errno = ENOMEM;
    return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl 0x40(%rdi), %eax
testl %eax, %eax
js 0x2eb51
movl %ecx, %r15d
leal 0x3(%r15), %r13d
addl %eax, %r13d
setb %al
sets %cl
orb %al, %cl
je 0x2ead4
callq 0x4050
movl $0xc, (%rax)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x2eb42
movq %r8, %r14
movl %edx, %ebp
movq %rsi, %r12
movq %rdi, %rbx
cmpl %r13d, 0x44(%rdi)
jae 0x2eaf4
movl %r13d, %esi
movq %rbx, %rdi
callq 0x23476
testl %eax, %eax
js 0x2eacd
movb (%r12), %al
movq 0x38(%rbx), %rcx
movslq 0x40(%rbx), %rdx
movb %al, (%rcx,%rdx)
movb 0x1(%r12), %al
movq 0x38(%rbx), %rcx
movslq 0x40(%rbx), %rdx
movb %al, 0x1(%rcx,%rdx)
movq 0x38(%rbx), %rax
movslq 0x40(%rbx), %rcx
movb %bpl, 0x2(%rax,%rcx)
movq 0x38(%rbx), %rax
movslq 0x40(%rbx), %rcx
leaq (%rax,%rcx), %rdi
addq $0x3, %rdi
movslq %r15d, %rdx
movq %r14, %rsi
callq 0x43c0
movl %r13d, 0x40(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6c1ac(%rip), %rdi     # 0x9ad04
leaq 0x6c1b4(%rip), %rsi     # 0x9ad13
leaq 0x6c1b3(%rip), %rcx     # 0x9ad19
movl $0x12ed, %edx           # imm = 0x12ED
callq 0x42f0
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/sam.c
// Function: bam_aux_first
uint8_t *bam_aux_first(const bam1_t *b)
{
    uint8_t *s = bam_get_aux(b);
    uint8_t *end = b->data + b->l_data;
    if (end - s <= 2) { errno = ENOENT; return NULL; }
    return s+2;
}

// Assembly:
movq 0x38(%rdi), %rcx
movl 0x14(%rdi), %edx
shll $0x2, %edx
movzwl 0x12(%rdi), %eax
addq %rcx, %rax
addq %rdx, %rax
movslq 0x18(%rdi), %rdx
leal 0x1(%rdx), %esi
sarl %esi
movslq %esi, %rsi
addq %rdx, %rax
addq %rsi, %rax
movslq 0x40(%rdi), %rdx
addq %rcx, %rdx
subq %rax, %rdx
cmpq $0x2, %rdx
jg 0x2ebb9
pushq %rax
callq 0x4050
movl $0x2, (%rax)
xorl %eax, %eax
addq $0x8, %rsp
retq
addq $0x2, %rax
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/sam.c
// Function: bam_aux_next
uint8_t *bam_aux_next(const bam1_t *b, const uint8_t *s)
{
    uint8_t *end = b->data + b->l_data;
    uint8_t *next = s? skip_aux((uint8_t *) s, end) : end;
    if (next == NULL) goto bad_aux;
    if (end - next <= 2) { errno = ENOENT; return NULL; }
    return next+2;

 bad_aux:
    hts_log_error("Corrupted aux data for read %s flag %d",
                  bam_get_qname(b), b->core.flag);
    errno = EINVAL;
    return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r15
movq 0x38(%rdi), %r14
movslq 0x40(%rdi), %r12
addq %r14, %r12
movq %r12, %rbx
testq %rsi, %rsi
je 0x2ebea
movq %rsi, %rdi
movq %r12, %rsi
callq 0x2da21
movq %rax, %rbx
testq %rbx, %rbx
je 0x2ec07
subq %rbx, %r12
cmpq $0x2, %r12
jg 0x2ec38
callq 0x4050
movl $0x2, (%rax)
xorl %ebx, %ebx
jmp 0x2ec3c
movzwl 0x10(%r15), %r8d
leaq 0x6c14d(%rip), %rsi     # 0x9ad60
leaq 0x6c153(%rip), %rdx     # 0x9ad6d
xorl %ebx, %ebx
movl $0x1, %edi
movq %r14, %rcx
xorl %eax, %eax
callq 0x14378
callq 0x4050
movl $0x16, (%rax)
jmp 0x2ec3c
addq $0x2, %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/sam.c
// Function: bam_aux_remove
uint8_t *bam_aux_remove(bam1_t *b, uint8_t *s)
{
    uint8_t *end = b->data + b->l_data;
    uint8_t *next = skip_aux(s, end);
    if (next == NULL) goto bad_aux;

    b->l_data -= next - (s-2);
    if (next >= end) { errno = ENOENT; return NULL; }

    memmove(s-2, next, end - next);
    return s;

 bad_aux:
    hts_log_error("Corrupted aux data for read %s flag %d",
                  bam_get_qname(b), b->core.flag);
    errno = EINVAL;
    return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r15
movq 0x38(%rdi), %r12
movslq 0x40(%rdi), %r13
leaq (%r12,%r13), %r14
movq %rsi, %rdi
movq %r14, %rsi
callq 0x2da21
testq %rax, %rax
je 0x2ecbe
leaq -0x2(%rbx), %rdi
movl %edi, %ecx
subl %eax, %ecx
addl %r13d, %ecx
movl %ecx, 0x40(%r15)
cmpq %r14, %rax
jae 0x2ecef
subq %rax, %r14
movq %rax, %rsi
movq %r14, %rdx
callq 0x4830
jmp 0x2ecfc
movzwl 0x10(%r15), %r8d
leaq 0x6c0d6(%rip), %rsi     # 0x9ada0
leaq 0x6c09c(%rip), %rdx     # 0x9ad6d
xorl %ebx, %ebx
movl $0x1, %edi
movq %r12, %rcx
xorl %eax, %eax
callq 0x14378
callq 0x4050
movl $0x16, (%rax)
jmp 0x2ecfc
callq 0x4050
movl $0x2, (%rax)
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/sam.c
// Function: bam_aux_update_float
int bam_aux_update_float(bam1_t *b, const char tag[2], float val)
{
    uint8_t *s = bam_aux_get(b, tag);
    int shrink = 0, new = 0;

    if (s) { // Tag present - what was it?
        switch (*s) {
            case 'f': break;
            case 'd': shrink = 1; break;
            default: errno = EINVAL; return -1;  // Not a float
        }
    } else {
        if (errno == ENOENT) {  // Tag doesn't exist - add a new one
            new = 1;
        }  else { // Invalid aux data, give up.
            return -1;
        }
    }

    if (new) { // Ensure there's room
        if (possibly_expand_bam_data(b, 3 + 4) < 0)
            return -1;
        s = b->data + b->l_data;
        *s++ = tag[0];
        *s++ = tag[1];
    } else if (shrink) { // Convert non-standard double tag to float
        memmove(s + 5, s + 9, b->l_data - ((s + 9) - b->data));
        b->l_data -= 4;
    }
    *s++ = 'f';
    float_to_le(val, s);
    if (new) b->l_data += 7;

    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movss %xmm0, 0xc(%rsp)
movq %rsi, %r15
movq %rdi, %rbx
callq 0x2c960
movq %rax, %r14
testq %rax, %rax
je 0x2f1ec
movzbl (%r14), %eax
cmpl $0x66, %eax
je 0x2f202
cmpl $0x64, %eax
jne 0x2f271
xorl %edx, %edx
jmp 0x2f204
callq 0x4050
movq %rax, %rcx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movb $0x1, %dl
cmpl $0x2, (%rcx)
je 0x2f204
jmp 0x2f281
movb $0x1, %dl
testq %r14, %r14
je 0x2f247
testb %dl, %dl
jne 0x2f229
leaq 0x5(%r14), %rdi
leaq 0x9(%r14), %rsi
movslq 0x40(%rbx), %rdx
subq %rsi, %rdx
addq 0x38(%rbx), %rdx
callq 0x4830
addl $-0x4, 0x40(%rbx)
movq %r14, %rcx
xorl %eax, %eax
movb $0x66, (%rcx)
movss 0xc(%rsp), %xmm0
movss %xmm0, 0x1(%rcx)
testq %r14, %r14
jne 0x2f281
addl $0x7, 0x40(%rbx)
jmp 0x2f281
movslq 0x40(%rbx), %rsi
cmpq $-0x7, %rsi
setb %al
addq $0x7, %rsi
testq $-0x80000000, %rsi      # imm = 0x80000000
sete %cl
testb %cl, %al
jne 0x2f28b
callq 0x4050
movl $0xc, (%rax)
jmp 0x2f27c
callq 0x4050
movl $0x16, (%rax)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movl 0x44(%rbx), %eax
cmpq %rax, %rsi
jbe 0x2f29f
movq %rbx, %rdi
callq 0x23476
testl %eax, %eax
js 0x2f27c
movq 0x38(%rbx), %rax
movslq 0x40(%rbx), %rcx
movb (%r15), %dl
addq %rax, %rcx
addq $0x2, %rcx
movb %dl, -0x2(%rcx)
movb 0x1(%r15), %al
movb %al, -0x1(%rcx)
jmp 0x2f22c
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/sam.c
// Function: bam_aux2f
double bam_aux2f(const uint8_t *s)
{
    int type;
    type = *s++;
    if (type == 'd') return le_to_double(s);
    else if (type == 'f') return le_to_float(s);
    else return get_int_aux_val(type, s, 0);
}

// Assembly:
movzbl (%rdi), %eax
cmpl $0x62, %eax
jle 0x2f64a
leal -0x63(%rax), %ecx
cmpl $0x6, %ecx
ja 0x2f65f
leaq 0x6ad62(%rip), %rax     # 0x9a39c
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movsbq 0x1(%rdi), %rax
jmp 0x2f69a
cmpl $0x43, %eax
je 0x2f691
cmpl $0x49, %eax
je 0x2f697
cmpl $0x53, %eax
jne 0x2f66b
movzwl 0x1(%rdi), %eax
jmp 0x2f69a
cmpl $0x73, %eax
jne 0x2f66b
movswq 0x1(%rdi), %rax
jmp 0x2f69a
pushq %rax
callq 0x4050
movl $0x16, (%rax)
xorl %eax, %eax
addq $0x8, %rsp
jmp 0x2f69a
movslq 0x1(%rdi), %rax
jmp 0x2f69a
movsd 0x1(%rdi), %xmm0
retq
cvtss2sd 0x1(%rdi), %xmm0
retq
movzbl 0x1(%rdi), %eax
jmp 0x2f69a
movl 0x1(%rdi), %eax
cvtsi2sd %rax, %xmm0
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/sam.c
// Function: bam_aux2Z
char *bam_aux2Z(const uint8_t *s)
{
    int type;
    type = *s++;
    if (type == 'Z' || type == 'H') return (char*)s;
    errno = EINVAL;
    return 0;
}

// Assembly:
movq %rdi, %rax
movzbl (%rdi), %ecx
cmpl $0x5a, %ecx
je 0x2f6cc
cmpl $0x48, %ecx
jne 0x2f6d0
incq %rax
retq
pushq %rax
callq 0x4050
movl $0x16, (%rax)
xorl %eax, %eax
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/sam.c
// Function: bam_auxB_len
uint32_t bam_auxB_len(const uint8_t *s)
{
    if (s[0] != 'B') {
        errno = EINVAL;
        return 0;
    }
    return le_to_u32(s + 2);
}

// Assembly:
cmpb $0x42, (%rdi)
jne 0x2f6ec
movl 0x2(%rdi), %eax
retq
pushq %rax
callq 0x4050
movl $0x16, (%rax)
xorl %eax, %eax
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/sam.c
// Function: bam_auxB2i
int64_t bam_auxB2i(const uint8_t *s, uint32_t idx)
{
    uint32_t len = bam_auxB_len(s);
    if (idx >= len) {
        errno = ERANGE;
        return 0;
    }
    return get_int_aux_val(s[1], s + 6, idx);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
cmpb $0x42, (%rdi)
jne 0x2f713
movl 0x2(%rbx), %eax
jmp 0x2f720
callq 0x4050
movl $0x16, (%rax)
xorl %eax, %eax
cmpl %r14d, %eax
jbe 0x2f748
movzbl 0x1(%rbx), %eax
cmpl $0x62, %eax
jg 0x2f75d
cmpl $0x43, %eax
je 0x2f777
cmpl $0x49, %eax
je 0x2f799
cmpl $0x53, %eax
jne 0x2f78c
addl %r14d, %r14d
movzwl 0x6(%rbx,%r14), %eax
jmp 0x2f755
callq 0x4050
movl $0x22, (%rax)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
cmpl $0x73, %eax
je 0x2f781
cmpl $0x69, %eax
je 0x2f7a4
cmpl $0x63, %eax
jne 0x2f78c
movl %r14d, %eax
movsbq 0x6(%rbx,%rax), %rax
jmp 0x2f755
movl %r14d, %eax
movzbl 0x6(%rbx,%rax), %eax
jmp 0x2f755
addl %r14d, %r14d
movswq 0x6(%rbx,%r14), %rax
jmp 0x2f755
callq 0x4050
movl $0x16, (%rax)
jmp 0x2f753
shll $0x2, %r14d
movl 0x6(%rbx,%r14), %eax
jmp 0x2f755
shll $0x2, %r14d
movslq 0x6(%rbx,%r14), %rax
jmp 0x2f755
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/sam.c
// Function: bam_auxB2f
double bam_auxB2f(const uint8_t *s, uint32_t idx)
{
    uint32_t len = bam_auxB_len(s);
    if (idx >= len) {
        errno = ERANGE;
        return 0.0;
    }
    if (s[1] == 'f') return le_to_float(s + 6 + 4 * idx);
    else return get_int_aux_val(s[1], s + 6, idx);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
cmpb $0x42, (%rdi)
jne 0x2f7c3
movl 0x2(%rbx), %eax
jmp 0x2f7d0
callq 0x4050
movl $0x16, (%rax)
xorl %eax, %eax
cmpl %r14d, %eax
jbe 0x2f7fa
movzbl 0x1(%rbx), %eax
cmpl $0x62, %eax
jle 0x2f80a
cmpl $0x68, %eax
jg 0x2f824
cmpl $0x63, %eax
je 0x2f852
cmpl $0x66, %eax
jne 0x2f843
shll $0x2, %r14d
cvtss2sd 0x6(%rbx,%r14), %xmm0
jmp 0x2f876
callq 0x4050
movl $0x22, (%rax)
xorps %xmm0, %xmm0
jmp 0x2f876
cmpl $0x43, %eax
je 0x2f839
cmpl $0x49, %eax
je 0x2f868
cmpl $0x53, %eax
jne 0x2f843
addl %r14d, %r14d
movzwl 0x6(%rbx,%r14), %eax
jmp 0x2f871
cmpl $0x69, %eax
je 0x2f85d
cmpl $0x73, %eax
jne 0x2f843
addl %r14d, %r14d
movswq 0x6(%rbx,%r14), %rax
jmp 0x2f871
movl %r14d, %eax
movzbl 0x6(%rbx,%rax), %eax
jmp 0x2f871
callq 0x4050
movl $0x16, (%rax)
xorl %eax, %eax
jmp 0x2f871
movl %r14d, %eax
movsbq 0x6(%rbx,%rax), %rax
jmp 0x2f871
shll $0x2, %r14d
movslq 0x6(%rbx,%r14), %rax
jmp 0x2f871
shll $0x2, %r14d
movl 0x6(%rbx,%r14), %eax
cvtsi2sd %rax, %xmm0
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/sam.c
// Function: bam_plp_init
bam_plp_t bam_plp_init(bam_plp_auto_f func, void *data)
{
    bam_plp_t iter;
    iter = (bam_plp_t)calloc(1, sizeof(struct bam_plp_s));
    iter->mp = mp_init();
    iter->head = iter->tail = mp_alloc(iter->mp);
    iter->max_tid = iter->max_pos = -1;
    iter->maxcnt = 8000;
    if (func) {
        iter->func = func;
        iter->data = data;
        iter->b = bam_init1();
    }
    return iter;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
movl $0x1, %edi
movl $0x80, %esi
callq 0x4300
movq %rax, %rbx
movl $0x1, %edi
movl $0x18, %esi
callq 0x4300
incl (%rax)
movq %rax, (%rbx)
movslq 0x4(%rax), %rcx
testq %rcx, %rcx
je 0x30842
movq 0x10(%rax), %rdx
leaq -0x1(%rcx), %rsi
movl %esi, 0x4(%rax)
movq -0x8(%rdx,%rcx,8), %rax
jmp 0x30851
movl $0x1, %edi
movl $0x88, %esi
callq 0x4300
movq %rax, 0x10(%rbx)
movq %rax, 0x8(%rbx)
movq $-0x1, 0x28(%rbx)
movl $0xffffffff, 0x1c(%rbx) # imm = 0xFFFFFFFF
movl $0x1f40, 0x3c(%rbx)     # imm = 0x1F40
testq %r15, %r15
je 0x3088f
movq %r15, 0x58(%rbx)
movq %r14, 0x60(%rbx)
movl $0x1, %edi
movl $0x50, %esi
callq 0x4300
movq %rax, 0x50(%rbx)
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/sam.c
// Function: bam_plp_destroy
void bam_plp_destroy(bam_plp_t iter)
{
    lbnode_t *p, *pnext;
    if ( iter->overlaps ) kh_destroy(olap_hash, iter->overlaps);
    for (p = iter->head; p != NULL; p = pnext) {
        if (iter->plp_destruct && p != iter->tail)
            iter->plp_destruct(iter->data, &p->b, &p->cd);
        pnext = p->next;
        mp_free(iter->mp, p);
    }
    mp_destroy(iter->mp);
    if (iter->b) bam_destroy1(iter->b);
    free(iter->plp);
    free(iter);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x68(%rdi), %r14
testq %r14, %r14
je 0x3091d
movq 0x18(%r14), %rdi
callq 0x45c0
movq 0x10(%r14), %rdi
callq 0x45c0
movq 0x20(%r14), %rdi
callq 0x45c0
movq %r14, %rdi
callq 0x45c0
movq 0x8(%rbx), %r14
testq %r14, %r14
je 0x309ae
movl $0x100, %ebp            # imm = 0x100
movq 0x78(%rbx), %rax
testq %rax, %rax
je 0x3094e
cmpq 0x10(%rbx), %r14
je 0x3094e
movq 0x60(%rbx), %rdi
leaq 0x80(%r14), %rdx
movq %r14, %rsi
callq *%rax
movq 0x78(%r14), %r15
movq (%rbx), %r12
decl (%r12)
movq $0x0, 0x78(%r14)
movl 0x8(%r12), %eax
cmpl %eax, 0x4(%r12)
jne 0x30990
leal (%rax,%rax), %ecx
testl %eax, %eax
cmovel %ebp, %ecx
movl %ecx, 0x8(%r12)
movq 0x10(%r12), %rdi
movslq %ecx, %rsi
shlq $0x3, %rsi
callq 0x4840
movq %rax, 0x10(%r12)
movq 0x10(%r12), %rax
movslq 0x4(%r12), %rcx
leal 0x1(%rcx), %edx
movl %edx, 0x4(%r12)
movq %r14, (%rax,%rcx,8)
movq %r15, %r14
testq %r15, %r15
jne 0x3092f
movq (%rbx), %r14
cmpl $0x0, 0x4(%r14)
jle 0x309e5
xorl %r15d, %r15d
movq 0x10(%r14), %rax
movq (%rax,%r15,8), %rax
movq 0x38(%rax), %rdi
callq 0x45c0
movq 0x10(%r14), %rax
movq (%rax,%r15,8), %rdi
callq 0x45c0
incq %r15
movslq 0x4(%r14), %rax
cmpq %rax, %r15
jl 0x309bb
movq 0x10(%r14), %rdi
callq 0x45c0
movq %r14, %rdi
callq 0x45c0
movq 0x50(%rbx), %rdi
testq %rdi, %rdi
je 0x30a04
callq 0x23544
movq 0x48(%rbx), %rdi
callq 0x45c0
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x45c0
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/sam.c
// Function: mp_free
static inline void mp_free(mempool_t *mp, lbnode_t *p)
{
    --mp->cnt; p->next = 0; // clear lbnode_t::next here
    if (mp->n == mp->max) {
        mp->max = mp->max? mp->max<<1 : 256;
        mp->buf = (lbnode_t**)realloc(mp->buf, sizeof(lbnode_t*) * mp->max);
    }
    mp->buf[mp->n++] = p;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
decl (%rdi)
movq $0x0, 0x78(%rsi)
movl 0x8(%rdi), %eax
cmpl %eax, 0x4(%rdi)
jne 0x30a5e
leal (%rax,%rax), %ecx
testl %eax, %eax
movl $0x100, %eax            # imm = 0x100
cmovnel %ecx, %eax
movl %eax, 0x8(%r14)
movq 0x10(%r14), %rdi
movslq %eax, %rsi
shlq $0x3, %rsi
callq 0x4840
movq %rax, 0x10(%r14)
movq 0x10(%r14), %rax
movslq 0x4(%r14), %rcx
leal 0x1(%rcx), %edx
movl %edx, 0x4(%r14)
movq %rbx, (%rax,%rcx,8)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/sam.c
// Function: overlap_remove
static void overlap_remove(bam_plp_t iter, const bam1_t *b)
{
    if ( !iter->overlaps ) return;

    khiter_t kitr;
    if ( b )
    {
        kitr = kh_get(olap_hash, iter->overlaps, bam_get_qname(b));
        if ( kitr!=kh_end(iter->overlaps) )
            kh_del(olap_hash, iter->overlaps, kitr);
    }
    else
    {
        // remove all
        for (kitr = kh_begin(iter->overlaps); kitr<kh_end(iter->overlaps); kitr++)
            if ( kh_exist(iter->overlaps, kitr) ) kh_del(olap_hash, iter->overlaps, kitr);
    }
}

// Assembly:
movq 0x68(%rdi), %r10
testq %r10, %r10
je 0x3134c
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
testq %rsi, %rsi
je 0x31238
movl (%r10), %eax
testl %eax, %eax
je 0x3127f
movq 0x38(%rsi), %r15
movq %rax, 0x10(%rsp)
leal -0x1(%rax), %edx
movb (%r15), %cl
testb %cl, %cl
je 0x31286
leaq 0x1(%r15), %rax
movl $0x811c9dc5, %r12d      # imm = 0x811C9DC5
movzbl %cl, %ecx
xorl %r12d, %ecx
imull $0x1000193, %ecx, %r12d # imm = 0x1000193
movb (%rax), %cl
incq %rax
testb %cl, %cl
jne 0x31220
jmp 0x3128c
cmpl $0x0, (%r10)
je 0x3133e
movq 0x10(%r10), %rax
xorl %edx, %edx
xorl %esi, %esi
movl %esi, %edi
shrl $0x4, %edi
movl (%rax,%rdi,4), %r8d
movl %edx, %ecx
andl $0x1e, %ecx
movl %r8d, %r9d
shrl %cl, %r9d
testb $0x3, %r9b
jne 0x31270
btsl %ecx, %r8d
movl %r8d, (%rax,%rdi,4)
decl 0x4(%r10)
incl %esi
addl $0x2, %edx
cmpl (%r10), %esi
jb 0x3124a
jmp 0x3133e
xorl %ebx, %ebx
jmp 0x31313
movl $0x811c9dc5, %r12d      # imm = 0x811C9DC5
andl %edx, %r12d
movq 0x10(%r10), %rsi
movl $0x1, %r13d
movl %r12d, %ebx
movq %r10, 0x20(%rsp)
movl %edx, 0xc(%rsp)
movq %rsi, 0x18(%rsp)
movl %ebx, %eax
shrl $0x4, %eax
movl (%rsi,%rax,4), %r14d
leal (%rbx,%rbx), %ebp
andl $0x1e, %ebp
movl %r14d, %eax
movl %ebp, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x31302
testb $0x1, %al
jne 0x312ec
movq 0x18(%r10), %rax
movl %ebx, %ecx
movq (%rax,%rcx,8), %rdi
movq %r15, %rsi
callq 0x46c0
movq 0x18(%rsp), %rsi
movl 0xc(%rsp), %edx
movq 0x20(%rsp), %r10
testl %eax, %eax
je 0x31302
addl %r13d, %ebx
andl %edx, %ebx
incl %r13d
cmpl %r12d, %ebx
jne 0x312aa
movq 0x10(%rsp), %rax
movl %eax, %ebx
jmp 0x31313
movl %ebp, %ecx
shrl %cl, %r14d
testb $0x3, %r14b
movq 0x10(%rsp), %rax
cmovnel %eax, %ebx
cmpl %eax, %ebx
je 0x3133e
movq 0x10(%r10), %rax
movl %ebx, %edx
shrl $0x4, %edx
movl (%rax,%rdx,4), %esi
addl %ebx, %ebx
andl $0x1e, %ebx
movl %esi, %edi
movl %ebx, %ecx
shrl %cl, %edi
testb $0x3, %dil
jne 0x3133e
btsl %ebx, %esi
movl %esi, (%rax,%rdx,4)
decl 0x4(%r10)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/sam.c
// Function: bam_plp_next
const bam_pileup1_t *bam_plp_next(bam_plp_t iter, int *_tid, int *_pos, int *_n_plp)
{
    hts_pos_t pos64 = 0;
    const bam_pileup1_t *p = bam_plp64_next(iter, _tid, &pos64, _n_plp);
    if (pos64 < INT_MAX) {
        *_pos = pos64;
    } else {
        hts_log_error("Position %"PRId64" too large", pos64);
        *_pos = INT_MAX;
        iter->error = 1;
        *_n_plp = -1;
        return NULL;
    }
    return p;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rcx, %r14
movq %rdx, %rbx
movq %rdi, %r15
leaq 0x8(%rsp), %r13
movq $0x0, (%r13)
movq %r13, %rdx
callq 0x30a83
movq (%r13), %rcx
cmpq $0x7ffffffe, %rcx       # imm = 0x7FFFFFFE
jg 0x3138c
movq %rax, %r12
movl %ecx, (%rbx)
jmp 0x313be
leaq 0x69b67(%rip), %rsi     # 0x9aefa
leaq 0x68366(%rip), %rdx     # 0x99700
xorl %r12d, %r12d
movl $0x1, %edi
xorl %eax, %eax
callq 0x14378
movl $0x7fffffff, (%rbx)     # imm = 0x7FFFFFFF
movl $0x1, 0x38(%r15)
movl $0xffffffff, (%r14)     # imm = 0xFFFFFFFF
movq %r12, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/sam.c
// Function: bam_plp64_auto
const bam_pileup1_t *bam_plp64_auto(bam_plp_t iter, int *_tid, hts_pos_t *_pos, int *_n_plp)
{
    const bam_pileup1_t *plp;
    if (iter->func == 0 || iter->error) { *_n_plp = -1; return 0; }
    if ((plp = bam_plp64_next(iter, _tid, _pos, _n_plp)) != 0) return plp;
    else { // no pileup line can be obtained; read alignments
        *_n_plp = 0;
        if (iter->is_eof) return 0;
        int ret;
        while ( (ret=iter->func(iter->data, iter->b)) >= 0) {
            if (bam_plp_push(iter, iter->b) < 0) {
                *_n_plp = -1;
                return 0;
            }
            if ((plp = bam_plp64_next(iter, _tid, _pos, _n_plp)) != 0) return plp;
            // otherwise no pileup line can be returned; read the next alignment.
        }
        if ( ret < -1 ) { iter->error = ret; *_n_plp = -1; return 0; }
        if (bam_plp_push(iter, 0) < 0) {
            *_n_plp = -1;
            return 0;
        }
        if ((plp = bam_plp64_next(iter, _tid, _pos, _n_plp)) != 0) return plp;
        return 0;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
cmpq $0x0, 0x58(%rdi)
je 0x325e1
movq %rdi, %r15
cmpl $0x0, 0x38(%rdi)
je 0x325f5
movl $0xffffffff, (%rbx)     # imm = 0xFFFFFFFF
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rdx, %r14
movq %rsi, %r12
movq %r15, %rdi
movq %rbx, %rcx
callq 0x30a83
testq %rax, %rax
jne 0x325e9
movl $0x0, (%rbx)
cmpl $0x0, 0x30(%r15)
jne 0x325e7
jmp 0x32640
movq 0x50(%r15), %rsi
movq %r15, %rdi
callq 0x313cf
testl %eax, %eax
js 0x325e1
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x30a83
testq %rax, %rax
jne 0x325e9
movq 0x50(%r15), %rsi
movq 0x60(%r15), %rdi
callq *0x58(%r15)
testl %eax, %eax
jns 0x3261a
cmpl $-0x1, %eax
je 0x3265b
movl %eax, 0x38(%r15)
jmp 0x325e1
cmpl $0x0, 0x38(%r15)
jne 0x325e1
movl $0x1, 0x30(%r15)
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x30a83
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/sam.c
// Function: bam_plp_auto
const bam_pileup1_t *bam_plp_auto(bam_plp_t iter, int *_tid, int *_pos, int *_n_plp)
{
    hts_pos_t pos64 = 0;
    const bam_pileup1_t *p = bam_plp64_auto(iter, _tid, &pos64, _n_plp);
    if (pos64 < INT_MAX) {
        *_pos = pos64;
    } else {
        hts_log_error("Position %"PRId64" too large", pos64);
        *_pos = INT_MAX;
        iter->error = 1;
        *_n_plp = -1;
        return NULL;
    }
    return p;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rcx, %r14
movq %rdx, %rbx
movq %rdi, %r15
leaq 0x8(%rsp), %r13
movq $0x0, (%r13)
movq %r13, %rdx
callq 0x325c6
movq (%r13), %rcx
cmpq $0x7ffffffe, %rcx       # imm = 0x7FFFFFFE
jg 0x326c9
movq %rax, %r12
movl %ecx, (%rbx)
jmp 0x326fb
leaq 0x688a4(%rip), %rsi     # 0x9af74
leaq 0x67029(%rip), %rdx     # 0x99700
xorl %r12d, %r12d
movl $0x1, %edi
xorl %eax, %eax
callq 0x14378
movl $0x7fffffff, (%rbx)     # imm = 0x7FFFFFFF
movl $0x1, 0x38(%r15)
movl $0xffffffff, (%r14)     # imm = 0xFFFFFFFF
movq %r12, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/sam.c
// Function: bam_plp_reset
void bam_plp_reset(bam_plp_t iter)
{
    overlap_remove(iter, NULL);
    iter->max_tid = iter->max_pos = -1;
    iter->tid = iter->pos = 0;
    iter->is_eof = 0;
    while (iter->head != iter->tail) {
        lbnode_t *p = iter->head;
        iter->head = p->next;
        mp_free(iter->mp, p);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %esi, %esi
callq 0x311dc
movq $-0x1, 0x28(%rbx)
movl $0xffffffff, 0x1c(%rbx) # imm = 0xFFFFFFFF
movq $0x0, 0x20(%rbx)
movl %r14d, 0x18(%rbx)
movl %r14d, 0x30(%rbx)
movq 0x8(%rbx), %r14
cmpq 0x10(%rbx), %r14
je 0x327ab
movl $0x100, %ebp            # imm = 0x100
movq 0x78(%r14), %rax
movq %rax, 0x8(%rbx)
movq (%rbx), %r15
decl (%r15)
movq $0x0, 0x78(%r14)
movl 0x8(%r15), %eax
cmpl %eax, 0x4(%r15)
jne 0x3278e
leal (%rax,%rax), %ecx
testl %eax, %eax
cmovel %ebp, %ecx
movl %ecx, 0x8(%r15)
movq 0x10(%r15), %rdi
movslq %ecx, %rsi
shlq $0x3, %rsi
callq 0x4840
movq %rax, 0x10(%r15)
movq 0x10(%r15), %rax
movslq 0x4(%r15), %rcx
leal 0x1(%rcx), %edx
movl %edx, 0x4(%r15)
movq %r14, (%rax,%rcx,8)
movq 0x8(%rbx), %r14
cmpq 0x10(%rbx), %r14
jne 0x3274e
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/sam.c
// Function: bam_mplp_init
bam_mplp_t bam_mplp_init(int n, bam_plp_auto_f func, void **data)
{
    int i;
    bam_mplp_t iter;
    iter = (bam_mplp_t)calloc(1, sizeof(struct bam_mplp_s));
    iter->pos = (hts_pos_t*)calloc(n, sizeof(hts_pos_t));
    iter->tid = (int32_t*)calloc(n, sizeof(int32_t));
    iter->n_plp = (int*)calloc(n, sizeof(int));
    iter->plp = (const bam_pileup1_t**)calloc(n, sizeof(bam_pileup1_t*));
    iter->iter = (bam_plp_t*)calloc(n, sizeof(bam_plp_t));
    iter->n = n;
    iter->min_pos = HTS_POS_MAX;
    iter->min_tid = (uint32_t)-1;
    for (i = 0; i < n; ++i) {
        iter->iter[i] = bam_plp_init(func, data[i]);
        iter->pos[i] = iter->min_pos;
        iter->tid[i] = iter->min_tid;
    }
    return iter;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movl %edi, %ebp
movl $0x1, %edi
movl $0x38, %esi
callq 0x4300
movq %rax, %r14
movl %ebp, %ebx
movslq %ebp, %rbp
movl $0x8, %esi
movq %rbp, %rdi
callq 0x4300
movq %rax, %r12
movq %rax, 0x18(%r14)
movl $0x4, %esi
movq %rbp, %rdi
callq 0x4300
movq %rax, %r13
movq %rax, 0x8(%r14)
movl $0x4, %esi
movq %rbp, %rdi
callq 0x4300
movq %rax, 0x28(%r14)
movl $0x8, %esi
movq %rbp, %rdi
callq 0x4300
movq %rax, 0x30(%r14)
movl $0x8, %esi
movq %rbp, %rdi
callq 0x4300
movq %rax, %r15
movabsq $0x7fffffff7fffffff, %rax # imm = 0x7FFFFFFF7FFFFFFF
movq %r15, 0x20(%r14)
movl %ebp, (%r14)
movq %rax, 0x10(%r14)
movq %r14, (%rsp)
movl $0xffffffff, 0x4(%r14)  # imm = 0xFFFFFFFF
testl %ebp, %ebp
jle 0x328a0
movl %ebx, %ebp
xorl %ebx, %ebx
movq %rax, %r14
movq 0x10(%rsp), %rax
movq (%rax,%rbx,8), %rsi
movq 0x8(%rsp), %rdi
callq 0x307f6
movq %rax, (%r15,%rbx,8)
movq %r14, %rax
movq %r14, (%r12,%rbx,8)
movl $0xffffffff, (%r13,%rbx,4) # imm = 0xFFFFFFFF
incq %rbx
cmpq %rbx, %rbp
jne 0x3286e
movq (%rsp), %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/sam.c
// Function: bam_mplp_init_overlaps
int bam_mplp_init_overlaps(bam_mplp_t iter)
{
    int i, r = 0;
    for (i = 0; i < iter->n; ++i)
        r |= bam_plp_init_overlaps(iter->iter[i]);
    return r == 0 ? 0 : -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movslq (%rdi), %rbx
testq %rbx, %rbx
jle 0x32901
movq 0x20(%rdi), %r14
xorl %r15d, %r15d
xorl %ebp, %ebp
movq (%r14,%r15,8), %r12
movl $0x1, %edi
movl $0x28, %esi
callq 0x4300
cmpq $0x1, %rax
movl $0x0, %ecx
sbbl %ecx, %ecx
movq %rax, 0x68(%r12)
orl %ecx, %ebp
incq %r15
cmpq %r15, %rbx
jne 0x328cc
xorl %eax, %eax
negl %ebp
sbbl %eax, %eax
jmp 0x32903
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/sam.c
// Function: bam_mplp_auto
int bam_mplp_auto(bam_mplp_t iter, int *_tid, int *_pos, int *n_plp, const bam_pileup1_t **plp)
{
    hts_pos_t pos64 = 0;
    int ret = bam_mplp64_auto(iter, _tid, &pos64, n_plp, plp);
    if (ret >= 0) {
        if (pos64 < INT_MAX) {
            *_pos = pos64;
        } else {
            hts_log_error("Position %"PRId64" too large", pos64);
            *_pos = INT_MAX;
            return -1;
        }
    }
    return ret;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
leaq 0x8(%rsp), %rdx
movq $0x0, (%rdx)
callq 0x3298d
testl %eax, %eax
js 0x32b90
movq 0x8(%rsp), %rcx
cmpq $0x7ffffffe, %rcx       # imm = 0x7FFFFFFE
jle 0x32b8e
leaq 0x68410(%rip), %rsi     # 0x9af81
leaq 0x66b88(%rip), %rdx     # 0x99700
movl $0x1, %edi
xorl %eax, %eax
callq 0x14378
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
movl %ecx, (%rbx)
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/sam.c
// Function: bam_mplp_reset
void bam_mplp_reset(bam_mplp_t iter)
{
    int i;
    iter->min_pos = HTS_POS_MAX;
    iter->min_tid = (uint32_t)-1;
    for (i = 0; i < iter->n; ++i) {
        bam_plp_reset(iter->iter[i]);
        iter->pos[i] = HTS_POS_MAX;
        iter->tid[i] = (uint32_t)-1;
        iter->n_plp[i] = 0;
        iter->plp[i] = NULL;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movabsq $0x7fffffff7fffffff, %r14 # imm = 0x7FFFFFFF7FFFFFFF
movq %r14, 0x10(%rdi)
movl $0xffffffff, 0x4(%rdi)  # imm = 0xFFFFFFFF
cmpl $0x0, (%rdi)
jle 0x32bff
movq %rdi, %rbx
xorl %r15d, %r15d
movq 0x20(%rbx), %rax
movq (%rax,%r15,8), %rdi
callq 0x3270c
movq 0x18(%rbx), %rax
movq %r14, (%rax,%r15,8)
movq 0x8(%rbx), %rax
movl $0xffffffff, (%rax,%r15,4) # imm = 0xFFFFFFFF
movq 0x28(%rbx), %rax
movl $0x0, (%rax,%r15,4)
movq 0x30(%rbx), %rax
movq $0x0, (%rax,%r15,8)
incq %r15
movslq (%rbx), %rax
cmpq %rax, %r15
jl 0x32bbb
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/sam.c
// Function: warn_if_known_stderr
static void warn_if_known_stderr(const char *line) {
    if (strstr(line, "M::bwa_idx_load_from_disk") != NULL)
        known_stderr("bwa", "Use `bwa mem -o file.sam ...` or `bwa sampe -f file.sam ...` instead of `bwa ... > file.sam`");
    else if (strstr(line, "M::mem_pestat") != NULL)
        known_stderr("bwa", "Use `bwa mem -o file.sam ...` instead of `bwa mem ... > file.sam`");
    else if (strstr(line, "loaded/built the index") != NULL)
        known_stderr("minimap2", "Use `minimap2 -o file.sam ...` instead of `minimap2 ... > file.sam`");
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
leaq 0x686e0(%rip), %rsi     # 0x9b332
callq 0x40e0
leaq 0x686ee(%rip), %rbx     # 0x9b34c
testq %rax, %rax
je 0x32c6c
leaq 0x686e6(%rip), %r14     # 0x9b350
jmp 0x32cab
leaq 0x6873a(%rip), %rsi     # 0x9b3ad
movq %r14, %rdi
callq 0x40e0
testq %rax, %rax
je 0x32c89
leaq 0x68734(%rip), %r14     # 0x9b3bb
jmp 0x32cab
leaq 0x6876d(%rip), %rsi     # 0x9b3fd
movq %r14, %rdi
callq 0x40e0
testq %rax, %rax
je 0x32ce9
leaq 0x68779(%rip), %r14     # 0x9b41d
leaq 0x68769(%rip), %rbx     # 0x9b414
leaq 0x687af(%rip), %r15     # 0x9b461
leaq 0x687b5(%rip), %rdx     # 0x9b46e
movl $0x3, %edi
movq %r15, %rsi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x14378
leaq 0x687f5(%rip), %rdx     # 0x9b4c7
movl $0x3, %edi
movq %r15, %rsi
movq %r14, %rcx
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x14378
popq %rbx
popq %r14
popq %r15
retq