// File: /workspace/github_c_makefile_star2_O1/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, %r14
movq %rdi, %rbx
movq 0x1c8(%rdi), %rax
movq 0x10(%rax), %rax
cmpq $0x0, 0x18(%rax)
jne 0x7671
movq 0x38(%rax), %rdi
callq 0x15ce3
movq 0x1c8(%rbx), %rcx
movq 0x10(%rcx), %rcx
movq %rax, 0x18(%rcx)
movq 0x1c8(%rbx), %rax
movq 0x10(%rax), %rax
movq %rbx, %r15
movq 0x18(%rax), %rbx
movl $0x1, %edi
movl $0x28, %esi
callq 0x32e0
movq %r15, 0x20(%rsp)
movq %rax, 0x1d0(%r15)
leaq 0x11f1a(%rip), %rsi     # 0x195bf
leaq 0x12639(%rip), %rdx     # 0x19ce5
leaq 0x12635(%rip), %rcx     # 0x19ce8
leaq 0x38(%rsp), %r8
leaq 0x30(%rsp), %r9
movq %rbx, %rdi
callq 0x16581
testq %rax, %rax
je 0x7a69
movq %rax, %r15
movl $0x0, 0x1c(%rsp)
movq 0x20(%rsp), %rbx
movq %r14, 0x48(%rsp)
movq 0x38(%rsp), %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0x3300
testl %eax, %eax
je 0x7715
movq 0x30(%rsp), %rsi
testq %rsi, %rsi
je 0x79fe
movq %r14, %rdi
callq 0x3300
testl %eax, %eax
jne 0x79fe
movq %r15, 0x50(%rsp)
movq 0x1d0(%rbx), %rax
movq %rax, 0x8(%rsp)
movl (%rax), %r8d
testl %r8d, %r8d
je 0x7761
movsbl (%r12), %ecx
testl %ecx, %ecx
movq %r12, 0x10(%rsp)
je 0x7769
movb 0x1(%r12), %al
testb %al, %al
je 0x776b
leaq 0x2(%r12), %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 0x774a
jmp 0x776b
xorl %r14d, %r14d
jmp 0x7811
xorl %ecx, %ecx
movl %ecx, %eax
xorl %edx, %edx
divl %r8d
movl %edx, %edi
leal -0x1(%r8), %esi
movl %ecx, %eax
xorl %edx, %edx
divl %esi
movl %edx, %r15d
incl %r15d
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rbx
movl %edi, %r14d
movl %edi, 0x28(%rsp)
movl %r14d, %eax
shrl $0x4, %eax
movl (%rbx,%rax,4), %ebp
leal (%r14,%r14), %r13d
andl $0x1e, %r13d
movl %ebp, %eax
movl %r13d, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x77fa
testb $0x1, %al
jne 0x77dc
movq 0x8(%rsp), %rax
movq 0x18(%rax), %rax
movl %r14d, %ecx
movq (%rax,%rcx,8), %rdi
movq 0x10(%rsp), %rsi
movq %r8, %r12
callq 0x3300
movq %r12, %r8
movl 0x28(%rsp), %edi
testl %eax, %eax
je 0x77fa
addl %r15d, %r14d
cmpl %r8d, %r14d
movl %r8d, %eax
movl $0x0, %ecx
cmovbl %ecx, %eax
subl %eax, %r14d
cmpl %edi, %r14d
jne 0x7794
movl %r8d, %r14d
jmp 0x7807
movl %r13d, %ecx
shrl %cl, %ebp
testb $0x3, %bpl
cmovnel %r8d, %r14d
movq 0x20(%rsp), %rbx
movq 0x10(%rsp), %r12
cmpl %r8d, %r14d
jne 0x7a33
movq 0x1d0(%rbx), %rdi
movq 0x38(%rsp), %r8
movl 0x8(%rdi), %eax
cmpl 0xc(%rdi), %eax
movq %rdi, 0x8(%rsp)
jb 0x785d
movl (%rdi), %eax
movl 0x4(%rdi), %ecx
addl %ecx, %ecx
cmpl %eax, %ecx
movl $0x0, %esi
sbbl %esi, %esi
orl $0x1, %esi
addl %eax, %esi
movq 0x8(%rsp), %rdi
movq %r8, %r14
callq 0x8283
movq %r14, %r8
movq 0x8(%rsp), %rdi
movl (%rdi), %r13d
movsbl (%r8), %esi
testl %esi, %esi
je 0x788b
movb 0x1(%r8), %al
testb %al, %al
je 0x788d
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 0x7874
jmp 0x788d
xorl %esi, %esi
movl %esi, %eax
xorl %edx, %edx
divl %r13d
movl %edx, %r15d
movq 0x10(%rdi), %r10
movl %edx, %eax
shrl $0x4, %eax
movl (%r10,%rax,4), %eax
leal (%r15,%r15), %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x7975
leal -0x1(%r13), %ecx
movl %esi, %eax
xorl %edx, %edx
divl %ecx
incl %edx
movl %r15d, %ebp
movl %r13d, %r12d
movq %r10, 0x10(%rsp)
movq %r8, 0x28(%rsp)
movl %edx, 0x44(%rsp)
movl %ebp, %eax
shrl $0x4, %eax
movl (%r10,%rax,4), %ebx
leal (,%rbp,2), %r14d
andl $0x1e, %r14d
movl %ebx, %eax
movl %r14d, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x7943
testb $0x1, %al
jne 0x791f
movq 0x18(%rdi), %rax
movl %ebp, %ecx
movq (%rax,%rcx,8), %rdi
movq %r8, %rsi
callq 0x3300
movl 0x44(%rsp), %edx
movq 0x10(%rsp), %r10
movq 0x28(%rsp), %r8
movq 0x8(%rsp), %rdi
testl %eax, %eax
je 0x7943
btl %r14d, %ebx
cmovbl %ebp, %r12d
addl %edx, %ebp
cmpl %r13d, %ebp
movl %r13d, %eax
movl $0x0, %ecx
cmovbl %ecx, %eax
subl %eax, %ebp
movl %r12d, %eax
cmpl %r15d, %ebp
jne 0x78d2
jmp 0x7946
movl %r13d, %eax
movl %eax, %r15d
cmpl %r13d, %eax
movq 0x20(%rsp), %rbx
jne 0x7975
movl %ebp, %eax
shrl $0x4, %eax
movl (%r10,%rax,4), %eax
leal (,%rbp,2), %ecx
shrl %cl, %eax
cmpl %r13d, %r12d
cmovel %ebp, %r12d
testb $0x2, %al
cmovel %ebp, %r12d
movl %r12d, %r15d
movl %r15d, %eax
shrl $0x4, %eax
movl (%r10,%rax,4), %esi
leal (%r15,%r15), %ecx
andl $0x1e, %ecx
shrl %cl, %esi
movl %r15d, %edx
testb $0x2, %sil
jne 0x79be
testb $0x1, %sil
movq 0x48(%rsp), %r14
movq 0x50(%rsp), %r15
je 0x79e6
movq 0x18(%rdi), %rsi
movq %r8, (%rsi,%rdx,8)
movl $0x3, %esi
shll %cl, %esi
notl %esi
movq 0x10(%rdi), %rcx
andl %esi, (%rcx,%rax,4)
incl 0x4(%rdi)
jmp 0x79e6
movq 0x18(%rdi), %rsi
movq %r8, (%rsi,%rdx,8)
movl $0x3, %esi
shll %cl, %esi
notl %esi
movq 0x10(%rdi), %rcx
andl %esi, (%rcx,%rax,4)
incl 0x4(%rdi)
incl 0x8(%rdi)
movq 0x48(%rsp), %r14
movq 0x50(%rsp), %r15
movq 0x30(%rsp), %rax
movq 0x1d0(%rbx), %rcx
movq 0x20(%rcx), %rcx
movq %rax, (%rcx,%rdx,8)
incl 0x1c(%rsp)
movq %r15, %rdi
leaq 0x11bb7(%rip), %rsi     # 0x195bf
leaq 0x122d6(%rip), %rdx     # 0x19ce5
leaq 0x122d2(%rip), %rcx     # 0x19ce8
leaq 0x38(%rsp), %r8
leaq 0x30(%rsp), %r9
callq 0x16581
movq %rax, %r15
testq %rax, %rax
jne 0x76e3
jmp 0x7a53
movq 0x1a5be(%rip), %rax     # 0x21ff8
movq (%rax), %rdi
leaq 0x122a7(%rip), %rsi     # 0x19ceb
movq %r12, %rdx
xorl %eax, %eax
callq 0x3320
jmp 0x781a
cmpl $0x0, 0x1c(%rsp)
je 0x7a69
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x122aa(%rip), %rdi     # 0x19d1a
movq %r14, %rsi
xorl %eax, %eax
callq 0x465a