// File: millanek[P]evo/process_vcf_fst.cpp
// Function: getVariantCountsForFst(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&, SetCounts*, std::vector<unsigned long, std::allocator<unsigned long>> const&, std::vector<unsigned long, std::allocator<unsigned long>> const&)
void getVariantCountsForFst(const std::vector<std::string>& fields, SetCounts* thisVariantCounts, const std::vector<size_t>& set1_loci, const std::vector<size_t>& set2_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);
    int n1 = (int)(set1_loci.size()*2); int n2 = (int)(set2_loci.size()*2);
    thisVariantCounts->set1HaplotypeVariant.assign(n1,0);
    thisVariantCounts->set2HaplotypeVariant.assign(n2,0);
    thisVariantCounts->set1_n_withoutMissing = n1;
    thisVariantCounts->set2_n_withoutMissing = n2;
    
    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 = 1;

        if (alleleAsMissing == 1) alt = 2;

        int set1i = 0; int set2i = 0; int set1hapI = 0; int set2hapI = 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->set1Count++; 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 = thisVariantCounts->set1_n_withoutMissing - 1;
            }
            if (v2int == alt) {
                thisVariantCounts->set1Count++; 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 = thisVariantCounts->set1_n_withoutMissing - 1;
            }
            set1i++; set1hapI = set1hapI+2;
        }
        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->set2Count++; thisVariantCounts->set2individualsWithVariant[set2i]++;
                thisVariantCounts->set2HaplotypeVariant[set2hapI]++;
            } else if (genotypes[i][0] == '.' || v1int == alleleAsMissing) {
                thisVariantCounts->missingGenotypesPerIndividual[i] = true;
                thisVariantCounts->set2_n_withoutMissing = thisVariantCounts->set2_n_withoutMissing - 1;
            }
            if (genotypes[i][2] - '0' == alt) {
                thisVariantCounts->set2Count++; thisVariantCounts->set2individualsWithVariant[set2i]++;
                thisVariantCounts->set2HaplotypeVariant[set2hapI+1]++;
            } else if (genotypes[i][2] == '.' || v2int == alleleAsMissing) {
                thisVariantCounts->missingGenotypesPerIndividual[i] = true;
                thisVariantCounts->set2_n_withoutMissing = thisVariantCounts->set2_n_withoutMissing - 1;
            }
            set2i++; set2hapI = set2hapI+2;
        }
        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 $0x220, %rsp            # imm = 0x220
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rdi
callq 0x3ffd0
subl $0x9, %eax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
movslq -0x24(%rbp), %rsi
movl $0x0, -0x28(%rbp)
leaq -0x28(%rbp), %rdx
callq 0x838d0
movq -0x10(%rbp), %rdi
addq $0x20, %rdi
movslq -0x24(%rbp), %rsi
movb $0x0, -0x29(%rbp)
leaq -0x29(%rbp), %rdx
callq 0x83900
movq -0x10(%rbp), %rdi
addq $0x48, %rdi
movl -0x24(%rbp), %eax
shll %eax
movslq %eax, %rsi
movl $0x0, -0x30(%rbp)
leaq -0x30(%rbp), %rdx
callq 0x838d0
movq -0x10(%rbp), %rax
addq $0x90, %rax
movq %rax, -0x168(%rbp)
movq -0x18(%rbp), %rdi
callq 0x83b90
movq -0x168(%rbp), %rdi
movq %rax, %rsi
movl $0x0, -0x34(%rbp)
leaq -0x34(%rbp), %rdx
callq 0x838d0
movq -0x10(%rbp), %rax
addq $0xa8, %rax
movq %rax, -0x160(%rbp)
movq -0x20(%rbp), %rdi
callq 0x83b90
movq -0x160(%rbp), %rdi
movq %rax, %rsi
movl $0x0, -0x38(%rbp)
leaq -0x38(%rbp), %rdx
callq 0x838d0
movq -0x18(%rbp), %rdi
callq 0x83b90
shlq %rax
movl %eax, -0x3c(%rbp)
movq -0x20(%rbp), %rdi
callq 0x83b90
shlq %rax
movl %eax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
addq $0x60, %rdi
movslq -0x3c(%rbp), %rsi
movl $0x0, -0x44(%rbp)
leaq -0x44(%rbp), %rdx
callq 0x838d0
movq -0x10(%rbp), %rdi
addq $0x78, %rdi
movslq -0x40(%rbp), %rsi
movl $0x0, -0x48(%rbp)
leaq -0x48(%rbp), %rdx
callq 0x838d0
movl -0x3c(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xc8(%rax)
movl -0x40(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xcc(%rax)
movq -0x8(%rbp), %rdi
movl $0x4, %esi
callq 0x52960
movq %rax, %rsi
leaq -0x60(%rbp), %rdi
movl $0x2c, %edx
callq 0x7bbe0
leaq -0x60(%rbp), %rdi
callq 0x3ffd0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xd0(%rax)
movl $0xffffffff, -0x64(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x68(%rbp)
movl -0x68(%rbp), %eax
movl %eax, -0x16c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x3ffd0
movq %rax, %rcx
movl -0x16c(%rbp), %eax
cmpl %ecx, %eax
jge 0xd8d05
movslq -0x68(%rbp), %rsi
leaq -0x60(%rbp), %rdi
callq 0x3d940
movq %rax, %rdi
leaq 0x7555f(%rip), %rsi     # 0x14e1e2
callq 0x2d770
movb %al, -0x16d(%rbp)
jmp 0xd8c90
movb -0x16d(%rbp), %al
testb $0x1, %al
jne 0xd8c9c
jmp 0xd8ccf
movq -0x10(%rbp), %rax
movl 0xd0(%rax), %ecx
subl $0x1, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xd0(%rax)
movl -0x68(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0xd8ccf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
jmp 0xd9583
movslq -0x68(%rbp), %rsi
leaq -0x60(%rbp), %rdi
callq 0x3d940
movq %rax, %rdi
callq 0xa930
cmpq $0x1, %rax
jbe 0xd8cf5
movq -0x10(%rbp), %rax
movb $0x1, 0xd4(%rax)
jmp 0xd8cf7
movl -0x68(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x68(%rbp)
jmp 0xd8c49
movq -0x10(%rbp), %rax
cmpl $0x1, 0xd0(%rax)
jne 0xd9571
movl $0x1, -0x78(%rbp)
cmpl $0x1, -0x64(%rbp)
jne 0xd8d2a
movl $0x2, -0x78(%rbp)
movl $0x0, -0x7c(%rbp)
movl $0x0, -0x80(%rbp)
movl $0x0, -0x84(%rbp)
movl $0x0, -0x88(%rbp)
movq -0x8(%rbp), %rdi
callq 0x400f0
movq %rax, -0xb0(%rbp)
leaq -0xb0(%rbp), %rdi
movl $0x9, %esi
callq 0xe2d10
movq %rax, -0xa8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x40120
movq %rax, -0xb8(%rbp)
leaq -0xb9(%rbp), %rdi
movq %rdi, -0x178(%rbp)
callq 0x48e80
movq -0x178(%rbp), %rcx
movq -0xa8(%rbp), %rsi
movq -0xb8(%rbp), %rdx
leaq -0xa0(%rbp), %rdi
callq 0xe2d50
jmp 0xd8dba
leaq -0xb9(%rbp), %rdi
callq 0x40090
movq -0x18(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0xc8(%rbp), %rdi
callq 0x83b30
movq %rax, -0xd0(%rbp)
movq -0xc8(%rbp), %rdi
callq 0x83b60
movq %rax, -0xd8(%rbp)
leaq -0xd0(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x83aa0
testb $0x1, %al
jne 0xd8e13
jmp 0xd9117
leaq -0xd0(%rbp), %rdi
callq 0x841c0
movq (%rax), %rax
movq %rax, -0xe0(%rbp)
movq -0xe0(%rbp), %rsi
leaq -0xa0(%rbp), %rdi
callq 0x3d940
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xac60
movq %rax, -0x180(%rbp)
jmp 0xd8e51
movq -0x180(%rbp), %rax
movsbl (%rax), %eax
addl $-0x30, %eax
movl %eax, -0xe4(%rbp)
movq -0xe0(%rbp), %rsi
leaq -0xa0(%rbp), %rdi
callq 0x3d940
movq %rax, %rdi
movl $0x2, %esi
callq 0xac60
movq %rax, -0x188(%rbp)
jmp 0xd8e8d
movq -0x188(%rbp), %rax
movsbl (%rax), %eax
subl $0x30, %eax
movl %eax, -0xe8(%rbp)
movl -0xe4(%rbp), %eax
cmpl -0x78(%rbp), %eax
jne 0xd8f37
movq -0x10(%rbp), %rax
movl 0xc0(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xc0(%rax)
movq -0x10(%rbp), %rdi
addq $0x90, %rdi
movslq -0x7c(%rbp), %rsi
callq 0x4d100
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x10(%rbp), %rdi
addq $0x60, %rdi
movslq -0x84(%rbp), %rsi
callq 0x4d100
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0xd8fe3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0xb9(%rbp), %rdi
callq 0x40090
jmp 0xd9583
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x70(%rbp)
movl %eax, -0x74(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x3dfa0
jmp 0xd9583
movq -0xe0(%rbp), %rsi
leaq -0xa0(%rbp), %rdi
callq 0x3d940
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xac60
movq %rax, -0x190(%rbp)
jmp 0xd8f5f
movq -0x190(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2e, %eax
je 0xd8f79
movl -0xe4(%rbp), %eax
cmpl -0x64(%rbp), %eax
jne 0xd8fe1
movq -0x10(%rbp), %rdi
addq $0x20, %rdi
movq -0xe0(%rbp), %rsi
callq 0x83940
movq %rdx, -0x1a0(%rbp)
movq %rax, -0x198(%rbp)
jmp 0xd8f9d
movq -0x1a0(%rbp), %rax
movq -0x198(%rbp), %rcx
movq %rcx, -0xf8(%rbp)
movq %rax, -0xf0(%rbp)
leaq -0xf8(%rbp), %rdi
movl $0x1, %esi
callq 0x480d0
movq -0x10(%rbp), %rax
movl 0xc8(%rax), %ecx
subl $0x1, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xc8(%rax)
jmp 0xd8fe3
movl -0xe8(%rbp), %eax
cmpl -0x78(%rbp), %eax
jne 0xd9041
movq -0x10(%rbp), %rax
movl 0xc0(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xc0(%rax)
movq -0x10(%rbp), %rdi
addq $0x90, %rdi
movslq -0x7c(%rbp), %rsi
callq 0x4d100
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x10(%rbp), %rdi
addq $0x60, %rdi
movl -0x84(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x4d100
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0xd90ee
movq -0xe0(%rbp), %rsi
leaq -0xa0(%rbp), %rdi
callq 0x3d940
movq %rax, %rdi
movl $0x2, %esi
callq 0xac60
movq %rax, -0x1a8(%rbp)
jmp 0xd906a
movq -0x1a8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2e, %eax
je 0xd9084
movl -0xe8(%rbp), %eax
cmpl -0x64(%rbp), %eax
jne 0xd90ec
movq -0x10(%rbp), %rdi
addq $0x20, %rdi
movq -0xe0(%rbp), %rsi
callq 0x83940
movq %rdx, -0x1b8(%rbp)
movq %rax, -0x1b0(%rbp)
jmp 0xd90a8
movq -0x1b8(%rbp), %rax
movq -0x1b0(%rbp), %rcx
movq %rcx, -0x108(%rbp)
movq %rax, -0x100(%rbp)
leaq -0x108(%rbp), %rdi
movl $0x1, %esi
callq 0x480d0
movq -0x10(%rbp), %rax
movl 0xc8(%rax), %ecx
subl $0x1, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xc8(%rax)
jmp 0xd90ee
movl -0x7c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
movl -0x84(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x84(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x841e0
jmp 0xd8df7
movq -0x20(%rbp), %rax
movq %rax, -0x110(%rbp)
movq -0x110(%rbp), %rdi
callq 0x83b30
movq %rax, -0x118(%rbp)
movq -0x110(%rbp), %rdi
callq 0x83b60
movq %rax, -0x120(%rbp)
leaq -0x118(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x83aa0
testb $0x1, %al
jne 0xd9164
jmp 0xd9489
leaq -0x118(%rbp), %rdi
callq 0x841c0
movq (%rax), %rax
movq %rax, -0x128(%rbp)
movq -0x128(%rbp), %rsi
leaq -0xa0(%rbp), %rdi
callq 0x3d940
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xac60
movq %rax, -0x1c0(%rbp)
jmp 0xd91a2
movq -0x1c0(%rbp), %rax
movsbl (%rax), %eax
addl $-0x30, %eax
movl %eax, -0x12c(%rbp)
movq -0x128(%rbp), %rsi
leaq -0xa0(%rbp), %rdi
callq 0x3d940
movq %rax, %rdi
movl $0x2, %esi
callq 0xac60
movq %rax, -0x1c8(%rbp)
jmp 0xd91de
movq -0x1c8(%rbp), %rax
movsbl (%rax), %eax
addl $-0x30, %eax
movl %eax, -0x130(%rbp)
movq -0x128(%rbp), %rsi
leaq -0xa0(%rbp), %rdi
callq 0x3d940
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xac60
movq %rax, -0x1d0(%rbp)
jmp 0xd9219
movq -0x1d0(%rbp), %rax
movsbl (%rax), %eax
subl $0x30, %eax
cmpl -0x78(%rbp), %eax
jne 0xd9279
movq -0x10(%rbp), %rax
movl 0xc4(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xc4(%rax)
movq -0x10(%rbp), %rdi
addq $0xa8, %rdi
movslq -0x80(%rbp), %rsi
callq 0x4d100
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x10(%rbp), %rdi
addq $0x78, %rdi
movslq -0x88(%rbp), %rsi
callq 0x4d100
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0xd9325
movq -0x128(%rbp), %rsi
leaq -0xa0(%rbp), %rdi
callq 0x3d940
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xac60
movq %rax, -0x1d8(%rbp)
jmp 0xd92a1
movq -0x1d8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2e, %eax
je 0xd92bb
movl -0x12c(%rbp), %eax
cmpl -0x64(%rbp), %eax
jne 0xd9323
movq -0x10(%rbp), %rdi
addq $0x20, %rdi
movq -0x128(%rbp), %rsi
callq 0x83940
movq %rdx, -0x1e8(%rbp)
movq %rax, -0x1e0(%rbp)
jmp 0xd92df
movq -0x1e8(%rbp), %rax
movq -0x1e0(%rbp), %rcx
movq %rcx, -0x140(%rbp)
movq %rax, -0x138(%rbp)
leaq -0x140(%rbp), %rdi
movl $0x1, %esi
callq 0x480d0
movq -0x10(%rbp), %rax
movl 0xcc(%rax), %ecx
subl $0x1, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xcc(%rax)
jmp 0xd9325
movq -0x128(%rbp), %rsi
leaq -0xa0(%rbp), %rdi
callq 0x3d940
movq %rax, %rdi
movl $0x2, %esi
callq 0xac60
movq %rax, -0x1f0(%rbp)
jmp 0xd934e
movq -0x1f0(%rbp), %rax
movsbl (%rax), %eax
subl $0x30, %eax
cmpl -0x78(%rbp), %eax
jne 0xd93b3
movq -0x10(%rbp), %rax
movl 0xc4(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xc4(%rax)
movq -0x10(%rbp), %rdi
addq $0xa8, %rdi
movslq -0x80(%rbp), %rsi
callq 0x4d100
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x10(%rbp), %rdi
addq $0x78, %rdi
movl -0x88(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x4d100
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0xd9460
movq -0x128(%rbp), %rsi
leaq -0xa0(%rbp), %rdi
callq 0x3d940
movq %rax, %rdi
movl $0x2, %esi
callq 0xac60
movq %rax, -0x1f8(%rbp)
jmp 0xd93dc
movq -0x1f8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2e, %eax
je 0xd93f6
movl -0x130(%rbp), %eax
cmpl -0x64(%rbp), %eax
jne 0xd945e
movq -0x10(%rbp), %rdi
addq $0x20, %rdi
movq -0x128(%rbp), %rsi
callq 0x83940
movq %rdx, -0x208(%rbp)
movq %rax, -0x200(%rbp)
jmp 0xd941a
movq -0x208(%rbp), %rax
movq -0x200(%rbp), %rcx
movq %rcx, -0x150(%rbp)
movq %rax, -0x148(%rbp)
leaq -0x150(%rbp), %rdi
movl $0x1, %esi
callq 0x480d0
movq -0x10(%rbp), %rax
movl 0xcc(%rax), %ecx
subl $0x1, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xcc(%rax)
jmp 0xd9460
movl -0x80(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x80(%rbp)
movl -0x88(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x88(%rbp)
leaq -0x118(%rbp), %rdi
callq 0x841e0
jmp 0xd9148
movq $0x0, -0x158(%rbp)
movq -0x158(%rbp), %rax
movq %rax, -0x210(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x3ffd0
movq %rax, %rcx
movq -0x210(%rbp), %rax
cmpq %rcx, %rax
je 0xd9565
movq -0x158(%rbp), %rsi
leaq -0xa0(%rbp), %rdi
callq 0x3d940
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xac60
movq %rax, -0x218(%rbp)
jmp 0xd94e9
movq -0x218(%rbp), %rax
movsbl (%rax), %eax
subl $0x30, %eax
cmpl -0x78(%rbp), %eax
jne 0xd9506
movq -0x10(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x158(%rbp), %rsi
leaq -0xa0(%rbp), %rdi
callq 0x3d940
movq %rax, %rdi
movl $0x2, %esi
callq 0xac60
movq %rax, -0x220(%rbp)
jmp 0xd952f
movq -0x220(%rbp), %rax
movsbl (%rax), %eax
subl $0x30, %eax
cmpl -0x78(%rbp), %eax
jne 0xd954c
movq -0x10(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0xd954e
movq -0x158(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x158(%rbp)
jmp 0xd9494
leaq -0xa0(%rbp), %rdi
callq 0x3dfa0
leaq -0x60(%rbp), %rdi
callq 0x3dfa0
addq $0x220, %rsp            # imm = 0x220
popq %rbp
retq
leaq -0x60(%rbp), %rdi
callq 0x3dfa0
movq -0x70(%rbp), %rdi
callq 0xab50
nopw %cs:(%rax,%rax)