// File: /workspace/github_cpp_makefile_star2_O3/statgen[P]statgen/lib/samtools-0.1.7a-hybrid/sam_header.c
// Function: sam_header2tbl
void *sam_header2tbl(const void *_dict, char type[2], char key_tag[2], char value_tag[2])
{
	const HeaderDict *dict = (const HeaderDict*)_dict;
    const list_t *l   = dict;
    khash_t(str) *tbl = kh_init(str);
    khiter_t k;
    int ret;

	if (_dict == 0) return tbl; // return an empty (not null) hash table
    while (l)
    {
        HeaderLine *hline = l->data;
        if ( hline->type[0]!=type[0] || hline->type[1]!=type[1] ) 
        {
            l = l->next;
            continue;
        }
        
        HeaderTag *key, *value;
        key   = header_line_has_tag(hline,key_tag);
        value = header_line_has_tag(hline,value_tag); 
        if ( !key || !value )
        {
            l = l->next;
            continue;
        }
        
        k = kh_get(str, tbl, key->value);
        if ( k != kh_end(tbl) )
            debug("[sam_header_lookup_table] They key %s not unique.\n", key->value);
        k = kh_put(str, tbl, key->value, &ret);
        kh_value(tbl, k) = value->value;

        l = l->next;
    }
    return tbl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r12
movl $0x1, %edi
movl $0x28, %esi
callq 0x3530
movq %rax, 0x10(%rsp)
testq %r12, %r12
je 0x2033f
movq %r12, %r9
movq %rbx, %r8
xorl %r10d, %r10d
movq $0x0, 0x8(%rsp)
xorl %r13d, %r13d
xorl %r12d, %r12d
movq $0x0, 0x40(%rsp)
xorl %ebp, %ebp
movl $0x0, 0x34(%rsp)
movq $0x0, 0x60(%rsp)
xorl %edi, %edi
movq %r14, 0x28(%rsp)
movq %r15, 0x70(%rsp)
movq %rbx, 0x48(%rsp)
movq 0x8(%r9), %rax
movb (%rax), %cl
cmpb (%r8), %cl
jne 0x1fd4b
movb 0x1(%rax), %cl
cmpb 0x1(%r8), %cl
jne 0x1fd4b
movq 0x8(%rax), %rax
testq %rax, %rax
je 0x1fd4b
movb (%r15), %cl
movq %rax, %rdx
movq 0x8(%rdx), %rbx
cmpb %cl, (%rbx)
jne 0x1fd23
movb 0x1(%rbx), %sil
cmpb 0x1(%r15), %sil
je 0x1fd2d
movq (%rdx), %rdx
testq %rdx, %rdx
jne 0x1fd11
xorl %ebx, %ebx
movb (%r14), %cl
movq 0x8(%rax), %r11
cmpb %cl, (%r11)
jne 0x1fd43
movb 0x1(%r11), %dl
cmpb 0x1(%r14), %dl
je 0x1fd62
movq (%rax), %rax
testq %rax, %rax
jne 0x1fd30
movl %r12d, %ebx
movl %ebp, %eax
movq (%r9), %r9
movl %ebx, %r12d
movl %eax, %ebp
testq %r9, %r9
jne 0x1fcee
jmp 0x2033f
testq %rbx, %rbx
je 0x1fd4b
movq 0x8(%rbx), %rdx
testl %edi, %edi
movq %r9, 0x58(%rsp)
movq %r11, 0x50(%rsp)
movq %rdi, 0x20(%rsp)
movq %rdx, 0x18(%rsp)
movl %ebp, 0x30(%rsp)
je 0x1fdb0
movsbl (%rdx), %ecx
testl %ecx, %ecx
je 0x1fdb7
movb 0x1(%rdx), %al
testb %al, %al
je 0x1fdb9
addq $0x2, %rdx
movl %ecx, %esi
shll $0x5, %esi
subl %ecx, %esi
movsbl %al, %ecx
addl %esi, %ecx
movb (%rdx), %al
incq %rdx
testb %al, %al
jne 0x1fd99
jmp 0x1fdb9
xorl %ebp, %ebp
jmp 0x1fe7c
xorl %ecx, %ecx
movl %ecx, %eax
xorl %edx, %edx
divl %edi
movl %edx, %r8d
leal -0x1(%rdi), %esi
movl %ecx, %eax
xorl %edx, %edx
divl %esi
incl %edx
movl %r8d, %ebp
movl %r8d, 0x38(%rsp)
movl %edx, 0x6c(%rsp)
movl %ebp, %eax
shrl $0x4, %eax
movq 0x60(%rsp), %rcx
movl (%rcx,%rax,4), %r15d
leal (,%rbp,2), %r14d
andl $0x1e, %r14d
movl %r15d, %eax
movl %r14d, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x1fe5b
testb $0x1, %al
jne 0x1fe2d
movl %ebp, %eax
movq 0x8(%rsp), %rcx
movq (%rcx,%rax,8), %rdi
movq 0x18(%rsp), %rsi
callq 0x34e0
movl 0x6c(%rsp), %edx
movl 0x38(%rsp), %r8d
movq 0x20(%rsp), %rdi
xorl %r10d, %r10d
testl %eax, %eax
je 0x1fe5b
addl %edx, %ebp
cmpl %edi, %ebp
movl %edi, %eax
cmovbl %r10d, %eax
subl %eax, %ebp
cmpl %r8d, %ebp
jne 0x1fdd9
movq 0x28(%rsp), %r14
movq 0x48(%rsp), %r8
movq 0x58(%rsp), %r9
leaq 0x710c(%rip), %r15      # 0x26f60
movq 0x50(%rsp), %r11
jmp 0x1fe8b
movl %r14d, %ecx
shrl %cl, %r15d
testb $0x3, %r15b
cmovnel %edi, %ebp
movq 0x28(%rsp), %r14
movq 0x48(%rsp), %r8
movq 0x58(%rsp), %r9
movq 0x50(%rsp), %r11
cmpl %edi, %ebp
leaq 0x70db(%rip), %r15      # 0x26f60
jne 0x20307
movl 0x30(%rsp), %esi
cmpl %esi, 0x34(%rsp)
jb 0x1ff57
movq 0x40(%rsp), %rax
addl %eax, %eax
cmpl %edi, %eax
movl $0x0, %eax
sbbl %eax, %eax
orl $0x1, %eax
addl %edi, %eax
movl $0x21, %ecx
leal -0x2(%rcx), %edx
decl %ecx
cmpl %eax, (%r15,%rdx,4)
ja 0x1feb3
movl %ecx, %eax
movl (%r15,%rax,4), %ebx
cvtsi2sd %rbx, %xmm0
mulsd 0x36ff(%rip), %xmm0     # 0x235d0
addsd 0x361f(%rip), %xmm0     # 0x234f8
cvttsd2si %xmm0, %rax
cmpl %eax, 0x40(%rsp)
jae 0x1ff57
movq %rax, 0x38(%rsp)
movl %ebx, %eax
shrl $0x4, %eax
leaq 0x4(,%rax,4), %r14
movq %r14, %rdi
callq 0x31d0
movq %rax, %r13
movq %rax, %rdi
movl $0xaa, %esi
movq %r14, %rdx
callq 0x3060
movq 0x20(%rsp), %rdx
cmpl %ebx, %edx
jae 0x1ff66
leaq (,%rbx,8), %r14
movq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x3610
movq 0x10(%rsp), %r15
movq %rax, 0x8(%rsp)
movq %rax, 0x18(%r15)
movq 0x20(%r15), %rdi
movq %r14, %rsi
callq 0x3610
movq 0x20(%rsp), %rdx
movq %r15, %rcx
movq %rax, 0x20(%r15)
jmp 0x1ff6b
movl %r12d, %ebx
movl %esi, %eax
movq %rax, 0x38(%rsp)
jmp 0x20132
movq 0x10(%rsp), %rcx
testl %edx, %edx
movq 0x28(%rsp), %r14
je 0x200f7
leal -0x1(%rbx), %edi
movq 0x10(%rcx), %r8
movl %edx, %r9d
xorl %r10d, %r10d
movl %r10d, %eax
shrl $0x4, %eax
movl (%r8,%rax,4), %edx
leal (%r10,%r10), %ecx
andl $0x1e, %ecx
movl %edx, %esi
shrl %cl, %esi
testb $0x3, %sil
jne 0x200a3
movq 0x8(%rsp), %rsi
movq (%rsi,%r10,8), %r14
movq 0x10(%rsp), %rsi
movq 0x20(%rsi), %r11
movq (%r11,%r10,8), %r15
btsl %ecx, %edx
movl %edx, (%r8,%rax,4)
movsbl (%r14), %ecx
testl %ecx, %ecx
je 0x1ffec
movb 0x1(%r14), %al
testb %al, %al
je 0x1ffee
leaq 0x2(%r14), %rdx
movl %ecx, %esi
shll $0x5, %esi
subl %ecx, %esi
movsbl %al, %ecx
addl %esi, %ecx
movb (%rdx), %al
incq %rdx
testb %al, %al
jne 0x1ffd5
jmp 0x1ffee
xorl %ecx, %ecx
movl %ecx, %eax
xorl %edx, %edx
divl %ebx
movl %edx, %esi
movl %ecx, %eax
xorl %edx, %edx
divl %edi
movl %esi, %eax
movl %esi, %ecx
addl %esi, %ecx
andl $0x1e, %ecx
movl $0x2, %r12d
shll %cl, %r12d
shrl $0x4, %eax
movl (%r13,%rax,4), %ebp
testl %ebp, %r12d
jne 0x20047
incl %edx
addl %edx, %esi
xorl %eax, %eax
cmpl %ebx, %esi
jb 0x20027
movl %ebx, %eax
subl %eax, %esi
movl %esi, %eax
shrl $0x4, %eax
movl (%r13,%rax,4), %ebp
leal (%rsi,%rsi), %ecx
andl $0x1e, %ecx
movl $0x2, %r12d
shll %cl, %r12d
testl %ebp, %r12d
je 0x2001d
notl %r12d
andl %ebp, %r12d
movl %r12d, (%r13,%rax,4)
movl %esi, %edx
cmpl 0x20(%rsp), %esi
jae 0x20091
movl (%r8,%rax,4), %esi
movl %esi, %ebp
shrl %cl, %ebp
testb $0x3, %bpl
jne 0x20091
movq 0x8(%rsp), %rbp
movq (%rbp,%rdx,8), %r12
movq %r14, (%rbp,%rdx,8)
movq (%r11,%rdx,8), %rbp
movq %r15, (%r11,%rdx,8)
btsl %ecx, %esi
movl %esi, (%r8,%rax,4)
movq %r12, %r14
movq %rbp, %r15
jmp 0x1ffc1
movq 0x8(%rsp), %rax
movq %r14, (%rax,%rdx,8)
movq %r15, (%r11,%rdx,8)
movq 0x28(%rsp), %r14
incq %r10
cmpq %r9, %r10
jne 0x1ff85
cmpl %ebx, 0x20(%rsp)
jbe 0x200f2
leaq (,%rbx,8), %r14
movq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x3610
movq 0x10(%rsp), %r15
movq %rax, 0x8(%rsp)
movq %rax, 0x18(%r15)
movq 0x20(%r15), %rdi
movq %r14, %rsi
movq 0x28(%rsp), %r14
callq 0x3610
movq %r15, %rcx
movq %rax, 0x20(%r15)
jmp 0x200f7
movq 0x10(%rsp), %rcx
movq 0x10(%rcx), %rdi
movq %rcx, %r15
callq 0x32c0
movq %r13, 0x10(%r15)
movl %ebx, (%r15)
movq 0x40(%rsp), %rax
movl %eax, 0x8(%r15)
movq 0x38(%rsp), %rcx
movl %ecx, 0xc(%r15)
movl %eax, 0x34(%rsp)
movq 0x48(%rsp), %r8
movq 0x58(%rsp), %r9
xorl %r10d, %r10d
movq 0x50(%rsp), %r11
movq 0x18(%rsp), %rcx
movsbl (%rcx), %esi
testl %esi, %esi
je 0x20160
movb 0x1(%rcx), %al
testb %al, %al
je 0x20162
addq $0x2, %rcx
movl %esi, %edx
shll $0x5, %edx
subl %esi, %edx
movsbl %al, %esi
addl %edx, %esi
movb (%rcx), %al
incq %rcx
testb %al, %al
jne 0x20149
jmp 0x20162
xorl %esi, %esi
movl %esi, %eax
xorl %edx, %edx
divl %ebx
movl %edx, %edi
movl %edx, %eax
shrl $0x4, %eax
movl (%r13,%rax,4), %eax
leal (%rdi,%rdi), %ecx
shrl %cl, %eax
testb $0x2, %al
je 0x20185
movl %edi, %r15d
jmp 0x20246
leal -0x1(%rbx), %ecx
movl %esi, %eax
xorl %edx, %edx
divl %ecx
incl %edx
movl %edi, %r12d
movl %ebx, %r15d
movq %rdi, 0x20(%rsp)
movl %edx, 0x60(%rsp)
movl %r12d, %eax
shrl $0x4, %eax
movl (%r13,%rax,4), %ebp
leal (%r12,%r12), %r14d
andl $0x1e, %r14d
movl %ebp, %eax
movl %r14d, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x20222
testb $0x1, %al
jne 0x201f6
movl %r12d, %eax
movq 0x8(%rsp), %rcx
movq (%rcx,%rax,8), %rdi
movq 0x18(%rsp), %rsi
callq 0x34e0
movl 0x60(%rsp), %edx
movq 0x20(%rsp), %rdi
movq 0x50(%rsp), %r11
xorl %r10d, %r10d
movq 0x58(%rsp), %r9
movq 0x48(%rsp), %r8
testl %eax, %eax
je 0x20222
btl %r14d, %ebp
cmovbl %r12d, %r15d
addl %edx, %r12d
cmpl %ebx, %r12d
movl %ebx, %eax
cmovbl %r10d, %eax
subl %eax, %r12d
cmpl %edi, %r12d
jne 0x2019f
movb $0x1, %al
movl %ebx, %ecx
cmpl %ebx, %r15d
movq 0x28(%rsp), %r14
je 0x20239
jmp 0x20246
movl %r14d, %ecx
shrl %cl, %ebp
testb $0x2, %bpl
sete %al
movl %r15d, %ecx
movl %r12d, %edi
movq 0x28(%rsp), %r14
cmpl %ebx, %ecx
cmovel %edi, %ecx
testb %al, %al
cmovnel %edi, %ecx
movl %ecx, %r15d
movl %r15d, %edx
shrl $0x4, %edx
movl (%r13,%rdx,4), %esi
leal (%r15,%r15), %ecx
andl $0x1e, %ecx
movl %esi, %edi
shrl %cl, %edi
movl %r15d, %eax
testb $0x2, %dil
jne 0x20277
testb $0x1, %dil
movq 0x70(%rsp), %r15
jne 0x202ba
movq 0x10(%rsp), %rdx
jmp 0x202ea
movq 0x8(%rsp), %rdi
movq 0x18(%rsp), %r15
movq %r15, (%rdi,%rax,8)
movl $0x3, %edi
shll %cl, %edi
notl %edi
andl %edi, %esi
movl %esi, (%r13,%rdx,4)
movq 0x10(%rsp), %rdx
movl 0x4(%rdx), %esi
movl 0x8(%rdx), %edi
incl %esi
movq %rsi, 0x40(%rsp)
movl %esi, 0x4(%rdx)
incl %edi
movl %edi, 0x34(%rsp)
movl %edi, 0x8(%rdx)
movq 0x70(%rsp), %r15
jmp 0x202ea
movl $0x3, %edi
shll %cl, %edi
movq 0x8(%rsp), %rcx
movq 0x18(%rsp), %r12
movq %r12, (%rcx,%rax,8)
notl %edi
andl %edi, %esi
movl %esi, (%r13,%rdx,4)
movq 0x10(%rsp), %rdx
movl 0x4(%rdx), %esi
incl %esi
movq %rsi, 0x40(%rsp)
movl %esi, 0x4(%rdx)
movq 0x8(%r11), %rcx
movq 0x20(%rdx), %rdx
movq %rcx, (%rdx,%rax,8)
movq %r13, 0x60(%rsp)
movl %ebx, %edi
movq 0x38(%rsp), %rax
jmp 0x1fd50
leaq 0x6a50(%rip), %rdi      # 0x26d5e
movq 0x18(%rsp), %rsi
xorl %eax, %eax
callq 0x501c
movq 0x20(%rsp), %rdi
movq 0x50(%rsp), %r11
xorl %r10d, %r10d
movq 0x58(%rsp), %r9
movq 0x48(%rsp), %r8
movq 0x8(%rbx), %rax
movq %rax, 0x18(%rsp)
jmp 0x1fe8b
movq 0x10(%rsp), %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq