// File: /workspace/github_cpp_makefile_star2_O3/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 0x1c723
movq %rsi, %rbx
movq (%rsi), %r12
cmpq %rsi, %r12
je 0x1c714
leaq 0x188(%rsp), %r15
leaq 0x10(%r12), %rsi
leaq 0x8(%rsp), %rdi
callq 0x28ef6
cmpb $0x0, 0x164(%rsp)
jne 0x1c681
cmpb $0x1, 0x165(%rsp)
jne 0x1c681
movq %r12, %r13
movq (%r13), %r13
cmpq %rbx, %r13
je 0x1c681
leaq 0x10(%r13), %rsi
movq %r15, %rdi
callq 0x28ef6
cmpb $0x0, 0x2e4(%rsp)
jne 0x1c5c1
cmpb $0x1, 0x2e5(%rsp)
jne 0x1c5c1
movq 0xe0(%rsp), %rdx
movq 0x260(%rsp), %rcx
cmpq %rcx, %rdx
jne 0x1c55c
movq 0x280(%rsp), %rsi
cmpq %rsi, 0x100(%rsp)
jne 0x1c564
xorl %eax, %eax
jmp 0x1c576
movq 0x280(%rsp), %rsi
movb $0x1, %al
cmpq %rsi, %rdx
jne 0x1c576
cmpq %rcx, 0x100(%rsp)
setne %al
movq 0x120(%rsp), %rdx
movq 0x2a0(%rsp), %rcx
cmpq %rcx, %rdx
jne 0x1c5a1
movq 0x2c0(%rsp), %rsi
cmpq %rsi, 0x140(%rsp)
jne 0x1c5a9
xorl %ecx, %ecx
jmp 0x1c5b9
movq 0x2c0(%rsp), %rsi
cmpq %rsi, %rdx
jne 0x1c5c1
cmpq %rcx, 0x140(%rsp)
setne %cl
orb %cl, %al
je 0x1c65c
xorl %ebp, %ebp
movq 0x2f0(%rsp), %rdi
testq %rdi, %rdi
je 0x1c5e0
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 0x1c604
movq (%rax), %rsi
incq %rsi
callq 0x5340
addq $-0x20, %r14
cmpq $0xc0, %r14
jne 0x1c5e6
movl $0x98, %r14d
leaq (%rsp,%r14), %rdi
addq $0x188, %rdi            # imm = 0x188
callq 0x2a10c
addq $-0x30, %r14
cmpq $0x38, %r14
jne 0x1c617
movl $0x50, %r14d
leaq (%rsp,%r14), %rdi
addq $0x188, %rdi            # imm = 0x188
callq 0xe71c
addq $-0x18, %r14
cmpq $-0x10, %r14
jne 0x1c637
testb %bpl, %bpl
je 0x1c4fc
jmp 0x1c681
movl 0x160(%rsp), %eax
cmpl 0x2e0(%rsp), %eax
setl %bpl
movq %r13, %rax
cmovlq %r12, %rax
movb $0x1, 0x16c(%rax)
jmp 0x1c5c3
movq 0x170(%rsp), %rdi
testq %rdi, %rdi
je 0x1c69e
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 0x1c6c0
movq (%rax), %rsi
incq %rsi
callq 0x5340
addq $-0x20, %r14
cmpq $0xc0, %r14
jne 0x1c6a4
movl $0x98, %r14d
leaq (%rsp,%r14), %rdi
addq $0x8, %rdi
callq 0x2a10c
addq $-0x30, %r14
cmpq $0x38, %r14
jne 0x1c6d3
movl $0x50, %r14d
leaq (%rsp,%r14), %rdi
addq $0x8, %rdi
callq 0xe71c
addq $-0x18, %r14
cmpq $-0x10, %r14
jne 0x1c6f0
movq (%r12), %r12
cmpq %rbx, %r12
jne 0x1c4ce
leaq 0x5928(%rip), %rsi      # 0x22043
movq %rbx, %rdi
callq 0x294fc
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 0x290d4
movq %rbx, %rdi
callq 0x55c0