// File: /workspace/github_c_makefile_star2_O3/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, %rsi # imm = 0x3FFFFFFFFFFFFFFF
movl 0x28(%rdi), %ebp
movq (%rbx), %rdx
leaq 0x1(%rdx), %rcx
cmpq %rcx, 0x8(%rbx)
jae 0x85e10
movq %rcx, %rax
shrq %rax
xorl %r15d, %r15d
cmpq %rsi, %rcx
cmovbeq %rax, %r15
addq %rcx, %r15
movq 0x10(%rbx), %rdi
movq %r15, %rsi
callq 0x4840
testq %rax, %rax
je 0x85fec
movq %rax, 0x10(%rbx)
movq %r15, 0x8(%rbx)
movq (%rbx), %rdx
leaq 0x1(%rdx), %rcx
jmp 0x85e14
movq 0x10(%rbx), %rax
movq %rcx, (%rbx)
movb $0x40, (%rax,%rdx)
xorl %r12d, %r12d
movq (%rbx), %rcx
movq %rcx, %rax
subq $-0x4, %rax
jae 0x85e6b
cmpq %rax, 0x8(%rbx)
jae 0x85e7d
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 0x85e76
movq %rax, 0x10(%rbx)
movq %r15, 0x8(%rbx)
movq (%rbx), %rcx
jmp 0x85e81
callq 0x4050
movl $0x4b, (%rax)
movl $0x1, %ebp
jmp 0x85ea3
movq 0x10(%rbx), %rax
movl %ebp, %edx
shrl $0x8, %edx
movb %dl, (%rax,%rcx)
movb %bpl, 0x1(%rax,%rcx)
movq (%rbx), %rax
movq 0x10(%rbx), %rcx
leaq 0x2(%rax), %rdx
movq %rdx, (%rbx)
movb $0x0, 0x2(%rcx,%rax)
xorl %ebp, %ebp
orl %r12d, %ebp
movq 0x20(%r14), %r13
testq %r13, %r13
je 0x85fdb
movabsq $0x3fffffffffffffff, %r12 # imm = 0x3FFFFFFFFFFFFFFF
movq (%rbx), %rdx
leaq 0x1(%rdx), %rcx
cmpq %rcx, 0x8(%rbx)
jae 0x85f05
movq %rcx, %r14
shrq %r14
cmpq %r12, %rcx
movl $0x0, %eax
cmovaq %rax, %r14
addq %rcx, %r14
movq 0x10(%rbx), %rdi
movq %r14, %rsi
callq 0x4840
testq %rax, %rax
je 0x85fc5
movq %rax, 0x10(%rbx)
movq %r14, 0x8(%rbx)
movq (%rbx), %rdx
leaq 0x1(%rdx), %rcx
jmp 0x85f09
movq 0x10(%rbx), %rax
movq %rcx, (%rbx)
movb $0x9, (%rax,%rdx)
xorl %r15d, %r15d
movslq 0x10(%r13), %r14
movq (%rbx), %rdi
leaq (%r14,%rdi), %rax
addq $0x2, %rax
cmpq %rdi, %rax
jbe 0x85f77
movq 0x8(%r13), %rsi
cmpq %rax, 0x8(%rbx)
jae 0x85f86
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 0x85fcd
movq %rax, 0x10(%rbx)
movq %r12, 0x8(%rbx)
movq (%rbx), %rdi
movabsq $0x3fffffffffffffff, %r12 # imm = 0x3FFFFFFFFFFFFFFF
movq (%rsp), %rsi
jmp 0x85f8a
callq 0x4050
movl $0x4b, (%rax)
movb $0x1, %al
jmp 0x85fad
movq 0x10(%rbx), %rax
addq %rax, %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
orb %al, %r15b
movzbl %r15b, %eax
orl %eax, %ebp
movq (%r13), %r13
testq %r13, %r13
jne 0x85ebd
jmp 0x85fdb
movb $0x1, %r15b
jmp 0x85f13
movb $0x1, %al
movabsq $0x3fffffffffffffff, %r12 # imm = 0x3FFFFFFFFFFFFFFF
jmp 0x85fad
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, %r12d
jmp 0x85e1e