// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/samtools-0.1.18/sam_header.c
// Function: sam_header_line_validate
static int sam_header_line_validate(HeaderLine *hline)
{
    list_t *tags;
    HeaderTag *tag;
    int itype, itag;
    
    // Is the type correct?
    itype = tag_exists(hline->type, types);
    if ( itype==-1 ) 
    {
        debug("The type [%c%c] not recognised.\n", hline->type[0],hline->type[1]);
        return 0;
    }

    // Has all required tags?
    itag = 0;
    while ( required_tags[itype] && required_tags[itype][itag] )
    {
        if ( !header_line_has_tag(hline,required_tags[itype][itag]) )
        {
            debug("The tag [%c%c] required for [%c%c] not present.\n", required_tags[itype][itag][0],required_tags[itype][itag][1],
                hline->type[0],hline->type[1]);
            return 0;
        }
        itag++;
    }

    // Are all tags recognised?
    tags = hline->tags;
    while ( tags )
    {
        tag = tags->data;
        if ( !tag_exists(tag->key,required_tags[itype]) && !tag_exists(tag->key,optional_tags[itype]) )
        {
            debug("Unknown tag [%c%c] for [%c%c].\n", tag->key[0],tag->key[1], hline->type[0],hline->type[1]);
            return 0;
        }
        tags = tags->next;
    }

    return 1;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq 0x28(%rsp), %rdi
leaq 0x2ce8fb(%rip), %rsi    # 0x63f5d0
callq 0x372200
movl %eax, 0x14(%rsp)
cmpl $-0x1, 0x14(%rsp)
jne 0x370d11
movq 0x28(%rsp), %rax
movsbl (%rax), %esi
movq 0x28(%rsp), %rax
movsbl 0x1(%rax), %edx
leaq 0x22d3f8(%rip), %rdi    # 0x59e0f5
movb $0x0, %al
callq 0x371320
movl $0x0, 0x34(%rsp)
jmp 0x370ebb
movl $0x0, 0x10(%rsp)
movslq 0x14(%rsp), %rdx
xorl %eax, %eax
leaq 0x2ce909(%rip), %rcx    # 0x63f630
cmpq $0x0, (%rcx,%rdx,8)
movb %al, 0xf(%rsp)
je 0x370d53
movslq 0x14(%rsp), %rcx
leaq 0x2ce8f2(%rip), %rax    # 0x63f630
movq (%rax,%rcx,8), %rax
movslq 0x10(%rsp), %rcx
cmpq $0x0, (%rax,%rcx,8)
setne %al
movb %al, 0xf(%rsp)
movb 0xf(%rsp), %al
testb $0x1, %al
jne 0x370d60
jmp 0x370dff
movq 0x28(%rsp), %rdi
movslq 0x14(%rsp), %rcx
leaq 0x2ce8bf(%rip), %rax    # 0x63f630
movq (%rax,%rcx,8), %rax
movslq 0x10(%rsp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x3710f0
cmpq $0x0, %rax
jne 0x370def
movslq 0x14(%rsp), %rcx
leaq 0x2ce89b(%rip), %rax    # 0x63f630
movq (%rax,%rcx,8), %rax
movslq 0x10(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %esi
movslq 0x14(%rsp), %rcx
leaq 0x2ce87f(%rip), %rax    # 0x63f630
movq (%rax,%rcx,8), %rax
movslq 0x10(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movsbl 0x1(%rax), %edx
movq 0x28(%rsp), %rax
movsbl (%rax), %ecx
movq 0x28(%rsp), %rax
movsbl 0x1(%rax), %r8d
leaq 0x22d33b(%rip), %rdi    # 0x59e116
movb $0x0, %al
callq 0x371320
movl $0x0, 0x34(%rsp)
jmp 0x370ebb
movl 0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x10(%rsp)
jmp 0x370d19
movq 0x28(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x20(%rsp)
cmpq $0x0, 0x20(%rsp)
je 0x370eb3
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
movslq 0x14(%rsp), %rcx
leaq 0x2ce7f8(%rip), %rax    # 0x63f630
movq (%rax,%rcx,8), %rsi
callq 0x372200
cmpl $0x0, %eax
jne 0x370ea0
movq 0x18(%rsp), %rdi
movslq 0x14(%rsp), %rcx
leaq 0x2ce7a9(%rip), %rax    # 0x63f600
movq (%rax,%rcx,8), %rsi
callq 0x372200
cmpl $0x0, %eax
jne 0x370ea0
movq 0x18(%rsp), %rax
movsbl (%rax), %esi
movq 0x18(%rsp), %rax
movsbl 0x1(%rax), %edx
movq 0x28(%rsp), %rax
movsbl (%rax), %ecx
movq 0x28(%rsp), %rax
movsbl 0x1(%rax), %r8d
leaq 0x22d2b8(%rip), %rdi    # 0x59e147
movb $0x0, %al
callq 0x371320
movl $0x0, 0x34(%rsp)
jmp 0x370ebb
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x20(%rsp)
jmp 0x370e0d
movl $0x1, 0x34(%rsp)
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)