// File: /workspace/github_c_makefile_star2_O0/lh3[P]bgt/vcf.c
// Function: bcf_hdr_parse_line2
int bcf_hdr_parse_line2(const char *str, uint32_t *info, int *id_beg, int *id_end)
{
	const char *p, *q;
	int ctype;
	int type = -1; // Type
	int num = -1; // Number
	int var = -1; // A, G, ., or fixed
	int ctg_len = -1;

	if (*str != '#' && str[1] != '#') return -1;
	*id_beg = *id_end = *info = -1;
	p = str + 2;
	for (q = p; *q && *q != '='; ++q); // FIXME: do we need to check spaces?
	if (*q == 0) return -2;
	if (q - p == 4 && strncmp(p, "INFO", 4) == 0) ctype = BCF_HL_INFO;
	else if (q - p == 6 && strncmp(p, "FILTER", 6) == 0) ctype = BCF_HL_FLT;
	else if (q - p == 6 && strncmp(p, "FORMAT", 6) == 0) ctype = BCF_HL_FMT;
	else if (q - p == 6 && strncmp(p, "contig", 6) == 0) ctype = BCF_HL_CTG;
	else return -3;
	for (; *q && *q != '<'; ++q);
	if (*q == 0) return -3;
	p = q + 1; // now p points to the first character following '<'
	while (*p && *p != '>') {
		int which = 0;
		char *tmp;
		const char *val;
		for (q = p; *q && *q != '='; ++q);
		if (*q == 0) break;
		if (q - p == 2 && strncmp(p, "ID", 2) == 0) which = 1; // ID
		else if (q - p == 4 && strncmp(p, "Type", 4) == 0) which = 2; // Number
		else if (q - p == 6 && strncmp(p, "Number", 6) == 0) which = 3; // Type
		else if (q - p == 6 && strncmp(p, "length", 6) == 0) which = 4; // length
		val = q + 1;
		if (*val == '"') { // quoted string
			for (q = val + 1; *q && *q != '"'; ++q)
				if (*q == '\\' && *(q+1) != 0) ++q;
			if (*q != '"') return -4; // open double quotation mark
			p = q + 1;
			if (*p == ',') ++p;
			continue;
		}
		for (q = val; *q && *q != ',' && *q != '>'; ++q); // parse val
		if (which == 1) {
			*id_beg = val - str; *id_end = q - str;
		} else if (which == 2) {
			if (q - val == 7 && strncmp(val, "Integer", 7) == 0) type = BCF_HT_INT;
			else if (q - val == 5 && strncmp(val, "Float", 5) == 0) type = BCF_HT_REAL;
			else if (q - val == 6 && strncmp(val, "String", 6) == 0) type = BCF_HT_STR;
			else if (q - val == 4 && strncmp(val, "Flag", 4) == 0) type = BCF_HT_FLAG;
		} else if (which == 3) {
			if (*val == 'A') var = BCF_VL_A;
			else if (*val == 'G') var = BCF_VL_G;
			else if (*val == 'R') var = BCF_VL_R;
			else if (isdigit(*val)) var = BCF_VL_FIXED, num = strtol(val, &tmp, 10);
			else var = BCF_VL_VAR;
			if (var != BCF_VL_FIXED) num = 0xfffff;
		} else if (which == 4) {
			if (isdigit(*val)) ctg_len = strtol(val, &tmp, 10);
		}
		p = q + 1;
	}
	if (ctype == BCF_HL_CTG) {
		if (ctg_len > 0) return ctg_len;
		else return -5;
	} else {
		if (ctype == BCF_HL_FLT) num = 0;
		if (type == BCF_HT_FLAG) {
			if (num != 0 && hts_verbose >= 2)
				fprintf(stderr, "[W::%s] ignore Number for a Flag\n", __func__);
			num = 0, var = BCF_VL_FIXED; // if Flag VCF type, force to change num to 0
		}
		if (num == 0) type = BCF_HT_FLAG, var = BCF_VL_FIXED; // conversely, if num==0, force the type to Flag
		if (*id_beg < 0 || type < 0 || num < 0 || var < 0) return -5; // missing information
		*info = (uint32_t)num<<12 | var<<8 | type<<4 | ctype;
		//printf("%d, %s, %d, %d, [%d,%d]\n", ctype, bcf_type_name[type], var, num, *id_beg, *id_end);
		return 0;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movl $0xffffffff, -0x40(%rbp) # imm = 0xFFFFFFFF
movl $0xffffffff, -0x44(%rbp) # imm = 0xFFFFFFFF
movl $0xffffffff, -0x48(%rbp) # imm = 0xFFFFFFFF
movl $0xffffffff, -0x4c(%rbp) # imm = 0xFFFFFFFF
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x23, %eax
je 0xeb99
movq -0x10(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x23, %eax
je 0xeb99
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xf2bc
movq -0x18(%rbp), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movq -0x28(%rbp), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movq -0x20(%rbp), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movq -0x10(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x61(%rbp)
je 0xebec
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3d, %eax
setne %al
movb %al, -0x61(%rbp)
movb -0x61(%rbp), %al
testb $0x1, %al
jne 0xebf5
jmp 0xec05
jmp 0xebf7
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0xebcb
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0xec1d
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0xf2bc
movq -0x38(%rbp), %rax
movq -0x30(%rbp), %rcx
subq %rcx, %rax
cmpq $0x4, %rax
jne 0xec54
movq -0x30(%rbp), %rdi
leaq 0x19cc1(%rip), %rsi     # 0x288fa
movl $0x4, %edx
callq 0x2080
cmpl $0x0, %eax
jne 0xec54
movl $0x1, -0x3c(%rbp)
jmp 0xed02
movq -0x38(%rbp), %rax
movq -0x30(%rbp), %rcx
subq %rcx, %rax
cmpq $0x6, %rax
jne 0xec88
movq -0x30(%rbp), %rdi
leaq 0x19453(%rip), %rsi     # 0x280c3
movl $0x6, %edx
callq 0x2080
cmpl $0x0, %eax
jne 0xec88
movl $0x0, -0x3c(%rbp)
jmp 0xed00
movq -0x38(%rbp), %rax
movq -0x30(%rbp), %rcx
subq %rcx, %rax
cmpq $0x6, %rax
jne 0xecbc
movq -0x30(%rbp), %rdi
leaq 0x197f3(%rip), %rsi     # 0x28497
movl $0x6, %edx
callq 0x2080
cmpl $0x0, %eax
jne 0xecbc
movl $0x2, -0x3c(%rbp)
jmp 0xecfe
movq -0x38(%rbp), %rax
movq -0x30(%rbp), %rcx
subq %rcx, %rax
cmpq $0x6, %rax
jne 0xecf0
movq -0x30(%rbp), %rdi
leaq 0x193f2(%rip), %rsi     # 0x280ca
movl $0x6, %edx
callq 0x2080
cmpl $0x0, %eax
jne 0xecf0
movl $0x3, -0x3c(%rbp)
jmp 0xecfc
movl $0xfffffffd, -0x4(%rbp) # imm = 0xFFFFFFFD
jmp 0xf2bc
jmp 0xecfe
jmp 0xed00
jmp 0xed02
jmp 0xed04
movq -0x38(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x62(%rbp)
je 0xed25
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3c, %eax
setne %al
movb %al, -0x62(%rbp)
movb -0x62(%rbp), %al
testb $0x1, %al
jne 0xed2e
jmp 0xed3e
jmp 0xed30
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0xed04
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0xed56
movl $0xfffffffd, -0x4(%rbp) # imm = 0xFFFFFFFD
jmp 0xf2bc
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x63(%rbp)
je 0xed83
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3e, %eax
setne %al
movb %al, -0x63(%rbp)
movb -0x63(%rbp), %al
testb $0x1, %al
jne 0xed8f
jmp 0xf1e9
movl $0x0, -0x50(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x64(%rbp)
je 0xedbf
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3d, %eax
setne %al
movb %al, -0x64(%rbp)
movb -0x64(%rbp), %al
testb $0x1, %al
jne 0xedc8
jmp 0xedd8
jmp 0xedca
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0xed9e
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0xede9
jmp 0xf1e9
movq -0x38(%rbp), %rax
movq -0x30(%rbp), %rcx
subq %rcx, %rax
cmpq $0x2, %rax
jne 0xee20
movq -0x30(%rbp), %rdi
leaq 0x192cc(%rip), %rsi     # 0x280d1
movl $0x2, %edx
callq 0x2080
cmpl $0x0, %eax
jne 0xee20
movl $0x1, -0x50(%rbp)
jmp 0xeec0
movq -0x38(%rbp), %rax
movq -0x30(%rbp), %rcx
subq %rcx, %rax
cmpq $0x4, %rax
jne 0xee54
movq -0x30(%rbp), %rdi
leaq 0x19298(%rip), %rsi     # 0x280d4
movl $0x4, %edx
callq 0x2080
cmpl $0x0, %eax
jne 0xee54
movl $0x2, -0x50(%rbp)
jmp 0xeebe
movq -0x38(%rbp), %rax
movq -0x30(%rbp), %rcx
subq %rcx, %rax
cmpq $0x6, %rax
jne 0xee88
movq -0x30(%rbp), %rdi
leaq 0x19269(%rip), %rsi     # 0x280d9
movl $0x6, %edx
callq 0x2080
cmpl $0x0, %eax
jne 0xee88
movl $0x3, -0x50(%rbp)
jmp 0xeebc
movq -0x38(%rbp), %rax
movq -0x30(%rbp), %rcx
subq %rcx, %rax
cmpq $0x6, %rax
jne 0xeeba
movq -0x30(%rbp), %rdi
leaq 0x1923c(%rip), %rsi     # 0x280e0
movl $0x6, %edx
callq 0x2080
cmpl $0x0, %eax
jne 0xeeba
movl $0x4, -0x50(%rbp)
jmp 0xeebc
jmp 0xeebe
jmp 0xeec0
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x22, %eax
jne 0xef88
movq -0x60(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x65(%rbp)
je 0xef09
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x22, %eax
setne %al
movb %al, -0x65(%rbp)
movb -0x65(%rbp), %al
testb $0x1, %al
jne 0xef12
jmp 0xef47
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x5c, %eax
jne 0xef37
movq -0x38(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
je 0xef37
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0xef39
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0xeee8
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x22, %eax
je 0xef5f
movl $0xfffffffc, -0x4(%rbp) # imm = 0xFFFFFFFC
jmp 0xf2bc
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2c, %eax
jne 0xef83
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0xed62
movq -0x60(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x66(%rbp)
je 0xefc2
movq -0x38(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x2c, %ecx
movb %al, -0x66(%rbp)
je 0xefc2
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3e, %eax
setne %al
movb %al, -0x66(%rbp)
movb -0x66(%rbp), %al
testb $0x1, %al
jne 0xefcb
jmp 0xefdb
jmp 0xefcd
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0xef90
cmpl $0x1, -0x50(%rbp)
jne 0xf00c
movq -0x60(%rbp), %rax
movq -0x10(%rbp), %rcx
subq %rcx, %rax
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x38(%rbp), %rax
movq -0x10(%rbp), %rcx
subq %rcx, %rax
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
jmp 0xf1d8
cmpl $0x2, -0x50(%rbp)
jne 0xf0f2
movq -0x38(%rbp), %rax
movq -0x60(%rbp), %rcx
subq %rcx, %rax
cmpq $0x7, %rax
jne 0xf04d
movq -0x60(%rbp), %rdi
leaq 0x190b5(%rip), %rsi     # 0x280e7
movl $0x7, %edx
callq 0x2080
cmpl $0x0, %eax
jne 0xf04d
movl $0x1, -0x40(%rbp)
jmp 0xf0ed
movq -0x38(%rbp), %rax
movq -0x60(%rbp), %rcx
subq %rcx, %rax
cmpq $0x5, %rax
jne 0xf081
movq -0x60(%rbp), %rdi
leaq 0x19086(%rip), %rsi     # 0x280ef
movl $0x5, %edx
callq 0x2080
cmpl $0x0, %eax
jne 0xf081
movl $0x2, -0x40(%rbp)
jmp 0xf0eb
movq -0x38(%rbp), %rax
movq -0x60(%rbp), %rcx
subq %rcx, %rax
cmpq $0x6, %rax
jne 0xf0b5
movq -0x60(%rbp), %rdi
leaq 0x19058(%rip), %rsi     # 0x280f5
movl $0x6, %edx
callq 0x2080
cmpl $0x0, %eax
jne 0xf0b5
movl $0x3, -0x40(%rbp)
jmp 0xf0e9
movq -0x38(%rbp), %rax
movq -0x60(%rbp), %rcx
subq %rcx, %rax
cmpq $0x4, %rax
jne 0xf0e7
movq -0x60(%rbp), %rdi
leaq 0x1902b(%rip), %rsi     # 0x280fc
movl $0x4, %edx
callq 0x2080
cmpl $0x0, %eax
jne 0xf0e7
movl $0x0, -0x40(%rbp)
jmp 0xf0e9
jmp 0xf0eb
jmp 0xf0ed
jmp 0xf1d6
cmpl $0x3, -0x50(%rbp)
jne 0xf195
movq -0x60(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x41, %eax
jne 0xf111
movl $0x2, -0x48(%rbp)
jmp 0xf186
movq -0x60(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x47, %eax
jne 0xf126
movl $0x3, -0x48(%rbp)
jmp 0xf184
movq -0x60(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x52, %eax
jne 0xf13b
movl $0x4, -0x48(%rbp)
jmp 0xf182
callq 0x2480
movq (%rax), %rax
movq -0x60(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0xf179
movl $0x0, -0x48(%rbp)
movq -0x60(%rbp), %rdi
leaq -0x58(%rbp), %rsi
movl $0xa, %edx
callq 0x2280
movl %eax, -0x44(%rbp)
jmp 0xf180
movl $0x1, -0x48(%rbp)
jmp 0xf182
jmp 0xf184
jmp 0xf186
cmpl $0x0, -0x48(%rbp)
je 0xf193
movl $0xfffff, -0x44(%rbp)   # imm = 0xFFFFF
jmp 0xf1d4
cmpl $0x4, -0x50(%rbp)
jne 0xf1d2
callq 0x2480
movq (%rax), %rax
movq -0x60(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0xf1d0
movq -0x60(%rbp), %rdi
leaq -0x58(%rbp), %rsi
movl $0xa, %edx
callq 0x2280
movl %eax, -0x4c(%rbp)
jmp 0xf1d2
jmp 0xf1d4
jmp 0xf1d6
jmp 0xf1d8
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0xed62
cmpl $0x3, -0x3c(%rbp)
jne 0xf20c
cmpl $0x0, -0x4c(%rbp)
jle 0xf200
movl -0x4c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0xf2bc
movl $0xfffffffb, -0x4(%rbp) # imm = 0xFFFFFFFB
jmp 0xf2bc
cmpl $0x0, -0x3c(%rbp)
jne 0xf219
movl $0x0, -0x44(%rbp)
cmpl $0x0, -0x40(%rbp)
jne 0xf25e
cmpl $0x0, -0x44(%rbp)
je 0xf250
leaq 0x1f034(%rip), %rax     # 0x2e260
cmpl $0x2, (%rax)
jl 0xf250
movq 0x1edc0(%rip), %rax     # 0x2dff8
movq (%rax), %rdi
leaq 0x18ebf(%rip), %rsi     # 0x28101
leaq 0x18eda(%rip), %rdx     # 0x28123
movb $0x0, %al
callq 0x2260
movl $0x0, -0x44(%rbp)
movl $0x0, -0x48(%rbp)
cmpl $0x0, -0x44(%rbp)
jne 0xf272
movl $0x0, -0x40(%rbp)
movl $0x0, -0x48(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x0, (%rax)
jl 0xf28d
cmpl $0x0, -0x40(%rbp)
jl 0xf28d
cmpl $0x0, -0x44(%rbp)
jl 0xf28d
cmpl $0x0, -0x48(%rbp)
jge 0xf296
movl $0xfffffffb, -0x4(%rbp) # imm = 0xFFFFFFFB
jmp 0xf2bc
movl -0x44(%rbp), %ecx
shll $0xc, %ecx
movl -0x48(%rbp), %eax
shll $0x8, %eax
orl %eax, %ecx
movl -0x40(%rbp), %eax
shll $0x4, %eax
orl %eax, %ecx
orl -0x3c(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)