// File: medvedevgroup[P]varmatch/src/wholegenome.cpp
// Function: WholeGenome::ConstructMatchRecord(SequencePath&, std::vector<DiploidVariant, std::allocator<DiploidVariant>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, int, int, int, int, int)
void WholeGenome::ConstructMatchRecord(SequencePath & best_path,
                                       vector<DiploidVariant> & variant_list,
                                       string & subsequence,
                                       int offset,
                                       int thread_index,
                                       int chr_id,
                                       int mode_index,
                                       int threshold_index){
    int truth_num = 0;
    int predict_num = 0;
    int truth_edit_distance = 0;
    int predict_edit_distance = 0;

    bool need_match_record = false;

    if (threshold_index == 0) need_match_record = true;

    bool multiple_match = false;

    if(best_path.donor_sequences[0] != best_path.donor_sequences[1]) multiple_match = true;

    string parsimonious_ref = subsequence;
    string parsimonious_alt0 = best_path.donor_sequences[0];
    string parsimonious_alt1 = best_path.donor_sequences[1];

    int parsimonious_pos = offset;
//    NormalizeVariantSequence(offset,
//                             parsimonious_ref,
//                             parsimonious_alt0,
//                             parsimonious_alt1,
//                             chr_id);

    string match_record = chrname_by_chrid[chr_id] + "\t" + to_string(parsimonious_pos+1) + "\t" + parsimonious_ref + "\t" + parsimonious_alt0;
    if(multiple_match) match_record += "/" + parsimonious_alt1;

    string vcf_record[2];
    string phasing_record[2];

    for (int i = 0; i < 2; i++) {
        for (int var_index = 0; var_index < variant_list.size(); var_index++) {
            DiploidVariant variant = variant_list[var_index];
            if(variant.flag != i) continue;
            //The exact wording from the C++ standard is (§4.7/4): "If the source type is bool,
            // the value false is converted to zero and the value true is converted to one."
            int phasing = best_path.choice_vector[var_index];
            if(phasing <= NOT_USE) continue;
            int edit_distance = CalculateEditDistance(variant, phasing, 0);
            if(i == 0){
                truth_num ++;
                truth_edit_distance += edit_distance;
            }else{
                predict_num ++;
                predict_edit_distance += edit_distance;
            }

            if(need_match_record){
                string alt_string = variant.alts[0];
                if(variant.multi_alts){
                    alt_string += "/" + variant.alts[1];
                }
                string phasing_string = "";
                if(phasing == 0){
                    phasing_string += "1";
                    if(variant.heterozygous){
                        if(variant.multi_alts && !variant.zero_one_var){
                            phasing_string += "|2";
                        }else{
                            phasing_string += "|0";
                        }
                    }else{
                        phasing_string += "|1";
                    }
                }else if(phasing == 1){
                    if(variant.multi_alts && !variant.zero_one_var){
                        phasing_string += "2|1";
                    }else if(variant.multi_alts && variant.zero_one_var){
                        phasing_string += "2|0";
                    }else{
                        phasing_string += "0|1";
                    }
                }else if(phasing == -1){
                    phasing_string += "0|1";
                }else if(phasing == -2){
                    phasing_string += "0|2";
                }
                string variant_record = to_string(variant.pos+1) + "," + variant.ref + "," + alt_string;
                vcf_record[i] += variant_record;
                phasing_record[i] += phasing_string;
                vcf_record[i] += ";";
                phasing_record[i] += ";";
            }
        }
        if(need_match_record){
            vcf_record[i] = vcf_record[i].substr(0, vcf_record[i].size()-1);
            phasing_record[i] = phasing_record[i].substr(0, phasing_record[i].size()-1);
        }

    }

    if(need_match_record){
        match_record += "\t" + vcf_record[0] + "\t" + vcf_record[1];
        match_record += "\t" + phasing_record[0] + "\t" + phasing_record[1];
        match_record += "\t" + to_string(best_path.score) + "\n";

        //complex_match_records[thread_index]->push_back(match_record);
        

        // this line should be recovered
        match_records_by_mode_by_thread[thread_index][mode_index]->push_back(match_record);
    


    }

    baseline_total_match_num[thread_index][threshold_index]->at(mode_index) += truth_num;
    query_total_match_num[thread_index][threshold_index]->at(mode_index) += predict_num;

    baseline_total_edit_distance[thread_index][threshold_index]->at(mode_index) += truth_edit_distance;
    query_total_edit_distance[thread_index][threshold_index]->at(mode_index) += predict_edit_distance;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x630, %rsp            # imm = 0x630
movl 0x20(%rbp), %eax
movl 0x18(%rbp), %eax
movl 0x10(%rbp), %eax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movl %r9d, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x520(%rbp)
movl $0x0, -0x2c(%rbp)
movl $0x0, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movl $0x0, -0x38(%rbp)
movb $0x0, -0x39(%rbp)
cmpl $0x0, 0x20(%rbp)
jne 0x28681
movb $0x1, -0x39(%rbp)
movb $0x0, -0x3a(%rbp)
movq -0x10(%rbp), %rdi
addq $0xd0, %rdi
movq -0x10(%rbp), %rsi
addq $0xd0, %rsi
addq $0x20, %rsi
callq 0x125b0
testb $0x1, %al
jne 0x286aa
jmp 0x286ae
movb $0x1, -0x3a(%rbp)
movq -0x20(%rbp), %rsi
leaq -0x60(%rbp), %rdi
callq 0x61b0
movq -0x10(%rbp), %rsi
addq $0xd0, %rsi
leaq -0x80(%rbp), %rdi
callq 0x61b0
jmp 0x286d1
movq -0x10(%rbp), %rsi
addq $0xf0, %rsi
leaq -0xb0(%rbp), %rdi
callq 0x61b0
jmp 0x286ea
movq -0x520(%rbp), %rdi
movl -0x24(%rbp), %eax
movl %eax, -0xb4(%rbp)
addq $0xb8, %rdi
leaq 0x10(%rbp), %rsi
callq 0x32770
movq %rax, -0x528(%rbp)
jmp 0x28713
movq -0x528(%rbp), %rsi
leaq 0x2ce7c(%rip), %rdx     # 0x5559d
leaq -0x178(%rbp), %rdi
callq 0xe200
jmp 0x2872f
movl -0xb4(%rbp), %esi
incl %esi
leaq -0x198(%rbp), %rdi
callq 0xb190
jmp 0x28745
leaq -0x158(%rbp), %rdi
leaq -0x178(%rbp), %rsi
leaq -0x198(%rbp), %rdx
callq 0xde60
jmp 0x28761
leaq 0x2ce35(%rip), %rdx     # 0x5559d
leaq -0x138(%rbp), %rdi
leaq -0x158(%rbp), %rsi
callq 0xb0f0
jmp 0x2877d
leaq -0x118(%rbp), %rdi
leaq -0x138(%rbp), %rsi
leaq -0x60(%rbp), %rdx
callq 0xe1b0
jmp 0x28796
leaq 0x2ce00(%rip), %rdx     # 0x5559d
leaq -0xf8(%rbp), %rdi
leaq -0x118(%rbp), %rsi
callq 0xb0f0
jmp 0x287b2
leaq -0xd8(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
leaq -0x80(%rbp), %rdx
callq 0xe1b0
jmp 0x287cb
leaq -0xf8(%rbp), %rdi
callq 0x6828
leaq -0x118(%rbp), %rdi
callq 0x6828
leaq -0x138(%rbp), %rdi
callq 0x6828
leaq -0x158(%rbp), %rdi
callq 0x6828
leaq -0x198(%rbp), %rdi
callq 0x6828
leaq -0x178(%rbp), %rdi
callq 0x6828
testb $0x1, -0x3a(%rbp)
je 0x289a4
leaq 0x2cd7b(%rip), %rsi     # 0x5559f
leaq -0x1b8(%rbp), %rdi
leaq -0xb0(%rbp), %rdx
callq 0x10610
jmp 0x28839
leaq -0xd8(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
callq 0x6560
jmp 0x2884e
leaq -0x1b8(%rbp), %rdi
callq 0x6828
jmp 0x289a4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x29721
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x29718
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x2970c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x28959
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x2894d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x28941
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x28935
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x28929
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0xf8(%rbp), %rdi
callq 0x6828
leaq -0x118(%rbp), %rdi
callq 0x6828
leaq -0x138(%rbp), %rdi
callq 0x6828
leaq -0x158(%rbp), %rdi
callq 0x6828
leaq -0x198(%rbp), %rdi
callq 0x6828
leaq -0x178(%rbp), %rdi
callq 0x6828
jmp 0x2970c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x29700
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x1b8(%rbp), %rdi
callq 0x6828
jmp 0x29700
leaq -0x200(%rbp), %rax
movq %rax, %rcx
addq $0x40, %rcx
movq %rcx, -0x538(%rbp)
movq %rax, -0x530(%rbp)
movq -0x530(%rbp), %rdi
movq %rdi, -0x540(%rbp)
callq 0x65e0
movq -0x540(%rbp), %rax
movq -0x538(%rbp), %rcx
addq $0x20, %rax
cmpq %rcx, %rax
movq %rax, -0x530(%rbp)
jne 0x289c0
leaq -0x240(%rbp), %rax
movq %rax, %rcx
addq $0x40, %rcx
movq %rcx, -0x550(%rbp)
movq %rax, -0x548(%rbp)
movq -0x548(%rbp), %rdi
movq %rdi, -0x558(%rbp)
callq 0x65e0
movq -0x558(%rbp), %rax
movq -0x550(%rbp), %rcx
addq $0x20, %rax
cmpq %rcx, %rax
movq %rax, -0x548(%rbp)
jne 0x28a0d
movl $0x0, -0x244(%rbp)
cmpl $0x2, -0x244(%rbp)
jge 0x2916e
movl $0x0, -0x248(%rbp)
movslq -0x248(%rbp), %rax
movq %rax, -0x560(%rbp)
movq -0x18(%rbp), %rdi
callq 0x335b0
movq %rax, %rcx
movq -0x560(%rbp), %rax
cmpq %rcx, %rax
jae 0x29073
movq -0x18(%rbp), %rdi
movslq -0x248(%rbp), %rsi
callq 0x33de0
movq %rax, %rsi
leaq -0x2a0(%rbp), %rdi
callq 0x340a0
jmp 0x28aaa
movb -0x254(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl -0x244(%rbp), %eax
je 0x28ae3
movl $0x7, -0x2a4(%rbp)
jmp 0x29032
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x2966a
movq -0x10(%rbp), %rdi
addq $0x168, %rdi            # imm = 0x168
movslq -0x248(%rbp), %rsi
callq 0x19a60
movl (%rax), %eax
movl %eax, -0x2a8(%rbp)
cmpl $-0x9, -0x2a8(%rbp)
jg 0x28b1a
movl $0x7, -0x2a4(%rbp)
jmp 0x29032
movq -0x520(%rbp), %rdi
movl -0x2a8(%rbp), %edx
leaq -0x2a0(%rbp), %rsi
xorl %ecx, %ecx
callq 0x20ac0
movl %eax, -0x564(%rbp)
jmp 0x28b3d
movl -0x564(%rbp), %eax
movl %eax, -0x2ac(%rbp)
cmpl $0x0, -0x244(%rbp)
jne 0x28b80
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
movl -0x2ac(%rbp), %eax
addl -0x34(%rbp), %eax
movl %eax, -0x34(%rbp)
jmp 0x28b95
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x29062
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
movl -0x2ac(%rbp), %eax
addl -0x38(%rbp), %eax
movl %eax, -0x38(%rbp)
testb $0x1, -0x39(%rbp)
je 0x29028
leaq -0x278(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x9080
movq %rax, %rsi
leaq -0x2d0(%rbp), %rdi
callq 0x61b0
jmp 0x28bc0
testb $0x1, -0x25f(%rbp)
je 0x28c53
leaq -0x278(%rbp), %rdi
movl $0x1, %esi
callq 0x9080
movq %rax, %rdx
leaq 0x2c9b7(%rip), %rsi     # 0x5559f
leaq -0x2f0(%rbp), %rdi
callq 0x10610
jmp 0x28bf6
leaq -0x2d0(%rbp), %rdi
leaq -0x2f0(%rbp), %rsi
callq 0x6560
jmp 0x28c0b
leaq -0x2f0(%rbp), %rdi
callq 0x6828
jmp 0x28c53
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x2901a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x2f0(%rbp), %rdi
callq 0x6828
jmp 0x2901a
leaq -0x311(%rbp), %rdi
movq %rdi, -0x570(%rbp)
callq 0x6760
movq -0x570(%rbp), %rdx
leaq 0x2c92a(%rip), %rsi     # 0x5559e
leaq -0x310(%rbp), %rdi
callq 0x9680
jmp 0x28c82
leaq -0x311(%rbp), %rdi
callq 0x64b0
cmpl $0x0, -0x2a8(%rbp)
jne 0x28d51
leaq 0x2c95d(%rip), %rsi     # 0x555ff
leaq -0x310(%rbp), %rdi
callq 0x6410
jmp 0x28cb0
testb $0x1, -0x260(%rbp)
je 0x28d35
testb $0x1, -0x25f(%rbp)
je 0x28d1c
testb $0x1, -0x25e(%rbp)
jne 0x28d1c
leaq 0x2cb62(%rip), %rsi     # 0x55834
leaq -0x310(%rbp), %rdi
callq 0x6410
jmp 0x28ce0
jmp 0x28d33
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x311(%rbp), %rdi
callq 0x64b0
jmp 0x2901a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x2900e
leaq 0x2cb09(%rip), %rsi     # 0x5582c
leaq -0x310(%rbp), %rdi
callq 0x6410
jmp 0x28d31
jmp 0x28d33
jmp 0x28d4c
leaq 0x2caf4(%rip), %rsi     # 0x55830
leaq -0x310(%rbp), %rdi
callq 0x6410
jmp 0x28d4a
jmp 0x28d4c
jmp 0x28e0d
cmpl $0x1, -0x2a8(%rbp)
jne 0x28dc7
testb $0x1, -0x25f(%rbp)
je 0x28d83
testb $0x1, -0x25e(%rbp)
jne 0x28d83
leaq 0x2cab4(%rip), %rsi     # 0x55827
leaq -0x310(%rbp), %rdi
callq 0x6410
jmp 0x28d81
jmp 0x28dc5
testb $0x1, -0x25f(%rbp)
je 0x28dac
testb $0x1, -0x25e(%rbp)
je 0x28dac
leaq 0x2ca8f(%rip), %rsi     # 0x5582b
leaq -0x310(%rbp), %rdi
callq 0x6410
jmp 0x28daa
jmp 0x28dc3
leaq 0x2ca7c(%rip), %rsi     # 0x5582f
leaq -0x310(%rbp), %rdi
callq 0x6410
jmp 0x28dc1
jmp 0x28dc3
jmp 0x28dc5
jmp 0x28e0b
cmpl $-0x1, -0x2a8(%rbp)
jne 0x28de7
leaq 0x2ca58(%rip), %rsi     # 0x5582f
leaq -0x310(%rbp), %rdi
callq 0x6410
jmp 0x28de5
jmp 0x28e09
cmpl $-0x2, -0x2a8(%rbp)
jne 0x28e07
leaq 0x2ca3c(%rip), %rsi     # 0x55833
leaq -0x310(%rbp), %rdi
callq 0x6410
jmp 0x28e05
jmp 0x28e07
jmp 0x28e09
jmp 0x28e0b
jmp 0x28e0d
movl -0x2a0(%rbp), %esi
incl %esi
leaq -0x3b8(%rbp), %rdi
callq 0xb190
jmp 0x28e23
leaq 0x2c713(%rip), %rdx     # 0x5553d
leaq -0x398(%rbp), %rdi
leaq -0x3b8(%rbp), %rsi
callq 0xb0f0
jmp 0x28e3f
leaq -0x298(%rbp), %rdx
leaq -0x378(%rbp), %rdi
leaq -0x398(%rbp), %rsi
callq 0xe1b0
jmp 0x28e5b
leaq 0x2c6db(%rip), %rdx     # 0x5553d
leaq -0x358(%rbp), %rdi
leaq -0x378(%rbp), %rsi
callq 0xb0f0
jmp 0x28e77
leaq -0x338(%rbp), %rdi
leaq -0x358(%rbp), %rsi
leaq -0x2d0(%rbp), %rdx
callq 0xe1b0
jmp 0x28e93
leaq -0x358(%rbp), %rdi
callq 0x6828
leaq -0x378(%rbp), %rdi
callq 0x6828
leaq -0x398(%rbp), %rdi
callq 0x6828
leaq -0x3b8(%rbp), %rdi
callq 0x6828
movslq -0x244(%rbp), %rax
shlq $0x5, %rax
leaq -0x200(%rbp,%rax), %rdi
leaq -0x338(%rbp), %rsi
callq 0x6560
jmp 0x28ee4
movslq -0x244(%rbp), %rax
shlq $0x5, %rax
leaq -0x240(%rbp,%rax), %rdi
leaq -0x310(%rbp), %rsi
callq 0x6560
jmp 0x28f05
movslq -0x244(%rbp), %rax
shlq $0x5, %rax
leaq -0x200(%rbp,%rax), %rdi
leaq 0x2c918(%rip), %rsi     # 0x55837
callq 0x6410
jmp 0x28f26
movslq -0x244(%rbp), %rax
shlq $0x5, %rax
leaq -0x240(%rbp,%rax), %rdi
leaq 0x2c8f7(%rip), %rsi     # 0x55837
callq 0x6410
jmp 0x28f47
leaq -0x338(%rbp), %rdi
callq 0x6828
leaq -0x310(%rbp), %rdi
callq 0x6828
leaq -0x2d0(%rbp), %rdi
callq 0x6828
jmp 0x29028
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x28fe2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x28fd6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x28fca
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x358(%rbp), %rdi
callq 0x6828
leaq -0x378(%rbp), %rdi
callq 0x6828
leaq -0x398(%rbp), %rdi
callq 0x6828
leaq -0x3b8(%rbp), %rdi
callq 0x6828
jmp 0x2900e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x338(%rbp), %rdi
callq 0x6828
leaq -0x310(%rbp), %rdi
callq 0x6828
leaq -0x2d0(%rbp), %rdi
callq 0x6828
jmp 0x29062
movl $0x0, -0x2a4(%rbp)
leaq -0x2a0(%rbp), %rdi
callq 0x32c60
movl -0x2a4(%rbp), %eax
testl %eax, %eax
je 0x2904c
jmp 0x2904a
jmp 0x2904e
jmp 0x2904e
movl -0x248(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x248(%rbp)
jmp 0x28a5f
leaq -0x2a0(%rbp), %rdi
callq 0x32c60
jmp 0x2966a
testb $0x1, -0x39(%rbp)
je 0x29158
movslq -0x244(%rbp), %rax
shlq $0x5, %rax
leaq -0x200(%rbp,%rax), %rdi
movq %rdi, -0x578(%rbp)
callq 0x6320
movq -0x578(%rbp), %rsi
movq %rax, %rcx
decq %rcx
xorl %eax, %eax
movl %eax, %edx
leaq -0x3d8(%rbp), %rdi
callq 0x6460
jmp 0x290bb
movslq -0x244(%rbp), %rax
shlq $0x5, %rax
leaq -0x200(%rbp,%rax), %rdi
leaq -0x3d8(%rbp), %rsi
movq %rsi, -0x588(%rbp)
callq 0x6530
movq -0x588(%rbp), %rdi
callq 0x6828
movslq -0x244(%rbp), %rax
shlq $0x5, %rax
leaq -0x240(%rbp,%rax), %rdi
movq %rdi, -0x580(%rbp)
callq 0x6320
movq -0x580(%rbp), %rsi
movq %rax, %rcx
decq %rcx
xorl %eax, %eax
movl %eax, %edx
leaq -0x3f8(%rbp), %rdi
callq 0x6460
jmp 0x2912b
movslq -0x244(%rbp), %rax
leaq -0x240(%rbp), %rdi
shlq $0x5, %rax
addq %rax, %rdi
leaq -0x3f8(%rbp), %rsi
callq 0x6530
leaq -0x3f8(%rbp), %rdi
callq 0x6828
jmp 0x2915a
movl -0x244(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x244(%rbp)
jmp 0x28a48
testb $0x1, -0x39(%rbp)
je 0x29475
leaq 0x2c41e(%rip), %rsi     # 0x5559d
leaq -0x458(%rbp), %rdi
leaq -0x200(%rbp), %rdx
callq 0x10610
jmp 0x29194
leaq 0x2c402(%rip), %rdx     # 0x5559d
leaq -0x438(%rbp), %rdi
leaq -0x458(%rbp), %rsi
callq 0xb0f0
jmp 0x291b0
leaq -0x1e0(%rbp), %rdx
leaq -0x418(%rbp), %rdi
leaq -0x438(%rbp), %rsi
callq 0xe1b0
jmp 0x291cc
leaq -0xd8(%rbp), %rdi
leaq -0x418(%rbp), %rsi
callq 0x6560
jmp 0x291e1
leaq -0x418(%rbp), %rdi
callq 0x6828
leaq -0x438(%rbp), %rdi
callq 0x6828
leaq -0x458(%rbp), %rdi
callq 0x6828
leaq 0x2c391(%rip), %rsi     # 0x5559d
leaq -0x4b8(%rbp), %rdi
leaq -0x240(%rbp), %rdx
callq 0x10610
jmp 0x29221
leaq 0x2c375(%rip), %rdx     # 0x5559d
leaq -0x498(%rbp), %rdi
leaq -0x4b8(%rbp), %rsi
callq 0xb0f0
jmp 0x2923d
leaq -0x220(%rbp), %rdx
leaq -0x478(%rbp), %rdi
leaq -0x498(%rbp), %rsi
callq 0xe1b0
jmp 0x29259
leaq -0xd8(%rbp), %rdi
leaq -0x478(%rbp), %rsi
callq 0x6560
jmp 0x2926e
leaq -0x478(%rbp), %rdi
callq 0x6828
leaq -0x498(%rbp), %rdi
callq 0x6828
leaq -0x4b8(%rbp), %rdi
callq 0x6828
movq -0x10(%rbp), %rax
movl 0x158(%rax), %esi
leaq -0x518(%rbp), %rdi
callq 0xb190
jmp 0x292aa
leaq 0x2c2ec(%rip), %rsi     # 0x5559d
leaq -0x4f8(%rbp), %rdi
leaq -0x518(%rbp), %rdx
callq 0xb140
jmp 0x292c6
leaq 0x2adbf(%rip), %rdx     # 0x5408c
leaq -0x4d8(%rbp), %rdi
leaq -0x4f8(%rbp), %rsi
callq 0xb0f0
jmp 0x292e2
leaq -0xd8(%rbp), %rdi
leaq -0x4d8(%rbp), %rsi
callq 0x6560
jmp 0x292f7
leaq -0x4d8(%rbp), %rdi
callq 0x6828
leaq -0x4f8(%rbp), %rdi
callq 0x6828
leaq -0x518(%rbp), %rdi
callq 0x6828
movq -0x520(%rbp), %rax
movq 0x178(%rax), %rax
movslq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq 0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x17750
jmp 0x29347
jmp 0x29475
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x2939e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x29392
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x418(%rbp), %rdi
callq 0x6828
leaq -0x438(%rbp), %rdi
callq 0x6828
leaq -0x458(%rbp), %rdi
callq 0x6828
jmp 0x2966a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x29401
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x293f5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x478(%rbp), %rdi
callq 0x6828
leaq -0x498(%rbp), %rdi
callq 0x6828
leaq -0x4b8(%rbp), %rdi
callq 0x6828
jmp 0x2966a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x29464
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
jmp 0x29458
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x88(%rbp)
movl %eax, -0x8c(%rbp)
leaq -0x4d8(%rbp), %rdi
callq 0x6828
leaq -0x4f8(%rbp), %rdi
callq 0x6828
leaq -0x518(%rbp), %rdi
callq 0x6828
jmp 0x2966a
movq -0x520(%rbp), %rax
movl -0x2c(%rbp), %ecx
movl %ecx, -0x594(%rbp)
movq 0x180(%rax), %rax
movslq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq 0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movslq 0x18(%rbp), %rsi
callq 0x34130
movq %rax, -0x590(%rbp)
jmp 0x294ae
movq -0x520(%rbp), %rax
movq -0x590(%rbp), %rcx
movl -0x594(%rbp), %esi
movl (%rcx), %edx
addl %esi, %edx
movl %edx, (%rcx)
movl -0x30(%rbp), %ecx
movl %ecx, -0x5a4(%rbp)
movq 0x188(%rax), %rax
movslq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq 0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movslq 0x18(%rbp), %rsi
callq 0x34130
movq %rax, -0x5a0(%rbp)
jmp 0x294fa
movq -0x520(%rbp), %rax
movq -0x5a0(%rbp), %rcx
movl -0x5a4(%rbp), %esi
movl (%rcx), %edx
addl %esi, %edx
movl %edx, (%rcx)
movl -0x34(%rbp), %ecx
movl %ecx, -0x5b4(%rbp)
movq 0x190(%rax), %rax
movslq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq 0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movslq 0x18(%rbp), %rsi
callq 0x34130
movq %rax, -0x5b0(%rbp)
jmp 0x29546
movq -0x520(%rbp), %rax
movq -0x5b0(%rbp), %rcx
movl -0x5b4(%rbp), %esi
movl (%rcx), %edx
addl %esi, %edx
movl %edx, (%rcx)
movl -0x38(%rbp), %ecx
movl %ecx, -0x5c4(%rbp)
movq 0x198(%rax), %rax
movslq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq 0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movslq 0x18(%rbp), %rsi
callq 0x34130
movq %rax, -0x5c0(%rbp)
jmp 0x29592
movq -0x5c0(%rbp), %rax
movl -0x5c4(%rbp), %ecx
addl (%rax), %ecx
movl %ecx, (%rax)
leaq -0x240(%rbp), %rax
movq %rax, -0x5d8(%rbp)
addq $0x40, %rax
movq %rax, -0x5d0(%rbp)
movq -0x5d0(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x5e0(%rbp)
callq 0x6828
movq -0x5d8(%rbp), %rcx
movq -0x5e0(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x5d0(%rbp)
jne 0x295bc
leaq -0x200(%rbp), %rax
movq %rax, -0x5f0(%rbp)
addq $0x40, %rax
movq %rax, -0x5e8(%rbp)
movq -0x5e8(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x5f8(%rbp)
callq 0x6828
movq -0x5f0(%rbp), %rcx
movq -0x5f8(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x5e8(%rbp)
jne 0x29606
leaq -0xd8(%rbp), %rdi
callq 0x6828
leaq -0xb0(%rbp), %rdi
callq 0x6828
leaq -0x80(%rbp), %rdi
callq 0x6828
leaq -0x60(%rbp), %rdi
callq 0x6828
addq $0x630, %rsp            # imm = 0x630
popq %rbp
retq
leaq -0x240(%rbp), %rax
movq %rax, -0x608(%rbp)
addq $0x40, %rax
movq %rax, -0x600(%rbp)
movq -0x600(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x610(%rbp)
callq 0x6828
movq -0x608(%rbp), %rcx
movq -0x610(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x600(%rbp)
jne 0x29683
leaq -0x200(%rbp), %rax
movq %rax, -0x620(%rbp)
addq $0x40, %rax
movq %rax, -0x618(%rbp)
movq -0x618(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x628(%rbp)
callq 0x6828
movq -0x620(%rbp), %rcx
movq -0x628(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x618(%rbp)
jne 0x296cd
jmp 0x29700
leaq -0xd8(%rbp), %rdi
callq 0x6828
leaq -0xb0(%rbp), %rdi
callq 0x6828
leaq -0x80(%rbp), %rdi
callq 0x6828
leaq -0x60(%rbp), %rdi
callq 0x6828
movq -0x88(%rbp), %rdi
callq 0x6750
nopw %cs:(%rax,%rax)