// File: medvedevgroup[P]varmatch/src/wholegenome.cpp
// Function: WholeGenome::PathMakeDecision(SequencePath&, std::vector<DiploidVariant, std::allocator<DiploidVariant>>&, std::multimap<int, int, std::less<int>, std::allocator<std::pair<int const, int>>>**, std::__cxx11::list<SequencePath, std::allocator<SequencePath>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int, int, int)
bool WholeGenome::PathMakeDecision(SequencePath& sp,
                                 vector<DiploidVariant> & variant_list,
                                 multimap<int, int> * choices_by_pos[],
                                 list<SequencePath> & sequence_path_list,
                                 const string & reference_sequence,
                                 int score_unit,
                                 int match_mode,
                                 int score_scheme)
{
    int pos = sp.current_genome_pos+1;

    vector<pair<int, int>> candidate_choices[2];
    for(int i = 0; i < 2; i++){

        // because if it's (-1,-1), it will do nothing, so it's ok to have this one...
        candidate_choices[i].push_back(pair<int, int>(-1, -1));
        // in this position, make choice of not use any variants, no matter if there is variant

        pair<multimap<int, int>::iterator, multimap<int, int>::iterator> var_range;
        var_range = choices_by_pos[i]->equal_range(pos);

        for(auto it = var_range.first; it != var_range.second; ++it){
            int var_index = (*it).second;
            DiploidVariant var = variant_list[var_index];
            //PrintVariant(var);

            // check if current var influence
            string ref = var.ref; //even we do not know the offset, we know ref start from pos of reference_sequence
            string alts[2];
            alts[0] = var.alts[0];
            alts[1] = alts[0];
            if(var.multi_alts && !var.zero_one_var){
                alts[1] = var.alts[1];
            }else if(var.heterozygous){
                alts[1] = ref;
            }

            // not just purely consider if a vqriant can be applied, but if a choice
            int skiped_y = -1;
            if(alts[1] == ref) skiped_y = 1;

            bool choice_applicable = true;
            for(int k = 0; k < ref.length(); k++){
            // for each ref char
                for(int y = 0; y < 2; y++){
                    // for each strain
                    if(y == skiped_y) continue;
                    if(sp.string_sequences[i*2+y][k+pos] != "."){
                        // decision in this area has already been made
                        if(k >= alts[y].length()){
                            choice_applicable = false;
                            break;
                        }else{
                            if(ref[k] != alts[y][k]){
                                choice_applicable = false;
                                break;
                            }
                        }
                    }
                }
                if(!choice_applicable) break;
            }

            if(choice_applicable){
                candidate_choices[i].push_back(pair<int, int>(var_index, 0));
            }

            if(var.heterozygous){

                //if heterozygous, then there is another choice, check if it is applicable

                string temp = alts[0];
                alts[0] = alts[1];
                alts[1] = temp;

                skiped_y = -1;
                if(alts[0] == ref) skiped_y = 0;

                choice_applicable = true;
                for(int k = 0; k < ref.length(); k++){
                // for each ref char
                    for(int y = 0; y < 2; y++){
                        // for each strain
                        if(skiped_y == y) continue;
                        if(sp.string_sequences[i*2+y][k+pos] != "."){
                            // decision in this area has already been made
                            if(k >= alts[y].length()){
                                // should be a deletion
                                choice_applicable = false;
                                break;
                            }else{
                                // should be equal at current position
                                // can be an insertion, as long as current position is the same
                                if(ref[k] != alts[y][k]){
                                    choice_applicable = false;
                                    break;
                                }
                            }
                        }
                    }
                    if(!choice_applicable) break;
                }

                if(choice_applicable){
                    if(var.multi_alts && !var.zero_one_var){
                        candidate_choices[i].push_back(pair<int, int>(var_index, 1));
                    }else{
                        candidate_choices[i].push_back(pair<int, int>(var_index, -1));
                    }
                }
            }

            if(var.multi_alts && var.zero_one_var){
                // here contains another two combinations  alt1/ref and ref/alt1
                alts[0] = var.alts[1];
                alts[1] = ref;

                choice_applicable = true;
                int y = 0;
                for(int k = 0; k < ref.length(); k++){
                // for each ref char
                    {
                        // for each strain
                        if(sp.string_sequences[i*2+y][k+pos] != "."){
                            // decision in this area has already been made
                            if(k >= alts[y].length()){
                                // should be a deletion
                                choice_applicable = false;
                                break;
                            }else{
                                // should be equal at current position
                                // can be an insertion, as long as current position is the same
                                if(ref[k] != alts[y][k]){
                                    choice_applicable = false;
                                    break;
                                }
                            }
                        }
                    }
                    if(!choice_applicable) break;
                }

                if(choice_applicable){
                    candidate_choices[i].push_back(pair<int, int>(var_index, 1));
                }


                alts[0] = ref;
                alts[1] = var.alts[1];

                choice_applicable = true;
                y = 1;
                for(int k = 0; k < ref.length(); k++){
                // for each ref char
                    {
                        // for each strain
                        if(sp.string_sequences[i*2+y][k+pos] != "."){
                            // decision in this area has already been made
                            if(k >= alts[y].length()){
                                // should be a deletion
                                choice_applicable = false;
                                break;
                            }else{
                                // should be equal at current position
                                // can be an insertion, as long as current position is the same
                                if(ref[k] != alts[y][k]){
                                    choice_applicable = false;
                                    break;
                                }
                            }
                        }
                    }
                    if(!choice_applicable) break;
                }

                if(choice_applicable){
                    candidate_choices[i].push_back(pair<int, int>(var_index, -2));
                }
            }
        }
    }

    //dout << candidate_choices[0].size() << "," << candidate_choices[1].size() << endl;

    for(int i = 0; i < candidate_choices[0].size(); i++){
        for(int j = 0; j < candidate_choices[1].size(); j++){
            // iterate all choices
            SequencePath path = sp;
            pair<int, int> var_choice[2];
            var_choice[0] = candidate_choices[0][i];
            var_choice[1] = candidate_choices[1][j];
            for(int x = 0; x < 2; x++){
                // iterate truth and predict
                int var_index = var_choice[x].first;
                if(var_index != -1){
//                    string temp_sequence = reference_sequence.substr(pos, 1);
//                    path.string_sequences[x*2][pos] = temp_sequence;
//                    path.string_sequences[x*2+1][pos] = temp_sequence;
//                }else{
                    // set score


                    DiploidVariant var = variant_list[var_index];
                    // if(var.flag != x){
                    //     dout << "Error" << endl;
                    // }
                    string ref = var.ref;
                    string alts[2];

                    int c = var_choice[x].second;
                    if(c == -1){
                        alts[0] = ref;
                        alts[1] = var.alts[0];
                    }else if(c == -2){
                        alts[0] = ref;
                        alts[1] = var.alts[1];
                    }else{
                        // c == 0 or 1
                        alts[0] = var.alts[c];
                        alts[1] = alts[0];

                        if(var.multi_alts && !var.zero_one_var){
                            // choose 1 or 0
                            alts[1] = var.alts[1- c];
                        }else{
                            // c is 0, choose 0 or -1
                            if(var.heterozygous) alts[1] = ref;
                        }
                    }

                    path.score += CalculateScore(var,
                                                 c,
                                                 score_unit,
                                                 match_mode,
                                                 score_scheme);

                    ToUpper(ref);
                    ToUpper(alts[0]);
                    ToUpper(alts[1]);
                    for(int y = 0; y < 2; y++){
                        // iterate two alts
                        string alt = alts[y];
                        vector<string> alt_vector;
                        GenerateAltVector(ref, alt, alt_vector);

                        int k = 0;
                        for(; k < ref.length()-1; k++){

                            if(alt_vector[k].size() != 1 || ref[k] != alt_vector[k][0]){
                                path.string_sequences[x*2+y][pos+k] = alt_vector[k];
                            }
                            // else changes nothing

                        }
                        // hence k == ref.length()-1, the last position
                        assert(k == ref.length()-1);
                        string alt_part = alt_vector[k];
                        if(alt_part.length() > 0){
                            if(alt_part.length() > 1){
                                if(alt_part[0] == ref[k]){
                                    if(path.string_sequences[x*2+y][pos+k] == "."){
                                        path.string_sequences[x*2+y][pos+k] = alt_part;
                                    }else{
                                        path.string_sequences[x*2+y][pos+k] += alt_part.substr(1, alt_part.size() - 1);
                                    }
                                }else{
                                    path.string_sequences[x*2+y][pos+k] = alt_part;
                                }
                            }else{
                                if(ref[k] != alt_vector[k][0]){
                                    path.string_sequences[x*2+y][pos+k] = alt_part;
                                }
                            }
                        }else{
                            path.string_sequences[x*2+y][pos+k] = "";
                        }
                    }
                }
                path.choice_made[x][pos] = var_choice[x];
            }
            // choice made
            dout << "after decision at pos " << pos << endl;
            PrintPath(path);
            sequence_path_list.push_back(path);
        }
    }

    //expected number of inserted paths are 2,3,4,6,x...
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x7c0, %rsp            # imm = 0x7C0
movl 0x20(%rbp), %eax
movl 0x18(%rbp), %eax
movl 0x10(%rbp), %eax
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x540(%rbp)
movq -0x18(%rbp), %rax
movl 0xc8(%rax), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
leaq -0x70(%rbp), %rax
movq %rax, %rcx
addq $0x30, %rcx
movq %rcx, -0x538(%rbp)
movq %rax, -0x530(%rbp)
movq -0x530(%rbp), %rdi
movq %rdi, -0x548(%rbp)
callq 0x34a50
movq -0x548(%rbp), %rax
movq -0x538(%rbp), %rcx
addq $0x18, %rax
cmpq %rcx, %rax
movq %rax, -0x530(%rbp)
jne 0x25b60
movl $0x0, -0x74(%rbp)
cmpl $0x2, -0x74(%rbp)
jge 0x2685e
movslq -0x74(%rbp), %rax
leaq (%rax,%rax,2), %rax
leaq -0x70(%rbp,%rax,8), %rax
movq %rax, -0x550(%rbp)
movl $0xffffffff, -0x80(%rbp) # imm = 0xFFFFFFFF
movl $0xffffffff, -0x84(%rbp) # imm = 0xFFFFFFFF
leaq -0x7c(%rbp), %rdi
leaq -0x80(%rbp), %rsi
leaq -0x84(%rbp), %rdx
callq 0x34aa0
jmp 0x25bdd
movq -0x550(%rbp), %rdi
leaq -0x7c(%rbp), %rsi
callq 0x34a70
jmp 0x25bef
leaq -0xa8(%rbp), %rdi
callq 0x34960
jmp 0x25bfd
movq -0x28(%rbp), %rax
movslq -0x74(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq -0x3c(%rbp), %rsi
callq 0x34990
movq %rdx, -0x560(%rbp)
movq %rax, -0x558(%rbp)
jmp 0x25c22
movq -0x560(%rbp), %rax
movq -0x558(%rbp), %rcx
movq %rcx, -0xb8(%rbp)
movq %rax, -0xb0(%rbp)
leaq -0xa8(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x349d0
movq -0xa8(%rbp), %rax
movq %rax, -0xc0(%rbp)
leaq -0xa8(%rbp), %rsi
addq $0x8, %rsi
leaq -0xc0(%rbp), %rdi
callq 0x33ac0
testb $0x1, %al
jne 0x25c7f
jmp 0x2684e
leaq -0xc0(%rbp), %rdi
callq 0x34a00
movl 0x4(%rax), %eax
movl %eax, -0xc4(%rbp)
movq -0x20(%rbp), %rdi
movslq -0xc4(%rbp), %rsi
callq 0x33de0
movq %rax, %rsi
leaq -0x120(%rbp), %rdi
callq 0x340a0
jmp 0x25cb5
leaq -0x118(%rbp), %rsi
leaq -0x140(%rbp), %rdi
callq 0x61b0
jmp 0x25cca
leaq -0x180(%rbp), %rax
movq %rax, %rcx
addq $0x40, %rcx
movq %rcx, -0x570(%rbp)
movq %rax, -0x568(%rbp)
movq -0x568(%rbp), %rdi
movq %rdi, -0x578(%rbp)
callq 0x65e0
movq -0x578(%rbp), %rax
movq -0x570(%rbp), %rcx
addq $0x20, %rax
cmpq %rcx, %rax
movq %rax, -0x568(%rbp)
jne 0x25ce6
leaq -0xf8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x9080
movq %rax, %rsi
leaq -0x180(%rbp), %rdi
callq 0x6070
jmp 0x25d38
leaq -0x160(%rbp), %rdi
leaq -0x180(%rbp), %rsi
callq 0x6070
jmp 0x25d4d
testb $0x1, -0xdf(%rbp)
je 0x25dc8
testb $0x1, -0xde(%rbp)
jne 0x25dc8
leaq -0xf8(%rbp), %rdi
movl $0x1, %esi
callq 0x9080
movq %rax, %rsi
leaq -0x160(%rbp), %rdi
callq 0x6070
jmp 0x25d81
jmp 0x25dea
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0x274ac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0x2683d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0x267e7
testb $0x1, -0xe0(%rbp)
je 0x25de8
leaq -0x160(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0x6070
jmp 0x25de6
jmp 0x25de8
jmp 0x25dea
movl $0xffffffff, -0x184(%rbp) # imm = 0xFFFFFFFF
leaq -0x180(%rbp), %rdi
addq $0x20, %rdi
leaq -0x140(%rbp), %rsi
callq 0xdcb0
testb $0x1, %al
jne 0x25e11
jmp 0x25e1b
movl $0x1, -0x184(%rbp)
movb $0x1, -0x185(%rbp)
movl $0x0, -0x18c(%rbp)
movslq -0x18c(%rbp), %rax
movq %rax, -0x580(%rbp)
leaq -0x140(%rbp), %rdi
callq 0x6630
movq %rax, %rcx
movq -0x580(%rbp), %rax
cmpq %rcx, %rax
jae 0x25fcb
movl $0x0, -0x190(%rbp)
cmpl $0x2, -0x190(%rbp)
jge 0x25faa
movl -0x190(%rbp), %eax
cmpl -0x184(%rbp), %eax
jne 0x25e83
jmp 0x25f96
movq -0x18(%rbp), %rax
movl -0x74(%rbp), %ecx
movl -0x190(%rbp), %esi
movl %ecx, %edx
movl %esi, %ecx
leal (%rcx,%rdx,2), %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
leaq 0x8(%rax,%rcx,8), %rdi
movl -0x18c(%rbp), %eax
movl -0x3c(%rbp), %ecx
addl %ecx, %eax
movslq %eax, %rsi
callq 0x9080
movq %rax, %rdi
leaq 0x2fb72(%rip), %rsi     # 0x55a32
callq 0x17c70
movb %al, -0x581(%rbp)
jmp 0x25ecd
movb -0x581(%rbp), %al
testb $0x1, %al
jne 0x25edc
jmp 0x25f94
movslq -0x18c(%rbp), %rax
movq %rax, -0x590(%rbp)
movslq -0x190(%rbp), %rax
leaq -0x180(%rbp), %rdi
shlq $0x5, %rax
addq %rax, %rdi
callq 0x6630
movq %rax, %rcx
movq -0x590(%rbp), %rax
cmpq %rcx, %rax
jb 0x25f1f
movb $0x0, -0x185(%rbp)
jmp 0x25faa
movslq -0x18c(%rbp), %rsi
leaq -0x140(%rbp), %rdi
callq 0x6810
movq %rax, -0x598(%rbp)
jmp 0x25f3b
movq -0x598(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x5a4(%rbp)
movslq -0x190(%rbp), %rax
shlq $0x5, %rax
leaq -0x180(%rbp,%rax), %rdi
movslq -0x18c(%rbp), %rsi
callq 0x6810
movq %rax, -0x5a0(%rbp)
jmp 0x25f73
movl -0x5a4(%rbp), %eax
movq -0x5a0(%rbp), %rcx
movsbl (%rcx), %ecx
cmpl %ecx, %eax
je 0x25f90
movb $0x0, -0x185(%rbp)
jmp 0x25faa
jmp 0x25f92
jmp 0x25f94
jmp 0x25f96
movl -0x190(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x190(%rbp)
jmp 0x25e63
testb $0x1, -0x185(%rbp)
jne 0x25fb5
jmp 0x25fcb
jmp 0x25fb7
movl -0x18c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18c(%rbp)
jmp 0x25e2c
testb $0x1, -0x185(%rbp)
je 0x26025
movslq -0x74(%rbp), %rax
leaq (%rax,%rax,2), %rax
leaq -0x70(%rbp,%rax,8), %rax
movq %rax, -0x5b0(%rbp)
movl $0x0, -0x19c(%rbp)
leaq -0x198(%rbp), %rdi
leaq -0xc4(%rbp), %rsi
leaq -0x19c(%rbp), %rdx
callq 0x34ad0
jmp 0x2600e
movq -0x5b0(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0x34a70
jmp 0x26023
jmp 0x26025
testb $0x1, -0xe0(%rbp)
je 0x26342
leaq -0x1c0(%rbp), %rdi
leaq -0x180(%rbp), %rsi
callq 0x61b0
jmp 0x26047
leaq -0x160(%rbp), %rsi
leaq -0x180(%rbp), %rdi
callq 0x6070
jmp 0x2605c
leaq -0x160(%rbp), %rdi
leaq -0x1c0(%rbp), %rsi
callq 0x6070
jmp 0x26071
movl $0xffffffff, -0x184(%rbp) # imm = 0xFFFFFFFF
leaq -0x180(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0xdcb0
testb $0x1, %al
jne 0x26094
jmp 0x260c3
movl $0x0, -0x184(%rbp)
jmp 0x260c3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
leaq -0x1c0(%rbp), %rdi
callq 0x6828
jmp 0x267e7
movb $0x1, -0x185(%rbp)
movl $0x0, -0x1c4(%rbp)
movslq -0x1c4(%rbp), %rax
movq %rax, -0x5b8(%rbp)
leaq -0x140(%rbp), %rdi
callq 0x6630
movq %rax, %rcx
movq -0x5b8(%rbp), %rax
cmpq %rcx, %rax
jae 0x26273
movl $0x0, -0x1c8(%rbp)
cmpl $0x2, -0x1c8(%rbp)
jge 0x26252
movl -0x184(%rbp), %eax
cmpl -0x1c8(%rbp), %eax
jne 0x2612b
jmp 0x2623e
movq -0x18(%rbp), %rax
movl -0x74(%rbp), %ecx
movl -0x1c8(%rbp), %esi
movl %ecx, %edx
movl %esi, %ecx
leal (%rcx,%rdx,2), %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
leaq 0x8(%rax,%rcx,8), %rdi
movl -0x1c4(%rbp), %eax
movl -0x3c(%rbp), %ecx
addl %ecx, %eax
movslq %eax, %rsi
callq 0x9080
movq %rax, %rdi
leaq 0x2f8ca(%rip), %rsi     # 0x55a32
callq 0x17c70
movb %al, -0x5b9(%rbp)
jmp 0x26175
movb -0x5b9(%rbp), %al
testb $0x1, %al
jne 0x26184
jmp 0x2623c
movslq -0x1c4(%rbp), %rax
movq %rax, -0x5c8(%rbp)
movslq -0x1c8(%rbp), %rax
leaq -0x180(%rbp), %rdi
shlq $0x5, %rax
addq %rax, %rdi
callq 0x6630
movq %rax, %rcx
movq -0x5c8(%rbp), %rax
cmpq %rcx, %rax
jb 0x261c7
movb $0x0, -0x185(%rbp)
jmp 0x26252
movslq -0x1c4(%rbp), %rsi
leaq -0x140(%rbp), %rdi
callq 0x6810
movq %rax, -0x5d0(%rbp)
jmp 0x261e3
movq -0x5d0(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x5dc(%rbp)
movslq -0x1c8(%rbp), %rax
shlq $0x5, %rax
leaq -0x180(%rbp,%rax), %rdi
movslq -0x1c4(%rbp), %rsi
callq 0x6810
movq %rax, -0x5d8(%rbp)
jmp 0x2621b
movl -0x5dc(%rbp), %eax
movq -0x5d8(%rbp), %rcx
movsbl (%rcx), %ecx
cmpl %ecx, %eax
je 0x26238
movb $0x0, -0x185(%rbp)
jmp 0x26252
jmp 0x2623a
jmp 0x2623c
jmp 0x2623e
movl -0x1c8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c8(%rbp)
jmp 0x2610b
testb $0x1, -0x185(%rbp)
jne 0x2625d
jmp 0x26273
jmp 0x2625f
movl -0x1c4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c4(%rbp)
jmp 0x260d4
testb $0x1, -0x185(%rbp)
je 0x26336
testb $0x1, -0xdf(%rbp)
je 0x262e3
testb $0x1, -0xde(%rbp)
jne 0x262e3
movslq -0x74(%rbp), %rax
leaq (%rax,%rax,2), %rax
leaq -0x70(%rbp,%rax,8), %rax
movq %rax, -0x5e8(%rbp)
movl $0x1, -0x1d4(%rbp)
leaq -0x1d0(%rbp), %rdi
leaq -0xc4(%rbp), %rsi
leaq -0x1d4(%rbp), %rdx
callq 0x34ad0
jmp 0x262cc
movq -0x5e8(%rbp), %rdi
leaq -0x1d0(%rbp), %rsi
callq 0x34a70
jmp 0x262e1
jmp 0x26334
movslq -0x74(%rbp), %rax
leaq (%rax,%rax,2), %rax
leaq -0x70(%rbp,%rax,8), %rax
movq %rax, -0x5f0(%rbp)
movl $0xffffffff, -0x1e0(%rbp) # imm = 0xFFFFFFFF
leaq -0x1dc(%rbp), %rdi
leaq -0xc4(%rbp), %rsi
leaq -0x1e0(%rbp), %rdx
callq 0x34ad0
jmp 0x2631d
movq -0x5f0(%rbp), %rdi
leaq -0x1dc(%rbp), %rsi
callq 0x34a70
jmp 0x26332
jmp 0x26334
jmp 0x26336
leaq -0x1c0(%rbp), %rdi
callq 0x6828
testb $0x1, -0xdf(%rbp)
je 0x26774
testb $0x1, -0xde(%rbp)
je 0x26774
leaq -0xf8(%rbp), %rdi
movl $0x1, %esi
callq 0x9080
movq %rax, %rsi
leaq -0x180(%rbp), %rdi
callq 0x6070
jmp 0x2637e
leaq -0x160(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0x6070
jmp 0x26393
movb $0x1, -0x185(%rbp)
movl $0x0, -0x1e4(%rbp)
movl $0x0, -0x1e8(%rbp)
movslq -0x1e8(%rbp), %rax
movq %rax, -0x5f8(%rbp)
leaq -0x140(%rbp), %rdi
callq 0x6630
movq %rax, %rcx
movq -0x5f8(%rbp), %rax
cmpq %rcx, %rax
jae 0x2650d
movq -0x18(%rbp), %rax
movl -0x74(%rbp), %ecx
movl -0x1e4(%rbp), %esi
movl %ecx, %edx
movl %esi, %ecx
leal (%rcx,%rdx,2), %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
leaq 0x8(%rax,%rcx,8), %rdi
movl -0x1e8(%rbp), %eax
movl -0x3c(%rbp), %ecx
addl %ecx, %eax
movslq %eax, %rsi
callq 0x9080
movq %rax, %rdi
leaq 0x2f61a(%rip), %rsi     # 0x55a32
callq 0x17c70
movb %al, -0x5f9(%rbp)
jmp 0x26425
movb -0x5f9(%rbp), %al
testb $0x1, %al
jne 0x26434
jmp 0x264ec
movslq -0x1e8(%rbp), %rax
movq %rax, -0x608(%rbp)
movslq -0x1e4(%rbp), %rax
leaq -0x180(%rbp), %rdi
shlq $0x5, %rax
addq %rax, %rdi
callq 0x6630
movq %rax, %rcx
movq -0x608(%rbp), %rax
cmpq %rcx, %rax
jb 0x26477
movb $0x0, -0x185(%rbp)
jmp 0x2650d
movslq -0x1e8(%rbp), %rsi
leaq -0x140(%rbp), %rdi
callq 0x6810
movq %rax, -0x610(%rbp)
jmp 0x26493
movq -0x610(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x61c(%rbp)
movslq -0x1e4(%rbp), %rax
shlq $0x5, %rax
leaq -0x180(%rbp,%rax), %rdi
movslq -0x1e8(%rbp), %rsi
callq 0x6810
movq %rax, -0x618(%rbp)
jmp 0x264cb
movl -0x61c(%rbp), %eax
movq -0x618(%rbp), %rcx
movsbl (%rcx), %ecx
cmpl %ecx, %eax
je 0x264e8
movb $0x0, -0x185(%rbp)
jmp 0x2650d
jmp 0x264ea
jmp 0x264ec
testb $0x1, -0x185(%rbp)
jne 0x264f7
jmp 0x2650d
jmp 0x264f9
movl -0x1e8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1e8(%rbp)
jmp 0x263ae
testb $0x1, -0x185(%rbp)
je 0x26567
movslq -0x74(%rbp), %rax
leaq (%rax,%rax,2), %rax
leaq -0x70(%rbp,%rax,8), %rax
movq %rax, -0x628(%rbp)
movl $0x1, -0x1f4(%rbp)
leaq -0x1f0(%rbp), %rdi
leaq -0xc4(%rbp), %rsi
leaq -0x1f4(%rbp), %rdx
callq 0x34ad0
jmp 0x26550
movq -0x628(%rbp), %rdi
leaq -0x1f0(%rbp), %rsi
callq 0x34a70
jmp 0x26565
jmp 0x26567
leaq -0x180(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0x6070
jmp 0x2657c
leaq -0xf8(%rbp), %rdi
movl $0x1, %esi
callq 0x9080
movq %rax, %rsi
leaq -0x160(%rbp), %rdi
callq 0x6070
jmp 0x2659e
movb $0x1, -0x185(%rbp)
movl $0x1, -0x1e4(%rbp)
movl $0x0, -0x1f8(%rbp)
movslq -0x1f8(%rbp), %rax
movq %rax, -0x630(%rbp)
leaq -0x140(%rbp), %rdi
callq 0x6630
movq %rax, %rcx
movq -0x630(%rbp), %rax
cmpq %rcx, %rax
jae 0x26718
movq -0x18(%rbp), %rax
movl -0x74(%rbp), %ecx
movl -0x1e4(%rbp), %esi
movl %ecx, %edx
movl %esi, %ecx
leal (%rcx,%rdx,2), %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
leaq 0x8(%rax,%rcx,8), %rdi
movl -0x1f8(%rbp), %eax
movl -0x3c(%rbp), %ecx
addl %ecx, %eax
movslq %eax, %rsi
callq 0x9080
movq %rax, %rdi
leaq 0x2f40f(%rip), %rsi     # 0x55a32
callq 0x17c70
movb %al, -0x631(%rbp)
jmp 0x26630
movb -0x631(%rbp), %al
testb $0x1, %al
jne 0x2663f
jmp 0x266f7
movslq -0x1f8(%rbp), %rax
movq %rax, -0x640(%rbp)
movslq -0x1e4(%rbp), %rax
leaq -0x180(%rbp), %rdi
shlq $0x5, %rax
addq %rax, %rdi
callq 0x6630
movq %rax, %rcx
movq -0x640(%rbp), %rax
cmpq %rcx, %rax
jb 0x26682
movb $0x0, -0x185(%rbp)
jmp 0x26718
movslq -0x1f8(%rbp), %rsi
leaq -0x140(%rbp), %rdi
callq 0x6810
movq %rax, -0x648(%rbp)
jmp 0x2669e
movq -0x648(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x654(%rbp)
movslq -0x1e4(%rbp), %rax
shlq $0x5, %rax
leaq -0x180(%rbp,%rax), %rdi
movslq -0x1f8(%rbp), %rsi
callq 0x6810
movq %rax, -0x650(%rbp)
jmp 0x266d6
movl -0x654(%rbp), %eax
movq -0x650(%rbp), %rcx
movsbl (%rcx), %ecx
cmpl %ecx, %eax
je 0x266f3
movb $0x0, -0x185(%rbp)
jmp 0x26718
jmp 0x266f5
jmp 0x266f7
testb $0x1, -0x185(%rbp)
jne 0x26702
jmp 0x26718
jmp 0x26704
movl -0x1f8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1f8(%rbp)
jmp 0x265b9
testb $0x1, -0x185(%rbp)
je 0x26772
movslq -0x74(%rbp), %rax
leaq (%rax,%rax,2), %rax
leaq -0x70(%rbp,%rax,8), %rax
movq %rax, -0x660(%rbp)
movl $0xfffffffe, -0x204(%rbp) # imm = 0xFFFFFFFE
leaq -0x200(%rbp), %rdi
leaq -0xc4(%rbp), %rsi
leaq -0x204(%rbp), %rdx
callq 0x34ad0
jmp 0x2675b
movq -0x660(%rbp), %rdi
leaq -0x200(%rbp), %rsi
callq 0x34a70
jmp 0x26770
jmp 0x26772
jmp 0x26774
leaq -0x180(%rbp), %rax
movq %rax, -0x670(%rbp)
addq $0x40, %rax
movq %rax, -0x668(%rbp)
movq -0x668(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x678(%rbp)
callq 0x6828
movq -0x670(%rbp), %rcx
movq -0x678(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x668(%rbp)
jne 0x2678d
leaq -0x140(%rbp), %rdi
callq 0x6828
leaq -0x120(%rbp), %rdi
callq 0x32c60
leaq -0xc0(%rbp), %rdi
callq 0x34a20
jmp 0x25c5f
leaq -0x180(%rbp), %rax
movq %rax, -0x688(%rbp)
addq $0x40, %rax
movq %rax, -0x680(%rbp)
movq -0x680(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x690(%rbp)
callq 0x6828
movq -0x688(%rbp), %rcx
movq -0x690(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x680(%rbp)
jne 0x26800
leaq -0x140(%rbp), %rdi
callq 0x6828
leaq -0x120(%rbp), %rdi
callq 0x32c60
jmp 0x274ac
jmp 0x26850
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
jmp 0x25b98
movl $0x0, -0x208(%rbp)
movslq -0x208(%rbp), %rax
movq %rax, -0x698(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x34b00
movq %rax, %rcx
movq -0x698(%rbp), %rax
cmpq %rcx, %rax
jae 0x27453
movl $0x0, -0x20c(%rbp)
movslq -0x20c(%rbp), %rax
movq %rax, -0x6a0(%rbp)
leaq -0x70(%rbp), %rdi
addq $0x18, %rdi
callq 0x34b00
movq %rax, %rcx
movq -0x6a0(%rbp), %rax
cmpq %rcx, %rax
jae 0x2743d
movq -0x18(%rbp), %rsi
leaq -0x390(%rbp), %rdi
callq 0x34b20
jmp 0x268dc
leaq -0x3a0(%rbp), %rax
movq %rax, %rcx
addq $0x10, %rcx
movq %rcx, -0x6b0(%rbp)
movq %rax, -0x6a8(%rbp)
movq -0x6a8(%rbp), %rdi
movq %rdi, -0x6b8(%rbp)
callq 0x34e90
jmp 0x2690d
movq -0x6b0(%rbp), %rcx
movq -0x6b8(%rbp), %rax
addq $0x8, %rax
cmpq %rcx, %rax
movq %rax, -0x6a8(%rbp)
jne 0x268f8
movslq -0x208(%rbp), %rsi
leaq -0x70(%rbp), %rdi
callq 0x34eb0
movq %rax, %rsi
leaq -0x3a0(%rbp), %rdi
callq 0x34ed0
jmp 0x2694c
leaq -0x58(%rbp), %rdi
movslq -0x20c(%rbp), %rsi
callq 0x34eb0
movq %rax, %rsi
leaq -0x398(%rbp), %rdi
callq 0x34ed0
jmp 0x2696d
movl $0x0, -0x3a4(%rbp)
cmpl $0x2, -0x3a4(%rbp)
jge 0x2739f
movslq -0x3a4(%rbp), %rax
movl -0x3a0(%rbp,%rax,8), %eax
movl %eax, -0x3a8(%rbp)
cmpl $-0x1, -0x3a8(%rbp)
je 0x2733c
movq -0x20(%rbp), %rdi
movslq -0x3a8(%rbp), %rsi
callq 0x33de0
movq %rax, %rsi
leaq -0x400(%rbp), %rdi
callq 0x340a0
jmp 0x269c6
leaq -0x3f8(%rbp), %rsi
leaq -0x420(%rbp), %rdi
callq 0x61b0
jmp 0x269db
leaq -0x460(%rbp), %rax
movq %rax, %rcx
addq $0x40, %rcx
movq %rcx, -0x6c8(%rbp)
movq %rax, -0x6c0(%rbp)
movq -0x6c0(%rbp), %rdi
movq %rdi, -0x6d0(%rbp)
callq 0x65e0
movq -0x6d0(%rbp), %rax
movq -0x6c8(%rbp), %rcx
addq $0x20, %rax
cmpq %rcx, %rax
movq %rax, -0x6c0(%rbp)
jne 0x269f7
movslq -0x3a4(%rbp), %rax
movl -0x39c(%rbp,%rax,8), %eax
movl %eax, -0x464(%rbp)
cmpl $-0x1, -0x464(%rbp)
jne 0x26ac9
leaq -0x460(%rbp), %rdi
leaq -0x420(%rbp), %rsi
callq 0x6070
jmp 0x26a5e
leaq -0x3d8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x9080
movq %rax, %rsi
leaq -0x440(%rbp), %rdi
callq 0x6070
jmp 0x26a7f
jmp 0x26bae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0x2742f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0x2732b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0x272d5
cmpl $-0x2, -0x464(%rbp)
jne 0x26b0e
leaq -0x460(%rbp), %rdi
leaq -0x420(%rbp), %rsi
callq 0x6070
jmp 0x26ae7
leaq -0x3d8(%rbp), %rdi
movl $0x1, %esi
callq 0x9080
movq %rax, %rsi
leaq -0x440(%rbp), %rdi
callq 0x6070
jmp 0x26b09
jmp 0x26bac
leaq -0x3d8(%rbp), %rdi
movslq -0x464(%rbp), %rsi
callq 0x9080
movq %rax, %rsi
leaq -0x460(%rbp), %rdi
callq 0x6070
jmp 0x26b32
leaq -0x440(%rbp), %rdi
leaq -0x460(%rbp), %rsi
callq 0x6070
jmp 0x26b47
testb $0x1, -0x3bf(%rbp)
je 0x26b88
testb $0x1, -0x3be(%rbp)
jne 0x26b88
leaq -0x3d8(%rbp), %rdi
movl -0x464(%rbp), %ecx
movl $0x1, %eax
subl %ecx, %eax
movslq %eax, %rsi
callq 0x9080
movq %rax, %rsi
leaq -0x440(%rbp), %rdi
callq 0x6070
jmp 0x26b86
jmp 0x26baa
testb $0x1, -0x3c0(%rbp)
je 0x26ba8
leaq -0x440(%rbp), %rdi
leaq -0x420(%rbp), %rsi
callq 0x6070
jmp 0x26ba6
jmp 0x26ba8
jmp 0x26baa
jmp 0x26bac
jmp 0x26bae
movq -0x540(%rbp), %rdi
movl -0x464(%rbp), %edx
movl 0x10(%rbp), %ecx
movl 0x18(%rbp), %r8d
movl 0x20(%rbp), %r9d
leaq -0x400(%rbp), %rsi
callq 0x21fd0
movl %eax, -0x6d4(%rbp)
jmp 0x26bda
movq -0x540(%rbp), %rdi
movl -0x6d4(%rbp), %ecx
movl -0x238(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x238(%rbp)
leaq -0x420(%rbp), %rsi
callq 0x328c0
jmp 0x26c03
movq -0x540(%rbp), %rdi
leaq -0x460(%rbp), %rsi
callq 0x328c0
jmp 0x26c18
movq -0x540(%rbp), %rdi
leaq -0x440(%rbp), %rsi
callq 0x328c0
jmp 0x26c2d
movl $0x0, -0x468(%rbp)
cmpl $0x2, -0x468(%rbp)
jge 0x27271
movslq -0x468(%rbp), %rax
shlq $0x5, %rax
leaq -0x460(%rbp,%rax), %rsi
leaq -0x488(%rbp), %rdi
callq 0x61b0
jmp 0x26c65
leaq -0x4a0(%rbp), %rdi
callq 0x12d30
leaq -0x4c0(%rbp), %rdi
leaq -0x420(%rbp), %rsi
callq 0x61b0
jmp 0x26c86
leaq -0x4e0(%rbp), %rdi
leaq -0x488(%rbp), %rsi
callq 0x61b0
jmp 0x26c9b
movq -0x540(%rbp), %rdi
leaq -0x4c0(%rbp), %rsi
leaq -0x4e0(%rbp), %rdx
leaq -0x4a0(%rbp), %rcx
callq 0x1dc90
jmp 0x26cbe
leaq -0x4e0(%rbp), %rdi
callq 0x6828
leaq -0x4c0(%rbp), %rdi
callq 0x6828
movl $0x0, -0x4e4(%rbp)
movslq -0x4e4(%rbp), %rax
movq %rax, -0x6e0(%rbp)
leaq -0x420(%rbp), %rdi
callq 0x6630
movq %rax, %rcx
movq -0x6e0(%rbp), %rax
subq $0x1, %rcx
cmpq %rcx, %rax
jae 0x26e6f
movslq -0x4e4(%rbp), %rsi
leaq -0x4a0(%rbp), %rdi
callq 0x9080
movq %rax, %rdi
callq 0x6320
cmpq $0x1, %rax
jne 0x26d9e
movslq -0x4e4(%rbp), %rsi
leaq -0x420(%rbp), %rdi
callq 0x6810
movq %rax, -0x6e8(%rbp)
jmp 0x26d4e
movq -0x6e8(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x6f4(%rbp)
movslq -0x4e4(%rbp), %rsi
leaq -0x4a0(%rbp), %rdi
callq 0x9080
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x6810
movq %rax, -0x6f0(%rbp)
jmp 0x26d86
movl -0x6f4(%rbp), %eax
movq -0x6f0(%rbp), %rcx
movsbl (%rcx), %ecx
cmpl %ecx, %eax
je 0x26e59
movslq -0x4e4(%rbp), %rsi
leaq -0x4a0(%rbp), %rdi
callq 0x9080
movq %rax, -0x700(%rbp)
movl -0x3a4(%rbp), %eax
movl -0x468(%rbp), %edx
movl %eax, %ecx
movl %edx, %eax
leal (%rax,%rcx,2), %eax
cltq
leaq (%rax,%rax,2), %rax
leaq -0x388(%rbp,%rax,8), %rdi
movl -0x3c(%rbp), %eax
movl -0x4e4(%rbp), %ecx
addl %ecx, %eax
movslq %eax, %rsi
callq 0x9080
movq -0x700(%rbp), %rsi
movq %rax, %rdi
callq 0x6070
jmp 0x26dfd
jmp 0x26e59
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0x27257
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0x26e48
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
leaq -0x4e0(%rbp), %rdi
callq 0x6828
leaq -0x4c0(%rbp), %rdi
callq 0x6828
jmp 0x27257
jmp 0x26e5b
movl -0x4e4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4e4(%rbp)
jmp 0x26ce0
movslq -0x4e4(%rbp), %rax
movq %rax, -0x708(%rbp)
leaq -0x420(%rbp), %rdi
callq 0x6630
movq %rax, %rcx
movq -0x708(%rbp), %rax
subq $0x1, %rcx
cmpq %rcx, %rax
jne 0x26e9e
jmp 0x26ebd
leaq 0x2e748(%rip), %rdi     # 0x555ed
leaq 0x2e755(%rip), %rsi     # 0x55601
movl $0x845, %edx            # imm = 0x845
leaq 0x2e879(%rip), %rcx     # 0x55731
callq 0x62f0
movslq -0x4e4(%rbp), %rsi
leaq -0x4a0(%rbp), %rdi
callq 0x9080
movq %rax, %rsi
leaq -0x508(%rbp), %rdi
callq 0x61b0
jmp 0x26ee1
leaq -0x508(%rbp), %rdi
callq 0x6630
cmpq $0x0, %rax
jbe 0x271cc
leaq -0x508(%rbp), %rdi
callq 0x6630
cmpq $0x1, %rax
jbe 0x27119
xorl %eax, %eax
movl %eax, %esi
leaq -0x508(%rbp), %rdi
callq 0x6810
movq %rax, -0x710(%rbp)
jmp 0x26f26
movq -0x710(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x71c(%rbp)
movslq -0x4e4(%rbp), %rsi
leaq -0x420(%rbp), %rdi
callq 0x6810
movq %rax, -0x718(%rbp)
jmp 0x26f52
movl -0x71c(%rbp), %eax
movq -0x718(%rbp), %rcx
movsbl (%rcx), %ecx
cmpl %ecx, %eax
jne 0x270cd
movl -0x3a4(%rbp), %eax
movl -0x468(%rbp), %edx
movl %eax, %ecx
movl %edx, %eax
leal (%rax,%rcx,2), %eax
cltq
leaq (%rax,%rax,2), %rax
leaq -0x388(%rbp,%rax,8), %rdi
movl -0x3c(%rbp), %eax
movl -0x4e4(%rbp), %ecx
addl %ecx, %eax
movslq %eax, %rsi
callq 0x9080
movq %rax, %rdi
leaq 0x2ea8a(%rip), %rsi     # 0x55a32
callq 0x125e0
movb %al, -0x71d(%rbp)
jmp 0x26fb5
movb -0x71d(%rbp), %al
testb $0x1, %al
jne 0x26fc1
jmp 0x27022
movl -0x3a4(%rbp), %eax
movl -0x468(%rbp), %edx
movl %eax, %ecx
movl %edx, %eax
leal (%rax,%rcx,2), %eax
cltq
leaq (%rax,%rax,2), %rax
leaq -0x388(%rbp,%rax,8), %rdi
movl -0x3c(%rbp), %eax
movl -0x4e4(%rbp), %ecx
addl %ecx, %eax
movslq %eax, %rsi
callq 0x9080
movq %rax, %rdi
leaq -0x508(%rbp), %rsi
callq 0x6070
jmp 0x27006
jmp 0x270cb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0x2724b
leaq -0x508(%rbp), %rdi
movq %rdi, -0x728(%rbp)
callq 0x6320
movq -0x728(%rbp), %rsi
movq %rax, %rcx
decq %rcx
leaq -0x528(%rbp), %rdi
movl $0x1, %edx
callq 0x6460
jmp 0x27055
movl -0x3a4(%rbp), %eax
movl -0x468(%rbp), %edx
movl %eax, %ecx
movl %edx, %eax
leal (%rax,%rcx,2), %eax
cltq
leaq (%rax,%rax,2), %rax
leaq -0x388(%rbp,%rax,8), %rdi
movl -0x3c(%rbp), %eax
movl -0x4e4(%rbp), %ecx
addl %ecx, %eax
movslq %eax, %rsi
callq 0x9080
movq %rax, %rdi
leaq -0x528(%rbp), %rsi
callq 0x6560
jmp 0x2709a
leaq -0x528(%rbp), %rdi
callq 0x6828
jmp 0x270cb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
leaq -0x528(%rbp), %rdi
callq 0x6828
jmp 0x2724b
jmp 0x27114
movl -0x3a4(%rbp), %eax
movl -0x468(%rbp), %edx
movl %eax, %ecx
movl %edx, %eax
leal (%rax,%rcx,2), %eax
cltq
leaq (%rax,%rax,2), %rax
leaq -0x388(%rbp,%rax,8), %rdi
movl -0x3c(%rbp), %eax
movl -0x4e4(%rbp), %ecx
addl %ecx, %eax
movslq %eax, %rsi
callq 0x9080
movq %rax, %rdi
leaq -0x508(%rbp), %rsi
callq 0x6070
jmp 0x27112
jmp 0x27114
jmp 0x271ca
movslq -0x4e4(%rbp), %rsi
leaq -0x420(%rbp), %rdi
callq 0x6810
movq %rax, -0x730(%rbp)
jmp 0x27135
movq -0x730(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x73c(%rbp)
movslq -0x4e4(%rbp), %rsi
leaq -0x4a0(%rbp), %rdi
callq 0x9080
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x6810
movq %rax, -0x738(%rbp)
jmp 0x2716d
movl -0x73c(%rbp), %eax
movq -0x738(%rbp), %rcx
movsbl (%rcx), %ecx
cmpl %ecx, %eax
je 0x271c8
movl -0x3a4(%rbp), %eax
movl -0x468(%rbp), %edx
movl %eax, %ecx
movl %edx, %eax
leal (%rax,%rcx,2), %eax
cltq
leaq (%rax,%rax,2), %rax
leaq -0x388(%rbp,%rax,8), %rdi
movl -0x3c(%rbp), %eax
movl -0x4e4(%rbp), %ecx
addl %ecx, %eax
movslq %eax, %rsi
callq 0x9080
movq %rax, %rdi
leaq -0x508(%rbp), %rsi
callq 0x6070
jmp 0x271c6
jmp 0x271c8
jmp 0x271ca
jmp 0x27213
movl -0x3a4(%rbp), %eax
movl -0x468(%rbp), %edx
movl %eax, %ecx
movl %edx, %eax
leal (%rax,%rcx,2), %eax
cltq
leaq (%rax,%rax,2), %rax
leaq -0x388(%rbp,%rax,8), %rdi
movl -0x3c(%rbp), %eax
movl -0x4e4(%rbp), %ecx
addl %ecx, %eax
movslq %eax, %rsi
callq 0x9080
movq %rax, %rdi
leaq 0x2e394(%rip), %rsi     # 0x5559e
callq 0x65c0
jmp 0x27211
jmp 0x27213
leaq -0x508(%rbp), %rdi
callq 0x6828
leaq -0x4a0(%rbp), %rdi
callq 0x13370
leaq -0x488(%rbp), %rdi
callq 0x6828
movl -0x468(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x468(%rbp)
jmp 0x26c37
leaq -0x508(%rbp), %rdi
callq 0x6828
leaq -0x4a0(%rbp), %rdi
callq 0x13370
leaq -0x488(%rbp), %rdi
callq 0x6828
jmp 0x272d5
leaq -0x460(%rbp), %rax
movq %rax, -0x750(%rbp)
addq $0x40, %rax
movq %rax, -0x748(%rbp)
movq -0x748(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x758(%rbp)
callq 0x6828
movq -0x750(%rbp), %rcx
movq -0x758(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x748(%rbp)
jne 0x2728a
leaq -0x420(%rbp), %rdi
callq 0x6828
leaq -0x400(%rbp), %rdi
callq 0x32c60
jmp 0x2733c
leaq -0x460(%rbp), %rax
movq %rax, -0x768(%rbp)
addq $0x40, %rax
movq %rax, -0x760(%rbp)
movq -0x760(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x770(%rbp)
callq 0x6828
movq -0x768(%rbp), %rcx
movq -0x770(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x760(%rbp)
jne 0x272ee
leaq -0x420(%rbp), %rdi
callq 0x6828
leaq -0x400(%rbp), %rdi
callq 0x32c60
jmp 0x2742f
movslq -0x3a4(%rbp), %rax
leaq -0x3a0(%rbp,%rax,8), %rcx
movq %rcx, -0x780(%rbp)
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
leaq -0x328(%rbp,%rax), %rdi
leaq -0x3c(%rbp), %rsi
callq 0x34f00
movq %rax, -0x778(%rbp)
jmp 0x27374
movq -0x780(%rbp), %rsi
movq -0x778(%rbp), %rdi
callq 0x34ed0
jmp 0x27389
jmp 0x2738b
movl -0x3a4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3a4(%rbp)
jmp 0x26977
movq 0x4cc12(%rip), %rdi     # 0x73fb8
leaq 0x2e41d(%rip), %rsi     # 0x557ca
callq 0x6420
movq %rax, -0x788(%rbp)
jmp 0x273bb
movq -0x788(%rbp), %rdi
movl -0x3c(%rbp), %esi
callq 0x6740
movq %rax, -0x790(%rbp)
jmp 0x273d3
movq -0x790(%rbp), %rdi
movq 0x4cb9f(%rip), %rsi     # 0x73f80
callq 0x6480
jmp 0x273e8
movq -0x540(%rbp), %rdi
leaq -0x390(%rbp), %rsi
callq 0x27510
jmp 0x273fd
movq -0x30(%rbp), %rdi
leaq -0x390(%rbp), %rsi
callq 0x34fe0
jmp 0x2740f
leaq -0x390(%rbp), %rdi
callq 0x35020
movl -0x20c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20c(%rbp)
jmp 0x2689c
leaq -0x390(%rbp), %rdi
callq 0x35020
jmp 0x274ac
jmp 0x2743f
movl -0x208(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x208(%rbp)
jmp 0x26868
movb $0x1, -0x1(%rbp)
leaq -0x70(%rbp), %rax
movq %rax, -0x7a0(%rbp)
addq $0x30, %rax
movq %rax, -0x798(%rbp)
movq -0x798(%rbp), %rdi
addq $-0x18, %rdi
movq %rdi, -0x7a8(%rbp)
callq 0x350f0
movq -0x7a0(%rbp), %rcx
movq -0x7a8(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x798(%rbp)
jne 0x2746d
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x7c0, %rsp            # imm = 0x7C0
popq %rbp
retq
leaq -0x70(%rbp), %rax
movq %rax, -0x7b8(%rbp)
addq $0x30, %rax
movq %rax, -0x7b0(%rbp)
movq -0x7b0(%rbp), %rdi
addq $-0x18, %rdi
movq %rdi, -0x7c0(%rbp)
callq 0x350f0
movq -0x7b8(%rbp), %rcx
movq -0x7c0(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x7b0(%rbp)
jne 0x274c2
jmp 0x274f5
movq -0x90(%rbp), %rdi
callq 0x6750
nopw %cs:(%rax,%rax)