// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movabsq $0x3fffffffffffffff, %rdx # imm = 0x3FFFFFFFFFFFFFFF
movl 0x28(%rdi), %ebp
movq (%rsi), %rax
incq %rax
cmpq %rax, 0x8(%rsi)
jae 0x884a2
movq %rax, %rcx
shrq %rcx
xorl %r15d, %r15d
cmpq %rdx, %rax
cmovbeq %rcx, %r15
addq %rax, %r15
movq 0x10(%rbx), %rdi
movq %r15, %rsi
callq 0x4840
testq %rax, %rax
je 0x88678
movq %rax, 0x10(%rbx)
movq %r15, 0x8(%rbx)
movq (%rbx), %rax
movq 0x10(%rbx), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, (%rbx)
movb $0x40, (%rcx,%rax)
xorl %r12d, %r12d
movq (%rbx), %rax
subq $-0x4, %rax
jae 0x88527
cmpq %rax, 0x8(%rbx)
jae 0x884fc
movq %rax, %rcx
shrq %rcx
xorl %r15d, %r15d
movabsq $0x3fffffffffffffff, %rdx # imm = 0x3FFFFFFFFFFFFFFF
cmpq %rdx, %rax
cmovbeq %rcx, %r15
addq %rax, %r15
movq 0x10(%rbx), %rdi
movq %r15, %rsi
callq 0x4840
testq %rax, %rax
je 0x88532
movq %rax, 0x10(%rbx)
movq %r15, 0x8(%rbx)
movl %ebp, %eax
shrl $0x8, %eax
movq (%rbx), %rcx
movq 0x10(%rbx), %rdx
movb %al, (%rdx,%rcx)
movb %bpl, 0x1(%rdx,%rcx)
movq (%rbx), %rax
movq 0x10(%rbx), %rcx
leaq 0x2(%rax), %rdx
movq %rdx, (%rbx)
movb $0x0, 0x2(%rcx,%rax)
xorl %ebp, %ebp
jmp 0x88537
callq 0x4050
movl $0x4b, (%rax)
movl $0x1, %ebp
orl %r12d, %ebp
movq 0x20(%r14), %r13
testq %r13, %r13
je 0x88667
movabsq $0x3fffffffffffffff, %r12 # imm = 0x3FFFFFFFFFFFFFFF
movq (%rbx), %rax
incq %rax
cmpq %rax, 0x8(%rbx)
jae 0x8858f
movq %rax, %r14
shrq %r14
cmpq %r12, %rax
movl $0x0, %ecx
cmovaq %rcx, %r14
addq %rax, %r14
movq 0x10(%rbx), %rdi
movq %r14, %rsi
callq 0x4840
testq %rax, %rax
je 0x88651
movq %rax, 0x10(%rbx)
movq %r14, 0x8(%rbx)
movq (%rbx), %rax
movq 0x10(%rbx), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, (%rbx)
movb $0x9, (%rcx,%rax)
xorl %r15d, %r15d
movslq 0x10(%r13), %r14
movq (%rbx), %rcx
leaq (%r14,%rcx), %rax
addq $0x2, %rax
cmpq %rcx, %rax
jbe 0x8862c
movq 0x8(%r13), %rsi
cmpq %rax, 0x8(%rbx)
jae 0x88603
movq %rsi, (%rsp)
movq %rax, %rcx
shrq %rcx
cmpq %r12, %rax
movl $0x0, %r12d
cmovbeq %rcx, %r12
addq %rax, %r12
movq 0x10(%rbx), %rdi
movq %r12, %rsi
callq 0x4840
testq %rax, %rax
je 0x88659
movq %rax, 0x10(%rbx)
movq %r12, 0x8(%rbx)
movabsq $0x3fffffffffffffff, %r12 # imm = 0x3FFFFFFFFFFFFFFF
movq (%rsp), %rsi
movq 0x10(%rbx), %rdi
addq (%rbx), %rdi
movq %r14, %rdx
callq 0x43c0
movq %r14, %rax
addq (%rbx), %rax
movq %rax, (%rbx)
movq 0x10(%rbx), %rcx
movb $0x0, (%rcx,%rax)
cmpl $-0x1, %r14d
sete %al
jmp 0x88639
callq 0x4050
movl $0x4b, (%rax)
movb $0x1, %al
orb %al, %r15b
movzbl %r15b, %eax
orl %eax, %ebp
movq (%r13), %r13
testq %r13, %r13
jne 0x88551
jmp 0x88667
movb $0x1, %r15b
jmp 0x885a4
movb $0x1, %al
movabsq $0x3fffffffffffffff, %r12 # imm = 0x3FFFFFFFFFFFFFFF
jmp 0x88639
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, %r12d
jmp 0x884b7