// File: /workspace/github_c_makefile_star2_O3/icebert[P]pblat/htslib/cram/sam_header.c
// Function: sam_hdr_find_line
char *sam_hdr_find_line(SAM_hdr *hdr, char *type,
			char *ID_key, char *ID_value) {
    SAM_hdr_type *ty = sam_hdr_find(hdr, type, ID_key, ID_value);
    kstring_t ks = KS_INITIALIZER;
    SAM_hdr_tag *tag;
    int r = 0;

    if (!ty)
	return NULL;

    // Paste together the line from the hashed copy
    r |= (kputc_('@', &ks) == EOF);
    r |= (kputs(type, &ks) == EOF);
    for (tag = ty->tag; tag; tag = tag->next) {
	r |= (kputc_('\t', &ks) == EOF);
	r |= (kputsn(tag->str, tag->len, &ks) == EOF);
    }

    if (r) {
	KS_FREE(&ks);
	return NULL;
    }

    return ks_str(&ks);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r15
callq 0x62c06
testq %rax, %rax
je 0x63322
movq %rax, (%rsp)
movl $0x1, %r14d
movl $0x1, %edi
callq 0x69d0
movq %rax, %r12
testq %rax, %rax
je 0x6313d
movb $0x40, (%r12)
movl $0x1, %ebx
jmp 0x6313f
xorl %ebx, %ebx
movq %r15, %rdi
callq 0x62d0
movq %rax, 0x10(%rsp)
movslq %eax, %rdx
leaq (%rdx,%rbx), %rbp
movq %rbp, %rax
incq %rax
jne 0x63160
movq %r12, %r13
jmp 0x631b5
movq %rdx, 0x8(%rsp)
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %r14
shrq $0x10, %r14
orq %rax, %r14
incq %r14
movq %r12, %rdi
movq %r14, %rsi
callq 0x6c80
testq %rax, %rax
je 0x63337
movq %rax, %r13
movq 0x8(%rsp), %rdx
addq %r13, %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6570
movb $0x0, (%r13,%rbp)
cmpl $-0x1, 0x10(%rsp)
sete %al
testq %r12, %r12
sete %cl
orb %al, %cl
movzbl %cl, %eax
movq (%rsp), %rcx
movq 0x10(%rcx), %rbx
testq %rbx, %rbx
jne 0x63201
jmp 0x63311
movq %rbp, %r12
movb $0x1, %bpl
jmp 0x63260
movq %r13, (%rsp)
movb $0x1, %al
jmp 0x632ef
movl %eax, 0x10(%rsp)
leaq 0x1(%rbp), %r12
cmpq %r14, %r12
jbe 0x63257
movq %rbp, %rax
shrq %rax
orq %rbp, %rax
movq %rax, %rcx
shrq $0x2, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x4, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x8, %rcx
orq %rax, %rcx
movq %rcx, %r14
shrq $0x10, %r14
orq %rcx, %r14
incq %r14
movq %r13, %rdi
movq %r14, %rsi
callq 0x6c80
testq %rax, %rax
je 0x631ee
movq %rax, %r13
jmp 0x6325a
movq %r13, %rax
movb $0x9, (%rax,%rbp)
xorl %ebp, %ebp
movq 0x8(%rbx), %rsi
movslq 0x10(%rbx), %r15
leaq (%r12,%r15), %rax
incq %rax
cmpq %r14, %rax
jae 0x6327a
movq %r13, (%rsp)
jmp 0x632d3
movq %rsi, 0x8(%rsp)
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %r14
shrq $0x10, %r14
orq %rax, %r14
incq %r14
movq %r13, %rdi
movq %r14, %rsi
callq 0x6c80
testq %rax, %rax
je 0x631f6
movq %rax, %r13
movq %rax, (%rsp)
movq 0x8(%rsp), %rsi
leaq (%r12,%r13), %rdi
addq %r15, %r12
movq %r15, %rdx
callq 0x6570
movb $0x0, (%r13,%r12)
cmpl $-0x1, %r15d
sete %al
orb %al, %bpl
movzbl %bpl, %eax
movl 0x10(%rsp), %ecx
orl %eax, %ecx
movl %ecx, %eax
movq (%rbx), %rbx
movq %r12, %rbp
testq %rbx, %rbx
movq (%rsp), %r13
jne 0x63201
testl %eax, %eax
je 0x63325
testq %r13, %r13
je 0x63322
movq %r13, %rdi
callq 0x68a0
xorl %r13d, %r13d
movq %r13, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, %al
movq %rbx, %rbp
movq %r12, %r13
jmp 0x631d1