// File: /workspace/github_cpp_makefile_star2_O1/medvedevgroup[P]varmatch/src/wholegenome.cpp
// Function: WholeGenome::ConvergePaths(std::__cxx11::list<SequencePath, std::allocator<SequencePath>>&)
void WholeGenome::ConvergePaths(list<SequencePath> & path_list){
    //dout << "===========start converge===================" << endl;
    int path_num = path_list.size();
    if(path_num <= 1) return;
    for(list<SequencePath>::iterator i = path_list.begin(); i!= path_list.end(); ++i){
        SequencePath  ref_path = *i;
        if(ref_path.removable) continue;
        if(!ref_path.same_donor_len) continue;
        list<SequencePath>::iterator j = i;
        ++j;
        for(; j != path_list.end(); ++j){
            SequencePath que_path = *j;
            if(que_path.removable) continue;
            if(!que_path.same_donor_len) continue;
            //dout << "Comparing following paths: " << endl;
            //PrintPath(ref_path);
            //PrintPath(que_path);
            if(DonorLengthEqual(ref_path, que_path)){
                if(ref_path.score >= que_path.score){
                    (*j).removable = true;
                    //dout << "delete path: " << endl;
                    //PrintPath((*j));
                }else{
                    (*i).removable = true;
                    //dout << "delete path: " << endl;
                    //PrintPath((*i));
                    break;
                }
            }
            //dout << "-    -     -   -   -   -   -  - - -" << endl;
        }
    }

    path_list.remove_if(IsRemovable);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x308, %rsp            # imm = 0x308
cmpl $0x2, 0x10(%rsi)
jl 0x1cb3f
movq %rsi, %rbx
movq (%rsi), %r12
cmpq %rsi, %r12
je 0x1cb30
leaq 0x188(%rsp), %r15
leaq 0x10(%r12), %rsi
leaq 0x8(%rsp), %rdi
callq 0x2935c
cmpb $0x0, 0x164(%rsp)
jne 0x1ca9d
cmpb $0x1, 0x165(%rsp)
jne 0x1ca9d
movq %r12, %r13
movq (%r13), %r13
cmpq %rbx, %r13
je 0x1ca9d
leaq 0x10(%r13), %rsi
movq %r15, %rdi
callq 0x2935c
cmpb $0x0, 0x2e4(%rsp)
jne 0x1c9dd
cmpb $0x1, 0x2e5(%rsp)
jne 0x1c9dd
movq 0xe0(%rsp), %rdx
movq 0x260(%rsp), %rcx
cmpq %rcx, %rdx
jne 0x1c97c
movq 0x100(%rsp), %rax
cmpq 0x280(%rsp), %rax
jne 0x1c97c
xorl %eax, %eax
jmp 0x1c993
movb $0x1, %al
cmpq 0x280(%rsp), %rdx
jne 0x1c993
cmpq %rcx, 0x100(%rsp)
setne %al
movq 0x120(%rsp), %rsi
movq 0x2a0(%rsp), %rcx
cmpq %rcx, %rsi
jne 0x1c9be
movq 0x140(%rsp), %rdx
cmpq 0x2c0(%rsp), %rdx
jne 0x1c9be
xorl %edx, %edx
jmp 0x1c9d5
movb $0x1, %dl
cmpq 0x2c0(%rsp), %rsi
jne 0x1c9d5
cmpq %rcx, 0x140(%rsp)
setne %dl
orb %dl, %al
je 0x1ca78
xorl %ebp, %ebp
movq 0x2f0(%rsp), %rdi
testq %rdi, %rdi
je 0x1c9fc
movq 0x300(%rsp), %rsi
subq %rdi, %rsi
callq 0x5340
movl $0x140, %r14d           # imm = 0x140
leaq (%rsp,%r14), %rax
addq $0x188, %rax            # imm = 0x188
movq -0x10(%rax), %rdi
cmpq %rdi, %rax
je 0x1ca20
movq (%rax), %rsi
incq %rsi
callq 0x5340
addq $-0x20, %r14
cmpq $0xc0, %r14
jne 0x1ca02
movl $0x98, %r14d
leaq (%rsp,%r14), %rdi
addq $0x188, %rdi            # imm = 0x188
callq 0x2a5c6
addq $-0x30, %r14
cmpq $0x38, %r14
jne 0x1ca33
movl $0x50, %r14d
leaq (%rsp,%r14), %rdi
addq $0x188, %rdi            # imm = 0x188
callq 0xe7ca
addq $-0x18, %r14
cmpq $-0x10, %r14
jne 0x1ca53
testb %bpl, %bpl
je 0x1c91c
jmp 0x1ca9d
movl 0x160(%rsp), %eax
cmpl 0x2e0(%rsp), %eax
setl %bpl
movq %r13, %rax
cmovlq %r12, %rax
movb $0x1, 0x16c(%rax)
jmp 0x1c9df
movq 0x170(%rsp), %rdi
testq %rdi, %rdi
je 0x1caba
movq 0x180(%rsp), %rsi
subq %rdi, %rsi
callq 0x5340
movl $0x140, %r14d           # imm = 0x140
leaq (%rsp,%r14), %rax
addq $0x8, %rax
movq -0x10(%rax), %rdi
cmpq %rdi, %rax
je 0x1cadc
movq (%rax), %rsi
incq %rsi
callq 0x5340
addq $-0x20, %r14
cmpq $0xc0, %r14
jne 0x1cac0
movl $0x98, %r14d
leaq (%rsp,%r14), %rdi
addq $0x8, %rdi
callq 0x2a5c6
addq $-0x30, %r14
cmpq $0x38, %r14
jne 0x1caef
movl $0x50, %r14d
leaq (%rsp,%r14), %rdi
addq $0x8, %rdi
callq 0xe7ca
addq $-0x18, %r14
cmpq $-0x10, %r14
jne 0x1cb0c
movq (%r12), %r12
cmpq %rbx, %r12
jne 0x1c8ee
leaq 0x5889(%rip), %rsi      # 0x223c0
movq %rbx, %rdi
callq 0x29986
addq $0x308, %rsp            # imm = 0x308
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x29560
movq %rbx, %rdi
callq 0x55c0