// File: /workspace/github_c_makefile_star2_O1/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 $0x28, %rsp
movq %rsi, %r13
callq 0x62ab8
testq %rax, %rax
je 0x631fe
movq %rax, 0x18(%rsp)
movl $0x1, %r14d
movl $0x1, %edi
callq 0x69d0
testq %rax, %rax
movq %rax, 0x10(%rsp)
je 0x6300c
movb $0x40, (%rax)
movl $0x1, %ebx
movq %rax, 0x8(%rsp)
jmp 0x63017
xorl %ebx, %ebx
movq $0x0, 0x8(%rsp)
movq %r13, %rdi
callq 0x62d0
movq %rax, 0x20(%rsp)
movslq %eax, %r15
leaq (%r15,%rbx), %rbp
movq %rbp, %rax
incq %rax
jne 0x6303a
movq 0x8(%rsp), %r12
jmp 0x6308c
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 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x6c80
testq %rax, %rax
je 0x63213
movq %rax, %r12
movq %r12, 0x8(%rsp)
addq %r12, %rbx
movq %rbx, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x6570
movb $0x0, (%r12,%rbp)
cmpl $-0x1, 0x20(%rsp)
sete %al
cmpq $0x0, 0x10(%rsp)
sete %cl
orb %al, %cl
movzbl %cl, %eax
movq 0x18(%rsp), %rcx
movq 0x10(%rcx), %rbx
testq %rbx, %rbx
movq 0x8(%rsp), %r13
je 0x631ed
movl %eax, 0x18(%rsp)
leaq 0x1(%rbp), %r12
cmpq %r14, %r12
jbe 0x63129
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 0x631d9
movq %rax, %r13
jmp 0x6312c
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 0x6314d
movq %r13, 0x8(%rsp)
jmp 0x631a3
movq %rsi, 0x10(%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 0x631e4
movq %rax, %r13
movq %rax, 0x8(%rsp)
movq 0x10(%rsp), %rsi
leaq (%r12,%r13), %rdi
movq %r15, %rdx
callq 0x6570
addq %r15, %r12
movb $0x0, (%r13,%r12)
cmpl $-0x1, %r15d
sete %al
orb %al, %bpl
movzbl %bpl, %eax
movl 0x18(%rsp), %ecx
orl %eax, %ecx
movl %ecx, %eax
movq (%rbx), %rbx
movq %r12, %rbp
jmp 0x630c1
movq %rbp, %r12
movb $0x1, %bpl
jmp 0x63132
movq %r13, 0x8(%rsp)
movb $0x1, %al
jmp 0x631bf
testl %eax, %eax
je 0x63201
testq %r13, %r13
je 0x631fe
movq %r13, %rdi
callq 0x68a0
xorl %r13d, %r13d
movq %r13, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, %al
movq %rbx, %rbp
jmp 0x630aa