// File: /workspace/github_cpp_makefile_star2_O1/statgen[P]statgen/lib/samtools-0.1.7a-hybrid/sam_header.c
// Function: sam_header_parse2
void *sam_header_parse2(const char *headerText)
{
    list_t *hlines = NULL;
    HeaderLine *hline;
    const char *text;
    char *buf=NULL;
    size_t nbuf = 0;

    if ( !headerText )
		return 0;

    text = headerText;
    while ( (text=nextline(&buf, &nbuf, text)) )
    {
        hline = sam_header_line_parse(buf);
        if ( hline && sam_header_line_validate(hline) )
            hlines = list_append(hlines, hline);
        else
        {
			if (hline) sam_header_line_free(hline);
			sam_header_free(hlines);
            if ( buf ) free(buf);
            return NULL;
        }
    }
    if ( buf ) free(buf);

    return hlines;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
testq %rdi, %rdi
je 0x200f6
movq %rdi, %rsi
leaq 0x10378(%rip), %rbx     # 0x30010
movabsq $0x100000000, %rcx      # imm = 0x100000000
movl $0x2401, %edx           # imm = 0x2401
xorl %r15d, %r15d
xorl %r8d, %r8d
xorl %r13d, %r13d
cmpb $0x0, (%rsi)
movq %r13, 0x10(%rsp)
je 0x1fcfa
movq %r15, %rdi
movl $0x1, %ebp
xorl %r12d, %r12d
movq %rsi, %r15
movzbl (%r15), %eax
cmpl $0xd, %eax
ja 0x1fcd6
btl %eax, %edx
jb 0x1fce0
incq %r15
addq %rcx, %r12
incl %ebp
jmp 0x1fcc8
cmpl $0xa, %eax
je 0x1fcfe
cmpl $0xd, %eax
jne 0x1fd01
xorl %eax, %eax
cmpb $0xa, 0x1(%r15)
sete %al
leaq (%r15,%rax,2), %r15
jmp 0x1fd01
xorl %esi, %esi
jmp 0x1fd6c
incq %r15
testl %ebp, %ebp
je 0x1fd1f
movslq %ebp, %r14
testq %rdi, %rdi
je 0x1fd27
cmpq %r14, %r8
jae 0x1fd3a
movq %rsi, %r13
movq %r14, %rsi
callq 0x3610
jmp 0x1fd32
movq %r15, %rsi
movq %rdi, %r15
jmp 0x1fd6c
movq %r14, %rdi
movq %rsi, %r13
callq 0x31d0
movq %r13, %rsi
movq %rax, %r13
jmp 0x1fd40
movq %r8, %r14
movq %rdi, %r13
testq %r13, %r13
je 0x200de
movslq %ebp, %rdx
movq %r13, %rdi
callq 0x3680
sarq $0x20, %r12
movb $0x0, (%r13,%r12)
movq %r14, %r8
movq %r15, %rsi
movq %r13, %r15
movq 0x10(%rsp), %r13
testq %rsi, %rsi
je 0x200fb
cmpb $0x40, (%r15)
movq %rsi, 0x20(%rsp)
movq %r8, 0x18(%rsp)
jne 0x200a2
leaq 0x1(%r15), %rcx
movq $-0x1, %rax
movq %r15, %r14
movzbl (%rcx), %edx
testl %edx, %edx
je 0x1fdae
cmpl $0x9, %edx
je 0x1fdae
incq %rcx
decq %rax
incq %r14
jmp 0x1fd97
cmpq $-0x3, %rax
jne 0x200ab
movl $0x10, %edi
callq 0x31d0
movq %rax, %r13
movb 0x1(%r15), %al
movb %al, (%r13)
movb 0x2(%r15), %cl
movb %cl, 0x1(%r13)
movq $0x0, 0x8(%r13)
movq 0x1022c(%rip), %rsi     # 0x30010
testq %rsi, %rsi
movq %r15, 0x8(%rsp)
je 0x1fe12
xorl %edx, %edx
cmpb %al, (%rsi)
jne 0x1fdf9
cmpb %cl, 0x1(%rsi)
je 0x1fe0d
movq 0x8(%rbx,%rdx,8), %rsi
incq %rdx
testq %rsi, %rsi
jne 0x1fdf0
movq $-0x1, %rdx
movslq %edx, %rbp
jmp 0x1fe19
movq $-0x1, %rbp
xorl %edx, %edx
movb 0x1(%r14), %al
incq %r14
decq %rdx
cmpb $0x9, %al
je 0x1fe1b
cmpq $-0x2, %rdx
jne 0x200be
testb %al, %al
je 0x1ff2e
movq %r14, %r12
movzbl (%r12), %eax
testl %eax, %eax
je 0x1fe51
cmpl $0x9, %eax
je 0x1fe51
incq %r12
jmp 0x1fe3e
leaq 0x10218(%rip), %rax     # 0x30070
cmpq $0x0, (%rax,%rbp,8)
jne 0x1fe71
leaq 0x101da(%rip), %rax     # 0x30040
cmpq $0x0, (%rax,%rbp,8)
je 0x1fefc
leaq 0x3(%r14), %rsi
leaq -0x1(%r12), %rdx
movq %r14, %rdi
callq 0x20d71
movq %rax, %r14
movq 0x8(%r13), %r15
movq %r15, %rax
testq %rax, %rax
je 0x1feb7
movq 0x8(%rax), %rsi
movb (%rsi), %dl
cmpb (%r14), %dl
jne 0x1feac
movb 0x1(%rsi), %dl
cmpb 0x1(%r14), %dl
jne 0x1feac
xorl %edx, %edx
movq %rsi, %rcx
jmp 0x1feb1
movq (%rax), %rax
movb $0x1, %dl
testb %dl, %dl
jne 0x1fe8c
jmp 0x1feb9
xorl %ecx, %ecx
testq %rcx, %rcx
jne 0x1ff10
movq %r15, %rdi
movq %r14, %rsi
callq 0x1fa62
movq %rax, 0x8(%r13)
xorl %edx, %edx
movzbl (%r12,%rdx), %eax
cmpl $0x9, %eax
jne 0x1fede
incq %rdx
jmp 0x1fecf
testl %eax, %eax
je 0x1ff2e
cmpq $0x1, %rdx
jne 0x200c0
addq %rdx, %r12
movq %r12, %r14
testb %al, %al
jne 0x1fe3b
jmp 0x1ff2e
leaq -0x1(%r12), %rdx
leaq 0x7e73(%rip), %rdi      # 0x27d7b
movq %r14, %rsi
jmp 0x1fe7d
movsbl (%r14), %esi
movsbl 0x1(%r14), %edx
leaq 0x7e5e(%rip), %rdi      # 0x27d7e
movq 0x8(%rsp), %rcx
xorl %eax, %eax
callq 0x4d75
jmp 0x1febe
movq 0x8(%rsp), %r15
testq %r13, %r13
je 0x20129
movq 0x100cd(%rip), %rsi     # 0x30010
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testq %rsi, %rsi
je 0x1ff72
movb (%r13), %dl
xorl %ecx, %ecx
cmpb %dl, (%rsi)
jne 0x1ff61
movb 0x1(%rsi), %sil
cmpb 0x1(%r13), %sil
je 0x1ff70
movq 0x8(%rbx,%rcx,8), %rsi
incq %rcx
testq %rsi, %rsi
jne 0x1ff53
jmp 0x1ff72
movl %ecx, %eax
cmpl $-0x1, %eax
je 0x20150
cltq
leaq 0x100ec(%rip), %rcx     # 0x30070
movq (%rcx,%rax,8), %rcx
testq %rcx, %rcx
je 0x1ffe7
movq (%rcx), %rdx
testq %rdx, %rdx
je 0x1ffe7
movq 0x8(%r13), %rsi
xorl %edi, %edi
movq %rsi, %r8
testq %r8, %r8
je 0x1ffce
movq 0x8(%r8), %r11
movb (%r11), %r10b
cmpb (%rdx), %r10b
jne 0x1ffc1
movb 0x1(%r11), %r10b
cmpb 0x1(%rdx), %r10b
jne 0x1ffc1
xorl %r10d, %r10d
movq %r11, %r9
jmp 0x1ffc7
movq (%r8), %r8
movb $0x1, %r10b
testb %r10b, %r10b
jne 0x1ff9e
jmp 0x1ffd1
xorl %r9d, %r9d
testq %r9, %r9
je 0x20102
movq 0x8(%rcx,%rdi,8), %rdx
incq %rdi
testq %rdx, %rdx
jne 0x1ff9b
movq 0x8(%r13), %rdi
testq %rdi, %rdi
je 0x20074
testq %rcx, %rcx
je 0x20030
movq (%rcx), %r8
testq %r8, %r8
je 0x20030
movq 0x8(%rdi), %r9
movsbl (%r9), %esi
xorl %r10d, %r10d
cmpb %sil, (%r8)
jne 0x2001c
movsbl 0x1(%r9), %edx
cmpb %dl, 0x1(%r8)
je 0x2002b
movq 0x8(%rcx,%r10,8), %r8
incq %r10
testq %r8, %r8
jne 0x2000c
jmp 0x20030
testq %r10, %r10
je 0x20035
movq (%rdi), %rdi
jmp 0x1ffeb
leaq 0x10004(%rip), %r8      # 0x30040
movq (%r8,%rax,8), %r8
testq %r8, %r8
je 0x20030
movq (%r8), %r9
testq %r9, %r9
je 0x20030
xorl %r10d, %r10d
cmpb %sil, (%r9)
jne 0x2005b
cmpb %dl, 0x1(%r9)
je 0x2006a
movq 0x8(%r8,%r10,8), %r9
incq %r10
testq %r9, %r9
jne 0x20050
jmp 0x20030
testq %r10, %r10
jne 0x20030
jmp 0x2016a
movq 0x10(%rsp), %rdi
movq %r13, %rsi
callq 0x1fa62
movq %rax, %r13
movabsq $0x100000000, %rcx      # imm = 0x100000000
movl $0x2401, %edx           # imm = 0x2401
movq 0x20(%rsp), %rsi
movq 0x18(%rsp), %r8
jmp 0x1fcb0
leaq 0x7c37(%rip), %rdi      # 0x27ce0
jmp 0x200b2
leaq 0x7c5e(%rip), %rdi      # 0x27d10
movq %r15, %rsi
xorl %eax, %eax
callq 0x4d75
jmp 0x200d6
notl %edx
leaq 0x7c7b(%rip), %rdi      # 0x27d42
movq 0x8(%rsp), %r15
movq %r15, %rsi
xorl %eax, %eax
callq 0x4d75
xorl %r13d, %r13d
jmp 0x1ff33
leaq 0x7bda(%rip), %rdi      # 0x27cbf
xorl %eax, %eax
callq 0x4d75
movq %r14, %r8
xorl %esi, %esi
jmp 0x1fd64
xorl %r13d, %r13d
jmp 0x2013e
testq %r15, %r15
jne 0x20136
jmp 0x2013e
movsbl (%rdx), %esi
movsbl 0x1(%rdx), %edx
movsbl (%r13), %ecx
movsbl 0x1(%r13), %r8d
leaq 0x7cbb(%rip), %rdi      # 0x27dd5
xorl %eax, %eax
callq 0x4d75
movq %r13, %rdi
callq 0x1f9d3
movq 0x10(%rsp), %rdi
callq 0x1f998
xorl %r13d, %r13d
movq %r15, %rdi
callq 0x32c0
movq %r13, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movsbl (%r13), %esi
movsbl 0x1(%r13), %edx
leaq 0x7c53(%rip), %rdi      # 0x27db4
xorl %eax, %eax
callq 0x4d75
jmp 0x20121
movsbl (%r13), %ecx
movsbl 0x1(%r13), %r8d
leaq 0x7c8b(%rip), %rdi      # 0x27e06
jmp 0x2011a