// File: /workspace/github_c_makefile_star2_O3/xiongxu[P]bam2bedGraph2/samtools-0.1.19/misc/bamcheck.c
// Function: init_group_id
void init_group_id(stats_t *stats, char *id)
{
    if ( !stats->sam->header->dict )
        stats->sam->header->dict = sam_header_parse2(stats->sam->header->text);
    void *iter = stats->sam->header->dict;
    const char *key, *val;
    int n = 0;
    stats->rg_hash = kh_init(kh_rg);
    while ( (iter = sam_header2key_val(iter, "RG","ID","SM", &key, &val)) )
    {
        if ( !strcmp(id,key) || (val && !strcmp(id,val)) )
        {
            khiter_t k = kh_get(kh_rg, stats->rg_hash, key);
            if ( k != kh_end(stats->rg_hash) ) 
                fprintf(stderr, "[init_group_id] The group ID not unique: \"%s\"\n", key);
            int ret;
            k = kh_put(kh_rg, stats->rg_hash, key, &ret);
            kh_value(stats->rg_hash, k) = val;
            n++;
        }
    }
    if ( !n )
        error("The sample or read group \"%s\" not present.\n", id);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %r12
movq %rdi, %rbx
movq 0x1c8(%rdi), %rax
movq 0x10(%rax), %rax
movq 0x18(%rax), %r14
testq %r14, %r14
jne 0x79b1
movq 0x38(%rax), %rdi
callq 0x162ec
movq %rax, %r14
movq 0x1c8(%rbx), %rax
movq 0x10(%rax), %rax
movq %r14, 0x18(%rax)
movl $0x1, %edi
movl $0x28, %esi
callq 0x32e0
movq %rax, 0x1d0(%rbx)
leaq 0x12ca1(%rip), %rsi     # 0x1a66f
leaq 0x133c0(%rip), %rdx     # 0x1ad95
leaq 0x133bc(%rip), %rcx     # 0x1ad98
leaq 0x38(%rsp), %r8
leaq 0x30(%rsp), %r9
movq %r14, %rdi
callq 0x16e09
testq %rax, %rax
je 0x7ff2
movq %rax, %r14
leaq 0x126af(%rip), %rbp     # 0x1a0b0
movl $0x0, 0xc(%rsp)
movq %r12, 0x20(%rsp)
movq %rbx, 0x40(%rsp)
movq 0x38(%rsp), %rsi
movq %r12, %rdi
movq %rsi, 0x10(%rsp)
callq 0x3300
testl %eax, %eax
je 0x7a47
movq 0x30(%rsp), %rsi
testq %rsi, %rsi
je 0x7f74
movq %r12, %rdi
callq 0x3300
testl %eax, %eax
jne 0x7f74
movq 0x1d0(%rbx), %rbx
movl (%rbx), %edi
testl %edi, %edi
movq %r14, 0x48(%rsp)
je 0x7a89
movq 0x10(%rsp), %r8
movsbl (%r8), %ecx
testl %ecx, %ecx
je 0x7a96
movb 0x1(%r8), %al
testb %al, %al
je 0x7a98
leaq 0x2(%r8), %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 0x7a72
jmp 0x7a98
xorl %r15d, %r15d
movq 0x10(%rsp), %r8
jmp 0x7b4e
xorl %ecx, %ecx
movl %ecx, %eax
xorl %edx, %edx
divl %edi
movl %edx, %ebp
leal -0x1(%rdi), %esi
movl %ecx, %eax
xorl %edx, %edx
divl %esi
incl %edx
movq 0x10(%rbx), %rsi
movl %ebp, %r15d
movq %rdi, 0x18(%rsp)
movq %rsi, 0x28(%rsp)
movl %r15d, %eax
shrl $0x4, %eax
movl (%rsi,%rax,4), %r13d
leal (%r15,%r15), %r14d
andl $0x1e, %r14d
movl %r13d, %eax
movl %r14d, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x7b34
testb $0x1, %al
jne 0x7b0e
movq 0x18(%rbx), %rax
movl %r15d, %ecx
movq (%rax,%rcx,8), %rdi
movq %r8, %rsi
movq %rbx, %r12
movl %edx, %ebx
callq 0x3300
movq 0x28(%rsp), %rsi
movl %ebx, %edx
movq %r12, %rbx
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %r8
testl %eax, %eax
je 0x7b34
addl %edx, %r15d
cmpl %edi, %r15d
movl %edi, %eax
movl $0x0, %ecx
cmovbl %ecx, %eax
subl %eax, %r15d
cmpl %ebp, %r15d
jne 0x7abc
movq 0x20(%rsp), %r12
leaq 0x1257e(%rip), %rbp     # 0x1a0b0
jmp 0x7b57
movl %r14d, %ecx
shrl %cl, %r13d
testb $0x3, %r13b
cmovnel %edi, %r15d
movq 0x20(%rsp), %r12
leaq 0x12562(%rip), %rbp     # 0x1a0b0
cmpl %edi, %r15d
jne 0x7fa9
movl 0x8(%rbx), %eax
cmpl 0xc(%rbx), %eax
jb 0x7da6
movl 0x4(%rbx), %eax
leal (%rax,%rax), %ecx
cmpl %edi, %ecx
movl $0x0, %ecx
sbbl %ecx, %ecx
orl $0x1, %ecx
addl %edi, %ecx
movl $0x21, %edx
leal -0x2(%rdx), %esi
decl %edx
cmpl %ecx, (%rbp,%rsi,4)
ja 0x7b7c
movl %edx, %ecx
movl (%rbp,%rcx,4), %ebp
xorps %xmm0, %xmm0
cvtsi2sd %rbp, %xmm0
mulsd 0x126a3(%rip), %xmm0    # 0x1a240
addsd 0x1267b(%rip), %xmm0    # 0x1a220
cvttsd2si %xmm0, %rcx
cmpl %ecx, %eax
jae 0x7da6
movq %rcx, 0x18(%rsp)
movq %r8, 0x10(%rsp)
movl %ebp, %eax
shrl $0x4, %eax
leaq 0x4(,%rax,4), %r14
movq %r14, %rdi
callq 0x33e0
movq %rax, %r13
movq %rax, %rdi
movl $0xaa, %esi
movq %r14, %rdx
callq 0x3260
movl (%rbx), %edx
cmpl %ebp, %edx
jae 0x7c14
movq 0x18(%rbx), %rdi
leaq (,%rbp,8), %r14
movq %r14, %rsi
callq 0x3430
movq %rax, 0x18(%rbx)
movq 0x20(%rbx), %rdi
movq %r14, %rsi
callq 0x3430
movq %rax, 0x20(%rbx)
movl (%rbx), %edx
testl %edx, %edx
je 0x7d82
leal -0x1(%rbp), %edi
xorl %r8d, %r8d
movq 0x10(%rbx), %r9
movl %r8d, %eax
shrl $0x4, %eax
movl (%r9,%rax,4), %esi
leal (%r8,%r8), %ecx
andl $0x1e, %ecx
movl %esi, %r10d
shrl %cl, %r10d
testb $0x3, %r10b
jne 0x7d4a
movl %r8d, %edx
movq 0x18(%rbx), %r10
movq 0x20(%rbx), %r14
movq (%r10,%rdx,8), %r11
movq (%r14,%rdx,8), %r10
btsl %ecx, %esi
movl %esi, (%r9,%rax,4)
movsbl (%r11), %ecx
testl %ecx, %ecx
je 0x7c8c
movb 0x1(%r11), %al
testb %al, %al
je 0x7c8e
leaq 0x2(%r11), %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 0x7c75
jmp 0x7c8e
xorl %ecx, %ecx
movl %ecx, %eax
xorl %edx, %edx
divl %ebp
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, %r15d
shll %cl, %r15d
shrl $0x4, %eax
movl (%r13,%rax,4), %r14d
testl %r14d, %r15d
jne 0x7ce7
incl %edx
addl %edx, %esi
xorl %eax, %eax
cmpl %ebp, %esi
jb 0x7cc7
movl %ebp, %eax
subl %eax, %esi
movl %esi, %eax
shrl $0x4, %eax
movl (%r13,%rax,4), %r14d
leal (%rsi,%rsi), %ecx
andl $0x1e, %ecx
movl $0x2, %r15d
shll %cl, %r15d
testl %r14d, %r15d
je 0x7cbd
notl %r15d
andl %r14d, %r15d
movl %r15d, (%r13,%rax,4)
movl (%rbx), %edx
movl %esi, %r14d
cmpl %edx, %esi
jae 0x7d3a
movl (%r9,%rax,4), %r9d
shrl %cl, %r9d
movq 0x18(%rbx), %rsi
testb $0x3, %r9b
jne 0x7d3e
movq (%rsi,%r14,8), %rdx
movq %r11, (%rsi,%r14,8)
movq 0x20(%rbx), %rsi
movq (%rsi,%r14,8), %r15
movq %r10, (%rsi,%r14,8)
movl $0x1, %esi
shll %cl, %esi
movq 0x10(%rbx), %r9
orl %esi, (%r9,%rax,4)
movq %rdx, %r11
movq %r15, %r10
jmp 0x7c61
movq 0x18(%rbx), %rsi
movq %r11, (%rsi,%r14,8)
movq 0x20(%rbx), %rax
movq %r10, (%rax,%r14,8)
incl %r8d
cmpl %edx, %r8d
jne 0x7c22
cmpl %ebp, %edx
jbe 0x7d82
movq 0x18(%rbx), %rdi
leaq (,%rbp,8), %r14
movq %r14, %rsi
callq 0x3430
movq %rax, 0x18(%rbx)
movq 0x20(%rbx), %rdi
movq %r14, %rsi
callq 0x3430
movq %rax, 0x20(%rbx)
movq 0x10(%rbx), %rdi
callq 0x3060
movq %r13, 0x10(%rbx)
movl %ebp, (%rbx)
movl 0x4(%rbx), %eax
movl %eax, 0x8(%rbx)
movq 0x18(%rsp), %rax
movl %eax, 0xc(%rbx)
movl %ebp, %edi
movq 0x10(%rsp), %r8
movsbl (%r8), %esi
testl %esi, %esi
je 0x7dd1
movb 0x1(%r8), %al
testb %al, %al
je 0x7dd3
leaq 0x2(%r8), %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 0x7dba
jmp 0x7dd3
xorl %esi, %esi
movl %esi, %eax
xorl %edx, %edx
divl %edi
movl %edx, %r10d
movq 0x10(%rbx), %r9
movl %edx, %eax
shrl $0x4, %eax
movl (%r9,%rax,4), %eax
leal (%r10,%r10), %ecx
shrl %cl, %eax
testb $0x2, %al
je 0x7dfb
movl %r10d, %r13d
jmp 0x7ec6
leal -0x1(%rdi), %ecx
movl %esi, %eax
xorl %edx, %edx
divl %ecx
movl %edx, %ebp
incl %ebp
movl %r10d, %r15d
movl %edi, %r13d
movq %r8, 0x10(%rsp)
movq %rdi, 0x18(%rsp)
movq %r10, 0x28(%rsp)
movq %r9, 0x50(%rsp)
movl %r15d, %eax
shrl $0x4, %eax
movl (%r9,%rax,4), %r12d
leal (%r15,%r15), %r14d
andl $0x1e, %r14d
movl %r12d, %eax
movl %r14d, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x7e9f
testb $0x1, %al
jne 0x7e6f
movq 0x18(%rbx), %rax
movl %r15d, %ecx
movq (%rax,%rcx,8), %rdi
movq %r8, %rsi
callq 0x3300
movq 0x28(%rsp), %r10
movq 0x50(%rsp), %r9
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %r8
testl %eax, %eax
je 0x7e9f
btl %r14d, %r12d
cmovbl %r15d, %r13d
addl %ebp, %r15d
cmpl %edi, %r15d
movl %edi, %eax
movl $0x0, %ecx
cmovbl %ecx, %eax
subl %eax, %r15d
cmpl %r10d, %r15d
jne 0x7e22
movb $0x1, %al
movl %edi, %ecx
cmpl %edi, %r13d
movq 0x20(%rsp), %r12
je 0x7eb7
jmp 0x7ec6
movl %r14d, %ecx
shrl %cl, %r12d
testb $0x2, %r12b
sete %al
movl %r13d, %ecx
movl %r15d, %r10d
movq 0x20(%rsp), %r12
cmpl %edi, %ecx
cmovel %r10d, %ecx
testb %al, %al
cmovnel %r10d, %ecx
movl %ecx, %r13d
movl %r13d, %eax
shrl $0x4, %eax
movl (%r9,%rax,4), %edx
leal (,%r13,2), %ecx
andl $0x1e, %ecx
shrl %cl, %edx
testb $0x2, %dl
jne 0x7ef8
testb $0x1, %dl
movq 0x48(%rsp), %r14
leaq 0x121bf(%rip), %rbp     # 0x1a0b0
jne 0x7f33
movl %r13d, %edx
jmp 0x7f51
movq 0x18(%rbx), %rsi
movl %r13d, %edx
movq %r8, (%rsi,%rdx,8)
movl $0x3, %esi
shll %cl, %esi
notl %esi
movq 0x10(%rbx), %rcx
andl %esi, (%rcx,%rax,4)
movq 0x4(%rbx), %xmm0
psubd 0x122c0(%rip), %xmm0    # 0x1a1e0
movq %xmm0, 0x4(%rbx)
movq 0x48(%rsp), %r14
leaq 0x1217f(%rip), %rbp     # 0x1a0b0
jmp 0x7f51
movq 0x18(%rbx), %rsi
movl %r13d, %edx
movq %r8, (%rsi,%rdx,8)
movl $0x3, %esi
shll %cl, %esi
notl %esi
movq 0x10(%rbx), %rcx
andl %esi, (%rcx,%rax,4)
incl 0x4(%rbx)
movl 0xc(%rsp), %esi
movq 0x30(%rsp), %rax
movq 0x40(%rsp), %rbx
movq 0x1d0(%rbx), %rcx
movq 0x20(%rcx), %rcx
movq %rax, (%rcx,%rdx,8)
incl %esi
movl %esi, 0xc(%rsp)
movq %r14, %rdi
leaq 0x126f1(%rip), %rsi     # 0x1a66f
leaq 0x12e10(%rip), %rdx     # 0x1ad95
leaq 0x12e0c(%rip), %rcx     # 0x1ad98
leaq 0x38(%rsp), %r8
leaq 0x30(%rsp), %r9
callq 0x16e09
movq %rax, %r14
testq %rax, %rax
jne 0x7a13
jmp 0x7fdc
movq 0x1b048(%rip), %rax     # 0x22ff8
movq (%rax), %rdi
leaq 0x12de1(%rip), %rsi     # 0x1ad9b
movq %r8, %rdx
xorl %eax, %eax
callq 0x3320
movq 0x40(%rsp), %rax
movq 0x1d0(%rax), %rbx
movq 0x38(%rsp), %r8
movl (%rbx), %edi
jmp 0x7b57
cmpl $0x0, 0xc(%rsp)
je 0x7ff2
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x12dd1(%rip), %rdi     # 0x1adca
movq %r12, %rsi
xorl %eax, %eax
callq 0x4926