// File: tplinderoth[P]introDist/Dxyz.cpp
// Function: getMaf(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
double getMaf (const std::string &info) {
	// returns MAF based on the AF INFO subfield
	static char f [30];
	f[0] = '\0';
	int j=0;
	for (unsigned int i=0; i<info.size(); ++i) {
		if (i+2 < info.size() && info[i]=='A' && info[i+1]=='F' && info[i+2]=='=') {
			i += 3;
			while (i < info.size() && info[i] != ';' && info[i] != ',') {
				f[j] = info[i];
				++j;
				++i;
			}
			f[j] = '\0';
			break;
		}
	}

	if (!f[0]) {
		return -1.0;
	}

	double freq = atof(f);
	return (freq < 0.5 ? freq : 1.0-freq);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movb $0x0, 0x223ed(%rip)     # 0x2d4d0
movl $0x0, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
callq 0x82f0
movq %rax, %rcx
movq -0x28(%rbp), %rax
cmpq %rcx, %rax
jae 0xb24c
movl -0x18(%rbp), %eax
addl $0x2, %eax
movl %eax, %eax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
callq 0x82f0
movq %rax, %rcx
movq -0x30(%rbp), %rax
cmpq %rcx, %rax
jae 0xb23c
movq -0x10(%rbp), %rdi
movl -0x18(%rbp), %eax
movl %eax, %esi
callq 0x8480
movsbl (%rax), %eax
cmpl $0x41, %eax
jne 0xb23c
movq -0x10(%rbp), %rdi
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
callq 0x8480
movsbl (%rax), %eax
cmpl $0x46, %eax
jne 0xb23c
movq -0x10(%rbp), %rdi
movl -0x18(%rbp), %eax
addl $0x2, %eax
movl %eax, %eax
movl %eax, %esi
callq 0x8480
movsbl (%rax), %eax
cmpl $0x3d, %eax
jne 0xb23c
movl -0x18(%rbp), %eax
addl $0x3, %eax
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
callq 0x82f0
movq -0x40(%rbp), %rcx
movq %rax, %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, -0x31(%rbp)
jae 0xb1ed
movq -0x10(%rbp), %rdi
movl -0x18(%rbp), %eax
movl %eax, %esi
callq 0x8480
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x3b, %ecx
movb %al, -0x31(%rbp)
je 0xb1ed
movq -0x10(%rbp), %rdi
movl -0x18(%rbp), %eax
movl %eax, %esi
callq 0x8480
movsbl (%rax), %eax
cmpl $0x2c, %eax
setne %al
movb %al, -0x31(%rbp)
movb -0x31(%rbp), %al
testb $0x1, %al
jne 0xb1f6
jmp 0xb22b
movq -0x10(%rbp), %rdi
movl -0x18(%rbp), %eax
movl %eax, %esi
callq 0x8480
movb (%rax), %dl
movslq -0x14(%rbp), %rcx
leaq 0x222bf(%rip), %rax     # 0x2d4d0
movb %dl, (%rax,%rcx)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0xb197
movslq -0x14(%rbp), %rcx
leaq 0x2229a(%rip), %rax     # 0x2d4d0
movb $0x0, (%rax,%rcx)
jmp 0xb24c
jmp 0xb23e
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0xb0f1
cmpb $0x0, 0x2227d(%rip)     # 0x2d4d0
jne 0xb264
movsd 0x12dc3(%rip), %xmm0    # 0x1e020
movsd %xmm0, -0x8(%rbp)
jmp 0xb2ac
leaq 0x22265(%rip), %rdi     # 0x2d4d0
callq 0x8560
movsd %xmm0, -0x20(%rbp)
movsd 0x12d8b(%rip), %xmm0    # 0x1e008
ucomisd -0x20(%rbp), %xmm0
jbe 0xb290
movsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
jmp 0xb2a2
movsd 0x12d80(%rip), %xmm0    # 0x1e018
subsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
movsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
movsd -0x8(%rbp), %xmm0
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)