LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/faidx.c
// Function: fai_save
static int fai_save(const faidx_t *fai, hFILE *fp) {
    khint_t k;
    int i;
    char buf[96]; // Must be big enough for format below.

    for (i = 0; i < fai->n; ++i) {
        faidx1_t x;
        k = kh_get(s, fai->hash, fai->name[i]);
        assert(k < kh_end(fai->hash));
        x = kh_value(fai->hash, k);

        if (fai->format == FAI_FASTA) {
            snprintf(buf, sizeof(buf),
                 "\t%"PRIu64"\t%"PRIu64"\t%"PRIu32"\t%"PRIu32"\n",
                 x.len, x.seq_offset, x.line_blen, x.line_len);
        } else {
            snprintf(buf, sizeof(buf),
                 "\t%"PRIu64"\t%"PRIu64"\t%"PRIu32"\t%"PRIu32"\t%"PRIu64"\n",
                 x.len, x.seq_offset, x.line_blen, x.line_len, x.qual_offset);
        }

        if (hputs(fai->name[i], fp) != 0) return -1;
        if (hputs(buf, fp) != 0) return -1;
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0xd5f27
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0xd4c10
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x10(%rbp), %rcx
movq 0x18(%rcx), %rcx
cmpl (%rcx), %eax
jae 0xd5e0b
jmp 0xd5e2a
leaq 0x21ec0(%rip), %rdi     # 0xf7cd2
leaq 0x21ecf(%rip), %rsi     # 0xf7ce8
movl $0x168, %edx            # imm = 0x168
leaq 0x21ecb(%rip), %rcx     # 0xf7cf0
callq 0x42e0
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x20(%rax), %rsi
movl -0x1c(%rbp), %eax
imulq $0x28, %rax, %rax
addq %rax, %rsi
leaq -0xa8(%rbp), %rdi
movl $0x28, %edx
callq 0x43b0
movq -0x10(%rbp), %rax
cmpl $0x1, 0x20(%rax)
jne 0xd5e92
leaq -0x80(%rbp), %rdi
movq -0x98(%rbp), %rcx
movq -0x90(%rbp), %r8
movl -0xa0(%rbp), %r9d
movl -0xa4(%rbp), %eax
movl $0x60, %esi
leaq 0x21e91(%rip), %rdx     # 0xf7d17
movl %eax, (%rsp)
movb $0x0, %al
callq 0x47e0
jmp 0xd5ed5
leaq -0x80(%rbp), %rdi
movq -0x98(%rbp), %rcx
movq -0x90(%rbp), %r8
movl -0xa0(%rbp), %r9d
movl -0xa4(%rbp), %r10d
movq -0x88(%rbp), %rax
movl $0x60, %esi
leaq 0x21e62(%rip), %rdx     # 0xf7d27
movl %r10d, (%rsp)
movq %rax, 0x8(%rsp)
movb $0x0, %al
callq 0x47e0
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -0x18(%rbp), %rsi
callq 0xd6cc0
cmpl $0x0, %eax
je 0xd5efc
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xd5f2e
leaq -0x80(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xd6cc0
cmpl $0x0, %eax
je 0xd5f17
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xd5f2e
jmp 0xd5f19
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0xd5dca
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xc0, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/faidx.c
// Function: bgzf_getc_
static inline int bgzf_getc_(BGZF *fp) {
    if (fp->block_offset+1 < fp->block_length) {
        int c = ((unsigned char*)fp->uncompressed_block)[fp->block_offset++];
        fp->uncompressed_address++;
        return c;
    }

    return bgzf_getc(fp);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl 0x10(%rax), %eax
addl $0x1, %eax
movq -0x10(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0xd5fb8
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x10(%rbp), %rdx
movl 0x10(%rdx), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, 0x10(%rdx)
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x20(%rax)
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0xd5fc4
movq -0x10(%rbp), %rdi
callq 0x10e30
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/./htslib/hfile.h
// Function: hputs
static inline int hputs(const char *text, hFILE *fp)
{
    HTSLIB_EXPORT
    extern int hputs2(const char *, size_t, size_t, hFILE *);

    size_t nbytes = strlen(text), n = fp->limit - fp->begin;
    if (n > nbytes) n = nbytes;
    memcpy(fp->begin, text, n);
    fp->begin += n;
    return (n == nbytes)? 0 : hputs2(text, nbytes, n, fp);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x41b0
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rcx
subq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x18(%rbp), %rax
jbe 0xd6d06
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x43b0
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
addq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rax
cmpq -0x18(%rbp), %rax
jne 0xd6d3c
xorl %eax, %eax
movl %eax, -0x24(%rbp)
jmp 0xd6d54
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x10(%rbp), %rcx
callq 0x14650
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/header.c
// Function: sam_hdr_fill_hrecs
int sam_hdr_fill_hrecs(sam_hdr_t *bh) {
    sam_hrecs_t *hrecs = sam_hrecs_new();

    if (!hrecs)
        return -1;

    if (bh->target_name && bh->target_len && bh->n_targets > 0) {
        if (sam_hrecs_refs_from_targets_array(hrecs, bh) != 0) {
            sam_hrecs_free(hrecs);
            return -1;
        }
    }

    // Parse existing header text
    if (bh->text && bh->l_text > 0) {
        if (sam_hrecs_parse_lines(hrecs, bh->text, bh->l_text) != 0) {
            sam_hrecs_free(hrecs);
            return -1;
        }
    }

    if (add_stub_ref_sq_lines(hrecs) < 0) {
        sam_hrecs_free(hrecs);
        return -1;
    }

    bh->hrecs = hrecs;

    if (hrecs->refs_changed >= 0 && rebuild_target_arrays(bh) != 0)
        return -1;

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
callq 0xd75b0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0xd74b8
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xd759f
movq -0x10(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0xd7500
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0xd7500
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
jle 0xd7500
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xd77d0
cmpl $0x0, %eax
je 0xd74fe
movq -0x18(%rbp), %rdi
callq 0xd7b50
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xd759f
jmp 0xd7500
movq -0x10(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0xd7548
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jbe 0xd7548
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdx
callq 0xd7cc0
cmpl $0x0, %eax
je 0xd7546
movq -0x18(%rbp), %rdi
callq 0xd7b50
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xd759f
jmp 0xd7548
movq -0x18(%rbp), %rdi
callq 0xd83a0
cmpl $0x0, %eax
jge 0xd7568
movq -0x18(%rbp), %rdi
callq 0xd7b50
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xd759f
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x18(%rbp), %rax
cmpl $0x0, 0x94(%rax)
jl 0xd7598
movq -0x10(%rbp), %rdi
callq 0xd8500
cmpl $0x0, %eax
je 0xd7598
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xd759f
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/header.c
// Function: sam_hrecs_free
void sam_hrecs_free(sam_hrecs_t *hrecs) {
    if (!hrecs)
        return;

    if (hrecs->h)
        kh_destroy(sam_hrecs_t, hrecs->h);

    if (hrecs->ref_hash)
        kh_destroy(m_s2i, hrecs->ref_hash);

    if (hrecs->ref)
        free(hrecs->ref);

    if (hrecs->rg_hash)
        kh_destroy(m_s2i, hrecs->rg_hash);

    if (hrecs->rg)
        free(hrecs->rg);

    if (hrecs->pg_hash)
        kh_destroy(m_s2i, hrecs->pg_hash);

    if (hrecs->pg)
        free(hrecs->pg);

    if (hrecs->pg_end)
        free(hrecs->pg_end);

    if (hrecs->type_pool)
        pool_destroy(hrecs->type_pool);

    if (hrecs->tag_pool)
        pool_destroy(hrecs->tag_pool);

    if (hrecs->str_pool)
        string_pool_destroy(hrecs->str_pool);

    if (hrecs->type_order)
        free(hrecs->type_order);

    if (hrecs->ID_buf)
        free(hrecs->ID_buf);

    free(hrecs);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0xd7b68
jmp 0xd7cb3
movq -0x8(%rbp), %rax
cmpq $0x0, (%rax)
je 0xd7b7e
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0xde5c0
movq -0x8(%rbp), %rax
cmpq $0x0, 0x38(%rax)
je 0xd7b96
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdi
callq 0xde610
movq -0x8(%rbp), %rax
cmpq $0x0, 0x30(%rax)
je 0xd7bae
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x45a0
movq -0x8(%rbp), %rax
cmpq $0x0, 0x50(%rax)
je 0xd7bc6
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rdi
callq 0xde610
movq -0x8(%rbp), %rax
cmpq $0x0, 0x48(%rax)
je 0xd7bde
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0x45a0
movq -0x8(%rbp), %rax
cmpq $0x0, 0x70(%rax)
je 0xd7bf6
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rdi
callq 0xde610
movq -0x8(%rbp), %rax
cmpq $0x0, 0x68(%rax)
je 0xd7c0e
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rdi
callq 0x45a0
movq -0x8(%rbp), %rax
cmpq $0x0, 0x78(%rax)
je 0xd7c26
movq -0x8(%rbp), %rax
movq 0x78(%rax), %rdi
callq 0x45a0
movq -0x8(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0xd7c3e
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x820a0
movq -0x8(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0xd7c56
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x820a0
movq -0x8(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0xd7c6e
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x823b0
movq -0x8(%rbp), %rax
cmpq $0x0, 0xa0(%rax)
je 0xd7c8c
movq -0x8(%rbp), %rax
movq 0xa0(%rax), %rdi
callq 0x45a0
movq -0x8(%rbp), %rax
cmpq $0x0, 0x80(%rax)
je 0xd7caa
movq -0x8(%rbp), %rax
movq 0x80(%rax), %rdi
callq 0x45a0
movq -0x8(%rbp), %rdi
callq 0x45a0
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/header.c
// Function: add_stub_ref_sq_lines
static int add_stub_ref_sq_lines(sam_hrecs_t *hrecs) {
    int tid;
    char len[32];

    for (tid = 0; tid < hrecs->nref; tid++) {
        if (hrecs->ref[tid].ty == NULL) {
            snprintf(len, sizeof(len), "%"PRIhts_pos, hrecs->ref[tid].len);
            if (sam_hrecs_add(hrecs, "SQ",
                              "SN", hrecs->ref[tid].name,
                              "LN", len, NULL) != 0)
                return -1;

            // Check that the stub has actually been filled
            if(hrecs->ref[tid].ty == NULL) {
                hts_log_error("Reference stub with tid=%d, name=\"%s\", len=%"PRIhts_pos" could not be filled",
                        tid, hrecs->ref[tid].name, hrecs->ref[tid].len);
                return -1;
            }
        }
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x28(%rcx), %eax
jge 0xd84e3
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x14(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
cmpq $0x0, 0x10(%rax)
jne 0xd84d3
leaq -0x40(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x14(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rcx
movl $0x20, %esi
leaq 0x183e1(%rip), %rdx     # 0xf07e9
movb $0x0, %al
callq 0x47e0
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x14(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rcx
leaq -0x40(%rbp), %r9
leaq 0x1a2b8(%rip), %rsi     # 0xf26ec
leaq 0x1b522(%rip), %rdx     # 0xf395d
leaq 0x1d8fe(%rip), %r8      # 0xf5d40
xorl %eax, %eax
movq $0x0, (%rsp)
movb $0x0, %al
callq 0xdf4c0
cmpl $0x0, %eax
je 0xd8464
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xd84ea
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x14(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
cmpq $0x0, 0x10(%rax)
jne 0xd84d1
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x14(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq (%rax), %r8
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x14(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq 0x8(%rax), %r9
movl $0x1, %edi
leaq 0x200f9(%rip), %rsi     # 0xf85b3
leaq 0x20108(%rip), %rdx     # 0xf85c9
movb $0x0, %al
callq 0x1b030
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xd84ea
jmp 0xd84d3
jmp 0xd84d5
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xd83b3
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/header.c
// Function: rebuild_target_arrays
static int rebuild_target_arrays(sam_hdr_t *bh) {
    if (!bh || !bh->hrecs)
        return -1;

    sam_hrecs_t *hrecs = bh->hrecs;
    if (hrecs->refs_changed < 0)
        return 0;

    if (sam_hdr_update_target_arrays(bh, hrecs, hrecs->refs_changed) != 0)
        return -1;

    hrecs->refs_changed = -1;
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0xd851e
movq -0x10(%rbp), %rax
cmpq $0x0, 0x38(%rax)
jne 0xd8527
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xd8583
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, 0x94(%rax)
jge 0xd8549
movl $0x0, -0x4(%rbp)
jmp 0xd8583
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x18(%rbp), %rax
movl 0x94(%rax), %edx
callq 0xd7130
cmpl $0x0, %eax
je 0xd856e
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xd8583
movq -0x18(%rbp), %rax
movl $0xffffffff, 0x94(%rax) # imm = 0xFFFFFFFF
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/header.c
// Function: sam_hdr_rebuild
int sam_hdr_rebuild(sam_hdr_t *bh) {
    sam_hrecs_t *hrecs;
    if (!bh)
        return -1;

    if (!(hrecs = bh->hrecs))
        return bh->text ? 0 : -1;

    if (hrecs->refs_changed >= 0) {
        if (rebuild_target_arrays(bh) < 0) {
            hts_log_error("Header target array rebuild has failed");
            return -1;
        }
    }

    /* If header text wasn't changed or header is empty, don't rebuild it. */
    if (!hrecs->dirty)
        return 0;

    if (hrecs->pgs_changed && sam_hdr_link_pg(bh) < 0) {
        hts_log_error("Linking @PG lines has failed");
        return -1;
    }

    kstring_t ks = KS_INITIALIZE;
    if (sam_hrecs_rebuild_text(hrecs, &ks) != 0) {
        ks_free(&ks);
        hts_log_error("Header text rebuild has failed");
        return -1;
    }

    hrecs->dirty = 0;

    /* Sync */
    free(bh->text);
    bh->l_text = ks_len(&ks);
    bh->text = ks_release(&ks);

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0xd85ff
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xd8764
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
jne 0xd862f
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
cmpq $0x0, %rdx
cmovnel %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0xd8764
movq -0x18(%rbp), %rax
cmpl $0x0, 0x94(%rax)
jl 0xd8672
movq -0x10(%rbp), %rdi
callq 0xd8500
cmpl $0x0, %eax
jge 0xd8670
movl $0x1, %edi
leaq 0x1f9ad(%rip), %rsi     # 0xf8003
leaq 0x1f9b6(%rip), %rdx     # 0xf8013
movb $0x0, %al
callq 0x1b030
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xd8764
jmp 0xd8672
movq -0x18(%rbp), %rax
cmpl $0x0, 0x90(%rax)
jne 0xd868b
movl $0x0, -0x4(%rbp)
jmp 0xd8764
movq -0x18(%rbp), %rax
cmpl $0x0, 0x98(%rax)
je 0xd86cc
movq -0x10(%rbp), %rdi
callq 0xd8810
cmpl $0x0, %eax
jge 0xd86cc
movl $0x1, %edi
leaq 0x1f951(%rip), %rsi     # 0xf8003
leaq 0x1f981(%rip), %rdx     # 0xf803a
movb $0x0, %al
callq 0x1b030
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xd8764
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x4250
movq -0x18(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0xd8c10
cmpl $0x0, %eax
je 0xd871a
leaq -0x30(%rbp), %rdi
callq 0xd8ca0
movl $0x1, %edi
leaq 0x1f900(%rip), %rsi     # 0xf8003
leaq 0x1f94d(%rip), %rdx     # 0xf8057
movb $0x0, %al
callq 0x1b030
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xd8764
movq -0x18(%rbp), %rax
movl $0x0, 0x90(%rax)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x45a0
leaq -0x30(%rbp), %rdi
callq 0xd8cd0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
leaq -0x30(%rbp), %rdi
callq 0xd8cf0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x28(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/header.c
// Function: sam_hrecs_rebuild_text
int sam_hrecs_rebuild_text(const sam_hrecs_t *hrecs, kstring_t *ks) {
    ks->l = 0;

    if (!hrecs->h || !hrecs->h->size) {
        return kputsn("", 0, ks) >= 0 ? 0 : -1;
    }
    if (sam_hrecs_rebuild_lines(hrecs, ks) != 0)
        return -1;

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq $0x0, (%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0xd8c42
movq -0x10(%rbp), %rax
movq (%rax), %rax
cmpl $0x0, 0x4(%rax)
jne 0xd8c6a
movq -0x18(%rbp), %rdx
leaq 0x17328(%rip), %rdi     # 0xeff75
xorl %eax, %eax
movl %eax, %esi
callq 0xdd420
movl %eax, %edx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
cmpl $0x0, %edx
cmovgel %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0xd8c8c
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xdd890
cmpl $0x0, %eax
je 0xd8c85
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xd8c8c
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/header.c
// Function: sam_hdr_add_lines
int sam_hdr_add_lines(sam_hdr_t *bh, const char *lines, size_t len) {
    sam_hrecs_t *hrecs;

    if (!bh || !lines)
        return -1;

    if (len == 0 && *lines == '\0')
        return 0;

    if (!(hrecs = bh->hrecs)) {
        if (sam_hdr_fill_hrecs(bh) != 0)
            return -1;
        hrecs = bh->hrecs;
    }

    if (sam_hrecs_parse_lines(hrecs, lines, len) != 0)
        return -1;

    if (hrecs->refs_changed >= 0 && rebuild_target_arrays(bh) != 0)
        return -1;

    hrecs->dirty = 1;
    redact_header_text(bh);

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0xd8d52
cmpq $0x0, -0x18(%rbp)
jne 0xd8d5e
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xd8e13
cmpq $0x0, -0x20(%rbp)
jne 0xd8d7d
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0xd8d7d
movl $0x0, -0x4(%rbp)
jmp 0xd8e13
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
jne 0xd8db2
movq -0x10(%rbp), %rdi
callq 0xd7490
cmpl $0x0, %eax
je 0xd8da6
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xd8e13
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0xd7cc0
cmpl $0x0, %eax
je 0xd8dd1
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xd8e13
movq -0x28(%rbp), %rax
cmpl $0x0, 0x94(%rax)
jl 0xd8df5
movq -0x10(%rbp), %rdi
callq 0xd8500
cmpl $0x0, %eax
je 0xd8df5
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xd8e13
movq -0x28(%rbp), %rax
movl $0x1, 0x90(%rax)
movq -0x10(%rbp), %rdi
callq 0xd8e20
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/header.c
// Function: redact_header_text
static void redact_header_text(sam_hdr_t *bh) {
    assert(bh->hrecs && bh->hrecs->dirty);
    bh->l_text = 0;
    free(bh->text);
    bh->text = NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x38(%rax)
je 0xd8e4a
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
cmpl $0x0, 0x90(%rax)
je 0xd8e4a
jmp 0xd8e69
leaq 0x1f7bb(%rip), %rdi     # 0xf860c
leaq 0x1f2ef(%rip), %rsi     # 0xf8147
movl $0x492, %edx            # imm = 0x492
leaq 0x1f7c6(%rip), %rcx     # 0xf862a
callq 0x42e0
movq -0x8(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x45a0
movq -0x8(%rbp), %rax
movq $0x0, 0x28(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/header.c
// Function: sam_hdr_add_line
int sam_hdr_add_line(sam_hdr_t *bh, const char *type, ...) {
    va_list args;
    sam_hrecs_t *hrecs;

    if (!bh || !type)
        return -1;

    if (!(hrecs = bh->hrecs)) {
        if (sam_hdr_fill_hrecs(bh) != 0)
            return -1;
        hrecs = bh->hrecs;
    }

    va_start(args, type);
    int ret = sam_hrecs_vadd(hrecs, type, args, NULL);
    va_end(args);

    if (ret == 0) {
        if (hrecs->refs_changed >= 0 && rebuild_target_arrays(bh) != 0)
            return -1;

        if (hrecs->dirty)
            redact_header_text(bh);
    }

    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
testb %al, %al
je 0xd8edb
movaps %xmm0, -0xc0(%rbp)
movaps %xmm1, -0xb0(%rbp)
movaps %xmm2, -0xa0(%rbp)
movaps %xmm3, -0x90(%rbp)
movaps %xmm4, -0x80(%rbp)
movaps %xmm5, -0x70(%rbp)
movaps %xmm6, -0x60(%rbp)
movaps %xmm7, -0x50(%rbp)
movq %r9, -0xc8(%rbp)
movq %r8, -0xd0(%rbp)
movq %rcx, -0xd8(%rbp)
movq %rdx, -0xe0(%rbp)
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0xd8f0d
cmpq $0x0, -0x18(%rbp)
jne 0xd8f19
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xd8fdb
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
jne 0xd8f51
movq -0x10(%rbp), %rdi
callq 0xd7490
cmpl $0x0, %eax
je 0xd8f45
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xd8fdb
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x38(%rbp)
leaq -0x30(%rbp), %rax
leaq -0xf0(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x10, (%rax)
movq -0x38(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq -0x30(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
movb $0x0, %al
callq 0xd8ff0
movl %eax, -0x3c(%rbp)
leaq -0x30(%rbp), %rax
cmpl $0x0, -0x3c(%rbp)
jne 0xd8fd5
movq -0x38(%rbp), %rax
cmpl $0x0, 0x94(%rax)
jl 0xd8fbd
movq -0x10(%rbp), %rdi
callq 0xd8500
cmpl $0x0, %eax
je 0xd8fbd
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xd8fdb
movq -0x38(%rbp), %rax
cmpl $0x0, 0x90(%rax)
je 0xd8fd3
movq -0x10(%rbp), %rdi
callq 0xd8e20
jmp 0xd8fd5
movl -0x3c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xf0, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/header.c
// Function: sam_hdr_find_line_id
int sam_hdr_find_line_id(sam_hdr_t *bh, const char *type,
                      const char *ID_key, const char *ID_val, kstring_t *ks) {
    sam_hrecs_t *hrecs;
    if (!bh || !type)
        return -2;

    if (!(hrecs = bh->hrecs)) {
        if (sam_hdr_fill_hrecs(bh) != 0)
            return -2;
        hrecs = bh->hrecs;
    }

    sam_hrec_type_t *ty = sam_hrecs_find_type_id(hrecs, type, ID_key, ID_val);
    if (!ty)
        return -1;

    ks->l = 0;
    if (build_header_line(ty, ks) < 0) {
        return -2;
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0xd98ba
cmpq $0x0, -0x18(%rbp)
jne 0xd98c6
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0xd9951
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
jne 0xd98fb
movq -0x10(%rbp), %rdi
callq 0xd7490
cmpl $0x0, %eax
je 0xd98ef
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0xd9951
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0xd9960
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0xd9924
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xd9951
movq -0x30(%rbp), %rax
movq $0x0, (%rax)
movq -0x40(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0xd9d20
cmpl $0x0, %eax
jge 0xd994a
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0xd9951
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/header.c
// Function: build_header_line
static int build_header_line(const sam_hrec_type_t *ty, kstring_t *ks) {
    sam_hrec_tag_t *tag;
    int r = 0;
    char c[2]= { ty->type >> 8, ty->type & 0xff };

    r |= (kputc_('@', ks) == EOF);
    r |= (kputsn(c, 2, ks) == EOF);
    for (tag = ty->tag; tag; tag = tag->next) {
        r |= (kputc_('\t', ks) == EOF);
        r |= (kputsn(tag->str, tag->len, ks) == EOF);
    }

    return r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movl 0x28(%rax), %eax
shrl $0x8, %eax
movb %al, -0x1e(%rbp)
movq -0x8(%rbp), %rax
movl 0x28(%rax), %eax
andl $0xff, %eax
movb %al, -0x1d(%rbp)
movq -0x10(%rbp), %rsi
movl $0x40, %edi
callq 0xdf5a0
cmpl $-0x1, %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
orl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
leaq -0x1e(%rbp), %rdi
movq -0x10(%rbp), %rdx
movl $0x2, %esi
callq 0xdd420
cmpl $-0x1, %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
orl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0xd9dfe
movq -0x10(%rbp), %rsi
movl $0x9, %edi
callq 0xdf5a0
cmpl $-0x1, %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
orl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x18(%rbp), %rax
movslq 0x10(%rax), %rsi
movq -0x10(%rbp), %rdx
callq 0xdd420
cmpl $-0x1, %eax
sete %al
andb $0x1, %al
movzbl %al, %eax
orl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0xd9da1
movl -0x1c(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/header.c
// Function: sam_hdr_find_line_pos
int sam_hdr_find_line_pos(sam_hdr_t *bh, const char *type,
                          int pos, kstring_t *ks) {
    sam_hrecs_t *hrecs;
    if (!bh || !type)
        return -2;

    if (!(hrecs = bh->hrecs)) {
        if (sam_hdr_fill_hrecs(bh) != 0)
            return -2;
        hrecs = bh->hrecs;
    }

    sam_hrec_type_t *ty = sam_hrecs_find_type_pos(hrecs, type, pos);
    if (!ty)
        return -1;

    ks->l = 0;
    if (build_header_line(ty, ks) < 0) {
        return -2;
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq %rcx, -0x28(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0xd9e35
cmpq $0x0, -0x18(%rbp)
jne 0xd9e41
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0xd9ec7
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
jne 0xd9e76
movq -0x10(%rbp), %rdi
callq 0xd7490
cmpl $0x0, %eax
je 0xd9e6a
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0xd9ec7
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
callq 0xd9ed0
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0xd9e9a
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xd9ec7
movq -0x28(%rbp), %rax
movq $0x0, (%rax)
movq -0x38(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0xd9d20
cmpl $0x0, %eax
jge 0xd9ec0
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0xd9ec7
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/header.c
// Function: sam_hdr_remove_line_id
int sam_hdr_remove_line_id(sam_hdr_t *bh, const char *type, const char *ID_key, const char *ID_value) {
    sam_hrecs_t *hrecs;
    if (!bh || !type)
        return -1;

    if (!(hrecs = bh->hrecs)) {
        if (sam_hdr_fill_hrecs(bh) != 0)
            return -1;
        hrecs = bh->hrecs;
    }

    if (!strncmp(type, "PG", 2)) {
        hts_log_warning("Removing PG lines is not supported!");
        return -1;
    }

    sam_hrec_type_t *type_found = sam_hrecs_find_type_id(hrecs, type, ID_key, ID_value);
    if (!type_found)
        return 0;

    int ret = sam_hrecs_remove_line(hrecs, type, type_found, 1);
    if (ret == 0) {
        if (hrecs->refs_changed >= 0 && rebuild_target_arrays(bh) != 0)
            return -1;

        if (hrecs->dirty)
            redact_header_text(bh);
    }

    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0xda0a6
cmpq $0x0, -0x18(%rbp)
jne 0xda0b2
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xda1b4
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
jne 0xda0ea
movq -0x10(%rbp), %rdi
callq 0xd7490
cmpl $0x0, %eax
je 0xda0de
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xda1b4
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
leaq 0x1df81(%rip), %rsi     # 0xf8076
movl $0x2, %edx
callq 0x4200
cmpl $0x0, %eax
jne 0xda12a
movl $0x3, %edi
leaq 0x1df69(%rip), %rsi     # 0xf8079
leaq 0x1df79(%rip), %rdx     # 0xf8090
movb $0x0, %al
callq 0x1b030
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xda1b4
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0xd9960
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0xda153
movl $0x0, -0x4(%rbp)
jmp 0xda1b4
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x38(%rbp), %rdx
movl $0x1, %ecx
callq 0xda1c0
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jne 0xda1ae
movq -0x30(%rbp), %rax
cmpl $0x0, 0x94(%rax)
jl 0xda196
movq -0x10(%rbp), %rdi
callq 0xd8500
cmpl $0x0, %eax
je 0xda196
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xda1b4
movq -0x30(%rbp), %rax
cmpl $0x0, 0x90(%rax)
je 0xda1ac
movq -0x10(%rbp), %rdi
callq 0xd8e20
jmp 0xda1ae
movl -0x3c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/header.c
// Function: sam_hdr_remove_line_pos
int sam_hdr_remove_line_pos(sam_hdr_t *bh, const char *type, int position) {
    sam_hrecs_t *hrecs;
    if (!bh || !type || position < 0)
        return -1;

    if (!(hrecs = bh->hrecs)) {
        if (sam_hdr_fill_hrecs(bh) != 0)
            return -1;
        hrecs = bh->hrecs;
    }

    if (!strncmp(type, "PG", 2)) {
        hts_log_warning("Removing PG lines is not supported!");
        return -1;
    }

    sam_hrec_type_t *type_found = sam_hrecs_find_type_pos(hrecs, type,
                                                          position);
    if (!type_found)
        return -1;

    int ret = sam_hrecs_remove_line(hrecs, type, type_found, 1);
    if (ret == 0) {
        if (hrecs->refs_changed >= 0 && rebuild_target_arrays(bh) != 0)
            return -1;

        if (hrecs->dirty)
            redact_header_text(bh);
    }

    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0xda3d7
cmpq $0x0, -0x18(%rbp)
je 0xda3d7
cmpl $0x0, -0x1c(%rbp)
jge 0xda3e3
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xda4e0
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
jne 0xda41b
movq -0x10(%rbp), %rdi
callq 0xd7490
cmpl $0x0, %eax
je 0xda40f
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xda4e0
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rdi
leaq 0x1dc50(%rip), %rsi     # 0xf8076
movl $0x2, %edx
callq 0x4200
cmpl $0x0, %eax
jne 0xda45b
movl $0x3, %edi
leaq 0x1dc73(%rip), %rsi     # 0xf80b4
leaq 0x1dc48(%rip), %rdx     # 0xf8090
movb $0x0, %al
callq 0x1b030
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xda4e0
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
callq 0xd9ed0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0xda47f
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xda4e0
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x30(%rbp), %rdx
movl $0x1, %ecx
callq 0xda1c0
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
jne 0xda4da
movq -0x28(%rbp), %rax
cmpl $0x0, 0x94(%rax)
jl 0xda4c2
movq -0x10(%rbp), %rdi
callq 0xd8500
cmpl $0x0, %eax
je 0xda4c2
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xda4e0
movq -0x28(%rbp), %rax
cmpl $0x0, 0x90(%rax)
je 0xda4d8
movq -0x10(%rbp), %rdi
callq 0xd8e20
jmp 0xda4da
movl -0x34(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/header.c
// Function: sam_hrecs_find_key
sam_hrec_tag_t *sam_hrecs_find_key(sam_hrec_type_t *type,
                                   const char *key,
                                   sam_hrec_tag_t **prev) {
    sam_hrec_tag_t *tag, *p = NULL;
    if (!type)
        return NULL;

    for (tag = type->tag; tag; p = tag, tag = tag->next) {
        if (tag->str[0] == key[0] && tag->str[1] == key[1]) {
            if (prev)
                *prev = p;
            return tag;
        }
    }

    if (prev)
        *prev = p;

    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq $0x0, -0x30(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0xdaf7c
movq $0x0, -0x8(%rbp)
jmp 0xdb00a
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0xdaff0
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movsbl (%rax), %eax
movq -0x18(%rbp), %rcx
movsbl (%rcx), %ecx
cmpl %ecx, %eax
jne 0xdafd9
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movsbl 0x1(%rax), %eax
movq -0x18(%rbp), %rcx
movsbl 0x1(%rcx), %ecx
cmpl %ecx, %eax
jne 0xdafd9
cmpq $0x0, -0x20(%rbp)
je 0xdafcf
movq -0x30(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xdb00a
jmp 0xdafdb
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0xdaf88
cmpq $0x0, -0x20(%rbp)
je 0xdb002
movq -0x30(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/header.c
// Function: rebuild_hash
static int rebuild_hash(sam_hrecs_t *hrecs, const char *type) {
    sam_hrec_type_t *head, *step;
    khiter_t k;

    if (strncmp(type, "SQ", 2) == 0) {
        hrecs->nref = 0;
        kh_clear(m_s2i, hrecs->ref_hash);
    } else if (strncmp(type, "RG", 2) == 0) {
        hrecs->nrg = 0;
        kh_clear(m_s2i, hrecs->rg_hash);
    }

    k = kh_get(sam_hrecs_t, hrecs->h, TYPEKEY(type));

    if (k != kh_end(hrecs->h)) { // something to rebuild
        head = kh_val(hrecs->h, k);
        step = head;

        do {
            if (sam_hrecs_update_hashes(hrecs, TYPEKEY(type), step) == -1) {
                hts_log_error("Unable to rebuild hashes");
                return -1;
            }

            step = step->next;
        } while (step != head);
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rdi
leaq 0x15ec1(%rip), %rsi     # 0xf26ec
movl $0x2, %edx
callq 0x4200
cmpl $0x0, %eax
jne 0xdc854
movq -0x10(%rbp), %rax
movl $0x0, 0x28(%rax)
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rdi
callq 0xe0360
jmp 0xdc888
movq -0x18(%rbp), %rdi
leaq 0x15db7(%rip), %rsi     # 0xf2616
movl $0x2, %edx
callq 0x4200
cmpl $0x0, %eax
jne 0xdc886
movq -0x10(%rbp), %rax
movl $0x0, 0x40(%rax)
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rdi
callq 0xe0360
jmp 0xdc888
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rdi
callq 0xdabd0
movq -0x38(%rbp), %rdi
movl %eax, %esi
callq 0xdc6d0
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
cmpl (%rcx), %eax
je 0xdc935
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x20(%rax), %rax
movl -0x2c(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rdi
callq 0xdabd0
movq -0x40(%rbp), %rdi
movl %eax, %esi
movq -0x28(%rbp), %rdx
callq 0xdb3f0
cmpl $-0x1, %eax
jne 0xdc91e
movl $0x1, %edi
leaq 0x1c0fe(%rip), %rsi     # 0xf8a05
leaq 0x1c104(%rip), %rdx     # 0xf8a12
movb $0x0, %al
callq 0x1b030
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xdc93c
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x20(%rbp), %rax
jne 0xdc8d6
jmp 0xdc935
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/header.c
// Function: sam_hdr_count_lines
int sam_hdr_count_lines(sam_hdr_t *bh, const char *type) {
    int count;
    sam_hrec_type_t *first_ty, *itr_ty;

    if (!bh || !type)
        return -1;

    if (!bh->hrecs) {
        if (sam_hdr_fill_hrecs(bh) != 0)
            return -1;
    }

    // Deal with types that have counts
    switch (type[0]) {
    case 'S':
        if (type[1] == 'Q')
            return bh->hrecs->nref;
        break;
    case 'R':
        if (type[1] == 'G')
            return bh->hrecs->nrg;
        break;
    case 'P':
        if (type[1] == 'G')
            return bh->hrecs->npg;
        break;
    default:
        break;
    }

    first_ty = sam_hrecs_find_type_id(bh->hrecs, type, NULL, NULL);
    if (!first_ty)
        return 0;

    count = 1;
    for (itr_ty = first_ty->next;
         itr_ty && itr_ty != first_ty; itr_ty = itr_ty->next) {
        count++;
    }

    return count;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0xdcdae
cmpq $0x0, -0x18(%rbp)
jne 0xdcdba
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xdceeb
movq -0x10(%rbp), %rax
cmpq $0x0, 0x38(%rax)
jne 0xdcde1
movq -0x10(%rbp), %rdi
callq 0xd7490
cmpl $0x0, %eax
je 0xdcddf
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xdceeb
jmp 0xdcde1
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x34(%rbp)
subl $0x50, %eax
je 0xdce4a
jmp 0xdcdf2
movl -0x34(%rbp), %eax
subl $0x52, %eax
je 0xdce28
jmp 0xdcdfc
movl -0x34(%rbp), %eax
subl $0x53, %eax
jne 0xdce6c
jmp 0xdce06
movq -0x18(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x51, %eax
jne 0xdce26
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movl 0x28(%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0xdceeb
jmp 0xdce6e
movq -0x18(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x47, %eax
jne 0xdce48
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movl 0x40(%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0xdceeb
jmp 0xdce6e
movq -0x18(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x47, %eax
jne 0xdce6a
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movl 0x58(%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0xdceeb
jmp 0xdce6e
jmp 0xdce6e
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rdi
movq -0x18(%rbp), %rsi
xorl %eax, %eax
movl %eax, %ecx
movq %rcx, %rdx
callq 0xd9960
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0xdce9a
movl $0x0, -0x4(%rbp)
jmp 0xdceeb
movl $0x1, -0x1c(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x30(%rbp)
movb %al, -0x35(%rbp)
je 0xdcec6
movq -0x30(%rbp), %rax
cmpq -0x28(%rbp), %rax
setne %al
movb %al, -0x35(%rbp)
movb -0x35(%rbp), %al
testb $0x1, %al
jne 0xdcecf
jmp 0xdcee5
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0xdceac
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/header.c
// Function: sam_hdr_find_tag_id
int sam_hdr_find_tag_id(sam_hdr_t *bh,
                     const char *type,
                     const char *ID_key,
                     const char *ID_value,
                     const char *key,
                     kstring_t *ks) {
    sam_hrecs_t *hrecs;
    if (!bh || !type || !key)
        return -2;

    if (!(hrecs = bh->hrecs)) {
        if (sam_hdr_fill_hrecs(bh) != 0)
            return -2;
        hrecs = bh->hrecs;
    }

    sam_hrec_type_t *ty = sam_hrecs_find_type_id(hrecs, type, ID_key, ID_value);
    if (!ty)
        return -1;

    sam_hrec_tag_t *tag = sam_hrecs_find_key(ty, key, NULL);
    if (!tag || !tag->str || tag->len < 4)
        return -1;

    ks->l = 0;
    if (kputsn(tag->str+3, tag->len-3, ks) == EOF) {
        return -2;
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0xdd325
cmpq $0x0, -0x18(%rbp)
je 0xdd325
cmpq $0x0, -0x30(%rbp)
jne 0xdd331
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0xdd40e
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x40(%rbp)
cmpq $0x0, %rax
jne 0xdd369
movq -0x10(%rbp), %rdi
callq 0xd7490
cmpl $0x0, %eax
je 0xdd35d
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0xdd40e
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0xd9960
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0xdd392
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xdd40e
movq -0x48(%rbp), %rdi
movq -0x30(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0xdaf50
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
je 0xdd3c3
movq -0x50(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0xdd3c3
movq -0x50(%rbp), %rax
cmpl $0x4, 0x10(%rax)
jge 0xdd3cc
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xdd40e
movq -0x38(%rbp), %rax
movq $0x0, (%rax)
movq -0x50(%rbp), %rax
movq 0x8(%rax), %rdi
addq $0x3, %rdi
movq -0x50(%rbp), %rax
movl 0x10(%rax), %eax
subl $0x3, %eax
movslq %eax, %rsi
movq -0x38(%rbp), %rdx
callq 0xdd420
cmpl $-0x1, %eax
jne 0xdd407
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0xdd40e
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/header.c
// Function: sam_hdr_find_tag_pos
int sam_hdr_find_tag_pos(sam_hdr_t *bh,
                     const char *type,
                     int pos,
                     const char *key,
                     kstring_t *ks) {
    sam_hrecs_t *hrecs;
    if (!bh || !type || !key)
        return -2;

    if (!(hrecs = bh->hrecs)) {
        if (sam_hdr_fill_hrecs(bh) != 0)
            return -2;
        hrecs = bh->hrecs;
    }

    sam_hrec_type_t *ty = sam_hrecs_find_type_pos(hrecs, type, pos);
    if (!ty)
        return -1;

    sam_hrec_tag_t *tag = sam_hrecs_find_key(ty, key, NULL);
    if (!tag || !tag->str || tag->len < 4)
        return -1;

    ks->l = 0;
    if (kputsn(tag->str+3, tag->len-3, ks) == EOF) {
        return -2;
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0xdd500
cmpq $0x0, -0x18(%rbp)
je 0xdd500
cmpq $0x0, -0x28(%rbp)
jne 0xdd50c
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0xdd5e4
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
jne 0xdd544
movq -0x10(%rbp), %rdi
callq 0xd7490
cmpl $0x0, %eax
je 0xdd538
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0xdd5e4
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
callq 0xd9ed0
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0xdd568
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xdd5e4
movq -0x40(%rbp), %rdi
movq -0x28(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0xdaf50
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
je 0xdd599
movq -0x48(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0xdd599
movq -0x48(%rbp), %rax
cmpl $0x4, 0x10(%rax)
jge 0xdd5a2
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xdd5e4
movq -0x30(%rbp), %rax
movq $0x0, (%rax)
movq -0x48(%rbp), %rax
movq 0x8(%rax), %rdi
addq $0x3, %rdi
movq -0x48(%rbp), %rax
movl 0x10(%rax), %eax
subl $0x3, %eax
movslq %eax, %rsi
movq -0x30(%rbp), %rdx
callq 0xdd420
cmpl $-0x1, %eax
jne 0xdd5dd
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0xdd5e4
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/header.c
// Function: sam_hdr_remove_tag_id
int sam_hdr_remove_tag_id(sam_hdr_t *bh,
        const char *type,
        const char *ID_key,
        const char *ID_value,
        const char *key) {
    sam_hrecs_t *hrecs;
    if (!bh || !type || !key)
        return -1;

    if (!(hrecs = bh->hrecs)) {
        if (sam_hdr_fill_hrecs(bh) != 0)
            return -1;
        hrecs = bh->hrecs;
    }

    sam_hrec_type_t *ty = sam_hrecs_find_type_id(hrecs, type, ID_key, ID_value);
    if (!ty)
        return -1;

    int ret = sam_hrecs_remove_key(hrecs, ty, key);
    if (!ret && hrecs->dirty)
        redact_header_text(bh);

    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0xdd621
cmpq $0x0, -0x18(%rbp)
je 0xdd621
cmpq $0x0, -0x30(%rbp)
jne 0xdd62d
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xdd6c1
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
jne 0xdd662
movq -0x10(%rbp), %rdi
callq 0xd7490
cmpl $0x0, %eax
je 0xdd656
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xdd6c1
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0xd9960
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0xdd68b
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xdd6c1
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0xdd6d0
movl %eax, -0x44(%rbp)
cmpl $0x0, -0x44(%rbp)
jne 0xdd6bb
movq -0x38(%rbp), %rax
cmpl $0x0, 0x90(%rax)
je 0xdd6bb
movq -0x10(%rbp), %rdi
callq 0xd8e20
movl -0x44(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/header.c
// Function: sam_hrecs_rebuild_lines
static int sam_hrecs_rebuild_lines(const sam_hrecs_t *hrecs, kstring_t *ks) {
    const sam_hrec_type_t *t1, *t2;

    if (!hrecs->first_line)
        return kputsn("", 0, ks) >= 0 ? 0 : -1;

    t1 = t2 = hrecs->first_line;
    do {
        if (build_header_line(t1, ks) != 0)
            return -1;
        if (kputc('\n', ks) < 0)
            return -1;

        t1 = t1->global_next;
    } while (t1 != t2);

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0xdd8d3
movq -0x18(%rbp), %rdx
leaq 0x126bf(%rip), %rdi     # 0xeff75
xorl %eax, %eax
movl %eax, %esi
callq 0xdd420
movl %eax, %edx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
cmpl $0x0, %edx
cmovgel %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0xdd937
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xd9d20
cmpl $0x0, %eax
je 0xdd8fe
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xdd937
movq -0x18(%rbp), %rsi
movl $0xa, %edi
callq 0xe03e0
cmpl $0x0, %eax
jge 0xdd91a
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xdd937
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x28(%rbp), %rax
jne 0xdd8e3
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq