LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/sam.c
// Function: sam_parse_Bc_vals
HTS_ALIGN32
static char *sam_parse_Bc_vals(bam1_t *b, char *q, uint32_t *nused,
                               uint32_t *nalloc, int *overflow) {
    while (*q == ',') {
        if ((*nused)++ >= (*nalloc)) {
            if (grow_B_array(b, nalloc, 1) < 0)
                return NULL;
        }
        *(b->data + b->l_data) = hts_str2int(q + 1, &q, 8, overflow);
        b->l_data++;
    }
    return q;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
cmpb $0x2c, (%rsi)
jne 0x33606
movq %r8, %r14
movq %rcx, %r15
movq %rdx, %r12
movq %rdi, %r13
movl (%r12), %ecx
leal 0x1(%rcx), %eax
movl %eax, (%r12)
movl (%r15), %eax
cmpl %eax, %ecx
jb 0x334a4
cmpl $0x553f7ced, %eax       # imm = 0x553F7CED
jae 0x335d0
shrl %eax
movslq 0x40(%r13), %rsi
addq %rax, %rsi
setb %al
cmpq $0x7fffffff, %rsi       # imm = 0x7FFFFFFF
ja 0x335df
testb %al, %al
jne 0x335df
movl 0x44(%r13), %eax
cmpq %rax, %rsi
jbe 0x33498
movq %r13, %rdi
callq 0x23476
testl %eax, %eax
js 0x335ea
movl (%r15), %eax
movl %eax, %ecx
shrl %ecx
addl %eax, %ecx
movl %ecx, (%r15)
movzbl 0x1(%rbx), %eax
cmpl $0x2b, %eax
je 0x334ee
cmpl $0x2d, %eax
jne 0x334f4
leaq 0x2(%rbx), %rdi
addq $0x4, %rbx
xorl %ecx, %ecx
xorl %eax, %eax
movzbl (%rdi,%rcx), %edx
leal -0x3a(%rdx), %esi
cmpb $-0xa, %sil
setb %sil
jb 0x3353e
leaq (%rax,%rax,4), %rax
leaq (%rdx,%rax,2), %rax
addq $-0x30, %rax
incq %rcx
cmpl $0x2, %ecx
jne 0x334be
movl $0x80, %edx
xorl %esi, %esi
xorl %ecx, %ecx
jmp 0x3354b
addq $0x2, %rbx
jmp 0x334f7
incq %rbx
movq %rbx, %rdi
addq $0x2, %rbx
xorl %ecx, %ecx
xorl %eax, %eax
movzbl (%rdi,%rcx), %edx
leal -0x3a(%rdx), %esi
cmpb $-0xa, %sil
setb %sil
jb 0x33532
leaq (%rax,%rax,4), %rax
leaq (%rdx,%rax,2), %rax
addq $-0x30, %rax
incq %rcx
cmpl $0x2, %ecx
jne 0x33502
movl $0x7f, %edx
movb $0x1, %cl
xorl %esi, %esi
jmp 0x3354b
addq %rcx, %rdi
movl $0x7f, %edx
movb $0x1, %cl
jmp 0x33548
addq %rcx, %rdi
movl $0x80, %edx
xorl %ecx, %ecx
movq %rdi, %rbx
testb %sil, %sil
jne 0x335aa
movb (%rbx), %sil
cmpb $0x30, %sil
jb 0x335aa
movzbl %sil, %edi
addl $-0x30, %edi
cmpl $0x9, %edi
ja 0x335aa
leaq -0x78(%rdx), %rsi
movl %edi, %edi
cmpq $0xc, %rax
jb 0x33578
jne 0x33591
cmpq %rdi, %rsi
jb 0x33591
leaq (%rax,%rax,4), %rax
leaq (%rdi,%rax,2), %rax
movzbl 0x1(%rbx), %edi
incq %rbx
addl $-0x30, %edi
cmpl $0xa, %edi
jb 0x33569
jmp 0x335aa
movzbl 0x1(%rbx), %eax
incq %rbx
addl $-0x30, %eax
cmpl $0xa, %eax
jb 0x33591
movl $0x1, (%r14)
movq %rdx, %rax
movl %eax, %edx
negb %dl
movzbl %dl, %edx
testb %cl, %cl
cmovnel %eax, %edx
movq 0x38(%r13), %rax
movslq 0x40(%r13), %rcx
movb %dl, (%rax,%rcx)
incl 0x40(%r13)
cmpb $0x2c, (%rbx)
je 0x33441
jmp 0x33606
callq 0x4050
movl $0xc, (%rax)
xorl %ebx, %ebx
jmp 0x33606
callq 0x4050
movl $0xc, (%rax)
leaq 0x68046(%rip), %rsi     # 0x9b637
leaq 0x6708d(%rip), %rdx     # 0x9a685
xorl %ebx, %ebx
movl $0x1, %edi
xorl %eax, %eax
callq 0x14378
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/sam.c
// Function: sam_parse_BC_vals
HTS_ALIGN32
static char *sam_parse_BC_vals(bam1_t *b, char *q, uint32_t *nused,
                               uint32_t *nalloc, int *overflow) {
    while (*q == ',') {
        if ((*nused)++ >= (*nalloc)) {
            if (grow_B_array(b, nalloc, 1) < 0)
                return NULL;
        }
        if (q[1] != '-') {
            *(b->data + b->l_data) = hts_str2uint(q + 1, &q, 8, overflow);
            b->l_data++;
        } else {
            *overflow = 1;
            q++;
            skip_to_comma_(q);
        }
    }
    return q;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r13
cmpb $0x2c, (%rsi)
jne 0x337e9
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rdi, %r12
movl (%r15), %ecx
leal 0x1(%rcx), %eax
movl %eax, (%r15)
movl (%r14), %eax
cmpl %eax, %ecx
jb 0x336a4
cmpl $0x553f7ced, %eax       # imm = 0x553F7CED
jae 0x337b1
shrl %eax
movslq 0x40(%r12), %rsi
addq %rax, %rsi
setb %al
cmpq $0x7fffffff, %rsi       # imm = 0x7FFFFFFF
ja 0x337c1
testb %al, %al
jne 0x337c1
movl 0x44(%r12), %eax
cmpq %rax, %rsi
jbe 0x33698
movq %r12, %rdi
callq 0x23476
testl %eax, %eax
js 0x337cc
movl (%r14), %eax
movl %eax, %ecx
shrl %ecx
addl %eax, %ecx
movl %ecx, (%r14)
movb 0x1(%r13), %al
cmpb $0x2d, %al
jne 0x336ca
movl $0x1, (%rbx)
movb 0x1(%r13), %al
incq %r13
cmpb $0xa, %al
jl 0x337a4
cmpb $0x2c, %al
jne 0x336b2
jmp 0x337a4
incq %r13
xorl %ecx, %ecx
cmpb $0x2b, %al
sete %cl
leaq (%rcx,%r13), %rax
movb (%r13,%rcx), %dil
leal -0x30(%rdi), %edx
cmpb $0x9, %dl
ja 0x33724
leaq (%rcx,%r13), %rdx
addq $0x2, %rdx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
leaq (%rcx,%rcx,4), %rcx
movzbl %dil, %esi
leaq (%rsi,%rcx,2), %rcx
addq $-0x30, %rcx
testl %r8d, %r8d
setne %sil
je 0x3372b
movb 0x1(%rax), %dil
incq %rax
leal -0x30(%rdi), %r9d
incl %r8d
cmpb $0x9, %r9b
jbe 0x336f5
jmp 0x3372e
movb $0x1, %sil
xorl %ecx, %ecx
jmp 0x3372e
movq %rdx, %rax
movzbl (%rax), %edx
leal -0x3a(%rdx), %edi
cmpl $-0xa, %edi
setb %dil
orb %sil, %dil
addl $-0x30, %edx
cmpl $0xa, %edx
setae %sil
orb %dil, %sil
jne 0x3378f
cmpq $0x19, %rcx
jb 0x3375a
jne 0x33775
cmpl $0x6, %edx
jae 0x33775
leaq (%rcx,%rcx,4), %rcx
movl %edx, %edx
leaq (%rdx,%rcx,2), %rcx
movzbl 0x1(%rax), %edx
incq %rax
addl $-0x30, %edx
cmpl $0xa, %edx
jb 0x3374d
jmp 0x3378f
movzbl 0x1(%rax), %ecx
incq %rax
addl $-0x30, %ecx
cmpl $0xa, %ecx
jb 0x33775
movl $0x1, (%rbx)
movl $0xff, %ecx
movq 0x38(%r12), %rdx
movslq 0x40(%r12), %rsi
movb %cl, (%rdx,%rsi)
incl 0x40(%r12)
movq %rax, %r13
cmpb $0x2c, (%r13)
je 0x33641
jmp 0x337e9
callq 0x4050
movl $0xc, (%rax)
xorl %r13d, %r13d
jmp 0x337e9
callq 0x4050
movl $0xc, (%rax)
leaq 0x67e64(%rip), %rsi     # 0x9b637
leaq 0x66eab(%rip), %rdx     # 0x9a685
xorl %r13d, %r13d
movl $0x1, %edi
xorl %eax, %eax
callq 0x14378
movq %r13, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/sam.c
// Function: sam_parse_BS_vals
HTS_ALIGN32
static char *sam_parse_BS_vals(bam1_t *b, char *q, uint32_t *nused,
                               uint32_t *nalloc, int *overflow) {
    while (*q == ',') {
        if ((*nused)++ >= (*nalloc)) {
            if (grow_B_array(b, nalloc, 2) < 0)
                return NULL;
        }
        if (q[1] != '-') {
            u16_to_le(hts_str2uint(q + 1, &q, 16, overflow),
                      b->data + b->l_data);
            b->l_data += 2;
        } else {
            *overflow = 1;
            q++;
            skip_to_comma_(q);
        }
    }
    return q;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r13
cmpb $0x2c, (%rsi)
jne 0x33bd3
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rdi, %r12
movl (%r15), %ecx
leal 0x1(%rcx), %eax
movl %eax, (%r15)
movl (%r14), %eax
cmpl %eax, %ecx
jb 0x33a87
cmpl $0x553f7ced, %eax       # imm = 0x553F7CED
jae 0x33b9b
andl $0x7ffffffe, %eax       # imm = 0x7FFFFFFE
movslq 0x40(%r12), %rsi
addq %rax, %rsi
setb %al
cmpq $0x7fffffff, %rsi       # imm = 0x7FFFFFFF
ja 0x33bab
testb %al, %al
jne 0x33bab
movl 0x44(%r12), %eax
cmpq %rax, %rsi
jbe 0x33a7b
movq %r12, %rdi
callq 0x23476
testl %eax, %eax
js 0x33bb6
movl (%r14), %eax
movl %eax, %ecx
shrl %ecx
addl %eax, %ecx
movl %ecx, (%r14)
movb 0x1(%r13), %al
cmpb $0x2d, %al
jne 0x33aad
movl $0x1, (%rbx)
movb 0x1(%r13), %al
incq %r13
cmpb $0xa, %al
jl 0x33b8e
cmpb $0x2c, %al
jne 0x33a95
jmp 0x33b8e
incq %r13
xorl %ecx, %ecx
cmpb $0x2b, %al
sete %cl
leaq (%rcx,%r13), %rax
movb (%r13,%rcx), %dil
leal -0x30(%rdi), %edx
cmpb $0x9, %dl
ja 0x33b07
leaq (%rcx,%r13), %rdx
addq $0x4, %rdx
movl $0xfffffffd, %r8d       # imm = 0xFFFFFFFD
xorl %ecx, %ecx
leaq (%rcx,%rcx,4), %rcx
movzbl %dil, %esi
leaq (%rsi,%rcx,2), %rcx
addq $-0x30, %rcx
testl %r8d, %r8d
setne %sil
je 0x33b0e
movb 0x1(%rax), %dil
incq %rax
leal -0x30(%rdi), %r9d
incl %r8d
cmpb $0x9, %r9b
jbe 0x33ad8
jmp 0x33b11
movb $0x1, %sil
xorl %ecx, %ecx
jmp 0x33b11
movq %rdx, %rax
movzbl (%rax), %edx
leal -0x3a(%rdx), %edi
cmpl $-0xa, %edi
setb %dil
orb %sil, %dil
addl $-0x30, %edx
cmpl $0xa, %edx
setae %sil
orb %dil, %sil
jne 0x33b75
cmpq $0x1999, %rcx           # imm = 0x1999
jb 0x33b40
jne 0x33b5b
cmpl $0x6, %edx
jae 0x33b5b
leaq (%rcx,%rcx,4), %rcx
movl %edx, %edx
leaq (%rdx,%rcx,2), %rcx
movzbl 0x1(%rax), %edx
incq %rax
addl $-0x30, %edx
cmpl $0xa, %edx
jb 0x33b30
jmp 0x33b75
movzbl 0x1(%rax), %ecx
incq %rax
addl $-0x30, %ecx
cmpl $0xa, %ecx
jb 0x33b5b
movl $0x1, (%rbx)
movl $0xffff, %ecx           # imm = 0xFFFF
movq 0x38(%r12), %rdx
movslq 0x40(%r12), %rsi
movw %cx, (%rdx,%rsi)
leal 0x2(%rsi), %ecx
movl %ecx, 0x40(%r12)
movq %rax, %r13
cmpb $0x2c, (%r13)
je 0x33a21
jmp 0x33bd3
callq 0x4050
movl $0xc, (%rax)
xorl %r13d, %r13d
jmp 0x33bd3
callq 0x4050
movl $0xc, (%rax)
leaq 0x67a7a(%rip), %rsi     # 0x9b637
leaq 0x66ac1(%rip), %rdx     # 0x9a685
xorl %r13d, %r13d
movl $0x1, %edi
xorl %eax, %eax
callq 0x14378
movq %r13, %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: sam_parse_BI_vals
HTS_ALIGN32
static char *sam_parse_BI_vals(bam1_t *b, char *q, uint32_t *nused,
                               uint32_t *nalloc, int *overflow) {
    while (*q == ',') {
        if ((*nused)++ >= (*nalloc)) {
            if (grow_B_array(b, nalloc, 4) < 0)
                return NULL;
        }
        if (q[1] != '-') {
            u32_to_le(hts_str2uint(q + 1, &q, 32, overflow),
                      b->data + b->l_data);
            b->l_data += 4;
        } else {
            *overflow = 1;
            q++;
            skip_to_comma_(q);
        }
    }
    return q;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r13
cmpb $0x2c, (%rsi)
jne 0x33fd0
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rdi, %r12
movl (%r15), %ecx
leal 0x1(%rcx), %eax
movl %eax, (%r15)
movl (%r14), %eax
cmpl %eax, %ecx
jb 0x33e87
cmpl $0x553f7ced, %eax       # imm = 0x553F7CED
jae 0x33f98
addl %eax, %eax
andl $-0x4, %eax
movslq 0x40(%r12), %rsi
addq %rax, %rsi
setb %al
cmpq $0x7fffffff, %rsi       # imm = 0x7FFFFFFF
ja 0x33fa8
testb %al, %al
jne 0x33fa8
movl 0x44(%r12), %eax
cmpq %rax, %rsi
jbe 0x33e7b
movq %r12, %rdi
callq 0x23476
testl %eax, %eax
js 0x33fb3
movl (%r14), %eax
movl %eax, %ecx
shrl %ecx
addl %eax, %ecx
movl %ecx, (%r14)
movb 0x1(%r13), %al
cmpb $0x2d, %al
jne 0x33ead
movl $0x1, (%rbx)
movb 0x1(%r13), %al
incq %r13
cmpb $0xa, %al
jl 0x33f8b
cmpb $0x2c, %al
jne 0x33e95
jmp 0x33f8b
incq %r13
xorl %ecx, %ecx
cmpb $0x2b, %al
sete %cl
leaq (%rcx,%r13), %rax
movb (%r13,%rcx), %dil
leal -0x30(%rdi), %edx
cmpb $0x9, %dl
ja 0x33f07
leaq (%rcx,%r13), %rdx
addq $0x9, %rdx
movl $0xfffffff8, %r8d       # imm = 0xFFFFFFF8
xorl %ecx, %ecx
leaq (%rcx,%rcx,4), %rcx
movzbl %dil, %esi
leaq (%rsi,%rcx,2), %rcx
addq $-0x30, %rcx
testl %r8d, %r8d
setne %sil
je 0x33f0e
movb 0x1(%rax), %dil
incq %rax
leal -0x30(%rdi), %r9d
incl %r8d
cmpb $0x9, %r9b
jbe 0x33ed8
jmp 0x33f11
movb $0x1, %sil
xorl %ecx, %ecx
jmp 0x33f11
movq %rdx, %rax
movzbl (%rax), %edx
leal -0x3a(%rdx), %edi
cmpl $-0xa, %edi
setb %dil
orb %sil, %dil
addl $-0x30, %edx
cmpl $0xa, %edx
setae %sil
orb %dil, %sil
jne 0x33f75
cmpq $0x19999999, %rcx       # imm = 0x19999999
jb 0x33f40
jne 0x33f5b
cmpl $0x6, %edx
jae 0x33f5b
leaq (%rcx,%rcx,4), %rcx
movl %edx, %edx
leaq (%rdx,%rcx,2), %rcx
movzbl 0x1(%rax), %edx
incq %rax
addl $-0x30, %edx
cmpl $0xa, %edx
jb 0x33f30
jmp 0x33f75
movzbl 0x1(%rax), %ecx
incq %rax
addl $-0x30, %ecx
cmpl $0xa, %ecx
jb 0x33f5b
movl $0x1, (%rbx)
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq 0x38(%r12), %rdx
movslq 0x40(%r12), %rsi
movl %ecx, (%rdx,%rsi)
addl $0x4, 0x40(%r12)
movq %rax, %r13
cmpb $0x2c, (%r13)
je 0x33e21
jmp 0x33fd0
callq 0x4050
movl $0xc, (%rax)
xorl %r13d, %r13d
jmp 0x33fd0
callq 0x4050
movl $0xc, (%rax)
leaq 0x6767d(%rip), %rsi     # 0x9b637
leaq 0x666c4(%rip), %rdx     # 0x9a685
xorl %r13d, %r13d
movl $0x1, %edi
xorl %eax, %eax
callq 0x14378
movq %r13, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/sam.c
// Function: sam_parse_Bf_vals
HTS_ALIGN32
static char *sam_parse_Bf_vals(bam1_t *b, char *q, uint32_t *nused,
                               uint32_t *nalloc, int *overflow) {
    while (*q == ',') {
        if ((*nused)++ >= (*nalloc)) {
            if (grow_B_array(b, nalloc, 4) < 0)
                return NULL;
        }
        float_to_le(strtod(q + 1, &q), b->data + b->l_data);
        b->l_data += 4;
    }
    return q;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rsi, 0x8(%rsp)
cmpb $0x2c, (%rsi)
jne 0x340cf
movq %rcx, %r14
movq %rdx, %r15
movq %rdi, %r12
leaq 0x8(%rsp), %r13
movl (%r15), %ecx
leal 0x1(%rcx), %eax
movl %eax, (%r15)
movl (%r14), %eax
cmpl %eax, %ecx
jb 0x34062
cmpl $0x553f7ced, %eax       # imm = 0x553F7CED
jae 0x34099
addl %eax, %eax
andl $-0x4, %eax
movslq 0x40(%r12), %rsi
addq %rax, %rsi
setb %al
cmpq $0x7fffffff, %rsi       # imm = 0x7FFFFFFF
ja 0x340a8
testb %al, %al
jne 0x340a8
movl 0x44(%r12), %eax
cmpq %rax, %rsi
jbe 0x34056
movq %r12, %rdi
callq 0x23476
testl %eax, %eax
js 0x340b3
movl (%r14), %eax
movl %eax, %ecx
shrl %ecx
addl %eax, %ecx
movl %ecx, (%r14)
incq %rbx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x4350
cvtsd2ss %xmm0, %xmm0
movq 0x38(%r12), %rax
movslq 0x40(%r12), %rcx
movss %xmm0, (%rax,%rcx)
addl $0x4, 0x40(%r12)
movq 0x8(%rsp), %rbx
cmpb $0x2c, (%rbx)
je 0x3400c
jmp 0x340cf
callq 0x4050
movl $0xc, (%rax)
xorl %ebx, %ebx
jmp 0x340cf
callq 0x4050
movl $0xc, (%rax)
leaq 0x6757d(%rip), %rsi     # 0x9b637
leaq 0x665c4(%rip), %rdx     # 0x9a685
xorl %ebx, %ebx
movl $0x1, %edi
xorl %eax, %eax
callq 0x14378
movq %rbx, %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: sam_state_err
static void sam_state_err(SAM_state *fd, int errcode) {
    pthread_mutex_lock(&fd->command_m);
    if (!fd->errcode)
        fd->errcode = errcode;
    pthread_mutex_unlock(&fd->command_m);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %r14
leaq 0x78(%rdi), %rbx
movq %rbx, %rdi
callq 0x4750
cmpl $0x0, 0xd4(%r14)
jne 0x34106
movl %ebp, 0xd4(%r14)
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x4340
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/./htslib/kstring.h
// Function: kputsn_
static inline int kputsn_(const void *p, size_t l, kstring_t *s)
{
	size_t new_sz = s->l + l;
	if (new_sz < s->l) { errno = EOVERFLOW; return EOF; }
	if (ks_resize(s, new_sz ? new_sz : 1) < 0) return EOF;
	memcpy(s->s + s->l, p, l);
	s->l += l;
	return l;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq (%rdx), %rax
addq %rsi, %rax
jae 0x34b77
callq 0x4050
movl $0x4b, (%rax)
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x34bd6
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
cmpq $0x1, %rax
movq %rax, %rcx
adcq $0x0, %rcx
cmpq %rcx, 0x8(%rdx)
jae 0x34bc1
shrq $0x3e, %rax
movq %rcx, %rdx
shrq %rdx
xorl %r12d, %r12d
testq %rax, %rax
cmoveq %rdx, %r12
addq %rcx, %r12
movq 0x10(%r14), %rdi
movq %r12, %rsi
callq 0x4840
testq %rax, %rax
je 0x34b70
movq %rax, 0x10(%r14)
movq %r12, 0x8(%r14)
movq 0x10(%r14), %rdi
addq (%r14), %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x43c0
addq %rbx, (%r14)
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/sam_mods.c
// Function: bam_mods_at_qpos
int bam_mods_at_qpos(const bam1_t *b, int qpos, hts_base_mod_state *state,
                    hts_base_mod *mods, int n_mods) {
    // FIXME: for now this is inefficient in implementation.
    int r = 0;
    while (state->seq_pos <= qpos)
        if ((r = bam_mods_at_next_pos(b, state, mods, n_mods)) < 0)
            break;

    return r;
}

// Assembly:
xorl %eax, %eax
cmpl %esi, 0x2d00(%rdx)
jg 0x35d8a
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %r8d, %ebx
movq %rcx, %r14
movq %rdx, %r15
movl %esi, %ebp
movq %rdi, %r12
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movl %ebx, %ecx
callq 0x35631
testl %eax, %eax
js 0x35d82
cmpl %ebp, 0x2d00(%r15)
jle 0x35d65
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/sam_mods.c
// Function: bam_mods_query_type
int bam_mods_query_type(hts_base_mod_state *state, int code,
                        int *strand, int *implicit, char *canonical) {
    // Find code entry
    int i;
    for (i = 0; i < state->nmods; i++) {
        if (state->type[i] == code)
            break;
    }
    if (i == state->nmods)
        return -1;

    // Return data
    if (strand)    *strand    = state->strand[i];
    if (implicit)  *implicit  = state->implicit[i];
    if (canonical) *canonical = "?AC?G???T??????N"[state->canonical[i]];

    return 0;
}

// Assembly:
movl 0x2d04(%rdi), %r9d
xorl %r10d, %r10d
testl %r9d, %r9d
jle 0x35db7
cmpl %esi, (%rdi,%r10,4)
je 0x35db7
incq %r10
cmpq %r10, %r9
jne 0x35da6
movl %r9d, %r10d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl %r9d, %r10d
je 0x35dfd
movl %r10d, %esi
testq %rdx, %rdx
je 0x35dd3
movsbl 0x800(%rdi,%rsi), %eax
movl %eax, (%rdx)
testq %rcx, %rcx
je 0x35de1
movl 0x2900(%rdi,%rsi,4), %eax
movl %eax, (%rcx)
xorl %eax, %eax
testq %r8, %r8
je 0x35dfd
movslq 0x400(%rdi,%rsi,4), %rcx
leaq 0x65d16(%rip), %rdx     # 0x9bb0d
movb (%rcx,%rdx), %cl
movb %cl, (%r8)
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/sam_mods.c
// Function: bam_mods_queryi
int bam_mods_queryi(hts_base_mod_state *state, int i,
                    int *strand, int *implicit, char *canonical) {
    if (i < 0 || i >= state->nmods)
        return -1;

    // Return data
    if (strand)    *strand    = state->strand[i];
    if (implicit)  *implicit  = state->implicit[i];
    if (canonical) *canonical = "?AC?G???T??????N"[state->canonical[i]];

    return 0;
}

// Assembly:
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %esi, %esi
js 0x35e4a
cmpl %esi, 0x2d04(%rdi)
jle 0x35e4a
movl %esi, %esi
testq %rdx, %rdx
je 0x35e20
movsbl 0x800(%rdi,%rsi), %eax
movl %eax, (%rdx)
testq %rcx, %rcx
je 0x35e2e
movl 0x2900(%rdi,%rsi,4), %eax
movl %eax, (%rcx)
xorl %eax, %eax
testq %r8, %r8
je 0x35e4a
movslq 0x400(%rdi,%rsi,4), %rcx
leaq 0x65cc9(%rip), %rdx     # 0x9bb0d
movb (%rcx,%rdx), %cl
movb %cl, (%r8)
retq
nop
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/textutils.c
// Function: hts_decode_percent
int hts_decode_percent(char *dest, size_t *destlen, const char *s)
{
    char *d = dest;
    int hi, lo;

    while (*s) {
        if (*s == '%' && (hi = dehex(s[1])) >= 0 && (lo = dehex(s[2])) >= 0) {
            *d++ = (hi << 4) | lo;
            s += 3;
        }
        else *d++ = *s++;
    }

    *d = '\0';
    *destlen = d - dest;
    return 0;
}

// Assembly:
xorl %eax, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movzbl (%rdx), %r8d
cmpl $0x25, %r8d
je 0x35f97
testl %r8d, %r8d
jne 0x3601c
jmp 0x3602b
movsbl 0x1(%rdx), %r9d
leal -0x61(%r9), %r10d
cmpb $0x5, %r10b
ja 0x35fac
addl $-0x57, %r9d
jmp 0x35fcc
leal -0x41(%r9), %r10d
cmpb $0x5, %r10b
ja 0x35fbc
addl $-0x37, %r9d
jmp 0x35fcc
leal -0x30(%r9), %r10d
addl $-0x30, %r9d
cmpb $0xa, %r10b
cmovael %ecx, %r9d
testl %r9d, %r9d
js 0x3601c
movsbl 0x2(%rdx), %r10d
leal -0x61(%r10), %r11d
cmpb $0x5, %r11b
ja 0x35fe6
addl $-0x57, %r10d
jmp 0x36006
leal -0x41(%r10), %r11d
cmpb $0x5, %r11b
ja 0x35ff6
addl $-0x37, %r10d
jmp 0x36006
leal -0x30(%r10), %r11d
addl $-0x30, %r10d
cmpb $0xa, %r11b
cmovael %ecx, %r10d
testl %r10d, %r10d
js 0x3601c
shll $0x4, %r9d
orl %r9d, %r10d
movb %r10b, (%rdi,%rax)
addq $0x3, %rdx
jmp 0x36023
incq %rdx
movb %r8b, (%rdi,%rax)
incq %rax
jmp 0x35f7f
movb $0x0, (%rdi,%rax)
movq %rax, (%rsi)
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/textutils.c
// Function: hts_decode_base64
int hts_decode_base64(char *dest, size_t *destlen, const char *s)
{
    char *d = dest;
    int x0, x1, x2, x3;

    while (1) {
        x0 = debase64(*s++);
        x1 = (x0 >= 0)? debase64(*s++) : -1;
        x2 = (x1 >= 0)? debase64(*s++) : -1;
        x3 = (x2 >= 0)? debase64(*s++) : -1;
        if (x3 < 0) break;

        *d++ = (x0 << 2) | (x1 >> 4);
        *d++ = (x1 << 4) | (x2 >> 2);
        *d++ = (x2 << 6) | x3;
    }

    if (x1 >= 0) *d++ = (x0 << 2) | (x1 >> 4);
    if (x2 >= 0) *d++ = (x1 << 4) | (x2 >> 2);

    *destlen = d - dest;
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, (%rsp)
movq %rdi, %r14
leaq 0x1(%rdi), %rbx
movsbl (%r15), %edi
callq 0x36135
movl %eax, %r13d
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testl %eax, %eax
js 0x36083
movsbl 0x1(%r15), %edi
addq $0x2, %r15
callq 0x36135
movl %eax, %r12d
jmp 0x3608c
incq %r15
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
testl %r12d, %r12d
js 0x3609f
movsbl (%r15), %edi
incq %r15
callq 0x36135
movl %eax, %ebp
testl %ebp, %ebp
js 0x360b1
movsbl (%r15), %edi
incq %r15
callq 0x36135
jmp 0x360b6
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %eax, %eax
js 0x360e9
shll $0x2, %r13d
movl %r12d, %ecx
shrl $0x4, %ecx
orl %r13d, %ecx
movb %cl, -0x1(%rbx)
shll $0x4, %r12d
movl %ebp, %ecx
shrl $0x2, %ecx
orl %r12d, %ecx
movb %cl, (%rbx)
shll $0x6, %ebp
orl %ebp, %eax
movb %al, 0x1(%rbx)
addq $0x3, %rbx
jmp 0x3605b
leaq -0x1(%rbx), %rax
testl %r12d, %r12d
js 0x36103
shll $0x2, %r13d
movl %r12d, %ecx
shrl $0x4, %ecx
orl %r13d, %ecx
movb %cl, (%rax)
jmp 0x36106
movq %rax, %rbx
testl %ebp, %ebp
js 0x3611a
shll $0x4, %r12d
shrl $0x2, %ebp
orl %r12d, %ebp
movb %bpl, (%rbx)
incq %rbx
subq %r14, %rbx
movq (%rsp), %rax
movq %rbx, (%rax)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/textutils.c
// Function: debase64
static int debase64(char c)
{
    if (c >= 'a' && c <= 'z') return c - 'a' + 26;
    else if (c >= 'A' && c <= 'Z') return c - 'A';
    else if (c >= '0' && c <= '9') return c - '0' + 52;
    else if (c == '/') return 63;
    else if (c == '+') return 62;
    else return -1;  // Hence debase64('\0') = -1
}

// Assembly:
movl %edi, %eax
leal -0x61(%rax), %ecx
cmpb $0x19, %cl
ja 0x36143
addl $-0x47, %eax
retq
leal -0x41(%rax), %ecx
cmpb $0x19, %cl
ja 0x3614f
addl $-0x41, %eax
retq
leal -0x30(%rax), %ecx
cmpb $0x9, %cl
ja 0x3615b
addl $0x4, %eax
retq
xorl %ecx, %ecx
cmpb $0x2b, %al
setne %cl
negl %ecx
orl $0x3e, %ecx
cmpb $0x2f, %al
movl $0x3f, %eax
cmovnel %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/textutils.c
// Function: token_type
static char token_type(hts_json_token *token)
{
    const char *s = token->str;

    switch (*s) {
    case 'f':
        return (strcmp(s, "false") == 0)? 'b' : '?';
    case 'n':
        return (strcmp(s, "null") == 0)? '.' : '?';
    case 't':
        return (strcmp(s, "true") == 0)? 'b' : '?';
    case '-':
    case '0': case '1': case '2': case '3': case '4':
    case '5': case '6': case '7': case '8': case '9':
        return 'n';
    default:
        return '?';
    }
}

// Assembly:
pushq %rax
movq 0x8(%rdi), %rdi
movzbl (%rdi), %ecx
movb $0x6e, %al
leal -0x30(%rcx), %edx
cmpl $0xa, %edx
jb 0x364bc
cmpl $0x6d, %ecx
jg 0x3647e
cmpl $0x2d, %ecx
je 0x364bc
cmpl $0x66, %ecx
jne 0x3649d
leaq 0x639c5(%rip), %rsi     # 0x99e41
jmp 0x3648f
cmpl $0x6e, %ecx
je 0x364a1
cmpl $0x74, %ecx
jne 0x3649d
leaq 0x6596a(%rip), %rsi     # 0x9bdf9
callq 0x46c0
testl %eax, %eax
movl $0x62, %ecx
jmp 0x364b4
movb $0x3f, %al
jmp 0x364bc
leaq 0x6594c(%rip), %rsi     # 0x9bdf4
callq 0x46c0
testl %eax, %eax
movl $0x2e, %ecx
movl $0x3f, %eax
cmovel %ecx, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/textutils.c
// Function: hts_json_sskip_value
static char skip_value(char type, hts_json_nextfn *next, void *arg1, void *arg2)
{
    hts_json_token token;
    int level;

    switch (type? type : next(arg1, arg2, &token)) {
    case '\0':
        return '\0';

    case '?':
    case '}':
    case ']':
        return '?';

    case '{':
    case '[':
        level = 1;
        break;

    default:
        return 'v';
    }

    while (level > 0)
        switch (next(arg1, arg2, &token)) {
        case '\0':
            return '\0';

        case '?':
            return '?';

        case '{':
        case '[':
            level++;
            break;

        case '}':
        case ']':
            --level;
            break;

        default:
            break;
        }

    return 'v';
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %edx, %eax
movq %rsi, %rbx
movq %rdi, %r14
testb %al, %al
jne 0x36c99
leaq 0x8(%rsp), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3618e
movzbl %al, %ecx
leal -0x3f(%rcx), %edx
cmpl $0x3e, %edx
ja 0x36d13
movabsq $0x4000000040000001, %rsi # imm = 0x4000000040000001
btq %rdx, %rsi
jae 0x36cb8
movb $0x3f, %al
jmp 0x36d19
movabsq $0x1000000010000000, %rsi # imm = 0x1000000010000000
btq %rdx, %rsi
jae 0x36d13
movl $0x1, %ebp
leaq 0x8(%rsp), %r15
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x3618e
movzbl %al, %eax
cmpl $0x5c, %eax
jg 0x36cf8
cmpl $0x5b, %eax
je 0x36d07
testl %eax, %eax
je 0x36d19
cmpl $0x3f, %eax
jne 0x36d0d
jmp 0x36d19
cmpl $0x5d, %eax
je 0x36d0b
cmpl $0x7d, %eax
je 0x36d0b
cmpl $0x7b, %eax
jne 0x36d0d
incl %ebp
jmp 0x36d0d
decl %ebp
testl %ebp, %ebp
jg 0x36cd2
jmp 0x36d17
testl %ecx, %ecx
je 0x36d19
movb $0x76, %al
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/textutils.c
// Function: stringify_argv
char *stringify_argv(int argc, char *argv[]) {
    char *str, *cp;
    size_t nbytes = 1;
    int i, j;

    /* Allocate */
    for (i = 0; i < argc; i++) {
        if (i > 0) nbytes += 1;
        nbytes += strlen(argv[i]);
    }
    if (!(str = malloc(nbytes)))
        return NULL;

    /* Copy */
    cp = str;
    for (i = 0; i < argc; i++) {
        if (i > 0) *cp++ = ' ';
        j = 0;
        while (argv[i][j]) {
            if (argv[i][j] == '\t')
                *cp++ = ' ';
            else
                *cp++ = argv[i][j];
            j++;
        }
    }
    *cp++ = 0;

    return str;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movl %edi, %ebp
movl %edi, %r15d
movl $0x1, %r14d
testl %edi, %edi
jle 0x36e38
xorl %r12d, %r12d
cmpq $0x1, %r12
sbbq $-0x1, %r14
movq (%rbx,%r12,8), %rdi
callq 0x41d0
addq %rax, %r14
incq %r12
cmpq %r12, %r15
jne 0x36e1c
movq %r14, %rdi
callq 0x4680
testq %rax, %rax
je 0x36e95
movq %rax, %rdx
testl %ebp, %ebp
jle 0x36e90
xorl %ecx, %ecx
movq %rax, %rdi
testq %rcx, %rcx
je 0x36e5c
movb $0x20, (%rdi)
incq %rdi
movq %rdi, %rdx
xorl %esi, %esi
movq (%rbx,%rcx,8), %rdi
movzbl (%rdi,%rsi), %edi
movb $0x20, %r8b
cmpl $0x9, %edi
je 0x36e78
testl %edi, %edi
je 0x36e81
movl %edi, %r8d
movb %r8b, (%rdx,%rsi)
incq %rsi
jmp 0x36e61
incq %rcx
leaq (%rdx,%rsi), %rdi
cmpq %r15, %rcx
jne 0x36e51
addq %rsi, %rdx
movb $0x0, (%rdx)
jmp 0x36e97
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/textutils.c
// Function: encode_utf8
static char *encode_utf8(char *s, unsigned x)
{
    if (x >= 0x10000) {
        *s++ = 0xF0 | (x >> 18);
        *s++ = 0x80 | ((x >> 12) & 0x3F);
        *s++ = 0x80 | ((x >> 6) & 0x3F);
        *s++ = 0x80 | (x & 0x3F);
    }
    else if (x >= 0x800) {
        *s++ = 0xE0 | (x >> 12);
        *s++ = 0x80 | ((x >> 6) & 0x3F);
        *s++ = 0x80 | (x & 0x3F);
    }
    else if (x >= 0x80) {
        *s++ = 0xC0 | (x >> 6);
        *s++ = 0x80 | (x & 0x3F);
    }
    else *s++ = x;

    return s;
}

// Assembly:
movq %rdi, %rax
cmpl $0x10000, %esi          # imm = 0x10000
jb 0x370a9
movl %esi, %ecx
shrl $0x12, %ecx
orb $-0x10, %cl
movb %cl, (%rax)
movl %esi, %ecx
shrl $0xc, %ecx
andb $0x3f, %cl
orb $-0x80, %cl
movb %cl, 0x1(%rax)
movl %esi, %ecx
shrl $0x6, %ecx
andb $0x3f, %cl
orb $-0x80, %cl
movb %cl, 0x2(%rax)
andb $0x3f, %sil
orb $-0x80, %sil
movb %sil, 0x3(%rax)
addq $0x4, %rax
retq
cmpl $0x800, %esi            # imm = 0x800
jb 0x370da
movl %esi, %ecx
shrl $0xc, %ecx
orb $-0x20, %cl
movb %cl, (%rax)
movl %esi, %ecx
shrl $0x6, %ecx
andb $0x3f, %cl
orb $-0x80, %cl
movb %cl, 0x1(%rax)
andb $0x3f, %sil
orb $-0x80, %sil
movb %sil, 0x2(%rax)
addq $0x3, %rax
retq
cmpl $0x80, %esi
jb 0x370fd
movl %esi, %ecx
shrl $0x6, %ecx
orb $-0x40, %cl
movb %cl, (%rax)
andb $0x3f, %sil
orb $-0x80, %sil
movb %sil, 0x1(%rax)
addq $0x2, %rax
retq
movb %sil, (%rax)
incq %rax
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/thread_pool.c
// Function: hts_tpool_worker_id
int hts_tpool_worker_id(hts_tpool *p) {
    if (!p)
        return -1;
    pthread_t s = pthread_self();
    int i;
    for (i = 0; i < p->tsize; i++) {
        if (pthread_equal(s, p->t[i].tid))
            return i;
    }
    return -1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %rdi, %rdi
je 0x37156
movq %rdi, %r15
callq 0x4400
movslq 0x18(%r15), %r12
testq %r12, %r12
jle 0x37156
movq %rax, %r14
movq 0x20(%r15), %r15
addq $0x10, %r15
xorl %r13d, %r13d
movq (%r15), %rsi
movq %r14, %rdi
callq 0x48d0
testl %eax, %eax
jne 0x37153
incq %r13
addq $0x48, %r15
cmpq %r13, %r12
jne 0x37136
jmp 0x37156
movl %r13d, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/thread_pool.c
// Function: hts_tpool_next_result
hts_tpool_result *hts_tpool_next_result(hts_tpool_process *q) {
    hts_tpool_result *r;

    DBG_OUT(stderr, "Requesting next result on queue %p\n", q);

    pthread_mutex_lock(&q->p->pool_m);
    r = hts_tpool_next_result_locked(q);
    pthread_mutex_unlock(&q->p->pool_m);

    DBG_OUT(stderr, "(q=%p) Found %p\n", q, r);

    return r;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
addq $0x38, %rdi
callq 0x4750
movq %rbx, %rdi
callq 0x37197
movq %rax, %r14
movq (%rbx), %rdi
addq $0x38, %rdi
callq 0x4340
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/thread_pool.c
// Function: hts_tpool_next_result_locked
static hts_tpool_result *hts_tpool_next_result_locked(hts_tpool_process *q) {
    hts_tpool_result *r, *last;

    if (q->shutdown)
        return NULL;

    for (last = NULL, r = q->output_head; r; last = r, r = r->next) {
        if (r->serial == q->next_serial)
            break;
    }

    if (r) {
        // Remove r from out linked list
        if (q->output_head == r)
            q->output_head = r->next;
        else
            last->next = r->next;

        if (q->output_tail == r)
            q->output_tail = last;

        if (!q->output_head)
            q->output_tail = NULL;

        q->next_serial++;
        q->n_output--;

        if (q->qsize && q->n_output < q->qsize) {
            // Not technically input full, but can guarantee there is
            // room for the input to go somewhere so we still signal.
            // The waiting code will then check the condition again.
            if (q->n_input < q->qsize)
                pthread_cond_signal(&q->input_not_full_c);
            if (!q->shutdown)
                wake_next_worker(q, 1);
        }
    }

    return r;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpl $0x0, 0x50(%rdi)
je 0x371ae
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rdi, %r14
leaq 0x18(%rdi), %rax
xorl %esi, %esi
movq %rax, %rbx
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x371a3
movq %rsi, %rdx
movq 0x30(%r14), %rcx
movq %rbx, %rsi
cmpq %rcx, 0x10(%rbx)
jne 0x371ba
cmpq %rbx, 0x18(%r14)
movq %rdx, %rsi
cmoveq %rax, %rsi
movq (%rbx), %rdi
movq %rdi, (%rsi)
cmpq %rbx, 0x20(%r14)
jne 0x371ed
movq %rdx, 0x20(%r14)
cmpq $0x0, (%rax)
jne 0x371fb
movq $0x0, 0x20(%r14)
incq %rcx
movq %rcx, 0x30(%r14)
movl 0x28(%r14), %eax
movl 0x48(%r14), %ecx
leal -0x1(%rcx), %edx
movl %edx, 0x48(%r14)
testl %eax, %eax
sete %dl
cmpl %eax, %ecx
setg %cl
orb %dl, %cl
jne 0x371a3
cmpl %eax, 0x44(%r14)
jge 0x37231
leaq 0x90(%r14), %rdi
callq 0x4040
cmpl $0x0, 0x50(%r14)
jne 0x371a3
movq %r14, %rdi
callq 0x380e2
jmp 0x371a3
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/thread_pool.c
// Function: hts_tpool_next_result_wait
hts_tpool_result *hts_tpool_next_result_wait(hts_tpool_process *q) {
    hts_tpool_result *r;

    pthread_mutex_lock(&q->p->pool_m);
    while (!(r = hts_tpool_next_result_locked(q))) {
        /* Possible race here now avoided via _locked() call, but in case... */
        struct timeval now;
        struct timespec timeout;

        gettimeofday(&now, NULL);
        timeout.tv_sec = now.tv_sec + 10;
        timeout.tv_nsec = now.tv_usec * 1000;

        q->ref_count++;
        if (q->shutdown) {
            int rc = --q->ref_count;
            pthread_mutex_unlock(&q->p->pool_m);
            if (rc == 0)
                hts_tpool_process_destroy(q);
            return NULL;
        }
        pthread_cond_timedwait(&q->output_avail_c, &q->p->pool_m, &timeout);

        q->ref_count--;
    }
    pthread_mutex_unlock(&q->p->pool_m);

    return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq (%rdi), %rdi
addq $0x38, %rdi
callq 0x4750
leaq 0x60(%rbx), %r15
leaq 0x18(%rsp), %r12
leaq 0x8(%rsp), %r13
movq %rbx, %rdi
callq 0x37197
testq %rax, %rax
jne 0x372f5
movq %r12, %rdi
xorl %esi, %esi
callq 0x4810
movq 0x18(%rsp), %rax
addq $0xa, %rax
movq %rax, 0x8(%rsp)
imulq $0x3e8, 0x20(%rsp), %rax # imm = 0x3E8
movq %rax, 0x10(%rsp)
movl 0x50(%rbx), %ebp
movl 0x5c(%rbx), %r14d
leal 0x1(%r14), %eax
movl %eax, 0x5c(%rbx)
testl %ebp, %ebp
je 0x372d8
movl %r14d, 0x5c(%rbx)
movq (%rbx), %rdi
addq $0x38, %rdi
callq 0x4340
testl %r14d, %r14d
jne 0x372ed
movq %rbx, %rdi
callq 0x37316
jmp 0x372ed
movq (%rbx), %rsi
addq $0x38, %rsi
movq %r15, %rdi
movq %r13, %rdx
callq 0x47a0
decl 0x5c(%rbx)
testl %ebp, %ebp
je 0x37274
xorl %eax, %eax
jmp 0x37307
movq %rax, %rbp
movq (%rbx), %rdi
addq $0x38, %rdi
callq 0x4340
movq %rbp, %rax
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/thread_pool.c
// Function: hts_tpool_process_destroy
void hts_tpool_process_destroy(hts_tpool_process *q) {
    DBG_OUT(stderr, "Destroying results queue %p\n", q);

    if (!q)
        return;

    // Prevent dispatch from queuing up any more jobs.
    // We want to reset (and flush) the queue here, before
    // we set the shutdown flag, but we need to avoid races
    // with queue more input during reset.
    pthread_mutex_lock(&q->p->pool_m);
    q->no_more_input = 1;
    pthread_mutex_unlock(&q->p->pool_m);

    // Ensure it's fully drained before destroying the queue
    hts_tpool_process_reset(q, 0);
    pthread_mutex_lock(&q->p->pool_m);
    hts_tpool_process_detach_locked(q->p, q);
    hts_tpool_process_shutdown_locked(q);

    // Maybe a worker is scanning this queue, so delay destruction
    if (--q->ref_count > 0) {
        pthread_mutex_unlock(&q->p->pool_m);
        return;
    }

    pthread_cond_destroy(&q->output_avail_c);
    pthread_cond_destroy(&q->input_not_full_c);
    pthread_cond_destroy(&q->input_empty_c);
    pthread_cond_destroy(&q->none_processing_c);
    pthread_mutex_unlock(&q->p->pool_m);

    free(q);

    DBG_OUT(stderr, "Destroyed results queue %p\n", q);
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x37382
movq %rdi, %rbx
movq (%rdi), %rdi
addq $0x38, %rdi
callq 0x4750
movl $0x1, 0x40(%rbx)
movq (%rbx), %rdi
addq $0x38, %rdi
callq 0x4340
movq %rbx, %rdi
xorl %esi, %esi
callq 0x376d4
movq (%rbx), %rdi
addq $0x38, %rdi
callq 0x4750
movq (%rbx), %rdi
movq %rbx, %rsi
callq 0x3780c
movq %rbx, %rdi
callq 0x374eb
movl 0x5c(%rbx), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x5c(%rbx)
cmpl $0x2, %eax
jl 0x37384
movq (%rbx), %rdi
addq $0x38, %rdi
popq %rbx
jmp 0x4340
popq %rbx
retq
leaq 0x60(%rbx), %rdi
callq 0x49a0
leaq 0x90(%rbx), %rdi
callq 0x49a0
leaq 0xc0(%rbx), %rdi
callq 0x49a0
leaq 0xf0(%rbx), %rdi
callq 0x49a0
movq (%rbx), %rdi
addq $0x38, %rdi
callq 0x4340
movq %rbx, %rdi
popq %rbx
jmp 0x45c0
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/thread_pool.c
// Function: hts_tpool_process_empty
int hts_tpool_process_empty(hts_tpool_process *q) {
    int empty;

    pthread_mutex_lock(&q->p->pool_m);
    empty = q->n_input == 0 && q->n_processing == 0 && q->n_output == 0;
    pthread_mutex_unlock(&q->p->pool_m);

    return empty;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
addq $0x38, %rdi
callq 0x4750
xorl %ebp, %ebp
cmpl $0x0, 0x44(%rbx)
jne 0x373f0
cmpl $0x0, 0x4c(%rbx)
jne 0x373f0
xorl %ebp, %ebp
cmpl $0x0, 0x48(%rbx)
sete %bpl
movq (%rbx), %rdi
addq $0x38, %rdi
callq 0x4340
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/thread_pool.c
// Function: hts_tpool_process_ref_decr
void hts_tpool_process_ref_decr(hts_tpool_process *q) {
    pthread_mutex_lock(&q->p->pool_m);
    if (--q->ref_count <= 0) {
        pthread_mutex_unlock(&q->p->pool_m);
        hts_tpool_process_destroy(q);
        return;
    }

    // maybe also call destroy here if needed?
    pthread_mutex_unlock(&q->p->pool_m);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
addq $0x38, %rdi
callq 0x4750
movl 0x5c(%rbx), %r14d
leal -0x1(%r14), %eax
movl %eax, 0x5c(%rbx)
movq (%rbx), %rdi
addq $0x38, %rdi
callq 0x4340
cmpl $0x1, %r14d
jg 0x37464
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x37316
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/thread_pool.c
// Function: hts_tpool_process_len
int hts_tpool_process_len(hts_tpool_process *q) {
    int len;

    pthread_mutex_lock(&q->p->pool_m);
    len = q->n_output;
    pthread_mutex_unlock(&q->p->pool_m);

    return len;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
addq $0x38, %rdi
callq 0x4750
movl 0x48(%rbx), %ebp
movq (%rbx), %rdi
addq $0x38, %rdi
callq 0x4340
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/thread_pool.c
// Function: hts_tpool_process_sz
int hts_tpool_process_sz(hts_tpool_process *q) {
    int len;

    pthread_mutex_lock(&q->p->pool_m);
    len = q->n_output + q->n_input + q->n_processing;
    pthread_mutex_unlock(&q->p->pool_m);

    return len;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
addq $0x38, %rdi
callq 0x4750
movl 0x44(%rbx), %ebp
addl 0x48(%rbx), %ebp
addl 0x4c(%rbx), %ebp
movq (%rbx), %rdi
addq $0x38, %rdi
callq 0x4340
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/thread_pool.c
// Function: hts_tpool_process_shutdown_locked
static void hts_tpool_process_shutdown_locked(hts_tpool_process *q) {
    q->shutdown = 1;
    pthread_cond_broadcast(&q->output_avail_c);
    pthread_cond_broadcast(&q->input_not_full_c);
    pthread_cond_broadcast(&q->input_empty_c);
    pthread_cond_broadcast(&q->none_processing_c);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x1, 0x50(%rdi)
addq $0x60, %rdi
callq 0x4170
leaq 0x90(%rbx), %rdi
callq 0x4170
leaq 0xc0(%rbx), %rdi
callq 0x4170
addq $0xf0, %rbx
movq %rbx, %rdi
popq %rbx
jmp 0x4170
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/thread_pool.c
// Function: hts_tpool_process_is_shutdown
int hts_tpool_process_is_shutdown(hts_tpool_process *q) {
    pthread_mutex_lock(&q->p->pool_m);
    int r = q->shutdown;
    pthread_mutex_unlock(&q->p->pool_m);
    return r;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
addq $0x38, %rdi
callq 0x4750
movl 0x50(%rbx), %ebp
movq (%rbx), %rdi
addq $0x38, %rdi
callq 0x4340
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/thread_pool.c
// Function: hts_tpool_delete_result
void hts_tpool_delete_result(hts_tpool_result *r, int free_data) {
    if (!r)
        return;

    if (free_data && r->data)
        free(r->data);

    free(r);
}

// Assembly:
testq %rdi, %rdi
je 0x37575
pushq %rbx
movq %rdi, %rbx
testl %esi, %esi
je 0x3756c
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x3756c
callq 0x45c0
movq %rbx, %rdi
popq %rbx
jmp 0x45c0
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/thread_pool.c
// Function: hts_tpool_process_init
hts_tpool_process *hts_tpool_process_init(hts_tpool *p, int qsize, int in_only) {
    hts_tpool_process *q = malloc(sizeof(*q));
    if (!q)
        return NULL;

    pthread_cond_init(&q->output_avail_c,   NULL);
    pthread_cond_init(&q->input_not_full_c, NULL);
    pthread_cond_init(&q->input_empty_c,    NULL);
    pthread_cond_init(&q->none_processing_c,NULL);

    q->p           = p;
    q->input_head  = NULL;
    q->input_tail  = NULL;
    q->output_head = NULL;
    q->output_tail = NULL;
    q->next_serial = 0;
    q->curr_serial = 0;
    q->no_more_input = 0;
    q->n_input     = 0;
    q->n_output    = 0;
    q->n_processing= 0;
    q->qsize       = qsize;
    q->in_only     = in_only;
    q->shutdown    = 0;
    q->wake_dispatch = 0;
    q->ref_count   = 1;

    q->next        = NULL;
    q->prev        = NULL;

    hts_tpool_process_attach(p, q);

    return q;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movl %esi, %r15d
movq %rdi, %r14
movl $0x130, %edi            # imm = 0x130
callq 0x4680
testq %rax, %rax
je 0x3761e
movq %rax, %rbx
leaq 0x60(%rax), %rdi
xorl %esi, %esi
callq 0x45d0
leaq 0x90(%rbx), %rdi
xorl %esi, %esi
callq 0x45d0
leaq 0xc0(%rbx), %rdi
xorl %esi, %esi
callq 0x45d0
movq %rbx, %rdi
addq $0xf0, %rdi
xorl %esi, %esi
callq 0x45d0
movq %r14, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rbx)
movups %xmm0, 0x18(%rbx)
movups %xmm0, 0x30(%rbx)
movups %xmm0, 0x40(%rbx)
movl %r15d, 0x28(%rbx)
movl %ebp, 0x54(%rbx)
movl $0x0, 0x50(%rbx)
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %rax, 0x58(%rbx)
movups %xmm0, 0x120(%rbx)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3762e
jmp 0x37620
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/thread_pool.c
// Function: hts_tpool_process_attach
void hts_tpool_process_attach(hts_tpool *p, hts_tpool_process *q) {
    pthread_mutex_lock(&p->pool_m);
    if (p->q_head) {
        q->next = p->q_head;
        q->prev = p->q_head->prev;
        p->q_head->prev->next = q;
        p->q_head->prev = q;
    } else {
        q->next = q;
        q->prev = q;
    }
    p->q_head = q;
    assert(p->q_head && p->q_head->prev && p->q_head->next);
    pthread_mutex_unlock(&p->pool_m);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x38(%rdi), %rbx
movq %rbx, %rdi
callq 0x4750
movq 0x10(%r15), %rcx
testq %rcx, %rcx
je 0x3767a
movq %rcx, 0x120(%r14)
leaq 0x128(%rcx), %rax
movq 0x128(%rcx), %rdx
movq %rdx, 0x128(%r14)
movq 0x128(%rcx), %rcx
movq %r14, 0x120(%rcx)
jmp 0x37688
movq %r14, 0x120(%r14)
leaq 0x128(%r14), %rax
movq %r14, (%rax)
movq %r14, 0x10(%r15)
testq %r14, %r14
je 0x376b5
cmpq $0x0, 0x128(%r14)
je 0x376b5
cmpq $0x0, 0x120(%r14)
je 0x376b5
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x4340
leaq 0x64742(%rip), %rdi     # 0x9bdfe
leaq 0x6476b(%rip), %rsi     # 0x9be2e
leaq 0x64772(%rip), %rcx     # 0x9be3c
movl $0x1d4, %edx            # imm = 0x1D4
callq 0x42f0
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/thread_pool.c
// Function: hts_tpool_process_detach_locked
static void hts_tpool_process_detach_locked(hts_tpool *p,
                                            hts_tpool_process *q) {
    if (!p->q_head || !q->prev || !q->next)
        return;

    hts_tpool_process *curr = p->q_head, *first = curr;
    do {
        if (curr == q) {
            q->next->prev = q->prev;
            q->prev->next = q->next;
            p->q_head = q->next;
            q->next = q->prev = NULL;

            // Last one
            if (p->q_head == q)
                p->q_head = NULL;
            break;
        }

        curr = curr->next;
    } while (curr != first);
}

// Assembly:
movq 0x10(%rdi), %rax
testq %rax, %rax
je 0x37875
movq 0x128(%rsi), %rcx
testq %rcx, %rcx
je 0x37875
movq 0x120(%rsi), %r8
testq %r8, %r8
je 0x37875
leaq 0x120(%rsi), %rdx
movq %rax, %r9
cmpq %rsi, %r9
je 0x3784a
movq 0x120(%r9), %r9
cmpq %rax, %r9
jne 0x37837
jmp 0x37875
movq %rcx, 0x128(%r8)
movq 0x128(%rsi), %rax
movq %r8, 0x120(%rax)
movq 0x120(%rsi), %rax
movq %rax, 0x10(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, (%rdx)
cmpq %rsi, %rax
je 0x37876
retq
movq $0x0, 0x10(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/thread_pool.c
// Function: hts_tpool_wake_dispatch
void hts_tpool_wake_dispatch(hts_tpool_process *q) {
    pthread_mutex_lock(&q->p->pool_m);
    q->wake_dispatch = 1;
    pthread_cond_signal(&q->input_not_full_c);
    pthread_mutex_unlock(&q->p->pool_m);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
addq $0x38, %rdi
callq 0x4750
movl $0x1, 0x58(%rbx)
leaq 0x90(%rbx), %rdi
callq 0x4040
movq (%rbx), %rdi
addq $0x38, %rdi
popq %rbx
jmp 0x4340
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/thread_pool.c
// Function: hts_tpool_destroy
void hts_tpool_destroy(hts_tpool *p) {
    int i;

    DBG_OUT(stderr, "Destroying pool %p\n", p);

    /* Send shutdown message to worker threads */
    pthread_mutex_lock(&p->pool_m);
    p->shutdown = 1;

    DBG_OUT(stderr, "Sending shutdown request\n");

    for (i = 0; i < p->tsize; i++)
        pthread_cond_signal(&p->t[i].pending_c);

    pthread_mutex_unlock(&p->pool_m);

    DBG_OUT(stderr, "Shutdown complete\n");

    for (i = 0; i < p->tsize; i++)
        pthread_join(p->t[i].tid, NULL);

    pthread_mutex_destroy(&p->pool_m);
    for (i = 0; i < p->tsize; i++)
        pthread_cond_destroy(&p->t[i].pending_c);

    if (p->t_stack)
        free(p->t_stack);

    free(p->t);
    free(p);

    DBG_OUT(stderr, "Destroyed pool %p\n", p);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x38(%rdi), %r14
movq %r14, %rdi
callq 0x4750
movl $0x1, 0x8(%rbx)
cmpl $0x0, 0x18(%rbx)
jle 0x38365
movl $0x18, %r15d
xorl %r12d, %r12d
movq 0x20(%rbx), %rdi
addq %r15, %rdi
callq 0x4040
incq %r12
movslq 0x18(%rbx), %rax
addq $0x48, %r15
cmpq %rax, %r12
jl 0x38349
movq %r14, %rdi
callq 0x4340
cmpl $0x0, 0x18(%rbx)
jle 0x3839b
movl $0x10, %r15d
xorl %r12d, %r12d
movq 0x20(%rbx), %rax
movq (%rax,%r15), %rdi
xorl %esi, %esi
callq 0x4410
incq %r12
movslq 0x18(%rbx), %rax
addq $0x48, %r15
cmpq %rax, %r12
jl 0x3837c
movq %r14, %rdi
callq 0x4590
cmpl $0x0, 0x18(%rbx)
jle 0x383ce
movl $0x18, %r14d
xorl %r15d, %r15d
movq 0x20(%rbx), %rdi
addq %r14, %rdi
callq 0x49a0
incq %r15
movslq 0x18(%rbx), %rax
addq $0x48, %r14
cmpq %rax, %r15
jl 0x383b2
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x383dc
callq 0x45c0
movq 0x20(%rbx), %rdi
callq 0x45c0
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x45c0