// File: canzarlab[P]Trajan/src/LP.cpp
// Function: LP::WriteSolution(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void LP::WriteSolution(string fileName)
{
    ofstream sol_file(fileName);
    double weight = 0;
    vn n1 = t1.GetNodes(), n2 = t2.GetNodes();
    for (size_t i = 0; i < K.size(); i++)
    {
        for (size_t j = 0; j < K[i].size(); j++)
        {
            if (K[i][j] != -1 && x(K[i][j]) > 0)
            {
                weight += x(K[i][j]) * c(K[i][j]);
                sol_file << n1[i]->taxon << " " << n2[j]->taxon << " " << x(K[i][j]) << "\n"; 
            }
        }
    }
    ofstream trp_file(fileName + ".trp");
    for (auto& t : Triplets)
        trp_file << t.row() << " " << t.col() << " " << t.value() << '\n';
    PrintScore(weight);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x580, %rsp            # imm = 0x580
movq %rsi, -0x4b8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x4b0(%rbp)
leaq -0x210(%rbp), %rdi
movl $0x10, %edx
callq 0xa890
movq -0x4b0(%rbp), %rax
movq $0x0, -0x218(%rbp)
movq 0x30(%rax), %rsi
leaq -0x230(%rbp), %rdi
callq 0xa9210
jmp 0xae33a
movq -0x4b0(%rbp), %rax
movq 0x38(%rax), %rsi
leaq -0x258(%rbp), %rdi
callq 0xa9210
jmp 0xae353
movq $0x0, -0x260(%rbp)
movq -0x4b0(%rbp), %rdi
movq -0x260(%rbp), %rax
movq %rax, -0x4c0(%rbp)
addq $0xe0, %rdi
callq 0x9b070
movq %rax, %rcx
movq -0x4c0(%rbp), %rax
cmpq %rcx, %rax
jae 0xae6f0
movq $0x0, -0x268(%rbp)
movq -0x4b0(%rbp), %rdi
movq -0x268(%rbp), %rax
movq %rax, -0x4c8(%rbp)
addq $0xe0, %rdi
movq -0x260(%rbp), %rsi
callq 0x993b0
movq %rax, %rdi
callq 0x1be50
movq %rax, %rcx
movq -0x4c8(%rbp), %rax
cmpq %rcx, %rax
jae 0xae6d7
movq -0x4b0(%rbp), %rdi
addq $0xe0, %rdi
movq -0x260(%rbp), %rsi
callq 0x993b0
movq %rax, %rdi
movq -0x268(%rbp), %rsi
callq 0x145d0
cmpl $-0x1, (%rax)
je 0xae6be
movq -0x4b0(%rbp), %rdi
movq %rdi, %rax
addq $0xc0, %rax
movq %rax, -0x4d8(%rbp)
addq $0xe0, %rdi
movq -0x260(%rbp), %rsi
callq 0x993b0
movq %rax, %rdi
movq -0x268(%rbp), %rsi
callq 0x145d0
movq -0x4d8(%rbp), %rdi
movslq (%rax), %rsi
callq 0x145f0
movq %rax, -0x4d0(%rbp)
jmp 0xae463
movq -0x4d0(%rbp), %rax
movsd (%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0xae6be
movq -0x4b0(%rbp), %rdi
movq %rdi, %rax
addq $0xc0, %rax
movq %rax, -0x4e8(%rbp)
addq $0xe0, %rdi
movq -0x260(%rbp), %rsi
callq 0x993b0
movq %rax, %rdi
movq -0x268(%rbp), %rsi
callq 0x145d0
movq -0x4e8(%rbp), %rdi
movslq (%rax), %rsi
callq 0x145f0
movq %rax, -0x4e0(%rbp)
jmp 0xae4cc
movq -0x4b0(%rbp), %rdi
movq -0x4e0(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, -0x500(%rbp)
movq %rdi, %rax
addq $0xf8, %rax
movq %rax, -0x4f8(%rbp)
addq $0xe0, %rdi
movq -0x260(%rbp), %rsi
callq 0x993b0
movq %rax, %rdi
movq -0x268(%rbp), %rsi
callq 0x145d0
movq -0x4f8(%rbp), %rdi
movslq (%rax), %rsi
callq 0x145f0
movq %rax, -0x4f0(%rbp)
jmp 0xae530
movsd -0x500(%rbp), %xmm0
movq -0x4f0(%rbp), %rax
movsd (%rax), %xmm2
movsd -0x218(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x218(%rbp)
movq -0x260(%rbp), %rsi
leaq -0x230(%rbp), %rdi
callq 0xa19e0
movq (%rax), %rsi
addq $0x8, %rsi
leaq -0x210(%rbp), %rdi
callq 0xa3d0
movq %rax, -0x508(%rbp)
jmp 0xae58a
movq -0x508(%rbp), %rdi
leaq 0x5ccaa(%rip), %rsi     # 0x10b242
callq 0xa440
movq %rax, -0x510(%rbp)
jmp 0xae5a6
movq -0x268(%rbp), %rsi
leaq -0x258(%rbp), %rdi
callq 0xa19e0
movq -0x510(%rbp), %rdi
movq (%rax), %rsi
addq $0x8, %rsi
callq 0xa3d0
movq %rax, -0x518(%rbp)
jmp 0xae5d5
movq -0x518(%rbp), %rdi
leaq 0x5cc5f(%rip), %rsi     # 0x10b242
callq 0xa440
movq %rax, -0x520(%rbp)
jmp 0xae5f1
movq -0x4b0(%rbp), %rdi
movq %rdi, %rax
addq $0xc0, %rax
movq %rax, -0x530(%rbp)
addq $0xe0, %rdi
movq -0x260(%rbp), %rsi
callq 0x993b0
movq %rax, %rdi
movq -0x268(%rbp), %rsi
callq 0x145d0
movq -0x530(%rbp), %rdi
movslq (%rax), %rsi
callq 0x145f0
movq %rax, -0x528(%rbp)
jmp 0xae642
movq -0x520(%rbp), %rdi
movq -0x528(%rbp), %rax
movsd (%rax), %xmm0
callq 0xa870
movq %rax, -0x538(%rbp)
jmp 0xae662
movq -0x538(%rbp), %rdi
leaq 0x7d428(%rip), %rsi     # 0x12ba98
callq 0xa440
jmp 0xae677
jmp 0xae6be
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x238(%rbp)
movl %eax, -0x23c(%rbp)
jmp 0xae93b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x238(%rbp)
movl %eax, -0x23c(%rbp)
jmp 0xae92f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x238(%rbp)
movl %eax, -0x23c(%rbp)
jmp 0xae923
jmp 0xae6c0
movq -0x268(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x268(%rbp)
jmp 0xae39d
jmp 0xae6d9
movq -0x260(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x260(%rbp)
jmp 0xae35e
movq -0x4b8(%rbp), %rsi
leaq 0x7bb6d(%rip), %rdx     # 0x12a26b
leaq -0x488(%rbp), %rdi
callq 0xaf4b0
jmp 0xae70c
leaq -0x468(%rbp), %rdi
leaq -0x488(%rbp), %rsi
movl $0x10, %edx
callq 0xa890
jmp 0xae726
leaq -0x488(%rbp), %rdi
callq 0xa8d8
movq -0x4b0(%rbp), %rax
addq $0x88, %rax
movq %rax, -0x490(%rbp)
movq -0x490(%rbp), %rdi
callq 0xaf180
movq %rax, -0x498(%rbp)
movq -0x490(%rbp), %rdi
callq 0xaf1b0
movq %rax, -0x4a0(%rbp)
leaq -0x498(%rbp), %rdi
leaq -0x4a0(%rbp), %rsi
callq 0xaf530
testb $0x1, %al
jne 0xae788
jmp 0xae8d4
leaq -0x498(%rbp), %rdi
callq 0xaf570
movq %rax, -0x4a8(%rbp)
movq -0x4a8(%rbp), %rdi
callq 0xaf590
movq %rax, -0x540(%rbp)
jmp 0xae7b0
movq -0x540(%rbp), %rax
movl (%rax), %esi
leaq -0x468(%rbp), %rdi
callq 0xa790
movq %rax, -0x548(%rbp)
jmp 0xae7ce
movq -0x548(%rbp), %rdi
leaq 0x5ca66(%rip), %rsi     # 0x10b242
callq 0xa440
movq %rax, -0x550(%rbp)
jmp 0xae7ea
movq -0x4a8(%rbp), %rdi
callq 0xaf5a0
movq %rax, -0x558(%rbp)
jmp 0xae7ff
movq -0x550(%rbp), %rdi
movq -0x558(%rbp), %rax
movl (%rax), %esi
callq 0xa790
movq %rax, -0x560(%rbp)
jmp 0xae81d
movq -0x560(%rbp), %rdi
leaq 0x5ca17(%rip), %rsi     # 0x10b242
callq 0xa440
movq %rax, -0x568(%rbp)
jmp 0xae839
movq -0x4a8(%rbp), %rdi
callq 0xaf5c0
movq %rax, -0x570(%rbp)
jmp 0xae84e
movq -0x568(%rbp), %rdi
movq -0x570(%rbp), %rax
movsd (%rax), %xmm0
callq 0xa870
movq %rax, -0x578(%rbp)
jmp 0xae86e
movq -0x578(%rbp), %rdi
movl $0xa, %esi
callq 0xa520
jmp 0xae881
jmp 0xae883
leaq -0x498(%rbp), %rdi
callq 0xaf5e0
jmp 0xae76c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x238(%rbp)
movl %eax, -0x23c(%rbp)
leaq -0x488(%rbp), %rdi
callq 0xa8d8
jmp 0xae923
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x238(%rbp)
movl %eax, -0x23c(%rbp)
leaq -0x468(%rbp), %rdi
callq 0xa670
jmp 0xae923
movq -0x4b0(%rbp), %rdi
movsd -0x218(%rbp), %xmm0
callq 0xac460
jmp 0xae8ea
leaq -0x468(%rbp), %rdi
callq 0xa670
leaq -0x258(%rbp), %rdi
callq 0xffe0
leaq -0x230(%rbp), %rdi
callq 0xffe0
leaq -0x210(%rbp), %rdi
callq 0xa670
addq $0x580, %rsp            # imm = 0x580
popq %rbp
retq
leaq -0x258(%rbp), %rdi
callq 0xffe0
leaq -0x230(%rbp), %rdi
callq 0xffe0
leaq -0x210(%rbp), %rdi
callq 0xa670
movq -0x238(%rbp), %rdi
callq 0xa7c0
nopw %cs:(%rax,%rax)