// File: medvedevgroup[P]varmatch/src/wholegenome.cpp
// Function: WholeGenome::VariantMakeDecision(SequencePath&, std::vector<DiploidVariant, std::allocator<DiploidVariant>>&, std::__cxx11::list<SequencePath, std::allocator<SequencePath>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int, int, int, int)
bool WholeGenome::VariantMakeDecision(SequencePath& sp,
                         vector<DiploidVariant> & variant_list,
                         list<SequencePath> & sequence_path_list,
                         const string & reference_sequence,
                         int score_unit,
                         int match_mode,
                         int score_scheme,
                         int variant_index)
{

    int pos = sp.current_genome_pos+1;

    int var_index = variant_index;
    DiploidVariant var = variant_list[var_index];

    // also this variant may not be used
    AppendChangedSp(sp,
                variant_list,
                sequence_path_list,
                reference_sequence,
                score_unit,
                match_mode,
                score_scheme,
                var_index,
                NOT_USE);

    int i = 0;
    if(var.flag) i = 1;
    //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));
        AppendChangedSp(sp,
                        variant_list,
                        sequence_path_list,
                        reference_sequence,
                        score_unit,
                        match_mode,
                        score_scheme,
                        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));
                AppendChangedSp(sp,
                        variant_list,
                        sequence_path_list,
                        reference_sequence,
                        score_unit,
                        match_mode,
                        score_scheme,
                        var_index,
                        1);
            }else{
                //candidate_choices[i].push_back(pair<int, int>(var_index, -1));
                AppendChangedSp(sp,
                        variant_list,
                        sequence_path_list,
                        reference_sequence,
                        score_unit,
                        match_mode,
                        score_scheme,
                        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));
            AppendChangedSp(sp,
                variant_list,
                sequence_path_list,
                reference_sequence,
                score_unit,
                match_mode,
                score_scheme,
                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));
            AppendChangedSp(sp,
                variant_list,
                sequence_path_list,
                reference_sequence,
                score_unit,
                match_mode,
                score_scheme,
                var_index,
                -2);
        }
    }
        
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x268, %rsp            # imm = 0x268
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)
movl %r9d, -0x34(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x160(%rbp)
movq -0x18(%rbp), %rax
movl 0xc8(%rax), %eax
incl %eax
movl %eax, -0x38(%rbp)
movl 0x20(%rbp), %eax
movl %eax, -0x3c(%rbp)
movq -0x20(%rbp), %rdi
movslq -0x3c(%rbp), %rsi
callq 0x33de0
movq %rax, %rsi
leaq -0x98(%rbp), %rdi
callq 0x340a0
movq -0x160(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
movl -0x34(%rbp), %r9d
movl 0x10(%rbp), %r10d
movl 0x18(%rbp), %r11d
movl -0x3c(%rbp), %ebx
movq %rsp, %rax
movl %ebx, 0x10(%rax)
movl %r11d, 0x8(%rax)
movl %r10d, (%rax)
movl $0xfffffff7, 0x18(%rax) # imm = 0xFFFFFFF7
callq 0x233b0
jmp 0x23fda
movl $0x0, -0xa8(%rbp)
testb $0x1, -0x4c(%rbp)
je 0x2400d
movl $0x1, -0xa8(%rbp)
jmp 0x2400d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
jmp 0x24a98
leaq -0x90(%rbp), %rsi
leaq -0xc8(%rbp), %rdi
callq 0x61b0
jmp 0x24022
leaq -0x110(%rbp), %rax
movq %rax, %rcx
addq $0x40, %rcx
movq %rcx, -0x170(%rbp)
movq %rax, -0x168(%rbp)
movq -0x168(%rbp), %rdi
movq %rdi, -0x178(%rbp)
callq 0x65e0
movq -0x178(%rbp), %rax
movq -0x170(%rbp), %rcx
addq $0x20, %rax
cmpq %rcx, %rax
movq %rax, -0x168(%rbp)
jne 0x2403e
leaq -0x70(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x9080
movq %rax, %rsi
leaq -0x110(%rbp), %rdi
callq 0x6070
jmp 0x2408d
leaq -0xf0(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x6070
jmp 0x240a2
testb $0x1, -0x57(%rbp)
je 0x240e6
testb $0x1, -0x56(%rbp)
jne 0x240e6
leaq -0x70(%rbp), %rdi
movl $0x1, %esi
callq 0x9080
movq %rax, %rsi
leaq -0xf0(%rbp), %rdi
callq 0x6070
jmp 0x240cd
jmp 0x24105
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
jmp 0x24a42
testb $0x1, -0x58(%rbp)
je 0x24103
leaq -0xf0(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x6070
jmp 0x24101
jmp 0x24103
jmp 0x24105
movl $0xffffffff, -0x114(%rbp) # imm = 0xFFFFFFFF
leaq -0x110(%rbp), %rdi
addq $0x20, %rdi
leaq -0xc8(%rbp), %rsi
callq 0xdcb0
testb $0x1, %al
jne 0x2412c
jmp 0x24136
movl $0x1, -0x114(%rbp)
movb $0x1, -0x115(%rbp)
movl $0x0, -0x11c(%rbp)
movslq -0x11c(%rbp), %rax
movq %rax, -0x180(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x6630
movq %rax, %rcx
movq -0x180(%rbp), %rax
cmpq %rcx, %rax
jae 0x242e9
movl $0x0, -0x120(%rbp)
cmpl $0x2, -0x120(%rbp)
jge 0x242c8
movl -0x120(%rbp), %eax
cmpl -0x114(%rbp), %eax
jne 0x2419e
jmp 0x242b4
movq -0x18(%rbp), %rax
movl -0xa8(%rbp), %ecx
movl -0x120(%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 -0x11c(%rbp), %eax
movl -0x38(%rbp), %ecx
addl %ecx, %eax
movslq %eax, %rsi
callq 0x9080
movq %rax, %rdi
leaq 0x31854(%rip), %rsi     # 0x55a32
callq 0x17c70
movb %al, -0x181(%rbp)
jmp 0x241eb
movb -0x181(%rbp), %al
testb $0x1, %al
jne 0x241fa
jmp 0x242b2
movslq -0x11c(%rbp), %rax
movq %rax, -0x190(%rbp)
movslq -0x120(%rbp), %rax
leaq -0x110(%rbp), %rdi
shlq $0x5, %rax
addq %rax, %rdi
callq 0x6630
movq %rax, %rcx
movq -0x190(%rbp), %rax
cmpq %rcx, %rax
jb 0x2423d
movb $0x0, -0x115(%rbp)
jmp 0x242c8
movslq -0x11c(%rbp), %rsi
leaq -0xc8(%rbp), %rdi
callq 0x6810
movq %rax, -0x198(%rbp)
jmp 0x24259
movq -0x198(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x1a4(%rbp)
movslq -0x120(%rbp), %rax
shlq $0x5, %rax
leaq -0x110(%rbp,%rax), %rdi
movslq -0x11c(%rbp), %rsi
callq 0x6810
movq %rax, -0x1a0(%rbp)
jmp 0x24291
movl -0x1a4(%rbp), %eax
movq -0x1a0(%rbp), %rcx
movsbl (%rcx), %ecx
cmpl %ecx, %eax
je 0x242ae
movb $0x0, -0x115(%rbp)
jmp 0x242c8
jmp 0x242b0
jmp 0x242b2
jmp 0x242b4
movl -0x120(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x120(%rbp)
jmp 0x2417e
testb $0x1, -0x115(%rbp)
jne 0x242d3
jmp 0x242e9
jmp 0x242d5
movl -0x11c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x11c(%rbp)
jmp 0x24147
testb $0x1, -0x115(%rbp)
je 0x24335
movq -0x160(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
movl -0x34(%rbp), %r9d
movl 0x10(%rbp), %r10d
movl 0x18(%rbp), %r11d
movl -0x3c(%rbp), %ebx
movq %rsp, %rax
movl %ebx, 0x10(%rax)
movl %r11d, 0x8(%rax)
movl %r10d, (%rax)
movl $0x0, 0x18(%rax)
callq 0x233b0
jmp 0x24333
jmp 0x24335
testb $0x1, -0x58(%rbp)
je 0x24630
leaq -0x140(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x61b0
jmp 0x24354
leaq -0xf0(%rbp), %rsi
leaq -0x110(%rbp), %rdi
callq 0x6070
jmp 0x24369
leaq -0xf0(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0x6070
jmp 0x2437e
movl $0xffffffff, -0x114(%rbp) # imm = 0xFFFFFFFF
leaq -0x110(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0xdcb0
testb $0x1, %al
jne 0x243a1
jmp 0x243d0
movl $0x0, -0x114(%rbp)
jmp 0x243d0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
leaq -0x140(%rbp), %rdi
callq 0x6828
jmp 0x24a42
movb $0x1, -0x115(%rbp)
movl $0x0, -0x144(%rbp)
movslq -0x144(%rbp), %rax
movq %rax, -0x1b0(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x6630
movq %rax, %rcx
movq -0x1b0(%rbp), %rax
cmpq %rcx, %rax
jae 0x24583
movl $0x0, -0x148(%rbp)
cmpl $0x2, -0x148(%rbp)
jge 0x24562
movl -0x114(%rbp), %eax
cmpl -0x148(%rbp), %eax
jne 0x24438
jmp 0x2454e
movq -0x18(%rbp), %rax
movl -0xa8(%rbp), %ecx
movl -0x148(%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 -0x144(%rbp), %eax
movl -0x38(%rbp), %ecx
addl %ecx, %eax
movslq %eax, %rsi
callq 0x9080
movq %rax, %rdi
leaq 0x315ba(%rip), %rsi     # 0x55a32
callq 0x17c70
movb %al, -0x1b1(%rbp)
jmp 0x24485
movb -0x1b1(%rbp), %al
testb $0x1, %al
jne 0x24494
jmp 0x2454c
movslq -0x144(%rbp), %rax
movq %rax, -0x1c0(%rbp)
movslq -0x148(%rbp), %rax
leaq -0x110(%rbp), %rdi
shlq $0x5, %rax
addq %rax, %rdi
callq 0x6630
movq %rax, %rcx
movq -0x1c0(%rbp), %rax
cmpq %rcx, %rax
jb 0x244d7
movb $0x0, -0x115(%rbp)
jmp 0x24562
movslq -0x144(%rbp), %rsi
leaq -0xc8(%rbp), %rdi
callq 0x6810
movq %rax, -0x1c8(%rbp)
jmp 0x244f3
movq -0x1c8(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x1d4(%rbp)
movslq -0x148(%rbp), %rax
shlq $0x5, %rax
leaq -0x110(%rbp,%rax), %rdi
movslq -0x144(%rbp), %rsi
callq 0x6810
movq %rax, -0x1d0(%rbp)
jmp 0x2452b
movl -0x1d4(%rbp), %eax
movq -0x1d0(%rbp), %rcx
movsbl (%rcx), %ecx
cmpl %ecx, %eax
je 0x24548
movb $0x0, -0x115(%rbp)
jmp 0x24562
jmp 0x2454a
jmp 0x2454c
jmp 0x2454e
movl -0x148(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x148(%rbp)
jmp 0x24418
testb $0x1, -0x115(%rbp)
jne 0x2456d
jmp 0x24583
jmp 0x2456f
movl -0x144(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x144(%rbp)
jmp 0x243e1
testb $0x1, -0x115(%rbp)
je 0x24624
testb $0x1, -0x57(%rbp)
je 0x245df
testb $0x1, -0x56(%rbp)
jne 0x245df
movq -0x160(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
movl -0x34(%rbp), %r9d
movl 0x10(%rbp), %r10d
movl 0x18(%rbp), %r11d
movl -0x3c(%rbp), %ebx
movq %rsp, %rax
movl %ebx, 0x10(%rax)
movl %r11d, 0x8(%rax)
movl %r10d, (%rax)
movl $0x1, 0x18(%rax)
callq 0x233b0
jmp 0x245dd
jmp 0x24622
movq -0x160(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
movl -0x34(%rbp), %r9d
movl 0x10(%rbp), %r10d
movl 0x18(%rbp), %r11d
movl -0x3c(%rbp), %ebx
movq %rsp, %rax
movl %ebx, 0x10(%rax)
movl %r11d, 0x8(%rax)
movl %r10d, (%rax)
movl $0xffffffff, 0x18(%rax) # imm = 0xFFFFFFFF
callq 0x233b0
jmp 0x24620
jmp 0x24622
jmp 0x24624
leaq -0x140(%rbp), %rdi
callq 0x6828
testb $0x1, -0x57(%rbp)
je 0x24a40
testb $0x1, -0x56(%rbp)
je 0x24a40
leaq -0x70(%rbp), %rdi
movl $0x1, %esi
callq 0x9080
movq %rax, %rsi
leaq -0x110(%rbp), %rdi
callq 0x6070
jmp 0x24663
leaq -0xf0(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x6070
jmp 0x24678
movb $0x1, -0x115(%rbp)
movl $0x0, -0x14c(%rbp)
movl $0x0, -0x150(%rbp)
movslq -0x150(%rbp), %rax
movq %rax, -0x1e0(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x6630
movq %rax, %rcx
movq -0x1e0(%rbp), %rax
cmpq %rcx, %rax
jae 0x247f5
movq -0x18(%rbp), %rax
movl -0xa8(%rbp), %ecx
movl -0x14c(%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 -0x150(%rbp), %eax
movl -0x38(%rbp), %ecx
addl %ecx, %eax
movslq %eax, %rsi
callq 0x9080
movq %rax, %rdi
leaq 0x31332(%rip), %rsi     # 0x55a32
callq 0x17c70
movb %al, -0x1e1(%rbp)
jmp 0x2470d
movb -0x1e1(%rbp), %al
testb $0x1, %al
jne 0x2471c
jmp 0x247d4
movslq -0x150(%rbp), %rax
movq %rax, -0x1f0(%rbp)
movslq -0x14c(%rbp), %rax
leaq -0x110(%rbp), %rdi
shlq $0x5, %rax
addq %rax, %rdi
callq 0x6630
movq %rax, %rcx
movq -0x1f0(%rbp), %rax
cmpq %rcx, %rax
jb 0x2475f
movb $0x0, -0x115(%rbp)
jmp 0x247f5
movslq -0x150(%rbp), %rsi
leaq -0xc8(%rbp), %rdi
callq 0x6810
movq %rax, -0x1f8(%rbp)
jmp 0x2477b
movq -0x1f8(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x204(%rbp)
movslq -0x14c(%rbp), %rax
shlq $0x5, %rax
leaq -0x110(%rbp,%rax), %rdi
movslq -0x150(%rbp), %rsi
callq 0x6810
movq %rax, -0x200(%rbp)
jmp 0x247b3
movl -0x204(%rbp), %eax
movq -0x200(%rbp), %rcx
movsbl (%rcx), %ecx
cmpl %ecx, %eax
je 0x247d0
movb $0x0, -0x115(%rbp)
jmp 0x247f5
jmp 0x247d2
jmp 0x247d4
testb $0x1, -0x115(%rbp)
jne 0x247df
jmp 0x247f5
jmp 0x247e1
movl -0x150(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x150(%rbp)
jmp 0x24693
testb $0x1, -0x115(%rbp)
je 0x24841
movq -0x160(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
movl -0x34(%rbp), %r9d
movl 0x10(%rbp), %r10d
movl 0x18(%rbp), %r11d
movl -0x3c(%rbp), %ebx
movq %rsp, %rax
movl %ebx, 0x10(%rax)
movl %r11d, 0x8(%rax)
movl %r10d, (%rax)
movl $0x1, 0x18(%rax)
callq 0x233b0
jmp 0x2483f
jmp 0x24841
leaq -0x110(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x6070
jmp 0x24856
leaq -0x70(%rbp), %rdi
movl $0x1, %esi
callq 0x9080
movq %rax, %rsi
leaq -0xf0(%rbp), %rdi
callq 0x6070
jmp 0x24875
movb $0x1, -0x115(%rbp)
movl $0x1, -0x14c(%rbp)
movl $0x0, -0x154(%rbp)
movslq -0x154(%rbp), %rax
movq %rax, -0x210(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x6630
movq %rax, %rcx
movq -0x210(%rbp), %rax
cmpq %rcx, %rax
jae 0x249f2
movq -0x18(%rbp), %rax
movl -0xa8(%rbp), %ecx
movl -0x14c(%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 -0x154(%rbp), %eax
movl -0x38(%rbp), %ecx
addl %ecx, %eax
movslq %eax, %rsi
callq 0x9080
movq %rax, %rdi
leaq 0x31135(%rip), %rsi     # 0x55a32
callq 0x17c70
movb %al, -0x211(%rbp)
jmp 0x2490a
movb -0x211(%rbp), %al
testb $0x1, %al
jne 0x24919
jmp 0x249d1
movslq -0x154(%rbp), %rax
movq %rax, -0x220(%rbp)
movslq -0x14c(%rbp), %rax
leaq -0x110(%rbp), %rdi
shlq $0x5, %rax
addq %rax, %rdi
callq 0x6630
movq %rax, %rcx
movq -0x220(%rbp), %rax
cmpq %rcx, %rax
jb 0x2495c
movb $0x0, -0x115(%rbp)
jmp 0x249f2
movslq -0x154(%rbp), %rsi
leaq -0xc8(%rbp), %rdi
callq 0x6810
movq %rax, -0x228(%rbp)
jmp 0x24978
movq -0x228(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x234(%rbp)
movslq -0x14c(%rbp), %rax
shlq $0x5, %rax
leaq -0x110(%rbp,%rax), %rdi
movslq -0x154(%rbp), %rsi
callq 0x6810
movq %rax, -0x230(%rbp)
jmp 0x249b0
movl -0x234(%rbp), %eax
movq -0x230(%rbp), %rcx
movsbl (%rcx), %ecx
cmpl %ecx, %eax
je 0x249cd
movb $0x0, -0x115(%rbp)
jmp 0x249f2
jmp 0x249cf
jmp 0x249d1
testb $0x1, -0x115(%rbp)
jne 0x249dc
jmp 0x249f2
jmp 0x249de
movl -0x154(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x154(%rbp)
jmp 0x24890
testb $0x1, -0x115(%rbp)
je 0x24a3e
movq -0x160(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
movl -0x34(%rbp), %r9d
movl 0x10(%rbp), %r10d
movl 0x18(%rbp), %r11d
movl -0x3c(%rbp), %ebx
movq %rsp, %rax
movl %ebx, 0x10(%rax)
movl %r11d, 0x8(%rax)
movl %r10d, (%rax)
movl $0xfffffffe, 0x18(%rax) # imm = 0xFFFFFFFE
callq 0x233b0
jmp 0x24a3c
jmp 0x24a3e
jmp 0x24a40
ud2
leaq -0x110(%rbp), %rax
movq %rax, -0x248(%rbp)
addq $0x40, %rax
movq %rax, -0x240(%rbp)
movq -0x240(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x250(%rbp)
callq 0x6828
movq -0x248(%rbp), %rcx
movq -0x250(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x240(%rbp)
jne 0x24a5b
leaq -0xc8(%rbp), %rdi
callq 0x6828
leaq -0x98(%rbp), %rdi
callq 0x32c60
movq -0xa0(%rbp), %rdi
callq 0x6750