// File: /workspace/github_c_makefile_star2_O0/skoren[P]bacValidation/bamcat.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]) )
        {
            // Lower case tags are user-defined values.
            if( !(islower(tag->key[0]) || islower(tag->key[1])) )
            {
                // Neither is lower case, but tag was not recognized.
                debug("Unknown tag [%c%c] for [%c%c].\n", tag->key[0],tag->key[1], hline->type[0],hline->type[1]);
                // return 0; // Even unknown tags are allowed - for forward compatibility with new attributes
            }
            // else - allow user defined tag
        }
        tags = tags->next;
    }

    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq 0xc459(%rip), %rsi      # 0x17840
callq 0xdb00
movl %eax, -0x24(%rbp)
cmpl $-0x1, -0x24(%rbp)
jne 0xb41e
movq -0x10(%rbp), %rax
movsbl (%rax), %esi
movq -0x10(%rbp), %rax
movsbl 0x1(%rax), %edx
leaq 0x73ee(%rip), %rdi      # 0x127f9
movb $0x0, %al
callq 0xb9c0
movl $0x0, -0x4(%rbp)
jmp 0xb5e2
movl $0x0, -0x28(%rbp)
movslq -0x24(%rbp), %rdx
xorl %eax, %eax
leaq 0xc46e(%rip), %rcx      # 0x178a0
cmpq $0x0, (%rcx,%rdx,8)
movb %al, -0x29(%rbp)
je 0xb45a
movslq -0x24(%rbp), %rcx
leaq 0xc459(%rip), %rax      # 0x178a0
movq (%rax,%rcx,8), %rax
movslq -0x28(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
setne %al
movb %al, -0x29(%rbp)
movb -0x29(%rbp), %al
testb $0x1, %al
jne 0xb466
jmp 0xb4f9
movq -0x10(%rbp), %rdi
movslq -0x24(%rbp), %rcx
leaq 0xc42b(%rip), %rax      # 0x178a0
movq (%rax,%rcx,8), %rax
movslq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0xb7d0
cmpq $0x0, %rax
jne 0xb4eb
movslq -0x24(%rbp), %rcx
leaq 0xc409(%rip), %rax      # 0x178a0
movq (%rax,%rcx,8), %rax
movslq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %esi
movslq -0x24(%rbp), %rcx
leaq 0xc3ef(%rip), %rax      # 0x178a0
movq (%rax,%rcx,8), %rax
movslq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl 0x1(%rax), %edx
movq -0x10(%rbp), %rax
movsbl (%rax), %ecx
movq -0x10(%rbp), %rax
movsbl 0x1(%rax), %r8d
leaq 0x7342(%rip), %rdi      # 0x1281a
movb $0x0, %al
callq 0xb9c0
movl $0x0, -0x4(%rbp)
jmp 0xb5e2
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0xb425
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0xb5db
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movslq -0x24(%rbp), %rcx
leaq 0xc375(%rip), %rax      # 0x178a0
movq (%rax,%rcx,8), %rsi
callq 0xdb00
cmpl $0x0, %eax
jne 0xb5ca
movq -0x20(%rbp), %rdi
movslq -0x24(%rbp), %rcx
leaq 0xc324(%rip), %rax      # 0x17870
movq (%rax,%rcx,8), %rsi
callq 0xdb00
cmpl $0x0, %eax
jne 0xb5ca
callq 0x3440
movq (%rax), %rax
movq -0x20(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x200, %eax            # imm = 0x200
cmpl $0x0, %eax
jne 0xb5c8
callq 0x3440
movq (%rax), %rax
movq -0x20(%rbp), %rcx
movsbl 0x1(%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x200, %eax            # imm = 0x200
cmpl $0x0, %eax
jne 0xb5c8
movq -0x20(%rbp), %rax
movsbl (%rax), %esi
movq -0x20(%rbp), %rax
movsbl 0x1(%rax), %edx
movq -0x10(%rbp), %rax
movsbl (%rax), %ecx
movq -0x10(%rbp), %rax
movsbl 0x1(%rax), %r8d
leaq 0x728a(%rip), %rdi      # 0x1284b
movb $0x0, %al
callq 0xb9c0
jmp 0xb5ca
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0xb505
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)