// File: /workspace/github_cpp_makefile_star2_O3/medvedevgroup[P]varmatch/src/wholegenome.cpp
// Function: WholeGenome::PathMakeDecisionNoGenotype(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::PathMakeDecisionNoGenotype(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));
        // to maintain existance
        // 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];
            // 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){ //here do not have to change anything
                alts[1] = var.alts[1];
            }

            // not just purely consider if a vqriant can be applied, but if a choice
            bool choice_applicable = true;
            for(int k = 0; k < ref.length(); k++){
            // for each ref char
                int y = 0;
                // 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()){
                        choice_applicable = false;
                        break;
                    }else{
                        if(ref[k] != alts[y][k]){
                            choice_applicable = false;
                            break;
                        }
                    }
                }
            }

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

            if(var.multi_alts){ // here do not have to change anything

                //if heterozygous, then there is another choice, check if it is applicable
                string temp = alts[0];
                alts[0] = alts[1];
                alts[1] = temp;

                choice_applicable = true;
                for(int k = 0; k < ref.length(); k++){
                // for each ref char
                    //for(int y = 0; y < 2; y++)
                    int y = 0;
                    // 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){
                    candidate_choices[i].push_back(pair<int, int>(var_index, 1));
                }
            }
        }
    }

    //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){
                    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;
                    alts[0] = var.alts[c];
                    path.score += CalculateScore(var,
                                                 c,
                                                 score_unit,
                                                 match_mode,
                                                 score_scheme);

                    ToUpper(ref);
                    ToUpper(alts[0]);
                    int y = 0;

                    int k = 0;
                    for(; k < ref.length()-1; k++){
                        if(k < alts[y].length()){
                            if(ref[k] != alts[y][k]){
                                path.string_sequences[x*2+y][pos+k] = alts[y].substr(k,1);
                            }
                            // else change nothing
                        }else{
                            path.string_sequences[x*2+y][pos+k] = "";
                        }
                    }
                    // hence k == ref.length()-1, the last position
                    if(k < alts[y].length()){
                        string alt_part = alts[y].substr(k, alts[y].length()-k);
                        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] != alts[y][k]){
                                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];
            }
            sequence_path_list.push_back(path);
        }
    }

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x318, %rsp            # imm = 0x318
movq %r8, 0x168(%rsp)
movq %rcx, 0x160(%rsp)
movq %rdx, 0xf8(%rsp)
movq %rdi, 0x178(%rsp)
movl 0xc8(%rsi), %eax
incl %eax
leaq 0x4(%rsp), %rcx
movl %eax, (%rcx)
xorps %xmm0, %xmm0
leaq 0x118(%rsp), %rax
movaps %xmm0, 0x8(%rax)
movaps %xmm0, -0x8(%rax)
movaps %xmm0, -0x18(%rax)
movq %rsi, 0x170(%rsp)
leaq 0x8(%rsi), %rax
movq %rax, 0x158(%rsp)
leaq 0x100(%rsp), %rdi
movb $0x1, %bl
xorl %r15d, %r15d
leaq 0x1a441(%rip), %rbp     # 0x31a86
movq $-0x1, 0x198(%rsp)
movq %rdi, 0x30(%rsp)
leaq 0x198(%rsp), %rsi
callq 0x2ddde
movl %ebx, 0x28(%rsp)
movq 0x160(%rsp), %rax
movq (%rax,%r15,8), %rdi
leaq 0x4(%rsp), %rsi
callq 0x2dd60
movq %rax, %r14
cmpq %rdx, %rax
je 0x17996
leaq (%r15,%r15,2), %r15
shlq $0x4, %r15
addq 0x158(%rsp), %r15
movq %rdx, 0x58(%rsp)
movslq 0x24(%r14), %r12
movq 0xf8(%rsp), %rax
movq (%rax), %r13
imulq $0x58, %r12, %rbx
movl (%r13,%rbx), %eax
movl %eax, 0x198(%rsp)
leaq 0x1b0(%rsp), %rax
movq %rax, 0x1a0(%rsp)
movq 0x8(%r13,%rbx), %rsi
movq 0x10(%r13,%rbx), %rdx
addq %rsi, %rdx
leaq 0x1a0(%rsp), %rdi
callq 0x1123c
addq %rbx, %r13
leaq 0x28(%r13), %rsi
leaq 0x1c0(%rsp), %rbx
movq %rbx, %rdi
callq 0x28582
movq 0x50(%r13), %rax
leaq 0x1a0(%rsp), %rcx
movq %rax, 0x48(%rcx)
movups 0x40(%r13), %xmm0
movups %xmm0, 0x38(%rcx)
leaq 0x70(%rsp), %rax
movq %rax, 0x60(%rsp)
movq 0x1a0(%rsp), %rsi
movq 0x1a8(%rsp), %rdx
addq %rsi, %rdx
leaq 0x60(%rsp), %rdi
callq 0x1123c
movl $0x10, %eax
leaq (%rsp,%rax), %rcx
addq $0xa0, %rcx
movq %rcx, -0x10(%rcx)
movq $0x0, -0x8(%rcx)
movb $0x0, (%rcx)
addq $0x20, %rax
cmpq $0x50, %rax
jne 0x17743
movq 0x1c0(%rsp), %rsi
leaq 0xa0(%rsp), %rdi
callq 0x51c0
leaq 0xc0(%rsp), %r13
movq %r13, %rdi
leaq 0xa0(%rsp), %rsi
callq 0x51c0
cmpb $0x1, 0x1d9(%rsp)
jne 0x177b2
movq 0x1c0(%rsp), %rsi
addq $0x20, %rsi
movq %r13, %rdi
callq 0x51c0
cmpq $0x0, 0x68(%rsp)
je 0x17805
xorl %r13d, %r13d
movl 0x4(%rsp), %eax
addl %r13d, %eax
movslq %eax, %rdi
shlq $0x5, %rdi
addq (%r15), %rdi
movq %rbp, %rsi
callq 0x50e0
testl %eax, %eax
je 0x177fb
cmpq %r13, 0xa8(%rsp)
jbe 0x17821
movq 0x60(%rsp), %rax
movb (%rax,%r13), %al
movq 0xa0(%rsp), %rcx
cmpb (%rcx,%r13), %al
jne 0x17821
incq %r13
cmpq %r13, 0x68(%rsp)
ja 0x177bd
movl %r12d, 0x8(%rsp)
movl $0x0, 0xc(%rsp)
movq 0x30(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x2ddde
cmpb $0x0, 0x1d9(%rsp)
je 0x17906
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0xa0(%rsp), %rsi
movq 0xa8(%rsp), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %rdi
callq 0x1123c
leaq 0xc0(%rsp), %r13
leaq 0xa0(%rsp), %rdi
movq %r13, %rsi
callq 0x51c0
movq %r13, %rdi
leaq 0x8(%rsp), %rsi
callq 0x51c0
cmpq $0x0, 0x68(%rsp)
je 0x178ce
xorl %r13d, %r13d
movl 0x4(%rsp), %eax
addl %r13d, %eax
movslq %eax, %rdi
shlq $0x5, %rdi
addq (%r15), %rdi
movq %rbp, %rsi
callq 0x50e0
testl %eax, %eax
je 0x178c4
cmpq %r13, 0xa8(%rsp)
jbe 0x178ea
movq 0x60(%rsp), %rax
movb (%rax,%r13), %al
movq 0xa0(%rsp), %rcx
cmpb (%rcx,%r13), %al
jne 0x178ea
incq %r13
cmpq %r13, 0x68(%rsp)
ja 0x17886
movl %r12d, 0x38(%rsp)
movl $0x1, 0x3c(%rsp)
movq 0x30(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x2ddde
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x17906
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5340
movq $-0x40, %r12
leaq 0xd0(%rsp), %r13
movq -0x10(%r13), %rdi
cmpq %rdi, %r13
je 0x1792a
movq (%r13), %rsi
incq %rsi
callq 0x5340
addq $-0x20, %r13
addq $0x20, %r12
jne 0x17915
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x17950
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x5340
movq %rbx, %rdi
callq 0xe71c
movq 0x1a0(%rsp), %rdi
leaq 0x1b0(%rsp), %rax
cmpq %rax, %rdi
je 0x1797d
movq 0x1b0(%rsp), %rsi
incq %rsi
callq 0x5340
movq %r14, %rdi
callq 0x5250
movq %rax, %r14
movq 0x58(%rsp), %rdx
cmpq %rdx, %rax
jne 0x1769e
movl $0x1, %r15d
leaq 0x118(%rsp), %rdi
testb $0x1, 0x28(%rsp)
movl $0x0, %ebx
jne 0x17645
movq 0x100(%rsp), %rax
movq 0x108(%rsp), %rdx
cmpq %rax, %rdx
je 0x18006
leaq 0xa8(%rsp), %r12
movq 0x118(%rsp), %rcx
movq 0x120(%rsp), %rsi
movq $0x0, 0x28(%rsp)
leaq 0x198(%rsp), %r14
cmpq %rcx, %rsi
movq %rcx, %rsi
je 0x17fe6
xorl %r15d, %r15d
movq %r14, %rdi
movq 0x170(%rsp), %rsi
callq 0x28ef6
movq 0x100(%rsp), %rax
movq 0x118(%rsp), %rcx
movq %r15, 0x30(%rsp)
movsd (%rcx,%r15,8), %xmm0
movq 0x28(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm1
movlhps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0]
movaps %xmm1, 0x180(%rsp)
movb $0x1, %r13b
leaq 0x180(%rsp), %rbp
xorl %r14d, %r14d
movslq (%rbp), %r15
cmpq $-0x1, %r15
je 0x17eb2
movq 0xf8(%rsp), %rax
movq (%rax), %rbx
movq %r15, 0x58(%rsp)
imulq $0x58, %r15, %r15
movl (%rbx,%r15), %eax
movl %eax, 0xa0(%rsp)
leaq 0xb8(%rsp), %rax
movq %rax, 0xa8(%rsp)
movq 0x8(%rbx,%r15), %rsi
movq 0x10(%rbx,%r15), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x1123c
addq %r15, %rbx
leaq 0x28(%rbx), %rsi
leaq 0xc8(%rsp), %rdi
callq 0x28582
movq 0x50(%rbx), %rax
movq %rax, 0x48(%r12)
movups 0x40(%rbx), %xmm0
movups %xmm0, 0x38(%r12)
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0xa8(%rsp), %rsi
movq 0xb0(%rsp), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %rdi
callq 0x1123c
movl $0x10, %eax
leaq (%rsp,%rax), %rcx
addq $0x60, %rcx
movq %rcx, -0x10(%rcx)
movq $0x0, -0x8(%rcx)
movb $0x0, (%rcx)
addq $0x20, %rax
cmpq $0x50, %rax
jne 0x17af8
movslq 0x4(%rbp), %r15
movq %r15, %rsi
shlq $0x5, %rsi
addq 0xc8(%rsp), %rsi
leaq 0x60(%rsp), %rdi
callq 0x51c0
movq 0x178(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
movl %r15d, %edx
movl 0x350(%rsp), %ecx
movl 0x358(%rsp), %r8d
movl 0x360(%rsp), %r9d
callq 0x174b2
addl %eax, 0x2f0(%rsp)
movq 0x10(%rsp), %rbx
testq %rbx, %rbx
je 0x17b94
movq 0x8(%rsp), %r15
xorl %r12d, %r12d
movsbl (%r15,%r12), %edi
callq 0x5610
movb %al, (%r15,%r12)
incq %r12
cmpq %r12, %rbx
jne 0x17b7e
movq 0x68(%rsp), %rbx
testq %rbx, %rbx
je 0x17bbc
movq 0x60(%rsp), %r15
xorl %r12d, %r12d
movsbl (%r15,%r12), %edi
callq 0x5610
movb %al, (%r15,%r12)
incq %r12
cmpq %r12, %rbx
jne 0x17ba6
cmpq $0x1, 0x10(%rsp)
jne 0x17bcf
xorl %r12d, %r12d
xorl %r15d, %r15d
jmp 0x17c94
leaq (%r14,%r14,2), %r12
shlq $0x4, %r12
leaq 0x1a0(%rsp), %rax
addq %rax, %r12
xorl %r15d, %r15d
cmpq %r15, 0x68(%rsp)
jbe 0x17c52
movq 0x8(%rsp), %rax
movb (%rax,%r15), %al
movq 0x60(%rsp), %rcx
cmpb (%rcx,%r15), %al
je 0x17c7d
movl $0x1, %ecx
leaq 0x38(%rsp), %rbx
movq %rbx, %rdi
leaq 0x60(%rsp), %rsi
movq %r15, %rdx
callq 0x5360
movl 0x4(%rsp), %eax
addl %r15d, %eax
movslq %eax, %rdi
shlq $0x5, %rdi
addq (%r12), %rdi
movq %rbx, %rsi
callq 0x53e0
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x17c7d
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x17c7d
movl 0x4(%rsp), %eax
addl %r15d, %eax
cltq
movq (%r12), %rcx
shlq $0x5, %rax
leaq (%rcx,%rax), %rdi
movq 0x8(%rcx,%rax), %rdx
xorl %esi, %esi
leaq 0x1997d(%rip), %rcx     # 0x315f2
xorl %r8d, %r8d
callq 0x54b0
incq %r15
movq 0x10(%rsp), %rax
decq %rax
cmpq %r15, %rax
ja 0x17be5
movl %r15d, %r12d
movq 0x68(%rsp), %rcx
subq %r15, %rcx
jbe 0x17d84
leaq 0x38(%rsp), %rdi
leaq 0x60(%rsp), %rsi
movq %r15, %rdx
callq 0x5360
cmpq $0x2, 0x40(%rsp)
jb 0x17dcb
movq 0x38(%rsp), %rax
movb (%rax), %al
movq 0x8(%rsp), %rcx
leaq (%r14,%r14,2), %rbx
shlq $0x4, %rbx
movslq 0x4(%rsp), %rdi
movslq %r12d, %rsi
addq %rsi, %rdi
shlq $0x5, %rdi
leaq 0x1a0(%rsp), %rdx
addq (%rdx,%rbx), %rdi
cmpb (%rcx,%r15), %al
jne 0x17e04
movq %rsi, %r15
addq %rdx, %rbx
leaq 0x19d80(%rip), %rsi     # 0x31a86
callq 0x50e0
testl %eax, %eax
je 0x17df2
movq 0x40(%rsp), %rcx
decq %rcx
movl $0x1, %edx
leaq 0x138(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x5360
movslq 0x4(%rsp), %rdi
addq %r15, %rdi
shlq $0x5, %rdi
addq (%rbx), %rdi
movq 0x138(%rsp), %rsi
movq 0x140(%rsp), %rdx
callq 0x50f0
movq 0x138(%rsp), %rdi
leaq 0x148(%rsp), %rax
cmpq %rax, %rdi
je 0x17e0e
movq 0x148(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x17e0e
leaq (%r14,%r14,2), %rax
shlq $0x4, %rax
movslq 0x4(%rsp), %rcx
movslq %r12d, %rdx
addq %rcx, %rdx
leaq 0x1a0(%rsp), %rcx
movq (%rcx,%rax), %rax
shlq $0x5, %rdx
leaq (%rax,%rdx), %rdi
movq 0x8(%rax,%rdx), %rdx
xorl %esi, %esi
leaq 0x19839(%rip), %rcx     # 0x315f2
xorl %r8d, %r8d
callq 0x54b0
leaq 0xa8(%rsp), %r12
jmp 0x17e32
movq 0x8(%rsp), %rax
movb (%rax,%r15), %al
movq 0x60(%rsp), %rcx
cmpb (%rcx,%r15), %al
je 0x17e0e
leaq (%r14,%r14,2), %rbx
shlq $0x4, %rbx
leaq 0x1a0(%rsp), %rax
addq %rax, %rbx
movslq 0x4(%rsp), %rax
movslq %r12d, %rdi
addq %rax, %rdi
shlq $0x5, %rdi
addq (%rbx), %rdi
leaq 0x38(%rsp), %rsi
callq 0x51c0
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x17e2a
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x5340
leaq 0xa8(%rsp), %r12
movq $-0x40, %rbx
leaq 0x90(%rsp), %r15
movq -0x10(%r15), %rdi
cmpq %rdi, %r15
je 0x17e55
movq (%r15), %rsi
incq %rsi
callq 0x5340
addq $-0x20, %r15
addq $0x20, %rbx
jne 0x17e41
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x17e7b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5340
leaq 0xc8(%rsp), %rdi
callq 0xe71c
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
movq 0x58(%rsp), %r15
je 0x17eb2
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x5340
leaq (%r14,%r14,2), %rdi
shlq $0x4, %rdi
leaq 0x200(%rsp), %rax
addq %rax, %rdi
leaq 0x4(%rsp), %rsi
callq 0x2906e
movl %r15d, (%rax)
movl 0x4(%rbp), %ecx
movl %ecx, 0x4(%rax)
movl $0x1, %r14d
leaq 0x188(%rsp), %rbp
testb $0x1, %r13b
movl $0x0, %r13d
jne 0x17a53
movq 0x168(%rsp), %rbx
movq %rbx, %rdi
leaq 0x198(%rsp), %r14
movq %r14, %rsi
callq 0x2e160
movq %rax, %rdi
movq %rbx, %rsi
callq 0x5070
incq 0x10(%rbx)
movq 0x300(%rsp), %rdi
testq %rdi, %rdi
je 0x17f3d
movq 0x310(%rsp), %rsi
subq %rdi, %rsi
callq 0x5340
movl $0x140, %ebx            # imm = 0x140
movq 0x30(%rsp), %r15
leaq (%rsp,%rbx), %rax
addq $0x198, %rax            # imm = 0x198
movq -0x10(%rax), %rdi
cmpq %rdi, %rax
je 0x17f65
movq (%rax), %rsi
incq %rsi
callq 0x5340
addq $-0x20, %rbx
cmpq $0xc0, %rbx
jne 0x17f47
movl $0x98, %ebx
leaq (%rsp,%rbx), %rdi
addq $0x198, %rdi            # imm = 0x198
callq 0x2a10c
addq $-0x30, %rbx
cmpq $0x38, %rbx
jne 0x17f77
movl $0x50, %ebx
leaq (%rsp,%rbx), %rdi
addq $0x198, %rdi            # imm = 0x198
callq 0xe71c
addq $-0x18, %rbx
cmpq $-0x10, %rbx
jne 0x17f96
incq %r15
movq 0x118(%rsp), %rcx
movq 0x120(%rsp), %rsi
movq %rsi, %rax
subq %rcx, %rax
sarq $0x3, %rax
cmpq %r15, %rax
ja 0x17a05
movq 0x100(%rsp), %rax
movq 0x108(%rsp), %rdx
movq 0x28(%rsp), %r9
incq %r9
movq %rdx, %rdi
subq %rax, %rdi
sarq $0x3, %rdi
movq %r9, 0x28(%rsp)
cmpq %r9, %rdi
ja 0x179f6
movl $0x30, %ebx
movq 0xe8(%rsp,%rbx), %rdi
testq %rdi, %rdi
je 0x18028
movq 0xf8(%rsp,%rbx), %rsi
subq %rdi, %rsi
callq 0x5340
addq $-0x18, %rbx
jne 0x1800b
movb $0x1, %al
addq $0x318, %rsp            # imm = 0x318
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x180b4
jmp 0x180b4
jmp 0x18089
jmp 0x18177
jmp 0x180b4
jmp 0x180bc
jmp 0x180bc
jmp 0x18146
movq %rax, %r14
movq 0x138(%rsp), %rdi
leaq 0x148(%rsp), %rax
cmpq %rax, %rdi
je 0x18149
movq 0x148(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x18149
movq %rax, %r14
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x180bf
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x180bf
movq %rax, %r14
jmp 0x18118
movq %rax, %r14
jmp 0x18110
movq %rax, %r14
jmp 0x1828c
movq %rax, %r14
movq $-0x40, %rbx
leaq 0xd0(%rsp), %r15
movq -0x10(%r15), %rdi
cmpq %rdi, %r15
je 0x180e2
movq (%r15), %rsi
incq %rsi
callq 0x5340
addq $-0x20, %r15
addq $0x20, %rbx
jne 0x180ce
movq 0x60(%rsp), %rdi
leaq 0x70(%rsp), %rax
cmpq %rax, %rdi
je 0x18108
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x5340
leaq 0x1c0(%rsp), %rbx
movq %rbx, %rdi
callq 0xe71c
movq 0x1a0(%rsp), %rdi
leaq 0x1b0(%rsp), %rax
cmpq %rax, %rdi
je 0x1828c
movq 0x1b0(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x1828c
movq %rax, %r14
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x18186
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x18186
jmp 0x18183
jmp 0x18183
movq %rax, %r14
jmp 0x181cf
jmp 0x18177
movq %rax, %r14
jmp 0x181dc
movq %rax, %r14
jmp 0x18201
jmp 0x18183
jmp 0x18183
movq %rax, %r14
movq $-0x40, %rbx
leaq 0x90(%rsp), %r15
movq -0x10(%r15), %rdi
cmpq %rdi, %r15
je 0x181a9
movq (%r15), %rsi
incq %rsi
callq 0x5340
addq $-0x20, %r15
addq $0x20, %rbx
jne 0x18195
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x181cf
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x5340
leaq 0xc8(%rsp), %rdi
callq 0xe71c
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x18201
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x300(%rsp), %rdi
testq %rdi, %rdi
je 0x1821e
movq 0x310(%rsp), %rsi
subq %rdi, %rsi
callq 0x5340
movl $0x140, %ebx            # imm = 0x140
leaq (%rsp,%rbx), %rax
addq $0x198, %rax            # imm = 0x198
movq -0x10(%rax), %rdi
cmpq %rdi, %rax
je 0x18241
movq (%rax), %rsi
incq %rsi
callq 0x5340
addq $-0x20, %rbx
cmpq $0xc0, %rbx
jne 0x18223
movl $0x98, %ebx
leaq (%rsp,%rbx), %rdi
addq $0x198, %rdi            # imm = 0x198
callq 0x2a10c
addq $-0x30, %rbx
cmpq $0x38, %rbx
jne 0x18253
movl $0x50, %ebx
leaq (%rsp,%rbx), %rdi
addq $0x198, %rdi            # imm = 0x198
callq 0xe71c
addq $-0x18, %rbx
cmpq $-0x10, %rbx
jne 0x18272
movl $0x30, %ebx
movq 0xe8(%rsp,%rbx), %rdi
testq %rdi, %rdi
je 0x182ae
movq 0xf8(%rsp,%rbx), %rsi
subq %rdi, %rsi
callq 0x5340
addq $-0x18, %rbx
jne 0x18291
movq %r14, %rdi
callq 0x55c0