// File: /workspace/github_cpp_makefile_star2_O2/medvedevgroup[P]varmatch/src/wholegenome.cpp
// Function: WholeGenome::ConstructMatchRecordNoGenotypeBackup(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::ConstructMatchRecordNoGenotypeBackup(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;

    bool need_match_record = false;
    if(threshold_index == 0) need_match_record = true;

    bool multiple_match = false;
    string parsimonious_ref = subsequence;
    string parsimonious_alt0 = best_path.donor_sequences[0];
    string parsimonious_alt1 = best_path.donor_sequences[0];

    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 (auto it = best_path.choice_made[i].begin(); it != best_path.choice_made[i].end(); ++it) {
            pair<int, int> selection = it->second;
            int phasing = selection.second;
            if(selection.first == -1) continue;
            if (phasing == -1) continue;
            DiploidVariant variant = variant_list[selection.first];
            if(!variant.flag){
                truth_num++;
            }else{
                predict_num++;
            }

            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|1";
                }else if(phasing == 1){
                    phasing_string += "2|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;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x288, %rsp            # imm = 0x288
movl %r9d, %ebp
movl %r8d, %ebx
movq %rdx, 0xd0(%rsp)
movq %rsi, %r12
movq %rdi, %r15
leaq 0x1c8(%rsp), %rdi
movq %rcx, %rsi
callq 0x53f0
leaq 0xd0(%r12), %r14
leaq 0x1a8(%rsp), %rdi
movq %r14, %rsi
callq 0x53f0
leaq 0x248(%rsp), %rdi
movq %r14, %rsi
callq 0x53f0
leaq 0xb8(%r15), %rdi
leaq 0x2c0(%rsp), %rsi
callq 0x19a5a
leaq 0xc5bb(%rip), %rdx      # 0x225a9
leaq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x96b0
incl %ebx
leaq 0x100(%rsp), %rdi
movl %ebx, %esi
callq 0x8011
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x100(%rsp), %rdx
callq 0x94bb
leaq 0xc57f(%rip), %rdx      # 0x225a9
leaq 0x120(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x7fce
leaq 0x160(%rsp), %rdi
leaq 0x120(%rsp), %rsi
leaq 0x1c8(%rsp), %rdx
callq 0x9691
leaq 0xc549(%rip), %rdx      # 0x225a9
leaq 0x60(%rsp), %rdi
leaq 0x160(%rsp), %rsi
callq 0x7fce
leaq 0xe0(%rsp), %rdi
leaq 0x60(%rsp), %rsi
leaq 0x1a8(%rsp), %rdx
callq 0x9691
leaq 0x60(%rsp), %rdi
callq 0x55e8
leaq 0x160(%rsp), %rdi
callq 0x55e8
leaq 0x120(%rsp), %rdi
callq 0x55e8
leaq 0x28(%rsp), %rdi
callq 0x55e8
leaq 0x100(%rsp), %rdi
callq 0x55e8
leaq 0x8(%rsp), %rdi
callq 0x55e8
pushq $0x10
popq %rax
leaq (%rsp,%rax), %rcx
addq $0x160, %rcx            # imm = 0x160
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
movb $0x0, (%rcx)
addq $0x20, %rax
cmpq $0x50, %rax
jne 0x160d4
movl %ebp, (%rsp)
movq %r15, 0x58(%rsp)
pushq $0x10
popq %rax
leaq (%rsp,%rax), %rcx
addq $0x120, %rcx            # imm = 0x120
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
movb $0x0, (%rcx)
addq $0x20, %rax
cmpq $0x50, %rax
jne 0x16100
movq %r12, 0xb8(%rsp)
leaq 0x68(%r12), %rax
movq %rax, 0xc0(%rsp)
xorl %edx, %edx
leaq 0x60(%rsp), %r12
movl $0x0, 0x4(%rsp)
xorl %ebx, %ebx
cmpq $0x2, %rdx
je 0x16427
imulq $0x30, %rdx, %rax
movq 0xc0(%rsp), %rcx
leaq (%rcx,%rax), %r14
addq $0x8, %r14
movq 0x10(%r14), %rbp
movq %rdx, 0xc8(%rsp)
movq %rdx, %rax
shlq $0x5, %rax
leaq (%rsp,%rax), %rcx
addq $0x160, %rcx            # imm = 0x160
movq %rcx, 0x50(%rsp)
addq %rsp, %rax
addq $0x120, %rax            # imm = 0x120
movq %rax, 0x48(%rsp)
movq %r14, 0xd8(%rsp)
cmpq %r14, %rbp
je 0x163b5
movslq 0x24(%rbp), %rax
cmpq $-0x1, %rax
sete %cl
movl 0x28(%rbp), %r15d
cmpl $-0x1, %r15d
sete %dl
orb %cl, %dl
jne 0x163a5
imulq $0x58, %rax, %rsi
movq 0xd0(%rsp), %rax
addq (%rax), %rsi
movq %r12, %rdi
callq 0x1a174
movzbl 0xac(%rsp), %r13d
cmpl $0x0, 0x2d0(%rsp)
jne 0x16384
movq 0x88(%rsp), %rsi
leaq 0x28(%rsp), %rdi
callq 0x53f0
cmpb $0x1, 0xa1(%rsp)
jne 0x1624a
movl %ebx, %r14d
movq 0x88(%rsp), %rdx
addq $0x20, %rdx
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
leaq 0xc37e(%rip), %rsi      # 0x225ab
callq 0x9dae
leaq 0x28(%rsp), %rdi
movq %rbx, %rsi
callq 0x55c0
movq %rbx, %rdi
callq 0x55e8
movl %r14d, %ebx
leaq 0x8(%rsp), %rdi
leaq 0xc354(%rip), %rsi      # 0x225aa
leaq 0x100(%rsp), %r12
movq %r12, %rdx
callq 0x72ee
leaq 0xc5dc(%rip), %rsi      # 0x22849
cmpl $0x1, %r15d
je 0x1627f
testl %r15d, %r15d
jne 0x16289
leaq 0xc5c6(%rip), %rsi      # 0x22845
leaq 0x8(%rsp), %rdi
callq 0x55a0
movl 0x60(%rsp), %esi
incl %esi
leaq 0x1e8(%rsp), %r15
movq %r15, %rdi
callq 0x8011
leaq 0x208(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
leaq 0xc295(%rip), %rdx      # 0x22549
callq 0x7fce
leaq 0x228(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
leaq 0x68(%rsp), %rdx
callq 0x9691
leaq 0x268(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
leaq 0xc263(%rip), %rdx      # 0x22549
callq 0x7fce
movq %r12, %rdi
movq %r14, %rsi
leaq 0x28(%rsp), %rdx
callq 0x9691
movq %r14, %rdi
callq 0x55e8
leaq 0x228(%rsp), %rdi
callq 0x55e8
leaq 0x208(%rsp), %rdi
callq 0x55e8
leaq 0x1e8(%rsp), %rdi
callq 0x55e8
movq 0x50(%rsp), %rdi
movq %r12, %rsi
callq 0x55c0
movq 0x48(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x55c0
movq 0x50(%rsp), %rdi
leaq 0xc4f1(%rip), %rsi      # 0x22843
callq 0x55a0
movq 0x48(%rsp), %rdi
leaq 0xc4e0(%rip), %rsi      # 0x22843
callq 0x55a0
movq %r12, %rdi
callq 0x55e8
leaq 0x8(%rsp), %rdi
callq 0x55e8
leaq 0x28(%rsp), %rdi
callq 0x55e8
addl %r13d, 0x4(%rsp)
xorl $0x1, %r13d
addl %r13d, %ebx
leaq 0x60(%rsp), %r12
movq %r12, %rdi
callq 0x19c16
movq 0xd8(%rsp), %r14
movq %rbp, %rdi
callq 0x5240
movq %rax, %rbp
jmp 0x1619e
cmpl $0x0, 0x2d0(%rsp)
jne 0x16417
movq 0x50(%rsp), %r14
movq 0x8(%r14), %rcx
decq %rcx
movq %r12, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x5320
movq %r14, %rdi
movq %r12, %rsi
callq 0x5390
movq %r12, %rdi
callq 0x55e8
movq 0x48(%rsp), %r14
movq 0x8(%r14), %rcx
decq %rcx
movq %r12, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x5320
movq %r14, %rdi
movq %r12, %rsi
callq 0x5390
movq %r12, %rdi
callq 0x55e8
movq 0xc8(%rsp), %rdx
incq %rdx
jmp 0x16147
cmpl $0x0, 0x2d0(%rsp)
je 0x16447
movslq (%rsp), %r15
movslq 0x2c8(%rsp), %r14
movq 0x58(%rsp), %rbp
jmp 0x165d4
leaq 0xc15b(%rip), %rsi      # 0x225a9
leaq 0x8(%rsp), %rdi
leaq 0x160(%rsp), %rdx
callq 0x9dae
leaq 0xc142(%rip), %rdx      # 0x225a9
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x7fce
leaq 0x180(%rsp), %rdx
leaq 0x60(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x9691
leaq 0xe0(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x55c0
leaq 0x60(%rsp), %rdi
callq 0x55e8
leaq 0x28(%rsp), %rdi
callq 0x55e8
leaq 0x8(%rsp), %rdi
callq 0x55e8
leaq 0xc0e5(%rip), %rsi      # 0x225a9
leaq 0x8(%rsp), %rdi
leaq 0x120(%rsp), %rdx
callq 0x9dae
leaq 0xc0cc(%rip), %rdx      # 0x225a9
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x7fce
leaq 0x140(%rsp), %rdx
leaq 0x60(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x9691
leaq 0xe0(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x55c0
leaq 0x60(%rsp), %rdi
callq 0x55e8
leaq 0x28(%rsp), %rdi
callq 0x55e8
leaq 0x8(%rsp), %rdi
callq 0x55e8
movq 0xb8(%rsp), %rax
movl 0x158(%rax), %esi
leaq 0x8(%rsp), %rdi
callq 0x8011
leaq 0xc057(%rip), %rsi      # 0x225a9
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x7fed
leaq 0xab04(%rip), %rdx      # 0x2106c
leaq 0x60(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x7fce
leaq 0xe0(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x55c0
leaq 0x60(%rsp), %rdi
callq 0x55e8
leaq 0x28(%rsp), %rdi
callq 0x55e8
leaq 0x8(%rsp), %rdi
callq 0x55e8
movq 0x58(%rsp), %rbp
movq 0x178(%rbp), %rax
movslq (%rsp), %r15
movq (%rax,%r15,8), %rax
movslq 0x2c8(%rsp), %r14
movq (%rax,%r14,8), %rdi
leaq 0xe0(%rsp), %rsi
callq 0xc896
movq 0x180(%rbp), %rax
movq (%rax,%r15,8), %rax
movslq 0x2d0(%rsp), %r13
movq (%rax,%r13,8), %rdi
movq %r14, %rsi
callq 0x1a1ca
addl %ebx, (%rax)
movq 0x188(%rbp), %rax
movq (%rax,%r15,8), %rax
movq (%rax,%r13,8), %rdi
movq %r14, %rsi
callq 0x1a1ca
movl 0x4(%rsp), %ecx
addl %ecx, (%rax)
pushq $0x20
popq %rbx
leaq (%rsp,%rbx), %rdi
addq $0x120, %rdi            # imm = 0x120
callq 0x55e8
addq $-0x20, %rbx
cmpq $-0x20, %rbx
jne 0x16615
pushq $0x20
popq %rbx
leaq (%rsp,%rbx), %rdi
addq $0x160, %rdi            # imm = 0x160
callq 0x55e8
addq $-0x20, %rbx
cmpq $-0x20, %rbx
jne 0x16632
leaq 0xe0(%rsp), %rdi
callq 0x55e8
leaq 0x248(%rsp), %rdi
callq 0x55e8
leaq 0x1a8(%rsp), %rdi
callq 0x55e8
leaq 0x1c8(%rsp), %rdi
callq 0x55e8
addq $0x288, %rsp            # imm = 0x288
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x166a8
jmp 0x166b7
jmp 0x166c6
jmp 0x167b4
jmp 0x166a8
jmp 0x166b7
jmp 0x166c6
jmp 0x167b4
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x55e8
jmp 0x166ba
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x55e8
jmp 0x166c9
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x55e8
jmp 0x167e7
jmp 0x167b4
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x55e8
jmp 0x166ef
movq %rax, %rbx
leaq 0x160(%rsp), %rdi
callq 0x55e8
jmp 0x16701
movq %rax, %rbx
leaq 0x120(%rsp), %rdi
callq 0x55e8
jmp 0x16713
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x55e8
jmp 0x16722
movq %rax, %rbx
leaq 0x100(%rsp), %rdi
callq 0x55e8
leaq 0x8(%rsp), %rdi
jmp 0x1682b
movq %rax, %rbx
jmp 0x1672f
movq %rax, %rbx
jmp 0x1683d
movq %rax, %rbx
jmp 0x1684a
movq %rax, %rbx
jmp 0x16830
jmp 0x167b4
jmp 0x167b4
jmp 0x167b4
jmp 0x1676c
jmp 0x16767
jmp 0x16767
movq %rax, %rbx
jmp 0x167aa
movq %rax, %rbx
jmp 0x167c9
movq %rax, %rbx
jmp 0x167d3
movq %rax, %rbx
jmp 0x167dd
movq %rax, %rbx
leaq 0x268(%rsp), %rdi
callq 0x55e8
jmp 0x1678b
movq %rax, %rbx
leaq 0x228(%rsp), %rdi
callq 0x55e8
jmp 0x1679d
movq %rax, %rbx
leaq 0x208(%rsp), %rdi
callq 0x55e8
leaq 0x1e8(%rsp), %rdi
jmp 0x167c4
movq %rax, %rbx
jmp 0x167e7
movq %rax, %rbx
leaq 0x100(%rsp), %rdi
callq 0x55e8
leaq 0x8(%rsp), %rdi
callq 0x55e8
leaq 0x28(%rsp), %rdi
callq 0x55e8
leaq 0x60(%rsp), %rdi
callq 0x19c16
pushq $0x20
popq %r14
leaq (%rsp,%r14), %rdi
addq $0x120, %rdi            # imm = 0x120
callq 0x55e8
addq $-0x20, %r14
cmpq $-0x20, %r14
jne 0x167eb
pushq $0x20
popq %r14
leaq (%rsp,%r14), %rdi
addq $0x160, %rdi            # imm = 0x160
callq 0x55e8
addq $-0x20, %r14
cmpq $-0x20, %r14
jne 0x16809
leaq 0xe0(%rsp), %rdi
callq 0x55e8
leaq 0x248(%rsp), %rdi
callq 0x55e8
leaq 0x1a8(%rsp), %rdi
callq 0x55e8
leaq 0x1c8(%rsp), %rdi
callq 0x55e8
movq %rbx, %rdi
callq 0x5540
nop