// File: millanek[P]evo/process_vcf_utils.cpp
// Function: getFourSetVariantCounts(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&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
FourSetCounts getFourSetVariantCounts(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>& set4_loci, const std::string& AA) {
    FourSetCounts thisVariantCounts;
    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(set4_loci.begin(), set4_loci.end(), i-NUM_NON_GENOTYPE_COLUMNS) != set4_loci.end()) { thisVariantCounts.set4AltCount++; }
            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(set4_loci.begin(), set4_loci.end(), i-NUM_NON_GENOTYPE_COLUMNS) != set4_loci.end()) { thisVariantCounts.set4AltCount++; }
            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 (AA == "ref") {
        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 (AA == "alt") {
        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 (AA == "N") {
    } else {
        std::cerr << "Error: Derived allele can only be \"ref\" or \"alt\"" << std::endl;
        exit(1);
    }
    
    return thisVariantCounts;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2e0, %rsp            # imm = 0x2E0
movq %rdi, -0x1a0(%rbp)
movq %rdi, %rax
movq %rax, -0x1a8(%rbp)
movq 0x10(%rbp), %rax
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 0x51e40
movq -0x1a0(%rbp), %rdi
addq $0x68, %rdi
movq %rdi, -0x198(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3ffd0
movq -0x198(%rbp), %rdi
movq %rax, %rsi
addq $-0x9, %rsi
movl $0x0, -0x38(%rbp)
leaq -0x38(%rbp), %rdx
callq 0x838d0
jmp 0x7eabc
movq $0x9, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x1b0(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3ffd0
movq %rax, %rcx
movq -0x1b0(%rbp), %rax
cmpq %rcx, %rax
je 0x7f064
movq -0x10(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x52960
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xa670
movsbl (%rax), %eax
cmpl $0x31, %eax
jne 0x7ed9b
movq -0x1a0(%rbp), %rax
movl (%rax), %ecx
incl %ecx
movl %ecx, (%rax)
movq -0x18(%rbp), %rdi
callq 0x83b30
movq %rax, -0x60(%rbp)
movq -0x18(%rbp), %rdi
callq 0x83b60
movq %rax, -0x68(%rbp)
movq -0x50(%rbp), %rax
addq $-0x9, %rax
movq %rax, -0x70(%rbp)
movq -0x60(%rbp), %rdi
movq -0x68(%rbp), %rsi
leaq -0x70(%rbp), %rdx
callq 0x83ae0
movq %rax, -0x1b8(%rbp)
jmp 0x7eb5d
movq -0x1b8(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x18(%rbp), %rdi
callq 0x83b60
movq %rax, -0x78(%rbp)
leaq -0x58(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x83aa0
testb $0x1, %al
jne 0x7eb88
jmp 0x7ebb7
movq -0x1a0(%rbp), %rax
movl 0x4(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rax)
jmp 0x7ebb7
movq -0x1a0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
callq 0x52220
jmp 0x7f62b
movq -0x20(%rbp), %rdi
callq 0x83b30
movq %rax, -0x88(%rbp)
movq -0x20(%rbp), %rdi
callq 0x83b60
movq %rax, -0x90(%rbp)
movq -0x50(%rbp), %rax
addq $-0x9, %rax
movq %rax, -0x98(%rbp)
movq -0x88(%rbp), %rdi
movq -0x90(%rbp), %rsi
leaq -0x98(%rbp), %rdx
callq 0x83ae0
movq %rax, -0x1c0(%rbp)
jmp 0x7ec09
movq -0x1c0(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x20(%rbp), %rdi
callq 0x83b60
movq %rax, -0xa0(%rbp)
leaq -0x80(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x83aa0
testb $0x1, %al
jne 0x7ec3a
jmp 0x7ec4a
movq -0x1a0(%rbp), %rax
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8(%rax)
movq -0x28(%rbp), %rdi
callq 0x83b30
movq %rax, -0xb0(%rbp)
movq -0x28(%rbp), %rdi
callq 0x83b60
movq %rax, -0xb8(%rbp)
movq -0x50(%rbp), %rax
addq $-0x9, %rax
movq %rax, -0xc0(%rbp)
movq -0xb0(%rbp), %rdi
movq -0xb8(%rbp), %rsi
leaq -0xc0(%rbp), %rdx
callq 0x83ae0
movq %rax, -0x1c8(%rbp)
jmp 0x7ec9c
movq -0x1c8(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0x28(%rbp), %rdi
callq 0x83b60
movq %rax, -0xc8(%rbp)
leaq -0xa8(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x83aa0
testb $0x1, %al
jne 0x7ecd3
jmp 0x7ece3
movq -0x1a0(%rbp), %rax
movl 0xc(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xc(%rax)
movq -0x30(%rbp), %rdi
callq 0x83b30
movq %rax, -0xd8(%rbp)
movq -0x30(%rbp), %rdi
callq 0x83b60
movq %rax, -0xe0(%rbp)
movq -0x50(%rbp), %rax
addq $-0x9, %rax
movq %rax, -0xe8(%rbp)
movq -0xd8(%rbp), %rdi
movq -0xe0(%rbp), %rsi
leaq -0xe8(%rbp), %rdx
callq 0x83ae0
movq %rax, -0x1d0(%rbp)
jmp 0x7ed35
movq -0x1d0(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0x30(%rbp), %rdi
callq 0x83b60
movq %rax, -0xf0(%rbp)
leaq -0xd0(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0x83aa0
testb $0x1, %al
jne 0x7ed6c
jmp 0x7ed7c
movq -0x1a0(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
movq -0x1a0(%rbp), %rdi
addq $0x68, %rdi
movq -0x50(%rbp), %rsi
subq $0x9, %rsi
callq 0x4d100
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x10(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x52960
movq %rax, %rdi
movl $0x2, %esi
callq 0xa670
movsbl (%rax), %eax
cmpl $0x31, %eax
jne 0x7f051
movq -0x1a0(%rbp), %rax
movl (%rax), %ecx
incl %ecx
movl %ecx, (%rax)
movq -0x18(%rbp), %rdi
callq 0x83b30
movq %rax, -0x100(%rbp)
movq -0x18(%rbp), %rdi
callq 0x83b60
movq %rax, -0x108(%rbp)
movq -0x50(%rbp), %rax
addq $-0x9, %rax
movq %rax, -0x110(%rbp)
movq -0x100(%rbp), %rdi
movq -0x108(%rbp), %rsi
leaq -0x110(%rbp), %rdx
callq 0x83ae0
movq %rax, -0x1d8(%rbp)
jmp 0x7ee20
movq -0x1d8(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq -0x18(%rbp), %rdi
callq 0x83b60
movq %rax, -0x118(%rbp)
leaq -0xf8(%rbp), %rdi
leaq -0x118(%rbp), %rsi
callq 0x83aa0
testb $0x1, %al
jne 0x7ee57
jmp 0x7ee67
movq -0x1a0(%rbp), %rax
movl 0x4(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rax)
movq -0x20(%rbp), %rdi
callq 0x83b30
movq %rax, -0x128(%rbp)
movq -0x20(%rbp), %rdi
callq 0x83b60
movq %rax, -0x130(%rbp)
movq -0x50(%rbp), %rax
addq $-0x9, %rax
movq %rax, -0x138(%rbp)
movq -0x128(%rbp), %rdi
movq -0x130(%rbp), %rsi
leaq -0x138(%rbp), %rdx
callq 0x83ae0
movq %rax, -0x1e0(%rbp)
jmp 0x7eeb9
movq -0x1e0(%rbp), %rax
movq %rax, -0x120(%rbp)
movq -0x20(%rbp), %rdi
callq 0x83b60
movq %rax, -0x140(%rbp)
leaq -0x120(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0x83aa0
testb $0x1, %al
jne 0x7eef0
jmp 0x7ef00
movq -0x1a0(%rbp), %rax
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8(%rax)
movq -0x28(%rbp), %rdi
callq 0x83b30
movq %rax, -0x150(%rbp)
movq -0x28(%rbp), %rdi
callq 0x83b60
movq %rax, -0x158(%rbp)
movq -0x50(%rbp), %rax
addq $-0x9, %rax
movq %rax, -0x160(%rbp)
movq -0x150(%rbp), %rdi
movq -0x158(%rbp), %rsi
leaq -0x160(%rbp), %rdx
callq 0x83ae0
movq %rax, -0x1e8(%rbp)
jmp 0x7ef52
movq -0x1e8(%rbp), %rax
movq %rax, -0x148(%rbp)
movq -0x28(%rbp), %rdi
callq 0x83b60
movq %rax, -0x168(%rbp)
leaq -0x148(%rbp), %rdi
leaq -0x168(%rbp), %rsi
callq 0x83aa0
testb $0x1, %al
jne 0x7ef89
jmp 0x7ef99
movq -0x1a0(%rbp), %rax
movl 0xc(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xc(%rax)
movq -0x30(%rbp), %rdi
callq 0x83b30
movq %rax, -0x178(%rbp)
movq -0x30(%rbp), %rdi
callq 0x83b60
movq %rax, -0x180(%rbp)
movq -0x50(%rbp), %rax
addq $-0x9, %rax
movq %rax, -0x188(%rbp)
movq -0x178(%rbp), %rdi
movq -0x180(%rbp), %rsi
leaq -0x188(%rbp), %rdx
callq 0x83ae0
movq %rax, -0x1f0(%rbp)
jmp 0x7efeb
movq -0x1f0(%rbp), %rax
movq %rax, -0x170(%rbp)
movq -0x30(%rbp), %rdi
callq 0x83b60
movq %rax, -0x190(%rbp)
leaq -0x170(%rbp), %rdi
leaq -0x190(%rbp), %rsi
callq 0x83aa0
testb $0x1, %al
jne 0x7f022
jmp 0x7f032
movq -0x1a0(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
movq -0x1a0(%rbp), %rdi
addq $0x68, %rdi
movq -0x50(%rbp), %rsi
subq $0x9, %rsi
callq 0x4d100
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0x7f053
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0x7eac4
movq -0x18(%rbp), %rdi
callq 0x83b90
movq %rax, %rcx
movq -0x1a0(%rbp), %rax
addl %ecx, %ecx
movl 0x4(%rax), %edx
subl %edx, %ecx
movl %ecx, 0x14(%rax)
movq -0x20(%rbp), %rdi
callq 0x83b90
movq %rax, %rcx
movq -0x1a0(%rbp), %rax
addl %ecx, %ecx
movl 0x8(%rax), %edx
subl %edx, %ecx
movl %ecx, 0x18(%rax)
movq -0x28(%rbp), %rdi
callq 0x83b90
movq %rax, %rcx
movq -0x1a0(%rbp), %rax
addl %ecx, %ecx
movl 0xc(%rax), %edx
subl %edx, %ecx
movl %ecx, 0x1c(%rax)
movq -0x30(%rbp), %rdi
callq 0x83b90
movq %rax, %rcx
movq -0x1a0(%rbp), %rax
addl %ecx, %ecx
movl 0x10(%rax), %edx
subl %edx, %ecx
movl %ecx, 0x20(%rax)
cvtsi2sdl 0x4(%rax), %xmm0
movsd %xmm0, -0x238(%rbp)
movq -0x18(%rbp), %rdi
callq 0x83b90
movsd -0x238(%rbp), %xmm0
movq %rax, %rcx
movq -0x1a0(%rbp), %rax
addq %rcx, %rcx
movq %rcx, %xmm1
movaps 0xaf051(%rip), %xmm2    # 0x12e160
movaps %xmm2, -0x220(%rbp)
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0xaf04e(%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, 0x28(%rax)
cvtsi2sdl 0x8(%rax), %xmm0
movsd %xmm0, -0x230(%rbp)
movq -0x20(%rbp), %rdi
callq 0x83b90
movsd -0x230(%rbp), %xmm0
movaps -0x220(%rbp), %xmm3
movaps -0x210(%rbp), %xmm2
movq %rax, %rcx
movq -0x1a0(%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)
cvtsi2sdl 0xc(%rax), %xmm0
movsd %xmm0, -0x228(%rbp)
movq -0x28(%rbp), %rdi
callq 0x83b90
movsd -0x228(%rbp), %xmm0
movaps -0x220(%rbp), %xmm3
movaps -0x210(%rbp), %xmm2
movq %rax, %rcx
movq -0x1a0(%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, 0x38(%rax)
cvtsi2sdl 0x10(%rax), %xmm0
movsd %xmm0, -0x200(%rbp)
movq -0x30(%rbp), %rdi
callq 0x83b90
movaps -0x220(%rbp), %xmm3
movaps -0x210(%rbp), %xmm2
movsd -0x200(%rbp), %xmm0
movq %rax, %rcx
movq -0x1a0(%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)
movq 0x10(%rbp), %rdi
leaq 0xb452e(%rip), %rsi     # 0x133788
callq 0x2d770
movb %al, -0x1f1(%rbp)
jmp 0x7f267
movb -0x1f1(%rbp), %al
testb $0x1, %al
jne 0x7f276
jmp 0x7f3f9
movq -0x1a0(%rbp), %rax
cvtsi2sdl 0x4(%rax), %xmm0
movsd %xmm0, -0x278(%rbp)
movq -0x18(%rbp), %rdi
callq 0x83b90
movsd -0x278(%rbp), %xmm0
movq %rax, %rcx
movq -0x1a0(%rbp), %rax
addq %rcx, %rcx
movq %rcx, %xmm1
movaps 0xaeeac(%rip), %xmm2    # 0x12e160
movaps %xmm2, -0x260(%rbp)
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0xaeea9(%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, 0x48(%rax)
cvtsi2sdl 0x8(%rax), %xmm0
movsd %xmm0, -0x270(%rbp)
movq -0x20(%rbp), %rdi
callq 0x83b90
movsd -0x270(%rbp), %xmm0
movaps -0x260(%rbp), %xmm3
movaps -0x250(%rbp), %xmm2
movq %rax, %rcx
movq -0x1a0(%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, 0x50(%rax)
cvtsi2sdl 0xc(%rax), %xmm0
movsd %xmm0, -0x268(%rbp)
movq -0x28(%rbp), %rdi
callq 0x83b90
movsd -0x268(%rbp), %xmm0
movaps -0x260(%rbp), %xmm3
movaps -0x250(%rbp), %xmm2
movq %rax, %rcx
movq -0x1a0(%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, 0x58(%rax)
cvtsi2sdl 0x10(%rax), %xmm0
movsd %xmm0, -0x240(%rbp)
movq -0x30(%rbp), %rdi
callq 0x83b90
movaps -0x260(%rbp), %xmm3
movaps -0x250(%rbp), %xmm2
movsd -0x240(%rbp), %xmm0
movq %rax, %rcx
movq -0x1a0(%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, 0x60(%rax)
jmp 0x7f605
movq 0x10(%rbp), %rdi
leaq 0xcd53f(%rip), %rsi     # 0x14c943
callq 0x2d770
movb %al, -0x279(%rbp)
jmp 0x7f411
movb -0x279(%rbp), %al
testb $0x1, %al
jne 0x7f420
jmp 0x7f5a0
movq -0x1a0(%rbp), %rax
cvtsi2sdl 0x14(%rax), %xmm0
movsd %xmm0, -0x2c8(%rbp)
movq -0x18(%rbp), %rdi
callq 0x83b90
movsd -0x2c8(%rbp), %xmm0
movq %rax, %rcx
movq -0x1a0(%rbp), %rax
addq %rcx, %rcx
movq %rcx, %xmm1
movaps 0xaed02(%rip), %xmm2    # 0x12e160
movaps %xmm2, -0x2b0(%rbp)
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0xaecff(%rip), %xmm2    # 0x12e170
movaps %xmm2, -0x2a0(%rbp)
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x48(%rax)
cvtsi2sdl 0x18(%rax), %xmm0
movsd %xmm0, -0x2c0(%rbp)
movq -0x20(%rbp), %rdi
callq 0x83b90
movsd -0x2c0(%rbp), %xmm0
movaps -0x2b0(%rbp), %xmm3
movaps -0x2a0(%rbp), %xmm2
movq %rax, %rcx
movq -0x1a0(%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, 0x50(%rax)
cvtsi2sdl 0x1c(%rax), %xmm0
movsd %xmm0, -0x2b8(%rbp)
movq -0x28(%rbp), %rdi
callq 0x83b90
movsd -0x2b8(%rbp), %xmm0
movaps -0x2b0(%rbp), %xmm3
movaps -0x2a0(%rbp), %xmm2
movq %rax, %rcx
movq -0x1a0(%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, 0x58(%rax)
cvtsi2sdl 0x20(%rax), %xmm0
movsd %xmm0, -0x288(%rbp)
movq -0x30(%rbp), %rdi
callq 0x83b90
movaps -0x2b0(%rbp), %xmm3
movaps -0x2a0(%rbp), %xmm2
movsd -0x288(%rbp), %xmm0
movq %rax, %rcx
movq -0x1a0(%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, 0x60(%rax)
jmp 0x7f603
movq 0x10(%rbp), %rdi
leaq 0xc9ff6(%rip), %rsi     # 0x1495a1
callq 0x2d770
movb %al, -0x2c9(%rbp)
jmp 0x7f5b8
movb -0x2c9(%rbp), %al
testb $0x1, %al
jne 0x7f5c4
jmp 0x7f5c6
jmp 0x7f601
movq 0x119a23(%rip), %rdi    # 0x198ff0
leaq 0xbbd14(%rip), %rsi     # 0x13b2e8
callq 0xa5c0
movq %rax, -0x2d8(%rbp)
jmp 0x7f5e2
movq -0x2d8(%rbp), %rdi
movq 0x119998(%rip), %rsi    # 0x198f88
callq 0xa610
jmp 0x7f5f7
movl $0x1, %edi
callq 0xa700
jmp 0x7f603
jmp 0x7f605
movb $0x1, -0x31(%rbp)
testb $0x1, -0x31(%rbp)
jne 0x7f61b
movq -0x1a0(%rbp), %rdi
callq 0x52220
movq -0x1a8(%rbp), %rax
addq $0x2e0, %rsp            # imm = 0x2E0
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0xab50
nopw %cs:(%rax,%rax)