// File: /workspace/github_cpp_makefile_star2_O2/medvedevgroup[P]varmatch/src/wholegenome.cpp
// Function: WholeGenome::MatchVariantListInThread(int, int, int, std::vector<DiploidVariant, std::allocator<DiploidVariant>>&, int)
bool WholeGenome::MatchVariantListInThread(int thread_index, 
    int threshold_index,
    int chr_id,
    vector<DiploidVariant> & variant_list,
    int cluster_id){
    //===================================================
    sort(variant_list.begin(), variant_list.end());
    // decide reference sequence
    vector<DiploidVariant> separate_var_list[2];
    vector<Interval> intervals;
    // separate into ref and que
    int total_mil = 0;
    int total_mdl = 0;
    int min_pos = genome_sequences[chr_id].length() + 1;
    int max_pos = -1;
    for (int i = 0; i < variant_list.size(); i++) {
        int flag = 0;
        if (variant_list[i].flag) flag = 1; // flag indicate if the variant is from ref set(0) or query set(1)
        int pos = variant_list[i].pos;
        separate_var_list[flag].push_back(variant_list[i]);
        total_mil += variant_list[i].mil;
        total_mdl += variant_list[i].mdl;
        auto ref_sequence = variant_list[i].ref;
        auto alt_sequences = variant_list[i].alts;
        min_pos = min(pos, min_pos);
        max_pos = max((int)(pos + ref_sequence.length()), max_pos);

        int end_pos = pos + ref_sequence.length() - 1; // included end position!!
        intervals.push_back(Interval(pos, end_pos));
    }
    min_pos = max(min_pos - 1, 0);
    max_pos = min(max_pos + 1, (int)genome_sequences[chr_id].length()); //exclusive

    if (separate_var_list[0].size() == 0 || separate_var_list[1].size() == 0) {
        //dout << separate_var_list[0].size() << ", " << separate_var_list[1].size() << endl;
        return false;
    }
    if (separate_var_list[0].size() == 1 && separate_var_list[1].size() == 1){
        // try direct match to save time
        if(separate_var_list[0][0] == separate_var_list[1][0]){

            DiploidVariant tv = separate_var_list[0][0];
            string match_record = chrname_by_chrid[chr_id] + "\t" + to_string(tv.pos+1) + "\t" + tv.ref + "\t" + tv.alts[0];
            if(tv.multi_alts) match_record += "/" + tv.alts[1];
            match_record += "\t.\t.\t.\t.\t.\n";
            // here we need to push back for all mode_index
            //complex_match_records[thread_index]->push_back(match_record);

            int edit_distance = CalculateEditDistance(tv, 0, 0);
            for(int mi = 0; mi < mode_index_list.size(); mi ++){
                int mode_i = mode_index_list[mi];
                //if(mi == 0){
                

                // this line should be recovered
                match_records_by_mode_by_thread[thread_index][mode_i]->push_back(match_record);
                
                //}else{
                //    match_records_by_mode_by_thread[thread_index][mode_i]->push_back("$"+to_string(match_records_by_mode_by_thread[thread_index][0]->size()));
                    // use dollor to represent that it is the same
                //}
                baseline_total_match_num[thread_index][threshold_index]->at(mode_i)++;
                query_total_match_num[thread_index][threshold_index]->at(mode_i)++;

                baseline_total_edit_distance[thread_index][threshold_index]->at(mode_i) +=  edit_distance;
                query_total_edit_distance[thread_index][threshold_index]->at(mode_i) += edit_distance;
                //calculate the edit distance
            }
            // output match result
            return true;
        }
        // if not match, still can match by changing genome
    }else if(separate_var_list[0].size() == 1 || separate_var_list[1].size() == 1){
        int flag = 0;
        if(separate_var_list[1].size() == 1) flag = 1;
        int r_flag = 1-flag;
        if(separate_var_list[r_flag].size() > 4){
            int total_r_mdl = 0;
            int total_r_mil = 0;

            for(int k = 0; k < separate_var_list[r_flag].size(); k++){
                DiploidVariant var = separate_var_list[r_flag][k];
                int var_mdl = var.mdl;
                int var_mil = var.mil;
                int ref_length = var.ref.length();
                total_r_mdl += var_mdl;
                total_r_mil += var_mil;
            }

            if(max(separate_var_list[flag][0].mdl, separate_var_list[flag][0].mil) > max(total_r_mdl, total_r_mil)) return false;
        }
    }

    separate_var_list[0].clear();
    separate_var_list[1].clear();
    // remove singular variant
    // [todo] try removing this filter to see running time changes
    vector<bool> appliable_flag;
    int total_change = total_mil+total_mdl;

    if(variant_list.size() > EASY_MATCH_VAR_NUM){
        for(int k = 0; k < variant_list.size(); k++){
            DiploidVariant cur_var = variant_list[k];
            int max_change = max(cur_var.mil, cur_var.mdl);
            if(max_change > total_change-max_change){
                appliable_flag.push_back(false);
                //dout << "this variant is removed" << endl;
            }else{
                appliable_flag.push_back(true);
            }
        }
    }else{
        for(int k = 0; k < variant_list.size(); k++){
            appliable_flag.push_back(true);
        }
    }

    string subsequence = genome_sequences[chr_id].substr(min_pos, max_pos - min_pos);

    ToUpper(subsequence); // subsequence only contains upper char
    int offset = min_pos;
    int subsequence_length = max_pos - min_pos;

    // have subsequence in hand
    //generate decision point
    multimap<int, int> * choices_by_pos[2];
    // choice by pos is to also equal to var by pos
    for(int i = 0; i < 2; i++){
        choices_by_pos[i] = new multimap<int, int>();
    }

    for(int index = 0; index < variant_list.size(); index++){
        if(!appliable_flag[index]) continue;
        // remove decision point if not applicable
        int pos = variant_list[index].pos - offset;
        int flag = 0;
        if(variant_list[index].flag) flag = 1;
        choices_by_pos[flag]->insert(pair<int, int>(pos, index));
        //dout << pos << index << endl;
    }

    vector<Interval> mergered_intervals = merge(intervals);
//    unordered_map<int, bool> sync_points;
//    for(int i = 0; i < mergered_intervals.size(); i++){
//        sync_points[mergered_intervals[i].end-offset] = true;
//    }
    vector<int> sync_points;
    for(int i = 0; i < mergered_intervals.size(); i++){
        sync_points.push_back(mergered_intervals[i].end-offset);
    }

    if(sync_points.back() < subsequence.size() - 1){
        sync_points.push_back(subsequence.size()-1);
    }

    int score_unit;
    int match_mode;
    int score_scheme;

    for(int i = 0; i < score_unit_list.size(); i++){
        score_unit = score_unit_list[i];
        for(int j = 0; j < match_mode_list.size(); j++){
            match_mode = match_mode_list[j];
            for(int k = 0; k < score_scheme_list.size(); k++){
                score_scheme = score_scheme_list[k];

                bool method2 = MatchingSingleClusterBaseExtending(
                                            cluster_id,
                                            thread_index,
                                            variant_list,
                                            subsequence,
                                            offset,
                                            choices_by_pos,
                                            sync_points,
                                            chr_id,
                                            score_unit,
                                            match_mode,
                                            score_scheme,
                                            threshold_index);
            }
        }
    }

    for(int i = 0; i < 2; i++){
        delete choices_by_pos[i];
    }
    //delete choices_by_pos;

    return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1f8, %rsp            # imm = 0x1F8
movl %r9d, 0x64(%rsp)
movq %r8, %r12
movq %rdx, 0xc8(%rsp)
movl %esi, 0x34(%rsp)
movq %rdi, %rbx
leaq 0xc(%rsp), %r14
movl %ecx, (%r14)
movq (%r8), %rdi
movq 0x8(%r8), %rsi
callq 0x1e3ed
xorps %xmm0, %xmm0
movaps %xmm0, 0xb0(%rsp)
movaps %xmm0, 0xa0(%rsp)
movaps %xmm0, 0x90(%rsp)
movaps %xmm0, 0x170(%rsp)
andq $0x0, 0x180(%rsp)
movq %rbx, 0x38(%rsp)
leaq 0x118(%rbx), %rdi
movq %rdi, 0xc0(%rsp)
movq %r14, %rsi
callq 0x19a5a
movl 0x8(%rax), %ebp
incl %ebp
xorl %r13d, %r13d
pushq $-0x1
popq %rax
movl %eax, 0x10(%rsp)
pushq $0x58
popq %rbx
xorl %r14d, %r14d
movl $0x0, 0x1c(%rsp)
movl $0x0, 0x20(%rsp)
movq %r12, 0x28(%rsp)
movq (%r12), %rcx
movq 0x8(%r12), %rax
subq %rcx, %rax
cqto
idivq %rbx
cmpq %r14, %rax
jbe 0xfb38
leaq (%rcx,%r13), %rsi
cmpb $0x0, 0x4c(%rcx,%r13)
movl (%rcx,%r13), %r15d
leaq 0x90(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmovneq %rax, %rdi
callq 0x19bea
movq (%r12), %rax
leaq (%rax,%r13), %rsi
addq $0x8, %rsi
movl 0x20(%rsp), %eax
addl 0x40(%rsi), %eax
movl %eax, 0x20(%rsp)
movl 0x1c(%rsp), %eax
addl 0x3c(%rsi), %eax
movl %eax, 0x1c(%rsp)
leaq 0xf8(%rsp), %rdi
callq 0x53f0
movq (%r12), %rax
leaq (%rax,%r13), %rsi
addq $0x28, %rsi
leaq 0x68(%rsp), %rdi
callq 0x19af0
movl 0x100(%rsp), %r12d
leal (%r15,%r12), %eax
decl %eax
movl %r15d, 0x40(%rsp)
movl %eax, 0x44(%rsp)
leaq 0x170(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x1eaf4
addl %r15d, %r12d
movl 0x10(%rsp), %eax
cmpl %eax, %r12d
cmovlel %eax, %r12d
cmpl %r15d, %ebp
cmovll %ebp, %r15d
leaq 0x68(%rsp), %rdi
callq 0xadcc
leaq 0xf8(%rsp), %rdi
callq 0x55e8
incq %r14
addq $0x58, %r13
movl %r12d, 0x10(%rsp)
movl %r15d, %ebp
movq 0x28(%rsp), %r12
jmp 0xfa44
cmpl $0x2, %ebp
pushq $0x1
popq %rax
cmovgel %ebp, %eax
movl %eax, 0x60(%rsp)
leaq 0xc(%rsp), %rsi
movq 0xc0(%rsp), %rbp
movq %rbp, %rdi
callq 0x19a5a
movl 0x10(%rsp), %ecx
incl %ecx
movl 0x8(%rax), %eax
cmpl %eax, %ecx
cmovgel %eax, %ecx
movq 0x90(%rsp), %rdi
movq 0x98(%rsp), %rax
subq %rdi, %rax
movq 0x38(%rsp), %r13
je 0xfef9
movq 0xa8(%rsp), %rsi
movq 0xb0(%rsp), %r9
subq %rsi, %r9
je 0xfef9
movl %ecx, 0x10(%rsp)
cmpq $0x58, %rax
jne 0xfe0e
cmpq $0x58, %r9
jne 0xfe18
callq 0x1a05e
testb %al, %al
je 0xff00
movq 0x90(%rsp), %rsi
leaq 0xf8(%rsp), %rdi
callq 0x1a174
leaq 0xb8(%r13), %rdi
leaq 0xc(%rsp), %rsi
callq 0x19a5a
leaq 0x129b8(%rip), %rdx     # 0x225a9
leaq 0x1d8(%rsp), %rdi
movq %rax, %rsi
callq 0x96b0
movl 0xf8(%rsp), %esi
incl %esi
leaq 0x1b8(%rsp), %rdi
callq 0x8011
leaq 0x198(%rsp), %rdi
leaq 0x1d8(%rsp), %rsi
leaq 0x1b8(%rsp), %rdx
callq 0x94bb
leaq 0x1296e(%rip), %rdx     # 0x225a9
leaq 0x150(%rsp), %rdi
leaq 0x198(%rsp), %rsi
callq 0x7fce
leaq 0x100(%rsp), %rdx
leaq 0xd0(%rsp), %rdi
leaq 0x150(%rsp), %rsi
callq 0x9691
leaq 0x12935(%rip), %rdx     # 0x225a9
leaq 0x40(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
callq 0x7fce
movq 0x120(%rsp), %rdx
leaq 0x68(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x9691
leaq 0x40(%rsp), %rdi
callq 0x55e8
leaq 0xd0(%rsp), %rdi
callq 0x55e8
leaq 0x150(%rsp), %rdi
callq 0x55e8
leaq 0x198(%rsp), %rdi
callq 0x55e8
leaq 0x1b8(%rsp), %rdi
callq 0x55e8
leaq 0x1d8(%rsp), %rdi
callq 0x55e8
cmpb $0x1, 0x139(%rsp)
jne 0xfd28
movq 0x120(%rsp), %rdx
addq $0x20, %rdx
leaq 0x128a6(%rip), %rsi     # 0x225ab
leaq 0x40(%rsp), %rdi
callq 0x9dae
leaq 0x68(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x55c0
leaq 0x40(%rsp), %rdi
callq 0x55e8
leaq 0x1287e(%rip), %rsi     # 0x225ad
leaq 0x68(%rsp), %rdi
callq 0x55a0
leaq 0xf8(%rsp), %rsi
movq %r13, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x104ac
movl %eax, %r14d
movslq 0x34(%rsp), %r13
movslq 0xc8(%rsp), %rbp
xorl %r15d, %r15d
movq 0x38(%rsp), %rbx
movq 0x238(%rbx), %rax
movq 0x240(%rbx), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %r15, %rcx
jbe 0x1032d
movslq (%rax,%r15,4), %r12
movq 0x178(%rbx), %rax
movq (%rax,%r13,8), %rax
movq (%rax,%r12,8), %rdi
leaq 0x68(%rsp), %rsi
callq 0xc896
movq 0x180(%rbx), %rax
movq (%rax,%r13,8), %rax
movq (%rax,%rbp,8), %rdi
movq %r12, %rsi
callq 0x1a1ca
incl (%rax)
movq 0x188(%rbx), %rax
movq (%rax,%r13,8), %rax
movq (%rax,%rbp,8), %rdi
movq %r12, %rsi
callq 0x1a1ca
incl (%rax)
movq 0x190(%rbx), %rax
movq (%rax,%r13,8), %rax
movq (%rax,%rbp,8), %rdi
movq %r12, %rsi
callq 0x1a1ca
addl %r14d, (%rax)
movq 0x198(%rbx), %rax
movq (%rax,%r13,8), %rax
movq (%rax,%rbp,8), %rdi
movq %r12, %rsi
callq 0x1a1ca
addl %r14d, (%rax)
incq %r15
jmp 0xfd65
cmpq $0x58, %r9
jne 0xff00
xorl %eax, %eax
cmpq $0x58, %r9
setne %al
imulq $0x18, %rax, %rdi
movq 0x90(%rsp,%rdi), %rsi
movq 0x98(%rsp,%rdi), %rcx
movq %rcx, %rax
subq %rsi, %rax
cqto
pushq $0x58
popq %r8
idivq %r8
cmpq $0x5, %rax
jb 0xff00
movq %r9, 0x190(%rsp)
leaq (%rsp,%rdi), %r12
addq $0x90, %r12
xorl %r14d, %r14d
xorl %r13d, %r13d
xorl %ebp, %ebp
xorl %ebx, %ebx
subq %rsi, %rcx
movq %rcx, %rax
cqto
pushq $0x58
popq %rcx
idivq %rcx
cmpq %r13, %rax
jbe 0xfeb9
addq %r14, %rsi
leaq 0xf8(%rsp), %r15
movq %r15, %rdi
callq 0x1a174
addl 0x13c(%rsp), %ebx
addl 0x140(%rsp), %ebp
movq %r15, %rdi
callq 0x19c16
incq %r13
movq (%r12), %rsi
movq 0x8(%r12), %rcx
addq $0x58, %r14
jmp 0xfe6b
xorl %eax, %eax
cmpq $0x58, 0x190(%rsp)
sete %al
imulq $0x18, %rax, %rax
movq 0x90(%rsp,%rax), %rax
movl 0x44(%rax), %ecx
movl 0x48(%rax), %eax
cmpl %eax, %ecx
cmovgl %ecx, %eax
cmpl %ebp, %ebx
cmovgl %ebx, %ebp
cmpl %ebp, %eax
movq 0x28(%rsp), %r12
movq 0x38(%rsp), %r13
movq 0xc0(%rsp), %rbp
jle 0xff00
xorl %ebx, %ebx
jmp 0x102ee
leaq 0xa8(%rsp), %rbx
leaq 0x90(%rsp), %rdi
callq 0x19a30
movq %rbx, %rdi
callq 0x19a30
andq $0x0, 0x68(%rsp)
andl $0x0, 0x70(%rsp)
andq $0x0, 0x78(%rsp)
andl $0x0, 0x80(%rsp)
andq $0x0, 0x88(%rsp)
movq (%r12), %rsi
movq 0x8(%r12), %rcx
movq %rcx, %rax
subq %rsi, %rax
cqto
pushq $0x58
popq %rdi
idivq %rdi
cmpq $0x5, %rax
jbe 0xffe0
movl 0x1c(%rsp), %eax
addl %eax, 0x20(%rsp)
xorl %r15d, %r15d
leaq 0xf8(%rsp), %r14
xorl %r12d, %r12d
subq %rsi, %rcx
movq %rcx, %rax
cqto
pushq $0x58
popq %rcx
idivq %rcx
cmpq %r12, %rax
jbe 0x1001b
addq %r15, %rsi
movq %r14, %rdi
callq 0x1a174
movl 0x13c(%rsp), %eax
movl 0x140(%rsp), %ecx
cmpl %eax, %ecx
cmovgl %ecx, %eax
movl 0x20(%rsp), %ecx
subl %eax, %ecx
xorl %esi, %esi
cmpl %ecx, %eax
setle %sil
leaq 0x68(%rsp), %rdi
callq 0x1a1ec
movq %r14, %rdi
callq 0x19c16
incq %r12
movq 0x28(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rcx
addq $0x58, %r15
jmp 0xff76
xorl %r15d, %r15d
leaq 0x68(%rsp), %rbx
pushq $0x1
popq %r14
subq %rsi, %rcx
movq %rcx, %rax
cqto
pushq $0x58
popq %rcx
idivq %rcx
cmpq %r15, %rax
jbe 0x1001b
movq %rbx, %rdi
movl %r14d, %esi
callq 0x1a1ec
incq %r15
movq 0x28(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rcx
jmp 0xffec
leaq 0xc(%rsp), %rsi
movq %rbp, %rdi
callq 0x19a5a
movl 0x60(%rsp), %ecx
decl %ecx
movl %ecx, %edx
movl %ecx, %ebx
movl 0x10(%rsp), %esi
subl %ecx, %esi
movslq %esi, %rcx
leaq 0xf8(%rsp), %rdi
movq %rax, %rsi
callq 0x5320
leaq 0xf8(%rsp), %rsi
movq %r13, %rdi
callq 0x19ac2
xorl %r15d, %r15d
pushq $0x30
popq %r14
movq 0x28(%rsp), %r12
cmpq $0x2, %r15
je 0x100a0
movq %r14, %rdi
callq 0x5300
movq %rax, %rcx
addq $0x8, %rcx
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rax)
movaps %xmm0, (%rax)
movq %rcx, 0x18(%rax)
movq %rcx, 0x20(%rax)
andq $0x0, 0x28(%rax)
movq %rax, 0x150(%rsp,%r15,8)
incq %r15
jmp 0x10067
xorl %r15d, %r15d
leaq 0x68(%rsp), %r14
xorl %ebp, %ebp
movq 0x8(%r12), %rax
subq (%r12), %rax
cqto
pushq $0x58
popq %rcx
idivq %rcx
cmpq %rbp, %rax
jbe 0x10103
movq %r14, %rdi
movq %rbp, %rsi
callq 0x1a22a
testq %rdx, (%rax)
je 0x100fa
movq (%r12), %rax
movl (%rax,%r15), %ecx
subl %ebx, %ecx
movzbl 0x4c(%rax,%r15), %eax
movq 0x150(%rsp,%rax,8), %rdi
movl %ecx, 0x40(%rsp)
movl %ebp, 0x44(%rsp)
leaq 0x40(%rsp), %rsi
callq 0x1f0e8
incq %rbp
addq $0x58, %r15
jmp 0x100aa
leaq 0x40(%rsp), %rdi
leaq 0x170(%rsp), %rdx
movq %r13, %rsi
callq 0x1a248
leaq 0xd0(%rsp), %rax
andq $0x0, 0x10(%rax)
xorps %xmm0, %xmm0
movaps %xmm0, (%rax)
xorl %r14d, %r14d
leaq 0x198(%rsp), %rbp
movq 0x40(%rsp), %rax
movq 0x48(%rsp), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r14, %rcx
jbe 0x1016f
movl 0x4(%rax,%r14,8), %eax
subl %ebx, %eax
movl %eax, 0x198(%rsp)
leaq 0xd0(%rsp), %rdi
movq %rbp, %rsi
callq 0x1c1d4
incq %r14
jmp 0x10136
movq 0xd8(%rsp), %rax
movslq -0x4(%rax), %rcx
movq 0x100(%rsp), %rax
leaq -0x1(%rax), %rdx
cmpq %rcx, %rdx
jbe 0x101a5
decl %eax
leaq 0x198(%rsp), %rsi
movl %eax, (%rsi)
leaq 0xd0(%rsp), %rdi
callq 0x1c1d4
xorl %edx, %edx
leaq 0x150(%rsp), %r15
leaq 0xf8(%rsp), %rbp
movq 0x1f0(%r13), %rax
movq 0x1f8(%r13), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %rdx, %rcx
jbe 0x1028d
movq %rdx, 0x10(%rsp)
movl (%rax,%rdx,4), %r12d
xorl %edx, %edx
movq 0x208(%r13), %rax
movq 0x210(%r13), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %rdx, %rcx
jbe 0x10280
movq %rdx, 0x20(%rsp)
movl (%rax,%rdx,4), %r13d
xorl %r14d, %r14d
movq 0x38(%rsp), %rdi
movq 0x220(%rdi), %rax
movq 0x228(%rdi), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %r14, %rcx
jbe 0x10270
movl (%rax,%r14,4), %eax
movl 0xc(%rsp), %r10d
subq $0x8, %rsp
movl 0x6c(%rsp), %esi
movl 0x3c(%rsp), %edx
movq 0x30(%rsp), %rcx
movq %rbp, %r8
movl %ebx, %r9d
pushq 0xd0(%rsp)
pushq %rax
pushq %r13
pushq %r12
pushq %r10
leaq 0x100(%rsp), %rax
pushq %rax
pushq %r15
callq 0x10564
addq $0x40, %rsp
incq %r14
jmp 0x1020a
movq 0x20(%rsp), %rdx
incq %rdx
movq %rdi, %r13
jmp 0x101e0
movq 0x10(%rsp), %rdx
incq %rdx
jmp 0x101b7
xorl %r15d, %r15d
pushq $0x30
popq %rbx
cmpq $0x2, %r15
je 0x102be
movq 0x150(%rsp,%r15,8), %r14
testq %r14, %r14
je 0x102ae
movq %r14, %rdi
callq 0x1b0cc
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5310
incq %r15
jmp 0x10293
leaq 0xd0(%rsp), %rdi
callq 0xce14
leaq 0x40(%rsp), %rdi
callq 0x1c30e
leaq 0xf8(%rsp), %rdi
callq 0x55e8
leaq 0x68(%rsp), %rdi
callq 0x1a2de
movb $0x1, %bl
leaq 0x170(%rsp), %rdi
callq 0x1c30e
pushq $0x18
popq %r14
leaq (%rsp,%r14), %rdi
addq $0x90, %rdi
callq 0x19a38
addq $-0x18, %r14
cmpq $-0x18, %r14
jne 0x102ff
movl %ebx, %eax
addq $0x1f8, %rsp            # imm = 0x1F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x68(%rsp), %rdi
callq 0x55e8
leaq 0xf8(%rsp), %rdi
callq 0x19c16
jmp 0x102ec
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x55e8
jmp 0x103fe
jmp 0x103fb
jmp 0x103fb
jmp 0x103fb
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x55e8
jmp 0x10379
movq %rax, %rbx
leaq 0xd0(%rsp), %rdi
callq 0x55e8
jmp 0x1038b
movq %rax, %rbx
leaq 0x150(%rsp), %rdi
callq 0x55e8
jmp 0x1039d
movq %rax, %rbx
leaq 0x198(%rsp), %rdi
callq 0x55e8
jmp 0x103af
movq %rax, %rbx
leaq 0x1b8(%rsp), %rdi
callq 0x55e8
leaq 0x1d8(%rsp), %rdi
jmp 0x10403
movq %rax, %rbx
jmp 0x103bc
jmp 0x10443
movq %rax, %rbx
jmp 0x10408
jmp 0x10448
jmp 0x1041b
jmp 0x1041b
jmp 0x103f4
jmp 0x10443
jmp 0x10443
jmp 0x10443
movq %rax, %rbx
leaq 0xf8(%rsp), %rdi
callq 0x19c16
jmp 0x1046f
jmp 0x103f4
movq %rax, %rbx
jmp 0x1046f
jmp 0x1041b
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x55e8
leaq 0xf8(%rsp), %rdi
callq 0x19c16
jmp 0x10479
jmp 0x10448
jmp 0x1041b
movq %rax, %rbx
jmp 0x10462
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0xadcc
jmp 0x10432
movq %rax, %rbx
leaq 0xf8(%rsp), %rdi
callq 0x55e8
jmp 0x10479
jmp 0x10443
movq %rax, %rbx
jmp 0x10479
movq %rax, %rbx
leaq 0xd0(%rsp), %rdi
callq 0xce14
leaq 0x40(%rsp), %rdi
callq 0x1c30e
leaq 0xf8(%rsp), %rdi
callq 0x55e8
leaq 0x68(%rsp), %rdi
callq 0x1a2de
leaq 0x170(%rsp), %rdi
callq 0x1c30e
pushq $0x18
popq %r14
leaq (%rsp,%r14), %rdi
addq $0x90, %rdi
callq 0x19a38
addq $-0x18, %r14
cmpq $-0x18, %r14
jne 0x1048a
movq %rbx, %rdi
callq 0x5540