// File: millanek[P]evo/process_vcf_fst.cpp
// Function: getVariantCountsForPBS(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&, ThreeSetCounts*, 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&)
void getVariantCountsForPBS(const std::vector<std::string>& fields, ThreeSetCounts* thisVariantCounts, const std::vector<size_t>& set1_loci, const std::vector<size_t>& set2_loci, const std::vector<size_t>& set3_loci) {
    
    int numSamples = (int)fields.size()-NUM_NON_GENOTYPE_COLUMNS;
    thisVariantCounts->individualsWithVariant.assign(numSamples,0);
    thisVariantCounts->missingGenotypesPerIndividual.assign(numSamples,false);
    thisVariantCounts->haplotypesWithVariant.assign(numSamples*2,0);
    
    thisVariantCounts->set1individualsWithVariant.assign(set1_loci.size(),0);
    thisVariantCounts->set2individualsWithVariant.assign(set2_loci.size(),0);
    thisVariantCounts->set3individualsWithVariant.assign(set3_loci.size(),0);
    int n1 = (int)(set1_loci.size()*2); int n2 = (int)(set2_loci.size()*2); int n3 = (int)(set3_loci.size()*2);
    thisVariantCounts->set1HaplotypeVariant.assign(n1,0); thisVariantCounts->set2HaplotypeVariant.assign(n2,0); thisVariantCounts->set3HaplotypeVariant.assign(n3,0);
    thisVariantCounts->set1_n_withoutMissing = n1; thisVariantCounts->set2_n_withoutMissing = n2; thisVariantCounts->set3_n_withoutMissing = n3;
    
    std::vector<std::string> altAlleles = split(fields[4], ',');
    thisVariantCounts->n_alt_alleles = (int)altAlleles.size();
    int alleleAsMissing = -1;
    for (int i = 0; i < (int)altAlleles.size(); i++) {
        if (altAlleles[i] == "*") {
            thisVariantCounts->n_alt_alleles = thisVariantCounts->n_alt_alleles - 1;
            alleleAsMissing = i + 1;
        }
        if (altAlleles[i].length() > 1) {
            thisVariantCounts->bIndel = true;
        }
    }
    
    if (thisVariantCounts->n_alt_alleles == 1) {
        int alt = (alleleAsMissing == 1) ? 1 : 2;
        
        int set1i = 0; int set2i = 0; int set3i = 0; int set1hapI = 0; int set2hapI = 0; int set3hapI = 0;
        std::vector<std::string> genotypes(fields.begin()+NUM_NON_GENOTYPE_COLUMNS,fields.end());
        //std::cerr << fields[0] << "\t" << fields[1] << "\tgenotypes.size()" << genotypes.size() << std::endl;
        for (const size_t i : set1_loci) {
            int v1int = genotypes[i][0] - '0'; int v2int = genotypes[i][2] - '0';
            if (v1int == alt) {
                thisVariantCounts->set1AltCount++; thisVariantCounts->set1individualsWithVariant[set1i]++;
                thisVariantCounts->set1HaplotypeVariant[set1hapI]++;
            } else if (genotypes[i][0] == '.' || v1int == alleleAsMissing) {
                //std::cerr << fields[0] << "\t" << fields[1] << "\t" << genotypes[i][0] << "\t" << i << std::endl;
                thisVariantCounts->missingGenotypesPerIndividual[i] = true;
                thisVariantCounts->set1_n_withoutMissing--;
            }
            if (v2int == alt) {
                thisVariantCounts->set1AltCount++; thisVariantCounts->set1individualsWithVariant[set1i]++;
                thisVariantCounts->set1HaplotypeVariant[set1hapI+1]++;
            } else if (genotypes[i][2] == '.' || v2int == alleleAsMissing) {
                thisVariantCounts->missingGenotypesPerIndividual[i] = true;
                //std::cerr << fields[0] << "\t" << fields[1] << "\t" << genotypes[i][2] << std::endl;
                thisVariantCounts->set1_n_withoutMissing--;
            }
            set1i++; set1hapI = set1hapI+2;
        } thisVariantCounts->set1AltAF = (double)thisVariantCounts->set1AltCount/thisVariantCounts->set1_n_withoutMissing;
        for (const size_t i : set2_loci) {
            int v1int = genotypes[i][0] - '0'; int v2int = genotypes[i][2] - '0';
            if (genotypes[i][0] - '0' == alt) {
                thisVariantCounts->set2AltCount++; thisVariantCounts->set2individualsWithVariant[set2i]++;
                thisVariantCounts->set2HaplotypeVariant[set2hapI]++;
            } else if (genotypes[i][0] == '.' || v1int == alleleAsMissing) {
                thisVariantCounts->missingGenotypesPerIndividual[i] = true;
                thisVariantCounts->set2_n_withoutMissing--;
            }
            if (genotypes[i][2] - '0' == alt) {
                thisVariantCounts->set2AltCount++; thisVariantCounts->set2individualsWithVariant[set2i]++;
                thisVariantCounts->set2HaplotypeVariant[set2hapI+1]++;
            } else if (genotypes[i][2] == '.' || v2int == alleleAsMissing) {
                thisVariantCounts->missingGenotypesPerIndividual[i] = true;
                thisVariantCounts->set2_n_withoutMissing--;
            }
            set2i++; set2hapI = set2hapI+2;
        } thisVariantCounts->set2AltAF = (double)thisVariantCounts->set2AltCount/thisVariantCounts->set2_n_withoutMissing;
        for (const size_t i : set3_loci) {
            int v1int = genotypes[i][0] - '0'; int v2int = genotypes[i][2] - '0';
            if (genotypes[i][0] - '0' == alt) {
                thisVariantCounts->set3AltCount++; thisVariantCounts->set2individualsWithVariant[set2i]++;
                thisVariantCounts->set3HaplotypeVariant[set2hapI]++;
            } else if (genotypes[i][0] == '.' || v1int == alleleAsMissing) {
                thisVariantCounts->missingGenotypesPerIndividual[i] = true;
                thisVariantCounts->set3_n_withoutMissing--;
            }
            if (genotypes[i][2] - '0' == alt) {
                thisVariantCounts->set3AltCount++; thisVariantCounts->set3individualsWithVariant[set2i]++;
                thisVariantCounts->set3HaplotypeVariant[set2hapI+1]++;
            } else if (genotypes[i][2] == '.' || v2int == alleleAsMissing) {
                thisVariantCounts->missingGenotypesPerIndividual[i] = true;
                thisVariantCounts->set3_n_withoutMissing--;
            }
            set3i++; set3hapI = set3hapI+2;
        } thisVariantCounts->set3AltAF = (double)thisVariantCounts->set3AltCount/thisVariantCounts->set3_n_withoutMissing;
        for (std::vector<std::string>::size_type i = 0; i != genotypes.size(); i++) {
            if (genotypes[i][0] - '0' == alt)
                thisVariantCounts->overall++;
            if (genotypes[i][2] - '0' == alt)
                thisVariantCounts->overall++;
        }
    }
    // std::cerr << "got here" << std::endl;
    /*if (fields[1] == "13433") {
     std::cerr << thisVariantCounts.set1Count << std::endl;
     std::cerr << thisVariantCounts.set2Count << std::endl;
     print_vector(thisVariantCounts.set1individualsWithVariant, std::cerr);
     print_vector(thisVariantCounts.set2individualsWithVariant, std::cerr);
     } */
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2e0, %rsp            # imm = 0x2E0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x8(%rbp), %rdi
callq 0x3ffd0
subl $0x9, %eax
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rdi
addq $0x50, %rdi
movslq -0x2c(%rbp), %rsi
movl $0x0, -0x30(%rbp)
leaq -0x30(%rbp), %rdx
callq 0x838d0
movq -0x10(%rbp), %rdi
addq $0xb0, %rdi
movslq -0x2c(%rbp), %rsi
movb $0x0, -0x31(%rbp)
leaq -0x31(%rbp), %rdx
callq 0x83900
movq -0x10(%rbp), %rdi
addq $0xe8, %rdi
movl -0x2c(%rbp), %eax
shll %eax
movslq %eax, %rsi
movl $0x0, -0x38(%rbp)
leaq -0x38(%rbp), %rdx
callq 0x838d0
movq -0x10(%rbp), %rax
addq $0x68, %rax
movq %rax, -0x1d8(%rbp)
movq -0x18(%rbp), %rdi
callq 0x83b90
movq -0x1d8(%rbp), %rdi
movq %rax, %rsi
movl $0x0, -0x3c(%rbp)
leaq -0x3c(%rbp), %rdx
callq 0x838d0
movq -0x10(%rbp), %rax
addq $0x80, %rax
movq %rax, -0x1d0(%rbp)
movq -0x20(%rbp), %rdi
callq 0x83b90
movq -0x1d0(%rbp), %rdi
movq %rax, %rsi
movl $0x0, -0x40(%rbp)
leaq -0x40(%rbp), %rdx
callq 0x838d0
movq -0x10(%rbp), %rax
addq $0x98, %rax
movq %rax, -0x1c8(%rbp)
movq -0x28(%rbp), %rdi
callq 0x83b90
movq -0x1c8(%rbp), %rdi
movq %rax, %rsi
movl $0x0, -0x44(%rbp)
leaq -0x44(%rbp), %rdx
callq 0x838d0
movq -0x18(%rbp), %rdi
callq 0x83b90
shlq %rax
movl %eax, -0x48(%rbp)
movq -0x20(%rbp), %rdi
callq 0x83b90
shlq %rax
movl %eax, -0x4c(%rbp)
movq -0x28(%rbp), %rdi
callq 0x83b90
shlq %rax
movl %eax, -0x50(%rbp)
movq -0x10(%rbp), %rdi
addq $0x100, %rdi            # imm = 0x100
movslq -0x48(%rbp), %rsi
movl $0x0, -0x54(%rbp)
leaq -0x54(%rbp), %rdx
callq 0x838d0
movq -0x10(%rbp), %rdi
addq $0x118, %rdi            # imm = 0x118
movslq -0x4c(%rbp), %rsi
movl $0x0, -0x58(%rbp)
leaq -0x58(%rbp), %rdx
callq 0x838d0
movq -0x10(%rbp), %rdi
addq $0x130, %rdi            # imm = 0x130
movslq -0x50(%rbp), %rsi
movl $0x0, -0x5c(%rbp)
leaq -0x5c(%rbp), %rdx
callq 0x838d0
movl -0x48(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xdc(%rax)
movl -0x4c(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xe0(%rax)
movl -0x50(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xe4(%rax)
movq -0x8(%rbp), %rdi
movl $0x4, %esi
callq 0x52960
movq %rax, %rsi
leaq -0x78(%rbp), %rdi
movl $0x2c, %edx
callq 0x7bbe0
leaq -0x78(%rbp), %rdi
callq 0x3ffd0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xd8(%rax)
movl $0xffffffff, -0x7c(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x80(%rbp)
movl -0x80(%rbp), %eax
movl %eax, -0x1dc(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x3ffd0
movq %rax, %rcx
movl -0x1dc(%rbp), %eax
cmpl %ecx, %eax
jge 0xd7df5
movslq -0x80(%rbp), %rsi
leaq -0x78(%rbp), %rdi
callq 0x3d940
movq %rax, %rdi
leaq 0x76472(%rip), %rsi     # 0x14e1e2
callq 0x2d770
movb %al, -0x1dd(%rbp)
jmp 0xd7d7d
movb -0x1dd(%rbp), %al
testb $0x1, %al
jne 0xd7d89
jmp 0xd7dc2
movq -0x10(%rbp), %rax
movl 0xd8(%rax), %ecx
subl $0x1, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xd8(%rax)
movl -0x80(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
jmp 0xd7dc2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0xd8a8f
movslq -0x80(%rbp), %rsi
leaq -0x78(%rbp), %rdi
callq 0x3d940
movq %rax, %rdi
callq 0xa930
cmpq $0x1, %rax
jbe 0xd7de5
movq -0x10(%rbp), %rax
movb $0x1, 0x5(%rax)
jmp 0xd7de7
movl -0x80(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x80(%rbp)
jmp 0xd7d36
movq -0x10(%rbp), %rax
cmpl $0x1, 0xd8(%rax)
jne 0xd8a7d
movl -0x7c(%rbp), %eax
subl $0x1, %eax
setne %al
movzbl %al, %eax
incl %eax
movl %eax, -0x90(%rbp)
movl $0x0, -0x94(%rbp)
movl $0x0, -0x98(%rbp)
movl $0x0, -0x9c(%rbp)
movl $0x0, -0xa0(%rbp)
movl $0x0, -0xa4(%rbp)
movl $0x0, -0xa8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x400f0
movq %rax, -0xd0(%rbp)
leaq -0xd0(%rbp), %rdi
movl $0x9, %esi
callq 0xe2d10
movq %rax, -0xc8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x40120
movq %rax, -0xd8(%rbp)
leaq -0xd9(%rbp), %rdi
movq %rdi, -0x1e8(%rbp)
callq 0x48e80
movq -0x1e8(%rbp), %rcx
movq -0xc8(%rbp), %rsi
movq -0xd8(%rbp), %rdx
leaq -0xc0(%rbp), %rdi
callq 0xe2d50
jmp 0xd7ec4
leaq -0xd9(%rbp), %rdi
callq 0x40090
movq -0x18(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq -0xe8(%rbp), %rdi
callq 0x83b30
movq %rax, -0xf0(%rbp)
movq -0xe8(%rbp), %rdi
callq 0x83b60
movq %rax, -0xf8(%rbp)
leaq -0xf0(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0x83aa0
testb $0x1, %al
jne 0xd7f1d
jmp 0xd8231
leaq -0xf0(%rbp), %rdi
callq 0x841c0
movq (%rax), %rax
movq %rax, -0x100(%rbp)
movq -0x100(%rbp), %rsi
leaq -0xc0(%rbp), %rdi
callq 0x3d940
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xac60
movq %rax, -0x1f0(%rbp)
jmp 0xd7f5b
movq -0x1f0(%rbp), %rax
movsbl (%rax), %eax
addl $-0x30, %eax
movl %eax, -0x104(%rbp)
movq -0x100(%rbp), %rsi
leaq -0xc0(%rbp), %rdi
callq 0x3d940
movq %rax, %rdi
movl $0x2, %esi
callq 0xac60
movq %rax, -0x1f8(%rbp)
jmp 0xd7f97
movq -0x1f8(%rbp), %rax
movsbl (%rax), %eax
subl $0x30, %eax
movl %eax, -0x108(%rbp)
movl -0x104(%rbp), %eax
cmpl -0x90(%rbp), %eax
jne 0xd804d
movq -0x10(%rbp), %rax
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rdi
addq $0x68, %rdi
movslq -0x94(%rbp), %rsi
callq 0x4d100
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x10(%rbp), %rdi
addq $0x100, %rdi            # imm = 0x100
movslq -0xa0(%rbp), %rsi
callq 0x4d100
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0xd80f8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0xd9(%rbp), %rdi
callq 0x40090
jmp 0xd8a8f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x3dfa0
jmp 0xd8a8f
movq -0x100(%rbp), %rsi
leaq -0xc0(%rbp), %rdi
callq 0x3d940
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xac60
movq %rax, -0x200(%rbp)
jmp 0xd8075
movq -0x200(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2e, %eax
je 0xd808f
movl -0x104(%rbp), %eax
cmpl -0x7c(%rbp), %eax
jne 0xd80f6
movq -0x10(%rbp), %rdi
addq $0xb0, %rdi
movq -0x100(%rbp), %rsi
callq 0x83940
movq %rdx, -0x210(%rbp)
movq %rax, -0x208(%rbp)
jmp 0xd80b6
movq -0x210(%rbp), %rax
movq -0x208(%rbp), %rcx
movq %rcx, -0x118(%rbp)
movq %rax, -0x110(%rbp)
leaq -0x118(%rbp), %rdi
movl $0x1, %esi
callq 0x480d0
movq -0x10(%rbp), %rax
movl 0xdc(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0xdc(%rax)
jmp 0xd80f8
movl -0x108(%rbp), %eax
cmpl -0x90(%rbp), %eax
jne 0xd8156
movq -0x10(%rbp), %rax
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rdi
addq $0x68, %rdi
movslq -0x94(%rbp), %rsi
callq 0x4d100
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x10(%rbp), %rdi
addq $0x100, %rdi            # imm = 0x100
movl -0xa0(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x4d100
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0xd8202
movq -0x100(%rbp), %rsi
leaq -0xc0(%rbp), %rdi
callq 0x3d940
movq %rax, %rdi
movl $0x2, %esi
callq 0xac60
movq %rax, -0x218(%rbp)
jmp 0xd817f
movq -0x218(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2e, %eax
je 0xd8199
movl -0x108(%rbp), %eax
cmpl -0x7c(%rbp), %eax
jne 0xd8200
movq -0x10(%rbp), %rdi
addq $0xb0, %rdi
movq -0x100(%rbp), %rsi
callq 0x83940
movq %rdx, -0x228(%rbp)
movq %rax, -0x220(%rbp)
jmp 0xd81c0
movq -0x228(%rbp), %rax
movq -0x220(%rbp), %rcx
movq %rcx, -0x128(%rbp)
movq %rax, -0x120(%rbp)
leaq -0x128(%rbp), %rdi
movl $0x1, %esi
callq 0x480d0
movq -0x10(%rbp), %rax
movl 0xdc(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0xdc(%rax)
jmp 0xd8202
movl -0x94(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x94(%rbp)
movl -0xa0(%rbp), %eax
addl $0x2, %eax
movl %eax, -0xa0(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x841e0
jmp 0xd7f01
movq -0x10(%rbp), %rax
cvtsi2sdl 0x8(%rax), %xmm0
movq -0x10(%rbp), %rax
cvtsi2sdl 0xdc(%rax), %xmm1
divsd %xmm1, %xmm0
movq -0x10(%rbp), %rax
movsd %xmm0, 0x20(%rax)
movq -0x20(%rbp), %rax
movq %rax, -0x130(%rbp)
movq -0x130(%rbp), %rdi
callq 0x83b30
movq %rax, -0x138(%rbp)
movq -0x130(%rbp), %rdi
callq 0x83b60
movq %rax, -0x140(%rbp)
leaq -0x138(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0x83aa0
testb $0x1, %al
jne 0xd82a0
jmp 0xd85cf
leaq -0x138(%rbp), %rdi
callq 0x841c0
movq (%rax), %rax
movq %rax, -0x148(%rbp)
movq -0x148(%rbp), %rsi
leaq -0xc0(%rbp), %rdi
callq 0x3d940
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xac60
movq %rax, -0x230(%rbp)
jmp 0xd82de
movq -0x230(%rbp), %rax
movsbl (%rax), %eax
addl $-0x30, %eax
movl %eax, -0x14c(%rbp)
movq -0x148(%rbp), %rsi
leaq -0xc0(%rbp), %rdi
callq 0x3d940
movq %rax, %rdi
movl $0x2, %esi
callq 0xac60
movq %rax, -0x238(%rbp)
jmp 0xd831a
movq -0x238(%rbp), %rax
movsbl (%rax), %eax
addl $-0x30, %eax
movl %eax, -0x150(%rbp)
movq -0x148(%rbp), %rsi
leaq -0xc0(%rbp), %rdi
callq 0x3d940
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xac60
movq %rax, -0x240(%rbp)
jmp 0xd8355
movq -0x240(%rbp), %rax
movsbl (%rax), %eax
subl $0x30, %eax
cmpl -0x90(%rbp), %eax
jne 0xd83b8
movq -0x10(%rbp), %rax
movl 0xc(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xc(%rax)
movq -0x10(%rbp), %rdi
addq $0x80, %rdi
movslq -0x98(%rbp), %rsi
callq 0x4d100
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x10(%rbp), %rdi
addq $0x118, %rdi            # imm = 0x118
movslq -0xa4(%rbp), %rsi
callq 0x4d100
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0xd8463
movq -0x148(%rbp), %rsi
leaq -0xc0(%rbp), %rdi
callq 0x3d940
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xac60
movq %rax, -0x248(%rbp)
jmp 0xd83e0
movq -0x248(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2e, %eax
je 0xd83fa
movl -0x14c(%rbp), %eax
cmpl -0x7c(%rbp), %eax
jne 0xd8461
movq -0x10(%rbp), %rdi
addq $0xb0, %rdi
movq -0x148(%rbp), %rsi
callq 0x83940
movq %rdx, -0x258(%rbp)
movq %rax, -0x250(%rbp)
jmp 0xd8421
movq -0x258(%rbp), %rax
movq -0x250(%rbp), %rcx
movq %rcx, -0x160(%rbp)
movq %rax, -0x158(%rbp)
leaq -0x160(%rbp), %rdi
movl $0x1, %esi
callq 0x480d0
movq -0x10(%rbp), %rax
movl 0xe0(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0xe0(%rax)
jmp 0xd8463
movq -0x148(%rbp), %rsi
leaq -0xc0(%rbp), %rdi
callq 0x3d940
movq %rax, %rdi
movl $0x2, %esi
callq 0xac60
movq %rax, -0x260(%rbp)
jmp 0xd848c
movq -0x260(%rbp), %rax
movsbl (%rax), %eax
subl $0x30, %eax
cmpl -0x90(%rbp), %eax
jne 0xd84f4
movq -0x10(%rbp), %rax
movl 0xc(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xc(%rax)
movq -0x10(%rbp), %rdi
addq $0x80, %rdi
movslq -0x98(%rbp), %rsi
callq 0x4d100
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x10(%rbp), %rdi
addq $0x118, %rdi            # imm = 0x118
movl -0xa4(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x4d100
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0xd85a0
movq -0x148(%rbp), %rsi
leaq -0xc0(%rbp), %rdi
callq 0x3d940
movq %rax, %rdi
movl $0x2, %esi
callq 0xac60
movq %rax, -0x268(%rbp)
jmp 0xd851d
movq -0x268(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2e, %eax
je 0xd8537
movl -0x150(%rbp), %eax
cmpl -0x7c(%rbp), %eax
jne 0xd859e
movq -0x10(%rbp), %rdi
addq $0xb0, %rdi
movq -0x148(%rbp), %rsi
callq 0x83940
movq %rdx, -0x278(%rbp)
movq %rax, -0x270(%rbp)
jmp 0xd855e
movq -0x278(%rbp), %rax
movq -0x270(%rbp), %rcx
movq %rcx, -0x170(%rbp)
movq %rax, -0x168(%rbp)
leaq -0x170(%rbp), %rdi
movl $0x1, %esi
callq 0x480d0
movq -0x10(%rbp), %rax
movl 0xe0(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0xe0(%rax)
jmp 0xd85a0
movl -0x98(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x98(%rbp)
movl -0xa4(%rbp), %eax
addl $0x2, %eax
movl %eax, -0xa4(%rbp)
leaq -0x138(%rbp), %rdi
callq 0x841e0
jmp 0xd8284
movq -0x10(%rbp), %rax
cvtsi2sdl 0xc(%rax), %xmm0
movq -0x10(%rbp), %rax
cvtsi2sdl 0xe0(%rax), %xmm1
divsd %xmm1, %xmm0
movq -0x10(%rbp), %rax
movsd %xmm0, 0x28(%rax)
movq -0x28(%rbp), %rax
movq %rax, -0x178(%rbp)
movq -0x178(%rbp), %rdi
callq 0x83b30
movq %rax, -0x180(%rbp)
movq -0x178(%rbp), %rdi
callq 0x83b60
movq %rax, -0x188(%rbp)
leaq -0x180(%rbp), %rdi
leaq -0x188(%rbp), %rsi
callq 0x83aa0
testb $0x1, %al
jne 0xd863e
jmp 0xd896d
leaq -0x180(%rbp), %rdi
callq 0x841c0
movq (%rax), %rax
movq %rax, -0x190(%rbp)
movq -0x190(%rbp), %rsi
leaq -0xc0(%rbp), %rdi
callq 0x3d940
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xac60
movq %rax, -0x280(%rbp)
jmp 0xd867c
movq -0x280(%rbp), %rax
movsbl (%rax), %eax
addl $-0x30, %eax
movl %eax, -0x194(%rbp)
movq -0x190(%rbp), %rsi
leaq -0xc0(%rbp), %rdi
callq 0x3d940
movq %rax, %rdi
movl $0x2, %esi
callq 0xac60
movq %rax, -0x288(%rbp)
jmp 0xd86b8
movq -0x288(%rbp), %rax
movsbl (%rax), %eax
addl $-0x30, %eax
movl %eax, -0x198(%rbp)
movq -0x190(%rbp), %rsi
leaq -0xc0(%rbp), %rdi
callq 0x3d940
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xac60
movq %rax, -0x290(%rbp)
jmp 0xd86f3
movq -0x290(%rbp), %rax
movsbl (%rax), %eax
subl $0x30, %eax
cmpl -0x90(%rbp), %eax
jne 0xd8756
movq -0x10(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rdi
addq $0x80, %rdi
movslq -0x98(%rbp), %rsi
callq 0x4d100
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x10(%rbp), %rdi
addq $0x130, %rdi            # imm = 0x130
movslq -0xa4(%rbp), %rsi
callq 0x4d100
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0xd8801
movq -0x190(%rbp), %rsi
leaq -0xc0(%rbp), %rdi
callq 0x3d940
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xac60
movq %rax, -0x298(%rbp)
jmp 0xd877e
movq -0x298(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2e, %eax
je 0xd8798
movl -0x194(%rbp), %eax
cmpl -0x7c(%rbp), %eax
jne 0xd87ff
movq -0x10(%rbp), %rdi
addq $0xb0, %rdi
movq -0x190(%rbp), %rsi
callq 0x83940
movq %rdx, -0x2a8(%rbp)
movq %rax, -0x2a0(%rbp)
jmp 0xd87bf
movq -0x2a8(%rbp), %rax
movq -0x2a0(%rbp), %rcx
movq %rcx, -0x1a8(%rbp)
movq %rax, -0x1a0(%rbp)
leaq -0x1a8(%rbp), %rdi
movl $0x1, %esi
callq 0x480d0
movq -0x10(%rbp), %rax
movl 0xe4(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0xe4(%rax)
jmp 0xd8801
movq -0x190(%rbp), %rsi
leaq -0xc0(%rbp), %rdi
callq 0x3d940
movq %rax, %rdi
movl $0x2, %esi
callq 0xac60
movq %rax, -0x2b0(%rbp)
jmp 0xd882a
movq -0x2b0(%rbp), %rax
movsbl (%rax), %eax
subl $0x30, %eax
cmpl -0x90(%rbp), %eax
jne 0xd8892
movq -0x10(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rdi
addq $0x98, %rdi
movslq -0x98(%rbp), %rsi
callq 0x4d100
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x10(%rbp), %rdi
addq $0x130, %rdi            # imm = 0x130
movl -0xa4(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x4d100
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0xd893e
movq -0x190(%rbp), %rsi
leaq -0xc0(%rbp), %rdi
callq 0x3d940
movq %rax, %rdi
movl $0x2, %esi
callq 0xac60
movq %rax, -0x2b8(%rbp)
jmp 0xd88bb
movq -0x2b8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2e, %eax
je 0xd88d5
movl -0x198(%rbp), %eax
cmpl -0x7c(%rbp), %eax
jne 0xd893c
movq -0x10(%rbp), %rdi
addq $0xb0, %rdi
movq -0x190(%rbp), %rsi
callq 0x83940
movq %rdx, -0x2c8(%rbp)
movq %rax, -0x2c0(%rbp)
jmp 0xd88fc
movq -0x2c8(%rbp), %rax
movq -0x2c0(%rbp), %rcx
movq %rcx, -0x1b8(%rbp)
movq %rax, -0x1b0(%rbp)
leaq -0x1b8(%rbp), %rdi
movl $0x1, %esi
callq 0x480d0
movq -0x10(%rbp), %rax
movl 0xe4(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0xe4(%rax)
jmp 0xd893e
movl -0x9c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9c(%rbp)
movl -0xa8(%rbp), %eax
addl $0x2, %eax
movl %eax, -0xa8(%rbp)
leaq -0x180(%rbp), %rdi
callq 0x841e0
jmp 0xd8622
movq -0x10(%rbp), %rax
cvtsi2sdl 0x10(%rax), %xmm0
movq -0x10(%rbp), %rax
cvtsi2sdl 0xe4(%rax), %xmm1
divsd %xmm1, %xmm0
movq -0x10(%rbp), %rax
movsd %xmm0, 0x30(%rax)
movq $0x0, -0x1c0(%rbp)
movq -0x1c0(%rbp), %rax
movq %rax, -0x2d0(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x3ffd0
movq %rax, %rcx
movq -0x2d0(%rbp), %rax
cmpq %rcx, %rax
je 0xd8a71
movq -0x1c0(%rbp), %rsi
leaq -0xc0(%rbp), %rdi
callq 0x3d940
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xac60
movq %rax, -0x2d8(%rbp)
jmp 0xd89ef
movq -0x2d8(%rbp), %rax
movsbl (%rax), %eax
subl $0x30, %eax
cmpl -0x90(%rbp), %eax
jne 0xd8a0f
movq -0x10(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x1c0(%rbp), %rsi
leaq -0xc0(%rbp), %rdi
callq 0x3d940
movq %rax, %rdi
movl $0x2, %esi
callq 0xac60
movq %rax, -0x2e0(%rbp)
jmp 0xd8a38
movq -0x2e0(%rbp), %rax
movsbl (%rax), %eax
subl $0x30, %eax
cmpl -0x90(%rbp), %eax
jne 0xd8a58
movq -0x10(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0xd8a5a
movq -0x1c0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1c0(%rbp)
jmp 0xd899a
leaq -0xc0(%rbp), %rdi
callq 0x3dfa0
leaq -0x78(%rbp), %rdi
callq 0x3dfa0
addq $0x2e0, %rsp            # imm = 0x2E0
popq %rbp
retq
leaq -0x78(%rbp), %rdi
callq 0x3dfa0
movq -0x88(%rbp), %rdi
callq 0xab50
nopw %cs:(%rax,%rax)