// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x288, %rsp            # imm = 0x288
movl %r9d, 0xd4(%rsp)
movl %r8d, %ebx
movq %rcx, %r14
movq %rdx, 0x158(%rsp)
movq %rsi, %rbp
movq %rdi, %r13
movq 0xd8(%rsi), %rdx
movb $0x1, %r12b
cmpq 0xf8(%rsi), %rdx
jne 0x1cbc9
testq %rdx, %rdx
je 0x1cbc6
movq 0xd0(%rbp), %rdi
movq 0xf0(%rbp), %rsi
callq 0x5350
testl %eax, %eax
setne %r12b
jmp 0x1cbc9
xorl %r12d, %r12d
leaq 0x128(%rsp), %rax
movq %rax, -0x10(%rax)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq 0x118(%rsp), %rdi
callq 0x112ce
leaq 0x1d0(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0xd0(%rbp), %rsi
movq 0xd8(%rbp), %rdx
addq %rsi, %rdx
leaq 0x1c0(%rsp), %rdi
callq 0x112ce
leaq 0x1f0(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0xf0(%rbp), %rsi
movq 0xf8(%rbp), %rdx
addq %rsi, %rdx
leaq 0x1e0(%rsp), %rdi
callq 0x112ce
leaq 0xb8(%r13), %rdi
leaq 0x2c0(%rsp), %rsi
callq 0x28988
leaq 0x30(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x20(%rsp), %rdi
callq 0x112ce
movq %rbp, 0x150(%rsp)
movq %r13, 0xc8(%rsp)
leaq 0x14939(%rip), %rsi     # 0x315c1
leaq 0x20(%rsp), %rdi
callq 0x5630
incl %ebx
movl %ebx, %ebp
negl %ebp
cmovsl %ebx, %ebp
movl $0x1, %r14d
cmpl $0xa, %ebp
jb 0x1ccef
movl $0x4, %r14d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x1cce6
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x1ccec
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x1ccef
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r14d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x1ccb3
addl $-0x3, %r14d
jmp 0x1ccef
addl $-0x2, %r14d
jmp 0x1ccef
decl %r14d
shrl $0x1f, %ebx
leal (%r14,%rbx), %esi
leaq 0xa8(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x98(%rsp), %rdi
movl $0x2d, %edx
callq 0x53b0
movl %ebx, %edi
addq 0x98(%rsp), %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0xe3b6
movq 0x20(%rsp), %rcx
movq 0x28(%rsp), %r8
movq 0xa0(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
cmpq %r15, %rcx
je 0x1cd4d
movq 0x30(%rsp), %rsi
cmpq %rsi, %rax
leaq 0xa8(%rsp), %rdi
jbe 0x1cd76
movl $0xf, %esi
cmpq %rdi, 0x98(%rsp)
je 0x1cd71
movq 0xa8(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x1cd8a
movq 0x98(%rsp), %rsi
leaq 0x20(%rsp), %rdi
callq 0x50f0
jmp 0x1cd9b
leaq 0x98(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x5380
leaq 0x10(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
je 0x1cdbe
movq %rsi, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x1cdc4
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x8(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x147d9(%rip), %rsi     # 0x315c1
movq %rsp, %rdi
callq 0x5630
leaq 0x210(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1ce20
movq %rdx, 0x200(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x210(%rsp)
jmp 0x1ce27
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
leaq 0x200(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x118(%rsp), %rsi
movq 0x120(%rsp), %rdx
callq 0x50f0
leaq 0x250(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1ce8b
movq %rdx, 0x240(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x250(%rsp)
jmp 0x1ce93
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
leaq 0x240(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x14708(%rip), %rsi     # 0x315c1
callq 0x5630
leaq 0x50(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1cee5
movq %rdx, 0x40(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x50(%rsp)
jmp 0x1ceec
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
movq 0x8(%rax), %rdx
leaq 0x40(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x1c0(%rsp), %rsi
movq 0x1c8(%rsp), %rdx
callq 0x50f0
leaq 0xe8(%rsp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1cf4d
movq %rdx, 0xd8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xe8(%rsp)
jmp 0x1cf53
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0xe0(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x40(%rsp), %rdi
cmpq %rbp, %rdi
je 0x1cf85
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x240(%rsp), %rdi
cmpq %r13, %rdi
je 0x1cfa2
movq 0x250(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x200(%rsp), %rdi
cmpq %r14, %rdi
je 0x1cfbf
movq 0x210(%rsp), %rsi
incq %rsi
callq 0x5340
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1cfda
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x1cfff
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x1d016
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5340
testb %r12b, %r12b
je 0x1d062
leaq 0x145a1(%rip), %rsi     # 0x315c3
leaq 0x40(%rsp), %rdi
leaq 0x1e0(%rsp), %rdx
callq 0xce96
movq 0x40(%rsp), %rsi
movq 0x48(%rsp), %rdx
leaq 0xd8(%rsp), %rdi
callq 0x50f0
movq 0x40(%rsp), %rdi
cmpq %rbp, %rdi
je 0x1d062
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x5340
movl $0x10, %eax
leaq (%rsp,%rax), %rcx
addq $0x240, %rcx            # imm = 0x240
movq %rcx, -0x10(%rcx)
movq $0x0, -0x8(%rcx)
movb $0x0, (%rcx)
addq $0x20, %rax
cmpq $0x50, %rax
jne 0x1d067
movl $0x10, %eax
leaq (%rsp,%rax), %rcx
addq $0x200, %rcx            # imm = 0x200
movq %rcx, -0x10(%rcx)
movq $0x0, -0x8(%rcx)
movb $0x0, (%rcx)
addq $0x20, %rax
cmpq $0x50, %rax
jne 0x1d090
leaq 0x48(%rsp), %r12
xorl %ebp, %ebp
movl $0x0, 0xbc(%rsp)
movl $0x0, 0xc0(%rsp)
movl $0x0, 0xb8(%rsp)
movl $0x0, 0xc4(%rsp)
movq 0x158(%rsp), %rax
movq (%rax), %rbx
cmpq %rbx, 0x8(%rax)
je 0x1d734
movq %rbp, %rax
shlq $0x5, %rax
leaq (%rsp,%rax), %rcx
addq $0x240, %rcx            # imm = 0x240
movq %rcx, 0x148(%rsp)
addq %rsp, %rax
addq $0x200, %rax            # imm = 0x200
movq %rax, 0x140(%rsp)
xorl %r13d, %r13d
movq %rbp, 0x138(%rsp)
imulq $0x58, %r13, %r14
movl (%rbx,%r14), %eax
movl %eax, 0x40(%rsp)
leaq 0x58(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x8(%rbx,%r14), %rsi
movq 0x10(%rbx,%r14), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x112ce
addq %r14, %rbx
leaq 0x28(%rbx), %rsi
leaq 0x68(%rsp), %rdi
callq 0x289ec
movq 0x50(%rbx), %rax
movq %rax, 0x48(%r12)
movups 0x40(%rbx), %xmm0
movups %xmm0, 0x38(%r12)
movzbl 0x8c(%rsp), %eax
cmpq %rax, %rbp
jne 0x1d6de
movq 0x150(%rsp), %rax
movq 0x168(%rax), %rax
movl (%rax,%r13,4), %r14d
cmpl $-0x8, %r14d
jl 0x1d6de
movq 0xc8(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movl %r14d, %edx
xorl %ecx, %ecx
callq 0x164bc
testq %rbp, %rbp
je 0x1d1db
incl 0xc0(%rsp)
addl %eax, 0xc4(%rsp)
jmp 0x1d1e9
incl 0xbc(%rsp)
addl %eax, 0xb8(%rsp)
cmpl $0x0, 0x2d0(%rsp)
jne 0x1d6de
movq 0x68(%rsp), %rax
leaq 0x10(%rsp), %rcx
movq %rcx, (%rsp)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
movq %rsp, %rdi
callq 0x112ce
cmpb $0x1, 0x81(%rsp)
jne 0x1d264
movq 0x68(%rsp), %rdx
addq $0x20, %rdx
leaq 0x20(%rsp), %rdi
leaq 0x1438d(%rip), %rsi     # 0x315c3
callq 0xce96
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
movq %rsp, %rdi
callq 0x50f0
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x1d264
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5340
movq %r15, 0x20(%rsp)
leaq 0x20(%rsp), %rdi
leaq 0x1434d(%rip), %rdx     # 0x315c2
movq %rdx, %rsi
callq 0xc45c
addl $0x2, %r14d
cmpl $0x3, %r14d
ja 0x1d33f
leaq 0x1400e(%rip), %rcx     # 0x312a0
movslq (%rcx,%r14,4), %rax
addq %rcx, %rax
leaq 0x145b3(%rip), %rsi     # 0x31853
jmpq *%rax
leaq 0x145ae(%rip), %rsi     # 0x31857
jmp 0x1d335
leaq 0x20(%rsp), %rdi
leaq 0x14369(%rip), %rsi     # 0x31623
callq 0x5630
cmpb $0x1, 0x80(%rsp)
leaq 0x14586(%rip), %rsi     # 0x31854
jne 0x1d335
cmpb $0x1, 0x81(%rsp)
leaq 0x14571(%rip), %rsi     # 0x31850
jne 0x1d335
cmpb $0x0, 0x82(%rsp)
leaq 0x14568(%rip), %rsi     # 0x31858
leaq 0x14559(%rip), %rax     # 0x31850
cmovneq %rax, %rsi
jmp 0x1d335
movb 0x81(%rsp), %al
cmpb $0x1, %al
jne 0x1d32e
cmpb $0x1, 0x82(%rsp)
leaq 0x14534(%rip), %rsi     # 0x3184b
jne 0x1d335
testb %al, %al
je 0x1d32e
cmpb $0x0, 0x82(%rsp)
leaq 0x14523(%rip), %rsi     # 0x3184f
jne 0x1d335
leaq 0x1451e(%rip), %rsi     # 0x31853
leaq 0x20(%rsp), %rdi
callq 0x5630
movl 0x40(%rsp), %r15d
incl %r15d
movl %r15d, %r14d
negl %r14d
cmovsl %r15d, %r14d
movl $0x1, %ebx
cmpl $0xa, %r14d
jb 0x1d39e
movl $0x4, %ebx
movl %r14d, %eax
cmpl $0x63, %eax
jbe 0x1d397
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x1d39c
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x1d39e
movl %eax, %ecx
movl $0xd1b71759, %edx       # imm = 0xD1B71759
imulq %rdx, %rcx
shrq $0x2d, %rcx
addl $0x4, %ebx
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x1d364
addl $-0x3, %ebx
jmp 0x1d39e
addl $-0x2, %ebx
jmp 0x1d39e
decl %ebx
movq %r12, %rbp
shrl $0x1f, %r15d
leal (%rbx,%r15), %esi
leaq 0x1b0(%rsp), %rax
movq %rax, 0x1a0(%rsp)
leaq 0x1a0(%rsp), %r12
movq %r12, %rdi
movl $0x2d, %edx
callq 0x53b0
movl %r15d, %edi
addq 0x1a0(%rsp), %rdi
movl %ebx, %esi
movl %r14d, %edx
callq 0xe3b6
movq %r12, %rdi
leaq 0x14174(%rip), %rsi     # 0x31561
callq 0x5630
leaq 0x170(%rsp), %rsi
movq %rsi, 0x160(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
leaq 0x30(%rsp), %r15
movq %rbp, %r12
je 0x1d42e
movq %rdx, 0x160(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x170(%rsp)
jmp 0x1d434
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x138(%rsp), %rbp
movq 0x8(%rax), %rdx
movq %rdx, 0x168(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
leaq 0x160(%rsp), %rdi
callq 0x50f0
leaq 0x190(%rsp), %rsi
movq %rsi, 0x180(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1d4a2
movq %rdx, 0x180(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x190(%rsp)
jmp 0x1d4a8
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x188(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x180(%rsp), %rdi
leaq 0x1408f(%rip), %rsi     # 0x31561
callq 0x5630
leaq 0x108(%rsp), %rsi
movq %rsi, 0xf8(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1d50b
movq %rdx, 0xf8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x108(%rsp)
jmp 0x1d511
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x100(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
leaq 0xf8(%rsp), %rdi
callq 0x50f0
leaq 0xa8(%rsp), %rsi
movq %rsi, 0x98(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1d576
movq %rdx, 0x98(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xa8(%rsp)
jmp 0x1d57c
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
leaq 0x108(%rsp), %rsi
movq 0x8(%rax), %rdx
movq %rdx, 0xa0(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0xf8(%rsp), %rdi
cmpq %rsi, %rdi
je 0x1d5bc
movq 0x108(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x180(%rsp), %rdi
leaq 0x190(%rsp), %rax
cmpq %rax, %rdi
je 0x1d5e1
movq 0x190(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x160(%rsp), %rdi
leaq 0x170(%rsp), %rax
cmpq %rax, %rdi
je 0x1d606
movq 0x170(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x1a0(%rsp), %rdi
leaq 0x1b0(%rsp), %rax
cmpq %rax, %rdi
je 0x1d62b
movq 0x1b0(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x98(%rsp), %rsi
movq 0xa0(%rsp), %rdx
movq 0x148(%rsp), %rdi
callq 0x50f0
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
movq 0x140(%rsp), %rdi
callq 0x50f0
movq 0x148(%rsp), %rdi
leaq 0x141ed(%rip), %rsi     # 0x3185b
callq 0x5630
movq 0x140(%rsp), %rdi
leaq 0x141d9(%rip), %rsi     # 0x3185b
callq 0x5630
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x1d6ac
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x1d6c3
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5340
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x1d6de
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5340
leaq 0x68(%rsp), %rdi
callq 0xe7ca
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x1d704
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x5340
incq %r13
movq 0x158(%rsp), %rax
movq (%rax), %rbx
movq 0x8(%rax), %rax
subq %rbx, %rax
sarq $0x3, %rax
movabsq $0x2e8ba2e8ba2e8ba3, %rcx # imm = 0x2E8BA2E8BA2E8BA3
imulq %rcx, %rax
cmpq %r13, %rax
ja 0x1d132
cmpl $0x0, 0x2d0(%rsp)
leaq 0x40(%rsp), %r13
jne 0x1d7da
movq %rbp, %r14
shlq $0x5, %r14
leaq (%rsp,%r14), %rbx
addq $0x240, %rbx            # imm = 0x240
movq 0x8(%rbx), %rcx
decq %rcx
movq %r13, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x5360
movq %rbx, %rdi
movq %r13, %rsi
callq 0x53e0
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x1d794
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x5340
leaq (%rsp,%r14), %rbx
addq $0x200, %rbx            # imm = 0x200
movq 0x8(%rbx), %rcx
decq %rcx
movq %r13, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x5360
movq %rbx, %rdi
movq %r13, %rsi
callq 0x53e0
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x1d7da
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x5340
leaq 0x1(%rbp), %rax
testq %rbp, %rbp
movq %rax, %rbp
je 0x1d0e7
movslq 0xd4(%rsp), %r13
movslq 0x2c8(%rsp), %rbx
movl 0x2d0(%rsp), %ebp
testl %ebp, %ebp
movq 0xc8(%rsp), %r12
jne 0x1dc46
leaq 0x13da9(%rip), %rsi     # 0x315c1
leaq 0x20(%rsp), %rdi
leaq 0x240(%rsp), %rdx
callq 0xce96
leaq 0x13d90(%rip), %rsi     # 0x315c1
leaq 0x20(%rsp), %rdi
callq 0x5630
movq 0x150(%rsp), %r14
leaq 0x50(%rsp), %r12
leaq 0x10(%rsp), %rsi
movq %rsi, (%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1d86e
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x1d874
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rsp, %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x260(%rsp), %rsi
movq 0x268(%rsp), %rdx
callq 0x50f0
movq %r12, 0x40(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1d8c6
movq %rdx, 0x40(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x50(%rsp)
jmp 0x1d8ce
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
movq %rdx, 0x48(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x40(%rsp), %rsi
movq 0x48(%rsp), %rdx
leaq 0xd8(%rsp), %rdi
callq 0x50f0
movq 0x40(%rsp), %rdi
cmpq %r12, %rdi
je 0x1d914
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x5340
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x1d92f
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x1d946
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5340
leaq 0x13c74(%rip), %rsi     # 0x315c1
leaq 0x20(%rsp), %rdi
leaq 0x200(%rsp), %rdx
callq 0xce96
leaq 0x13c5b(%rip), %rsi     # 0x315c1
leaq 0x20(%rsp), %rdi
callq 0x5630
leaq 0x10(%rsp), %rsi
movq %rsi, (%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1d996
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x1d99c
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rsp, %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x220(%rsp), %rsi
movq 0x228(%rsp), %rdx
callq 0x50f0
movq %r12, 0x40(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1d9ee
movq %rdx, 0x40(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x50(%rsp)
jmp 0x1d9f6
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
movq %rdx, 0x48(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x40(%rsp), %rsi
movq 0x48(%rsp), %rdx
leaq 0xd8(%rsp), %rdi
callq 0x50f0
movq 0x40(%rsp), %rdi
cmpq %r12, %rdi
je 0x1da3c
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x5340
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x1da57
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x1da6e
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5340
movl 0x158(%r14), %r14d
movl %r14d, %ebp
negl %ebp
cmovsl %r14d, %ebp
movl $0x1, %r15d
cmpl $0xa, %ebp
jb 0x1dad2
movl $0x4, %r15d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x1dac9
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x1dacf
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x1dad2
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r15d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x1da96
addl $-0x3, %r15d
jmp 0x1dad2
addl $-0x2, %r15d
jmp 0x1dad2
decl %r15d
shrl $0x1f, %r14d
leal (%r15,%r14), %esi
leaq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
movq %rax, (%rdi)
movl $0x2d, %edx
callq 0x53b0
leaq 0x20(%rsp), %r12
addq (%r12), %r14
movq %r14, %rdi
movl %r15d, %esi
movl %ebp, %edx
callq 0xe3b6
leaq 0x13ab3(%rip), %rcx     # 0x315c1
movl $0x1, %r8d
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x5380
leaq 0x10(%rsp), %r15
movq %r15, (%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
leaq 0x30(%rsp), %r14
movq 0xc8(%rsp), %r12
leaq 0x50(%rsp), %rbp
je 0x1db58
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x1db5f
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
movq %rsp, %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x124ec(%rip), %rsi     # 0x3006c
callq 0x5630
movq %rbp, 0x40(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x1dba8
movq %rdx, 0x40(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x50(%rsp)
jmp 0x1dbaf
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
movq 0x8(%rax), %rdx
movq %rdx, 0x48(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x40(%rsp), %rsi
movq 0x48(%rsp), %rdx
leaq 0xd8(%rsp), %rdi
callq 0x50f0
movq 0x40(%rsp), %rdi
cmpq %rbp, %rdi
je 0x1dbf5
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x5340
movq (%rsp), %rdi
cmpq %r15, %rdi
movl 0x2d0(%rsp), %ebp
je 0x1dc12
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x1dc29
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x178(%r12), %rax
movq (%rax,%r13,8), %rax
movq (%rax,%rbx,8), %rdi
leaq 0xd8(%rsp), %rsi
callq 0x10ca6
movq 0x180(%r12), %rax
movq (%rax,%r13,8), %rcx
movslq %ebp, %rax
movq (%rcx,%rax,8), %rdx
movq (%rdx), %rcx
movq 0x8(%rdx), %rdx
subq %rcx, %rdx
sarq $0x2, %rdx
cmpq %rbx, %rdx
jbe 0x1de0d
movl 0xbc(%rsp), %edx
addl %edx, (%rcx,%rbx,4)
movq 0x188(%r12), %rcx
movq (%rcx,%r13,8), %rcx
movq (%rcx,%rax,8), %rdx
movq (%rdx), %rcx
movq 0x8(%rdx), %rdx
subq %rcx, %rdx
sarq $0x2, %rdx
cmpq %rbx, %rdx
jbe 0x1de0d
movl 0xc0(%rsp), %edx
addl %edx, (%rcx,%rbx,4)
movq 0x190(%r12), %rcx
movq (%rcx,%r13,8), %rcx
movq (%rcx,%rax,8), %rdx
movq (%rdx), %rcx
movq 0x8(%rdx), %rdx
subq %rcx, %rdx
sarq $0x2, %rdx
cmpq %rbx, %rdx
jbe 0x1de0d
movl 0xb8(%rsp), %edx
addl %edx, (%rcx,%rbx,4)
movq 0x198(%r12), %rcx
movq (%rcx,%r13,8), %rcx
movq (%rcx,%rax,8), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
cmpq %rbx, %rdx
jbe 0x1de0d
movl 0xc4(%rsp), %ecx
addl %ecx, (%rax,%rbx,4)
movq $-0x40, %rbx
leaq 0x230(%rsp), %r14
movq -0x10(%r14), %rdi
cmpq %rdi, %r14
je 0x1dd30
movq (%r14), %rsi
incq %rsi
callq 0x5340
addq $-0x20, %r14
addq $0x20, %rbx
jne 0x1dd1c
movq $-0x40, %rbx
leaq 0x270(%rsp), %r14
movq -0x10(%r14), %rdi
cmpq %rdi, %r14
je 0x1dd5d
movq (%r14), %rsi
incq %rsi
callq 0x5340
addq $-0x20, %r14
addq $0x20, %rbx
jne 0x1dd49
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
cmpq %rax, %rdi
je 0x1dd8c
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x1e0(%rsp), %rdi
leaq 0x1f0(%rsp), %rax
cmpq %rax, %rdi
leaq 0x128(%rsp), %rbx
je 0x1ddb9
movq 0x1f0(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x1c0(%rsp), %rdi
leaq 0x1d0(%rsp), %rax
cmpq %rax, %rdi
je 0x1ddde
movq 0x1d0(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x118(%rsp), %rdi
cmpq %rbx, %rdi
je 0x1ddfb
movq 0x128(%rsp), %rsi
incq %rsi
callq 0x5340
addq $0x288, %rsp            # imm = 0x288
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x13cb0(%rip), %rdi     # 0x31ac4
movq %rbx, %rsi
xorl %eax, %eax
callq 0x5490
movq %rax, %rbx
movq 0x40(%rsp), %rdi
cmpq %rbp, %rdi
jne 0x1de4e
jmp 0x1de60
jmp 0x1de5d
jmp 0x1de7d
jmp 0x1e13c
jmp 0x1de41
jmp 0x1de5d
jmp 0x1de7d
jmp 0x1e13c
movq %rax, %rbx
movq 0x40(%rsp), %rdi
cmpq %r12, %rdi
je 0x1de60
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x1de60
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x1de80
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x1de80
movq %rax, %rbx
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x1e13f
movq 0x30(%rsp), %rsi
jmp 0x1e132
jmp 0x1e13c
movq %rax, %rbx
movq 0x40(%rsp), %rdi
cmpq %rbp, %rdi
je 0x1e199
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x1e199
movq %rax, %rbx
jmp 0x1e199
movq %rax, %rbx
movq 0x40(%rsp), %rdi
cmpq %rbp, %rdi
je 0x1deec
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x1deec
movq %rax, %rbx
movq 0x240(%rsp), %rdi
cmpq %r13, %rdi
je 0x1df0e
movq 0x250(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x1df0e
movq %rax, %rbx
movq 0x200(%rsp), %rdi
cmpq %r14, %rdi
je 0x1df30
movq 0x210(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x1df30
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1df50
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x1df50
movq %rax, %rbx
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x1df7a
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x1df7a
movq %rax, %rbx
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x1dfca
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x1dfca
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
jne 0x1df89
jmp 0x1dfca
movq %rax, %rbx
leaq 0x128(%rsp), %r14
jmp 0x1e1eb
movq %rax, %rbx
leaq 0x128(%rsp), %r14
jmp 0x1e210
movq %rax, %rbx
leaq 0x128(%rsp), %r14
jmp 0x1e1c6
jmp 0x1e13c
jmp 0x1e13c
jmp 0x1e13c
jmp 0x1e0a4
jmp 0x1e0a9
movq %rax, %rbx
movq 0xf8(%rsp), %rdi
leaq 0x108(%rsp), %rax
cmpq %rax, %rdi
je 0x1e01d
movq 0x108(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x1e01d
movq %rax, %rbx
movq 0x180(%rsp), %rdi
leaq 0x190(%rsp), %rax
cmpq %rax, %rdi
je 0x1e042
movq 0x190(%rsp), %rsi
incq %rsi
callq 0x5340
leaq 0x30(%rsp), %r15
jmp 0x1e04c
movq %rax, %rbx
movq 0x160(%rsp), %rdi
leaq 0x170(%rsp), %rax
cmpq %rax, %rdi
je 0x1e07b
movq 0x170(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x1e07b
movq %rax, %rbx
leaq 0x30(%rsp), %r15
movq 0x1a0(%rsp), %rdi
leaq 0x1b0(%rsp), %rax
cmpq %rax, %rdi
je 0x1e0dd
movq 0x1b0(%rsp), %rsi
jmp 0x1e0d5
movq %rax, %rbx
leaq 0x30(%rsp), %r15
jmp 0x1e0dd
movq %rax, %rbx
jmp 0x1e0dd
movq %rax, %rbx
jmp 0x1e0f4
jmp 0x1e0b0
movq %rax, %rbx
jmp 0x1e10f
movq %rax, %rbx
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x1e0dd
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x1e0f4
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x5340
leaq 0x10(%rsp), %rax
movq (%rsp), %rdi
cmpq %rax, %rdi
je 0x1e10f
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x5340
leaq 0x40(%rsp), %rdi
callq 0x28b44
jmp 0x1e13f
movq %rax, %rbx
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x1e13f
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x5340
jmp 0x1e13f
movq %rax, %rbx
movq $-0x40, %r14
leaq 0x230(%rsp), %r15
movq -0x10(%r15), %rdi
cmpq %rdi, %r15
je 0x1e162
movq (%r15), %rsi
incq %rsi
callq 0x5340
addq $-0x20, %r15
addq $0x20, %r14
jne 0x1e14e
movq $-0x40, %r14
leaq 0x270(%rsp), %r15
movq -0x10(%r15), %rdi
cmpq %rdi, %r15
je 0x1e18f
movq (%r15), %rsi
incq %rsi
callq 0x5340
addq $-0x20, %r15
addq $0x20, %r14
jne 0x1e17b
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
cmpq %rax, %rdi
leaq 0x128(%rsp), %r14
je 0x1e1c6
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x1e0(%rsp), %rdi
leaq 0x1f0(%rsp), %rax
cmpq %rax, %rdi
je 0x1e1eb
movq 0x1f0(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x1c0(%rsp), %rdi
leaq 0x1d0(%rsp), %rax
cmpq %rax, %rdi
je 0x1e210
movq 0x1d0(%rsp), %rsi
incq %rsi
callq 0x5340
movq 0x118(%rsp), %rdi
cmpq %r14, %rdi
je 0x1e22d
movq 0x128(%rsp), %rsi
incq %rsi
callq 0x5340
movq %rbx, %rdi
callq 0x55c0
nop