// File: /workspace/github_c_makefile_star2_O0/lh3[P]bgt/vcf.c
// Function: bcf_hdr_parse1
int bcf_hdr_parse1(bcf_hdr_t *h, const char *str)
{
	khint_t k;
	if (*str != '#') return -1;
	if (str[1] == '#') {
		uint32_t info;
		int len, ret, id_beg, id_end;
		char *s;

		len = bcf_hdr_parse_line2(str, &info, &id_beg, &id_end);
		if (len < 0) return -1;
		s = (char*)malloc(id_end - id_beg + 1);
		strncpy(s, str + id_beg, id_end - id_beg);
		s[id_end - id_beg] = 0;
		if (len > 0) { // a contig line
			vdict_t *d = (vdict_t*)h->dict[BCF_DT_CTG];
			k = kh_put(vdict, d, s, &ret);
			if (ret == 0) {
				if (hts_verbose >= 2)
					fprintf(stderr, "[W::%s] Duplicated contig name '%s'. Skipped.\n", __func__, s);
				free(s);
			} else {
				kh_val(d, k) = bcf_idinfo_def;
				kh_val(d, k).id = kh_size(d) - 1;
				kh_val(d, k).info[0] = len;
			}
		} else { // a FILTER/INFO/FORMAT line
			vdict_t *d = (vdict_t*)h->dict[BCF_DT_ID];
			k = kh_put(vdict, d, s, &ret);
			if (ret) { // absent from the dict
				kh_val(d, k) = bcf_idinfo_def;
				kh_val(d, k).info[info&0xf] = info;
				kh_val(d, k).id = kh_size(d) - 1;
			} else {
				kh_val(d, k).info[info&0xf] = info;
				free(s);
			}
		}
	} else {
		int i = 0;
		const char *p, *q;
		vdict_t *d = (vdict_t*)h->dict[BCF_DT_ID];
		// add samples
		d = (vdict_t*)h->dict[BCF_DT_SAMPLE];
		for (p = q = str;; ++q) {
			int ret;
			if (*q != '\t' && *q != 0) continue;
			if (++i > 9) {
				char *s;
				s = (char*)malloc(q - p + 1);
				strncpy(s, p, q - p);
				s[q - p] = 0;
				k = kh_put(vdict, d, s, &ret);
				if (ret) { // absent
					kh_val(d, k) = bcf_idinfo_def;
					kh_val(d, k).id = kh_size(d) - 1;
				} else {
					if (hts_verbose >= 2)
						fprintf(stderr, "[W::%s] Duplicated sample name '%s'. Skipped.\n", __func__, s);
				}
			}
			if (*q == 0) break;
			p = q + 1;
		}
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x23, %eax
je 0xf2fb
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xf669
movq -0x18(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x23, %eax
jne 0xf503
movq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
leaq -0x2c(%rbp), %rdx
leaq -0x30(%rbp), %rcx
callq 0xeb40
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jge 0xf336
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xf669
movl -0x30(%rbp), %eax
subl -0x2c(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rdi
callq 0x22f0
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
movq -0x18(%rbp), %rsi
movslq -0x2c(%rbp), %rax
addq %rax, %rsi
movl -0x30(%rbp), %eax
subl -0x2c(%rbp), %eax
movslq %eax, %rdx
callq 0x2070
movq -0x38(%rbp), %rax
movl -0x30(%rbp), %ecx
subl -0x2c(%rbp), %ecx
movslq %ecx, %rcx
movb $0x0, (%rax,%rcx)
cmpl $0x0, -0x24(%rbp)
jle 0xf445
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rsi
leaq -0x28(%rbp), %rdx
callq 0xf680
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x28(%rbp)
jne 0xf3e3
leaq 0x1eeb0(%rip), %rax     # 0x2e260
cmpl $0x2, (%rax)
jl 0xf3d8
movq 0x1ec3c(%rip), %rax     # 0x2dff8
movq (%rax), %rdi
movq -0x38(%rbp), %rcx
leaq 0x18d6d(%rip), %rsi     # 0x28137
leaq 0x18d95(%rip), %rdx     # 0x28166
movb $0x0, %al
callq 0x2260
movq -0x38(%rbp), %rdi
callq 0x2040
jmp 0xf440
movq -0x40(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x1c(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x1efc4(%rip), %rcx     # 0x2e3c0
movq %rcx, (%rax)
movq 0x1efc2(%rip), %rcx     # 0x2e3c8
movq %rcx, 0x8(%rax)
movq -0x40(%rbp), %rax
movl 0x4(%rax), %ecx
subl $0x1, %ecx
movq -0x40(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x1c(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rax
movl %ecx, 0xc(%rax)
movl -0x24(%rbp), %ecx
movq -0x40(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x1c(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rax
movl %ecx, (%rax)
jmp 0xf4fe
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rdi
movq -0x38(%rbp), %rsi
leaq -0x28(%rbp), %rdx
callq 0xf680
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x28(%rbp)
je 0xf4d3
movq -0x48(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x1c(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x1ef3c(%rip), %rcx     # 0x2e3c0
movq %rcx, (%rax)
movq 0x1ef3a(%rip), %rcx     # 0x2e3c8
movq %rcx, 0x8(%rax)
movl -0x20(%rbp), %edx
movq -0x48(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x1c(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movl -0x20(%rbp), %ecx
andl $0xf, %ecx
movl %ecx, %ecx
movl %edx, (%rax,%rcx,4)
movq -0x48(%rbp), %rax
movl 0x4(%rax), %ecx
subl $0x1, %ecx
movq -0x48(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x1c(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rax
movl %ecx, 0xc(%rax)
jmp 0xf4fc
movl -0x20(%rbp), %edx
movq -0x48(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x1c(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movl -0x20(%rbp), %ecx
andl $0xf, %ecx
movl %ecx, %ecx
movl %edx, (%rax,%rcx,4)
movq -0x38(%rbp), %rdi
callq 0x2040
jmp 0xf4fe
jmp 0xf662
movl $0x0, -0x4c(%rbp)
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x68(%rbp)
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x68(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x60(%rbp)
movq %rax, -0x58(%rbp)
movq -0x60(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x9, %eax
je 0xf54b
movq -0x60(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0xf54b
jmp 0xf64f
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
cmpl $0x9, %eax
jle 0xf635
movq -0x60(%rbp), %rdi
movq -0x58(%rbp), %rax
subq %rax, %rdi
addq $0x1, %rdi
callq 0x22f0
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rdi
movq -0x58(%rbp), %rsi
movq -0x60(%rbp), %rdx
movq -0x58(%rbp), %rax
subq %rax, %rdx
callq 0x2070
movq -0x78(%rbp), %rax
movq -0x60(%rbp), %rcx
movq -0x58(%rbp), %rdx
subq %rdx, %rcx
movb $0x0, (%rax,%rcx)
movq -0x68(%rbp), %rdi
movq -0x78(%rbp), %rsi
leaq -0x6c(%rbp), %rdx
callq 0xf680
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x6c(%rbp)
je 0xf602
movq -0x68(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x1c(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x1eded(%rip), %rcx     # 0x2e3c0
movq %rcx, (%rax)
movq 0x1edeb(%rip), %rcx     # 0x2e3c8
movq %rcx, 0x8(%rax)
movq -0x68(%rbp), %rax
movl 0x4(%rax), %ecx
subl $0x1, %ecx
movq -0x68(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x1c(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rax
movl %ecx, 0xc(%rax)
jmp 0xf633
leaq 0x1ec57(%rip), %rax     # 0x2e260
cmpl $0x2, (%rax)
jl 0xf631
movq 0x1e9e3(%rip), %rax     # 0x2dff8
movq (%rax), %rdi
movq -0x78(%rbp), %rcx
leaq 0x18b52(%rip), %rsi     # 0x28175
leaq 0x18b3c(%rip), %rdx     # 0x28166
movb $0x0, %al
callq 0x2260
jmp 0xf633
jmp 0xf635
movq -0x60(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0xf643
jmp 0xf660
movq -0x60(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
movq -0x60(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x60(%rbp)
jmp 0xf52e
jmp 0xf662
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)