// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/vcf.c
// Function: bcf_hdr_remove_from_hdict
static void bcf_hdr_remove_from_hdict(bcf_hdr_t *hdr, bcf_hrec_t *hrec)
{
    kstring_t str = KS_INITIALIZE;
    bcf_hdr_aux_t *aux = get_hdr_aux(hdr);
    khint_t k;
    int id;

    switch (hrec->type) {
    case BCF_HL_GEN:
        if (ksprintf(&str, "##%s=%s", hrec->key,hrec->value) < 0)
            str.l = 0;
        break;
    case BCF_HL_STR:
        id = bcf_hrec_find_key(hrec, "ID");
        if (id < 0)
            return;
        if (!hrec->vals[id] ||
            ksprintf(&str, "##%s=<ID=%s>", hrec->key, hrec->vals[id]) < 0)
            str.l = 0;
        break;
    default:
        return;
    }
    if (str.l) {
        k = kh_get(hdict, aux->gen, str.s);
    } else {
        // Couldn't get a string for some reason, so try the hard way...
        for (k = kh_begin(aux->gen); k < kh_end(aux->gen); k++) {
            if (kh_exist(aux->gen, k) && kh_val(aux->gen, k) == hrec)
                break;
        }
    }
    if (k != kh_end(aux->gen) && kh_val(aux->gen, k) == hrec) {
        kh_val(aux->gen, k) = NULL;
        free((char *) kh_key(aux->gen, k));
        kh_key(aux->gen, k) = NULL;
        kh_del(hdict, aux->gen, k);
    }
    free(str.s);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %r13
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
movl (%rsi), %eax
cmpl $0x4, %eax
je 0x2db0f
cmpl $0x5, %eax
jne 0x2dd14
movq 0x8(%r13), %rdx
movq 0x10(%r13), %rcx
leaq 0x7dc35(%rip), %rsi     # 0xab742
jmp 0x2db40
leaq 0x7c1f4(%rip), %rsi     # 0xa9d0a
movq %r13, %rdi
callq 0x2b32b
testl %eax, %eax
js 0x2dd14
movq 0x28(%r13), %rcx
movl %eax, %eax
movq (%rcx,%rax,8), %rcx
testq %rcx, %rcx
je 0x2db9e
movq 0x8(%r13), %rdx
leaq 0x7dc15(%rip), %rsi     # 0xab755
leaq 0x10(%rsp), %rdi
xorl %eax, %eax
callq 0x89557
testl %eax, %eax
js 0x2db9e
cmpq $0x0, 0x10(%rsp)
je 0x2dba7
movq %rbx, 0x30(%rsp)
movq 0x28(%rbx), %rdi
movl (%rdi), %r8d
testl %r8d, %r8d
je 0x2dd0a
movq 0x20(%rsp), %rbx
leal -0x1(%r8), %edx
movb (%rbx), %cl
testb %cl, %cl
je 0x2dbf9
leaq 0x1(%rbx), %rax
movl $0x811c9dc5, %r12d      # imm = 0x811C9DC5
movzbl %cl, %ecx
xorl %r12d, %ecx
imull $0x1000193, %ecx, %r12d # imm = 0x1000193
movb (%rax), %cl
incq %rax
testb %cl, %cl
jne 0x2db86
jmp 0x2dbff
movq $0x0, 0x10(%rsp)
movq %rbx, 0x30(%rsp)
movq 0x28(%rbx), %rdi
movl (%rdi), %r8d
testq %r8, %r8
je 0x2dd0a
movq 0x10(%rdi), %rax
xorl %edx, %edx
xorl %r15d, %r15d
movl %r15d, %ecx
shrl $0x4, %ecx
movl (%rax,%rcx,4), %esi
movl %edx, %ecx
andb $0x1e, %cl
shrl %cl, %esi
testb $0x3, %sil
jne 0x2dbe9
movq 0x20(%rdi), %rcx
cmpq %r13, (%rcx,%r15,8)
je 0x2dc96
incq %r15
addl $0x2, %edx
cmpq %r15, %r8
jne 0x2dbc5
jmp 0x2dd0a
movl $0x811c9dc5, %r12d      # imm = 0x811C9DC5
andl %edx, %r12d
movq 0x10(%rdi), %rsi
movl $0x1, %r14d
movl %r12d, %r15d
movq %rdi, 0x50(%rsp)
movq %r8, 0x48(%rsp)
movq %r13, 0x38(%rsp)
movl %edx, 0xc(%rsp)
movq %rsi, 0x40(%rsp)
movl %r15d, %eax
shrl $0x4, %eax
movl (%rsi,%rax,4), %r13d
leal (%r15,%r15), %ebp
andl $0x1e, %ebp
movl %r13d, %eax
movl %ebp, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x2dc84
testb $0x1, %al
jne 0x2dc71
movq 0x18(%rdi), %rax
movl %r15d, %ecx
movq (%rax,%rcx,8), %rdi
movq %rbx, %rsi
callq 0x46e0
movq 0x40(%rsp), %rsi
movl 0xc(%rsp), %edx
movq 0x48(%rsp), %r8
movq 0x50(%rsp), %rdi
testl %eax, %eax
je 0x2dc84
addl %r14d, %r15d
andl %edx, %r15d
incl %r14d
cmpl %r12d, %r15d
jne 0x2dc27
jmp 0x2dd0a
movl %ebp, %ecx
shrl %cl, %r13d
testb $0x3, %r13b
cmovnel %r8d, %r15d
movq 0x38(%rsp), %r13
cmpl %r8d, %r15d
je 0x2dd0a
movq 0x20(%rdi), %rax
movl %r15d, %ebx
cmpq %r13, (%rax,%rbx,8)
jne 0x2dd0a
xorl %r14d, %r14d
movq %r14, (%rax,%rbx,8)
movq 0x30(%rsp), %r12
movq 0x28(%r12), %rax
movq 0x18(%rax), %rax
movq (%rax,%rbx,8), %rdi
callq 0x45c0
movq 0x28(%r12), %rax
movq 0x18(%rax), %rax
movq %r14, (%rax,%rbx,8)
movq 0x28(%r12), %rax
cmpl %r15d, (%rax)
je 0x2dd0a
movq 0x10(%rax), %rdx
movl %r15d, %esi
shrl $0x4, %esi
movl (%rdx,%rsi,4), %edi
addl %r15d, %r15d
andl $0x1e, %r15d
movl %edi, %r8d
movl %r15d, %ecx
shrl %cl, %r8d
testb $0x3, %r8b
jne 0x2dd0a
btsl %r15d, %edi
movl %edi, (%rdx,%rsi,4)
decl 0x4(%rax)
movq 0x20(%rsp), %rdi
callq 0x45c0
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq