// File: /workspace/github_c_makefile_star2_O3/xiongxu[P]bam2bedGraph2/samtools-0.1.19/bcftools/vcf.c
// Function: vcf_dictread
int vcf_dictread(bcf_t *bp, bcf_hdr_t *h, const char *fn)
{
	vcf_t *v;
	gzFile fp;
	kstream_t *ks;
	kstring_t s, rn;
	int dret;
	if (bp == 0) return -1;
	if (!bp->is_vcf) return 0;
	s.l = s.m = 0; s.s = 0;
	rn.m = rn.l = h->l_nm; rn.s = h->name;
	v = (vcf_t*)bp->v;
	fp = gzopen(fn, "r");
	ks = ks_init(fp);
	while (ks_getuntil(ks, 0, &s, &dret) >= 0) {
		bcf_str2id_add(v->refhash, strdup(s.s));
		kputs(s.s, &rn); kputc('\0', &rn);
		if (dret != '\n') ks_getuntil(ks, '\n', &s, &dret);
	}
	ks_destroy(ks);
	gzclose(fp);
	h->l_nm = rn.l; h->name = rn.s;
	bcf_hdr_sync(h);
	free(s.s);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
testq %rdi, %rdi
je 0xda7d
cmpl $0x0, (%rdi)
je 0xda84
movq %rsi, %r13
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rbx
movaps %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
movl 0x8(%rsi), %r15d
movq 0x18(%rsi), %r14
movq 0x8(%rdi), %rax
movq %rax, 0x18(%rsp)
leaq 0xd248(%rip), %rsi      # 0x1ab0c
movq %rdx, %rdi
callq 0x22c0
movq %rax, %rbp
movl $0x1, %edi
movl $0x20, %esi
callq 0x2260
movq %rax, %r12
movq %rbp, 0x10(%rsp)
movq %rbp, 0x18(%rax)
movl $0x1000, %edi           # imm = 0x1000
callq 0x2360
movq %rax, (%r12)
xorl %ebp, %ebp
leaq 0x4(%rsp), %rcx
movq %r12, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0xd494
testl %eax, %eax
js 0xda46
movq %r13, 0x8(%rsp)
movslq %r15d, %r15
movq %r15, %rbp
movq 0x18(%rsp), %rax
movq 0x18(%rax), %r13
movq 0x30(%rsp), %rbx
movq %rbx, %rdi
callq 0x2510
movq %r13, %rdi
movq %rax, %rsi
callq 0xe8b3
movq %rbx, %rdi
callq 0x2180
movslq %eax, %r13
leaq (%r15,%r13), %rax
incq %rax
cmpq %rbp, %rax
jb 0xd999
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rbp
shrq $0x10, %rbp
orq %rax, %rbp
incq %rbp
movq %r14, %rdi
movq %rbp, %rsi
callq 0x23d0
movq %rax, %r14
leaq (%r14,%r15), %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x22e0
leaq (%r15,%r13), %rbx
movb $0x0, (%r14,%rbx)
addq %r13, %r15
incq %r15
cmpq %rbp, %r15
jb 0xd9fe
movq %r15, %rax
shrq %rax
orq %r15, %rax
movq %rax, %rcx
shrq $0x2, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x4, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x8, %rcx
orq %rax, %rcx
movq %rcx, %rbp
shrq $0x10, %rbp
orq %rcx, %rbp
incq %rbp
movq %r14, %rdi
movq %rbp, %rsi
callq 0x23d0
movq %rax, %r14
movw $0x0, (%r14,%rbx)
cmpl $0xa, 0x4(%rsp)
je 0xda23
movq %r12, %rdi
movl $0xa, %esi
leaq 0x20(%rsp), %rdx
leaq 0x4(%rsp), %rcx
callq 0xd494
movq %r12, %rdi
xorl %esi, %esi
leaq 0x20(%rsp), %rdx
leaq 0x4(%rsp), %rcx
callq 0xd494
testl %eax, %eax
jns 0xd91f
movq 0x8(%rsp), %r13
xorl %ebp, %ebp
movq (%r12), %rdi
callq 0x2060
movq %r12, %rdi
callq 0x2060
movq 0x10(%rsp), %rdi
callq 0x2050
movl %r15d, 0x8(%r13)
movq %r14, 0x18(%r13)
movq %r13, %rdi
callq 0xb73e
movq 0x30(%rsp), %rdi
callq 0x2060
jmp 0xda86
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0xda86
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq