// File: /workspace/github_cpp_makefile_star2_O2/aalto-speech[P]ftk/src/MSFG.cc
// Function: MultiStringFactorGraph::write(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) const
void
MultiStringFactorGraph::write(const std::string &filename) const
{
    ofstream outfile(filename);
    if (!outfile) return;

    vector<Arc*> arcs; collect_arcs(arcs);

    outfile << nodes.size() << " " << arcs.size() << " " << string_end_nodes.size() << endl;
    for (unsigned int i=0; i<nodes.size(); i++)
        outfile << "n " << i << " " << nodes[i].factor << endl;
    for (auto it = arcs.begin(); it != arcs.end(); ++it)
        outfile << "a " << (**it).source_node << " " << (**it).target_node << endl;
    for (auto it = string_end_nodes.cbegin(); it != string_end_nodes.cend(); ++it)
        outfile << "e " << it->first << " " << it->second << endl;
    outfile.close();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
movq %rdi, %rbx
leaq -0x240(%rbp), %r14
pushq $0x10
popq %rdx
movq %r14, %rdi
callq 0x4650
movq (%r14), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x220(%rbp,%rax)
jne 0x11172
xorps %xmm0, %xmm0
leaq -0x40(%rbp), %rsi
movaps %xmm0, (%rsi)
andq $0x0, 0x10(%rsi)
movq %rbx, %rdi
callq 0x103dc
movq 0x28(%rbx), %rsi
subq 0x20(%rbx), %rsi
sarq $0x7, %rsi
leaq -0x240(%rbp), %rdi
callq 0x4250
leaq 0x1237c(%rip), %rsi     # 0x23368
movq %rax, %rdi
callq 0x4340
movq -0x38(%rbp), %rsi
subq -0x40(%rbp), %rsi
sarq $0x3, %rsi
movq %rax, %rdi
callq 0x4250
leaq 0x12359(%rip), %rsi     # 0x23368
movq %rax, %rdi
callq 0x4340
movq 0x60(%rbx), %rsi
movq %rax, %rdi
callq 0x4250
movq %rax, %rdi
callq 0x4180
xorl %r14d, %r14d
leaq 0x12704(%rip), %r15     # 0x23739
leaq -0x240(%rbp), %r12
leaq 0x12325(%rip), %r13     # 0x23368
movl %r14d, %r14d
movq 0x28(%rbx), %rax
subq 0x20(%rbx), %rax
sarq $0x7, %rax
cmpq %r14, %rax
jbe 0x11098
movq %r12, %rdi
movq %r15, %rsi
callq 0x4340
movq %rax, %rdi
movq %r14, %rsi
callq 0x4250
movq %rax, %rdi
movq %r13, %rsi
callq 0x4340
movq %r14, %rsi
shlq $0x7, %rsi
addq 0x20(%rbx), %rsi
movq %rax, %rdi
callq 0x4300
movq %rax, %rdi
callq 0x4180
incl %r14d
jmp 0x11043
movq -0x40(%rbp), %r13
leaq 0x12699(%rip), %r14     # 0x2373c
leaq -0x240(%rbp), %r15
leaq 0x122b7(%rip), %r12     # 0x23368
cmpq -0x38(%rbp), %r13
je 0x110f8
movq %r15, %rdi
movq %r14, %rsi
callq 0x4340
movq (%r13), %rcx
movl (%rcx), %esi
movq %rax, %rdi
callq 0x4250
movq %rax, %rdi
movq %r12, %rsi
callq 0x4340
movq (%r13), %rcx
movl 0x4(%rcx), %esi
movq %rax, %rdi
callq 0x4250
movq %rax, %rdi
callq 0x4180
addq $0x8, %r13
jmp 0x110b1
movq 0x50(%rbx), %r15
addq $0x40, %rbx
leaq 0x12638(%rip), %r14     # 0x2373f
leaq -0x240(%rbp), %r12
leaq 0x12253(%rip), %r13     # 0x23368
cmpq %rbx, %r15
je 0x1115d
movq %r12, %rdi
movq %r14, %rsi
callq 0x4340
leaq 0x20(%r15), %rsi
movq %rax, %rdi
callq 0x4300
movq %rax, %rdi
movq %r13, %rsi
callq 0x4340
movl 0x40(%r15), %esi
movq %rax, %rdi
callq 0x4250
movq %rax, %rdi
callq 0x4180
movq %r15, %rdi
callq 0x43b0
movq %rax, %r15
jmp 0x11115
leaq -0x240(%rbp), %rdi
callq 0x4470
leaq -0x40(%rbp), %rdi
callq 0x12b1e
leaq -0x240(%rbp), %rdi
callq 0x44c0
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x11196
jmp 0x11196
jmp 0x11196
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x12b1e
leaq -0x240(%rbp), %rdi
callq 0x44c0
movq %rbx, %rdi
callq 0x45f0