// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x468, %rsp            # imm = 0x468
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x268(%rsp), %rdi
movl $0x10, %edx
callq 0x9710
movq 0x30(%rbx), %rax
movq 0x68(%rax), %rsi
movl 0x70(%rax), %edx
leaq 0x50(%rsp), %rdi
callq 0x3ca09
movq 0x38(%rbx), %rax
movq 0x68(%rax), %rsi
movl 0x70(%rax), %edx
leaq 0x38(%rsp), %rdi
callq 0x3ca09
movq %r14, 0x28(%rsp)
movq 0xe0(%rbx), %rax
movq 0xe8(%rbx), %rcx
cmpq %rax, %rcx
je 0x358c0
xorpd %xmm1, %xmm1
xorl %r14d, %r14d
leaq 0x26b27(%rip), %r12     # 0x5c262
xorpd %xmm0, %xmm0
movsd %xmm0, (%rsp)
leaq (%r14,%r14,2), %r15
movq (%rax,%r15,8), %rdx
cmpq %rdx, 0x8(%rax,%r15,8)
je 0x3589a
xorl %r13d, %r13d
movslq (%rdx,%r13,4), %rcx
cmpq $-0x1, %rcx
je 0x35877
testl %ecx, %ecx
js 0x35a58
cmpq %rcx, 0xc8(%rbx)
jle 0x35a58
movq 0xc0(%rbx), %rdx
movsd (%rdx,%rcx,8), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x35877
cmpq %rcx, 0x100(%rbx)
jle 0x35a58
movq 0xf8(%rbx), %rax
mulsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x30(%rsp)
movq 0x50(%rsp), %rax
movq (%rax,%r14,8), %rax
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
leaq 0x268(%rsp), %rdi
callq 0x93b0
movq %rax, %rbp
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x93b0
movq 0x38(%rsp), %rax
movq (%rax,%r13,8), %rax
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
movq %rbp, %rdi
callq 0x93b0
movq %rax, %rbp
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x93b0
movq 0xe0(%rbx), %rax
movq (%rax,%r15,8), %rax
movslq (%rax,%r13,4), %rax
testq %rax, %rax
js 0x35a58
cmpq %rax, 0xc8(%rbx)
jle 0x35a58
movq 0xc0(%rbx), %rcx
movsd (%rcx,%rax,8), %xmm0
movq %rbp, %rdi
callq 0x9570
movl $0x1, %edx
movq %rax, %rdi
leaq 0x39401(%rip), %rsi     # 0x6ec58
callq 0x93b0
movsd (%rsp), %xmm0
addsd 0x30(%rsp), %xmm0
movsd %xmm0, (%rsp)
movq 0xe0(%rbx), %rax
xorpd %xmm1, %xmm1
incq %r13
movq (%rax,%r15,8), %rdx
movq 0x8(%rax,%r15,8), %rcx
subq %rdx, %rcx
sarq $0x2, %rcx
cmpq %rcx, %r13
jb 0x3575a
movq 0xe8(%rbx), %rcx
incq %r14
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rsi # imm = 0xAAAAAAAAAAAAAAAB
imulq %rsi, %rdx
cmpq %rdx, %r14
jb 0x35744
jmp 0x358c9
xorpd %xmm0, %xmm0
movsd %xmm0, (%rsp)
leaq 0x18(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x28(%rsp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %rdi
callq 0xda46
leaq 0x38605(%rip), %rsi     # 0x6def7
leaq 0x8(%rsp), %rdi
callq 0x9700
leaq 0x68(%rsp), %rdi
leaq 0x8(%rsp), %rsi
movl $0x10, %edx
callq 0x9710
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x35927
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x9350
movq 0x88(%rbx), %rbp
movq 0x90(%rbx), %r14
cmpq %r14, %rbp
je 0x359af
leaq 0x26921(%rip), %r15     # 0x5c262
leaq 0x8(%rsp), %r12
movl (%rbp), %esi
leaq 0x68(%rsp), %rdi
callq 0x9650
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x93b0
movl 0x4(%rbp), %esi
movq %r13, %rdi
callq 0x9650
movq %rax, %r13
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x93b0
movsd 0x8(%rbp), %xmm0
movq %r13, %rdi
callq 0x9570
movb $0xa, 0x8(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x93b0
addq $0x10, %rbp
cmpq %r14, %rbp
jne 0x35946
movq %rbx, %rdi
movsd (%rsp), %xmm0
callq 0x33c98
movq 0x505dd(%rip), %rax     # 0x85fa0
movq (%rax), %rbx
movq 0x18(%rax), %r14
leaq 0x70(%rsp), %rdi
movq %rbx, -0x8(%rdi)
movq -0x18(%rbx), %rax
movq %r14, 0x68(%rsp,%rax)
callq 0x92d0
leaq 0x160(%rsp), %rdi
callq 0x9110
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x35a05
movq 0x48(%rsp), %rsi
subq %rdi, %rsi
callq 0x9350
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x35a1c
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x9350
leaq 0x270(%rsp), %rdi
movq %rbx, -0x8(%rdi)
movq -0x18(%rbx), %rax
movq %r14, 0x268(%rsp,%rax)
callq 0x92d0
leaq 0x360(%rsp), %rdi
callq 0x9110
addq $0x468, %rsp            # imm = 0x468
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x277e6(%rip), %rdi     # 0x5d245
leaq 0x277fc(%rip), %rsi     # 0x5d262
leaq 0x27818(%rip), %rcx     # 0x5d285
movl $0x1a9, %edx            # imm = 0x1A9
callq 0x9200
jmp 0x35aa3
jmp 0x35a7b
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x35ab5
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x9350
jmp 0x35ab5
jmp 0x35ab2
movq %rax, %rbx
jmp 0x35acc
movq %rax, %rbx
jmp 0x35ae3
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x9510
jmp 0x35ab5
movq %rax, %rbx
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x35acc
movq 0x48(%rsp), %rsi
subq %rdi, %rsi
callq 0x9350
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x35ae3
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x9350
leaq 0x268(%rsp), %rdi
callq 0x9510
movq %rbx, %rdi
callq 0x9680