// File: millanek[P]evo/process_vcf_utils.cpp
// Function: getThreeSetVariantCountsAA4(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&, std::vector<unsigned long, std::allocator<unsigned long>> const&, std::vector<unsigned long, std::allocator<unsigned long>> const&, std::vector<unsigned long, std::allocator<unsigned long>> const&, std::vector<unsigned long, std::allocator<unsigned long>> const&)
ThreeSetCounts getThreeSetVariantCountsAA4(const std::vector<std::string>& fields, const std::vector<size_t>& set1_loci, const std::vector<size_t>& set2_loci, const std::vector<size_t>& set3_loci, const std::vector<size_t>& AA_loci) {
    ThreeSetCounts thisVariantCounts;
    int AAaltCount = 0;
    thisVariantCounts.individualsWithVariant.assign((fields.size()-NUM_NON_GENOTYPE_COLUMNS),0);
    // std::cerr << fields[0] << "\t" << fields[1] << std::endl;
    for (std::vector<std::string>::size_type i = NUM_NON_GENOTYPE_COLUMNS; i != fields.size(); i++) {
        if (fields[i][0] == '1') {
            thisVariantCounts.overall++;
            if (std::find(set1_loci.begin(), set1_loci.end(), i-NUM_NON_GENOTYPE_COLUMNS) != set1_loci.end()) { thisVariantCounts.set1AltCount++; }
            if (std::find(set2_loci.begin(), set2_loci.end(), i-NUM_NON_GENOTYPE_COLUMNS) != set2_loci.end()) { thisVariantCounts.set2AltCount++; }
            if (std::find(set3_loci.begin(), set3_loci.end(), i-NUM_NON_GENOTYPE_COLUMNS) != set3_loci.end()) { thisVariantCounts.set3AltCount++; }
            if (std::find(AA_loci.begin(), AA_loci.end(), i-NUM_NON_GENOTYPE_COLUMNS) != AA_loci.end()) { AAaltCount++; }
            thisVariantCounts.individualsWithVariant[i- NUM_NON_GENOTYPE_COLUMNS]++;
        }
        if (fields[i][2] == '1') {
            thisVariantCounts.overall++;
            if (std::find(set1_loci.begin(), set1_loci.end(), i-NUM_NON_GENOTYPE_COLUMNS) != set1_loci.end()) { thisVariantCounts.set1AltCount++; }
            if (std::find(set2_loci.begin(), set2_loci.end(), i-NUM_NON_GENOTYPE_COLUMNS) != set2_loci.end()) { thisVariantCounts.set2AltCount++; }
            if (std::find(set3_loci.begin(), set3_loci.end(), i-NUM_NON_GENOTYPE_COLUMNS) != set3_loci.end()) { thisVariantCounts.set3AltCount++; }
            if (std::find(AA_loci.begin(), AA_loci.end(), i-NUM_NON_GENOTYPE_COLUMNS) != AA_loci.end()) { AAaltCount++; }
            thisVariantCounts.individualsWithVariant[i-NUM_NON_GENOTYPE_COLUMNS]++;
        }
    }
    thisVariantCounts.set1RefCount = (int)(set1_loci.size() * 2) - thisVariantCounts.set1AltCount;
    thisVariantCounts.set2RefCount = (int)(set2_loci.size() * 2) - thisVariantCounts.set2AltCount;
    thisVariantCounts.set3RefCount = (int)(set3_loci.size() * 2) - thisVariantCounts.set3AltCount;
    //thisVariantCounts.set4RefCount = (int)(set4_loci.size() * 2) - thisVariantCounts.set4AltCount;
    
    thisVariantCounts.set1AltAF = (double)thisVariantCounts.set1AltCount/(set1_loci.size() * 2);
    thisVariantCounts.set2AltAF = (double)thisVariantCounts.set2AltCount/(set2_loci.size() * 2);
    thisVariantCounts.set3AltAF = (double)thisVariantCounts.set3AltCount/(set3_loci.size() * 2);
    //thisVariantCounts.set4AltAF = (double)thisVariantCounts.set4AltCount/(set4_loci.size() * 2);
    
    // Fill in derived allele frequencies if possible
    if (AAaltCount == 0) {
        thisVariantCounts.set1daAF = (double)thisVariantCounts.set1AltCount/(set1_loci.size() * 2);
        thisVariantCounts.set2daAF = (double)thisVariantCounts.set2AltCount/(set2_loci.size() * 2);
        thisVariantCounts.set3daAF = (double)thisVariantCounts.set3AltCount/(set3_loci.size() * 2);
       // thisVariantCounts.set4daAF = (double)thisVariantCounts.set4AltCount/(set4_loci.size() * 2);
    } else if (AAaltCount == 2) {
        thisVariantCounts.set1daAF = (double)thisVariantCounts.set1RefCount/(set1_loci.size() * 2);
        thisVariantCounts.set2daAF = (double)thisVariantCounts.set2RefCount/(set2_loci.size() * 2);
        thisVariantCounts.set3daAF = (double)thisVariantCounts.set3RefCount/(set3_loci.size() * 2);
        //thisVariantCounts.set4daAF = (double)thisVariantCounts.set4RefCount/(set4_loci.size() * 2);
    } else if (AAaltCount == 1) {
    } else {
        std::cerr << "Error: Outgroup can only be one individual here" << std::endl;
        exit(1);
    }
    
    return thisVariantCounts;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2c0, %rsp            # imm = 0x2C0
movq %rdi, -0x1a8(%rbp)
movq %rdi, %rax
movq %rax, -0x1b0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movb $0x0, -0x31(%rbp)
callq 0x50ee0
movq -0x1a8(%rbp), %rdi
movl $0x0, -0x38(%rbp)
addq $0x50, %rdi
movq %rdi, -0x1a0(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3ffd0
movq -0x1a0(%rbp), %rdi
movq %rax, %rsi
addq $-0x9, %rsi
movl $0x0, -0x3c(%rbp)
leaq -0x3c(%rbp), %rdx
callq 0x838d0
jmp 0x7f6bf
movq $0x9, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x1b8(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3ffd0
movq %rax, %rcx
movq -0x1b8(%rbp), %rax
cmpq %rcx, %rax
je 0x7fc5f
movq -0x10(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x52960
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xa670
movsbl (%rax), %eax
cmpl $0x31, %eax
jne 0x7f99d
movq -0x1a8(%rbp), %rax
movl (%rax), %ecx
incl %ecx
movl %ecx, (%rax)
movq -0x18(%rbp), %rdi
callq 0x83b30
movq %rax, -0x68(%rbp)
movq -0x18(%rbp), %rdi
callq 0x83b60
movq %rax, -0x70(%rbp)
movq -0x58(%rbp), %rax
addq $-0x9, %rax
movq %rax, -0x78(%rbp)
movq -0x68(%rbp), %rdi
movq -0x70(%rbp), %rsi
leaq -0x78(%rbp), %rdx
callq 0x83ae0
movq %rax, -0x1c0(%rbp)
jmp 0x7f760
movq -0x1c0(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x18(%rbp), %rdi
callq 0x83b60
movq %rax, -0x80(%rbp)
leaq -0x60(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x83aa0
testb $0x1, %al
jne 0x7f78b
jmp 0x7f7ba
movq -0x1a8(%rbp), %rax
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8(%rax)
jmp 0x7f7ba
movq -0x1a8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
callq 0x51170
jmp 0x800a3
movq -0x20(%rbp), %rdi
callq 0x83b30
movq %rax, -0x90(%rbp)
movq -0x20(%rbp), %rdi
callq 0x83b60
movq %rax, -0x98(%rbp)
movq -0x58(%rbp), %rax
addq $-0x9, %rax
movq %rax, -0xa0(%rbp)
movq -0x90(%rbp), %rdi
movq -0x98(%rbp), %rsi
leaq -0xa0(%rbp), %rdx
callq 0x83ae0
movq %rax, -0x1c8(%rbp)
jmp 0x7f80c
movq -0x1c8(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x20(%rbp), %rdi
callq 0x83b60
movq %rax, -0xa8(%rbp)
leaq -0x88(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x83aa0
testb $0x1, %al
jne 0x7f843
jmp 0x7f853
movq -0x1a8(%rbp), %rax
movl 0xc(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xc(%rax)
movq -0x28(%rbp), %rdi
callq 0x83b30
movq %rax, -0xb8(%rbp)
movq -0x28(%rbp), %rdi
callq 0x83b60
movq %rax, -0xc0(%rbp)
movq -0x58(%rbp), %rax
addq $-0x9, %rax
movq %rax, -0xc8(%rbp)
movq -0xb8(%rbp), %rdi
movq -0xc0(%rbp), %rsi
leaq -0xc8(%rbp), %rdx
callq 0x83ae0
movq %rax, -0x1d0(%rbp)
jmp 0x7f8a5
movq -0x1d0(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0x28(%rbp), %rdi
callq 0x83b60
movq %rax, -0xd0(%rbp)
leaq -0xb0(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x83aa0
testb $0x1, %al
jne 0x7f8dc
jmp 0x7f8ec
movq -0x1a8(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
movq -0x30(%rbp), %rdi
callq 0x83b30
movq %rax, -0xe0(%rbp)
movq -0x30(%rbp), %rdi
callq 0x83b60
movq %rax, -0xe8(%rbp)
movq -0x58(%rbp), %rax
addq $-0x9, %rax
movq %rax, -0xf0(%rbp)
movq -0xe0(%rbp), %rdi
movq -0xe8(%rbp), %rsi
leaq -0xf0(%rbp), %rdx
callq 0x83ae0
movq %rax, -0x1d8(%rbp)
jmp 0x7f93e
movq -0x1d8(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0x30(%rbp), %rdi
callq 0x83b60
movq %rax, -0xf8(%rbp)
leaq -0xd8(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0x83aa0
testb $0x1, %al
jne 0x7f975
jmp 0x7f97e
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
movq -0x1a8(%rbp), %rdi
addq $0x50, %rdi
movq -0x58(%rbp), %rsi
subq $0x9, %rsi
callq 0x4d100
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x10(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x52960
movq %rax, %rdi
movl $0x2, %esi
callq 0xa670
movsbl (%rax), %eax
cmpl $0x31, %eax
jne 0x7fc4c
movq -0x1a8(%rbp), %rax
movl (%rax), %ecx
incl %ecx
movl %ecx, (%rax)
movq -0x18(%rbp), %rdi
callq 0x83b30
movq %rax, -0x108(%rbp)
movq -0x18(%rbp), %rdi
callq 0x83b60
movq %rax, -0x110(%rbp)
movq -0x58(%rbp), %rax
addq $-0x9, %rax
movq %rax, -0x118(%rbp)
movq -0x108(%rbp), %rdi
movq -0x110(%rbp), %rsi
leaq -0x118(%rbp), %rdx
callq 0x83ae0
movq %rax, -0x1e0(%rbp)
jmp 0x7fa22
movq -0x1e0(%rbp), %rax
movq %rax, -0x100(%rbp)
movq -0x18(%rbp), %rdi
callq 0x83b60
movq %rax, -0x120(%rbp)
leaq -0x100(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x83aa0
testb $0x1, %al
jne 0x7fa59
jmp 0x7fa69
movq -0x1a8(%rbp), %rax
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8(%rax)
movq -0x20(%rbp), %rdi
callq 0x83b30
movq %rax, -0x130(%rbp)
movq -0x20(%rbp), %rdi
callq 0x83b60
movq %rax, -0x138(%rbp)
movq -0x58(%rbp), %rax
addq $-0x9, %rax
movq %rax, -0x140(%rbp)
movq -0x130(%rbp), %rdi
movq -0x138(%rbp), %rsi
leaq -0x140(%rbp), %rdx
callq 0x83ae0
movq %rax, -0x1e8(%rbp)
jmp 0x7fabb
movq -0x1e8(%rbp), %rax
movq %rax, -0x128(%rbp)
movq -0x20(%rbp), %rdi
callq 0x83b60
movq %rax, -0x148(%rbp)
leaq -0x128(%rbp), %rdi
leaq -0x148(%rbp), %rsi
callq 0x83aa0
testb $0x1, %al
jne 0x7faf2
jmp 0x7fb02
movq -0x1a8(%rbp), %rax
movl 0xc(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xc(%rax)
movq -0x28(%rbp), %rdi
callq 0x83b30
movq %rax, -0x158(%rbp)
movq -0x28(%rbp), %rdi
callq 0x83b60
movq %rax, -0x160(%rbp)
movq -0x58(%rbp), %rax
addq $-0x9, %rax
movq %rax, -0x168(%rbp)
movq -0x158(%rbp), %rdi
movq -0x160(%rbp), %rsi
leaq -0x168(%rbp), %rdx
callq 0x83ae0
movq %rax, -0x1f0(%rbp)
jmp 0x7fb54
movq -0x1f0(%rbp), %rax
movq %rax, -0x150(%rbp)
movq -0x28(%rbp), %rdi
callq 0x83b60
movq %rax, -0x170(%rbp)
leaq -0x150(%rbp), %rdi
leaq -0x170(%rbp), %rsi
callq 0x83aa0
testb $0x1, %al
jne 0x7fb8b
jmp 0x7fb9b
movq -0x1a8(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
movq -0x30(%rbp), %rdi
callq 0x83b30
movq %rax, -0x180(%rbp)
movq -0x30(%rbp), %rdi
callq 0x83b60
movq %rax, -0x188(%rbp)
movq -0x58(%rbp), %rax
addq $-0x9, %rax
movq %rax, -0x190(%rbp)
movq -0x180(%rbp), %rdi
movq -0x188(%rbp), %rsi
leaq -0x190(%rbp), %rdx
callq 0x83ae0
movq %rax, -0x1f8(%rbp)
jmp 0x7fbed
movq -0x1f8(%rbp), %rax
movq %rax, -0x178(%rbp)
movq -0x30(%rbp), %rdi
callq 0x83b60
movq %rax, -0x198(%rbp)
leaq -0x178(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0x83aa0
testb $0x1, %al
jne 0x7fc24
jmp 0x7fc2d
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
movq -0x1a8(%rbp), %rdi
addq $0x50, %rdi
movq -0x58(%rbp), %rsi
subq $0x9, %rsi
callq 0x4d100
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0x7fc4e
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x7f6c7
movq -0x18(%rbp), %rdi
callq 0x83b90
movq %rax, %rcx
movq -0x1a8(%rbp), %rax
addl %ecx, %ecx
movl 0x8(%rax), %edx
subl %edx, %ecx
movl %ecx, 0x14(%rax)
movq -0x20(%rbp), %rdi
callq 0x83b90
movq %rax, %rcx
movq -0x1a8(%rbp), %rax
addl %ecx, %ecx
movl 0xc(%rax), %edx
subl %edx, %ecx
movl %ecx, 0x18(%rax)
movq -0x28(%rbp), %rdi
callq 0x83b90
movq %rax, %rcx
movq -0x1a8(%rbp), %rax
addl %ecx, %ecx
movl 0x10(%rax), %edx
subl %edx, %ecx
movl %ecx, 0x1c(%rax)
cvtsi2sdl 0x8(%rax), %xmm0
movsd %xmm0, -0x230(%rbp)
movq -0x18(%rbp), %rdi
callq 0x83b90
movsd -0x230(%rbp), %xmm0
movq %rax, %rcx
movq -0x1a8(%rbp), %rax
addq %rcx, %rcx
movq %rcx, %xmm1
movaps 0xae473(%rip), %xmm2    # 0x12e160
movaps %xmm2, -0x220(%rbp)
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0xae470(%rip), %xmm2    # 0x12e170
movaps %xmm2, -0x210(%rbp)
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x20(%rax)
cvtsi2sdl 0xc(%rax), %xmm0
movsd %xmm0, -0x228(%rbp)
movq -0x20(%rbp), %rdi
callq 0x83b90
movsd -0x228(%rbp), %xmm0
movaps -0x220(%rbp), %xmm3
movaps -0x210(%rbp), %xmm2
movq %rax, %rcx
movq -0x1a8(%rbp), %rax
addq %rcx, %rcx
movq %rcx, %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x28(%rax)
cvtsi2sdl 0x10(%rax), %xmm0
movsd %xmm0, -0x200(%rbp)
movq -0x28(%rbp), %rdi
callq 0x83b90
movaps -0x220(%rbp), %xmm3
movaps -0x210(%rbp), %xmm2
movsd -0x200(%rbp), %xmm0
movq %rax, %rcx
movq -0x1a8(%rbp), %rax
addq %rcx, %rcx
movq %rcx, %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x30(%rax)
cmpl $0x0, -0x38(%rbp)
jne 0x7ff06
movq -0x1a8(%rbp), %rax
cvtsi2sdl 0x8(%rax), %xmm0
movsd %xmm0, -0x270(%rbp)
movq -0x18(%rbp), %rdi
callq 0x83b90
movsd -0x270(%rbp), %xmm0
movq %rax, %rcx
movq -0x1a8(%rbp), %rax
addq %rcx, %rcx
movq %rcx, %xmm1
movaps 0xae345(%rip), %xmm2    # 0x12e160
movaps %xmm2, -0x260(%rbp)
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0xae342(%rip), %xmm2    # 0x12e170
movaps %xmm2, -0x250(%rbp)
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x38(%rax)
cvtsi2sdl 0xc(%rax), %xmm0
movsd %xmm0, -0x268(%rbp)
movq -0x20(%rbp), %rdi
callq 0x83b90
movsd -0x268(%rbp), %xmm0
movaps -0x260(%rbp), %xmm3
movaps -0x250(%rbp), %xmm2
movq %rax, %rcx
movq -0x1a8(%rbp), %rax
addq %rcx, %rcx
movq %rcx, %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x40(%rax)
cvtsi2sdl 0x10(%rax), %xmm0
movsd %xmm0, -0x238(%rbp)
movq -0x28(%rbp), %rdi
callq 0x83b90
movaps -0x260(%rbp), %xmm3
movaps -0x250(%rbp), %xmm2
movsd -0x238(%rbp), %xmm0
movq %rax, %rcx
movq -0x1a8(%rbp), %rax
addq %rcx, %rcx
movq %rcx, %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x48(%rax)
jmp 0x8007d
cmpl $0x2, -0x38(%rbp)
jne 0x80036
movq -0x1a8(%rbp), %rax
cvtsi2sdl 0x14(%rax), %xmm0
movsd %xmm0, -0x2b0(%rbp)
movq -0x18(%rbp), %rdi
callq 0x83b90
movsd -0x2b0(%rbp), %xmm0
movq %rax, %rcx
movq -0x1a8(%rbp), %rax
addq %rcx, %rcx
movq %rcx, %xmm1
movaps 0xae212(%rip), %xmm2    # 0x12e160
movaps %xmm2, -0x2a0(%rbp)
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0xae20f(%rip), %xmm2    # 0x12e170
movaps %xmm2, -0x290(%rbp)
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x38(%rax)
cvtsi2sdl 0x18(%rax), %xmm0
movsd %xmm0, -0x2a8(%rbp)
movq -0x20(%rbp), %rdi
callq 0x83b90
movsd -0x2a8(%rbp), %xmm0
movaps -0x2a0(%rbp), %xmm3
movaps -0x290(%rbp), %xmm2
movq %rax, %rcx
movq -0x1a8(%rbp), %rax
addq %rcx, %rcx
movq %rcx, %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x40(%rax)
cvtsi2sdl 0x1c(%rax), %xmm0
movsd %xmm0, -0x278(%rbp)
movq -0x28(%rbp), %rdi
callq 0x83b90
movaps -0x2a0(%rbp), %xmm3
movaps -0x290(%rbp), %xmm2
movsd -0x278(%rbp), %xmm0
movq %rax, %rcx
movq -0x1a8(%rbp), %rax
addq %rcx, %rcx
movq %rcx, %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x48(%rax)
jmp 0x8007b
cmpl $0x1, -0x38(%rbp)
jne 0x8003e
jmp 0x80079
movq 0x118fab(%rip), %rdi    # 0x198ff0
leaq 0xbb2cd(%rip), %rsi     # 0x13b319
callq 0xa5c0
movq %rax, -0x2b8(%rbp)
jmp 0x8005a
movq -0x2b8(%rbp), %rdi
movq 0x118f20(%rip), %rsi    # 0x198f88
callq 0xa610
jmp 0x8006f
movl $0x1, %edi
callq 0xa700
jmp 0x8007b
jmp 0x8007d
movb $0x1, -0x31(%rbp)
testb $0x1, -0x31(%rbp)
jne 0x80093
movq -0x1a8(%rbp), %rdi
callq 0x51170
movq -0x1b0(%rbp), %rax
addq $0x2c0, %rsp            # imm = 0x2C0
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0xab50
nopl (%rax)