// File: 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
movq %rsp, %rbp
subq $0x360, %rsp            # imm = 0x360
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x358(%rbp)
movq -0x10(%rbp), %rdi
callq 0x35560
movl %eax, -0x14(%rbp)
cmpl $0x1, -0x14(%rbp)
jg 0x283f5
jmp 0x28603
movq -0x10(%rbp), %rdi
callq 0x35da0
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0x35e00
movq %rax, -0x28(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x35dd0
testb $0x1, %al
jne 0x28425
jmp 0x285f3
leaq -0x20(%rbp), %rdi
callq 0x35e30
movq %rax, %rsi
leaq -0x1a8(%rbp), %rdi
callq 0x34b20
testb $0x1, -0x4c(%rbp)
je 0x28452
movl $0x4, -0x1ac(%rbp)
jmp 0x285c9
testb $0x1, -0x4b(%rbp)
jne 0x28467
movl $0x4, -0x1ac(%rbp)
jmp 0x285c9
movq -0x20(%rbp), %rax
movq %rax, -0x1b8(%rbp)
leaq -0x1b8(%rbp), %rdi
callq 0x35e50
movq -0x10(%rbp), %rdi
callq 0x35e00
movq %rax, -0x1c0(%rbp)
leaq -0x1b8(%rbp), %rdi
leaq -0x1c0(%rbp), %rsi
callq 0x35dd0
testb $0x1, %al
jne 0x284aa
jmp 0x285bf
leaq -0x1b8(%rbp), %rdi
callq 0x35e30
movq %rax, %rsi
leaq -0x340(%rbp), %rdi
callq 0x34b20
jmp 0x284c7
testb $0x1, -0x1e4(%rbp)
je 0x28502
movl $0x7, -0x1ac(%rbp)
jmp 0x2857f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x348(%rbp)
movl %eax, -0x34c(%rbp)
leaq -0x1a8(%rbp), %rdi
callq 0x35020
jmp 0x2860c
testb $0x1, -0x1e3(%rbp)
jne 0x28517
movl $0x7, -0x1ac(%rbp)
jmp 0x2857f
movq -0x358(%rbp), %rdi
leaq -0x1a8(%rbp), %rsi
leaq -0x340(%rbp), %rdx
callq 0x2c4b0
testb $0x1, %al
jne 0x28537
jmp 0x28575
movl -0x50(%rbp), %eax
cmpl -0x1e8(%rbp), %eax
jl 0x28557
leaq -0x1b8(%rbp), %rdi
callq 0x35e30
movb $0x1, 0x15c(%rax)
jmp 0x28573
leaq -0x20(%rbp), %rdi
callq 0x35e30
movb $0x1, 0x15c(%rax)
movl $0x5, -0x1ac(%rbp)
jmp 0x2857f
jmp 0x28575
movl $0x0, -0x1ac(%rbp)
leaq -0x340(%rbp), %rdi
callq 0x35020
movl -0x1ac(%rbp), %eax
movl %eax, -0x35c(%rbp)
testl %eax, %eax
je 0x285ac
jmp 0x2859d
movl -0x35c(%rbp), %eax
subl $0x5, %eax
je 0x285bf
jmp 0x285aa
jmp 0x285ae
jmp 0x285ae
leaq -0x1b8(%rbp), %rdi
callq 0x35e50
jmp 0x2847e
movl $0x0, -0x1ac(%rbp)
leaq -0x1a8(%rbp), %rdi
callq 0x35020
movl -0x1ac(%rbp), %eax
testl %eax, %eax
je 0x285e3
jmp 0x285e1
jmp 0x285e5
jmp 0x285e5
leaq -0x20(%rbp), %rdi
callq 0x35e50
jmp 0x28402
movq -0x10(%rbp), %rdi
leaq 0x40c2(%rip), %rsi      # 0x2c6c0
callq 0x35e70
addq $0x360, %rsp            # imm = 0x360
popq %rbp
retq
movq -0x348(%rbp), %rdi
callq 0x6750
nopl (%rax,%rax)