// File: aalto-speech[P]ftk/src/MSFG.cc
// Function: MultiStringFactorGraph::print_dot_digraph(std::ostream&)
void MultiStringFactorGraph::print_dot_digraph(ostream &fstr)
{
    fstr << "digraph {" << endl << endl;
    fstr << "\tnode [shape=ellipse,fontsize=30,fixedsize=false,width=0.95];" << endl;
    fstr << "\tedge [fontsize=12];" << endl;
    fstr << "\trankdir=LR;" << endl << endl;

    for (msfg_node_idx_t ni=0; ni<nodes.size(); ++ni) {
        fstr << "\t" << ni;
        string label = nodes[ni].factor;
        if (label == start_end_symbol && ni > 0) {
            label += " / " + reverse_string_end_nodes[ni];
            fstr << " [label=\"" << label << "\", style=filled, fillcolor=grey]" << endl;
        }
        else
            fstr << " [label=\"" << label << "\"]" << endl;
    }
    fstr << endl;

    for (msfg_node_idx_t ni=0; ni<nodes.size(); ++ni) {
        Node &nd = nodes[ni];
        for (auto ait = nd.outgoing.begin(); ait != nd.outgoing.end(); ++ait) {
            fstr << "\t" << (*ait)->source_node << " -> " << (*ait)->target_node;
            flt_type *cost = (*(*ait)).cost;
            if (cost != nullptr)
                fstr << "[label=\"" << *cost << "\"];";
            fstr << endl;
        }
    }
    fstr << "}" << endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x36ed7(%rip), %rsi     # 0x66620
callq 0x43c0
movq %rax, %rdi
movq 0x64840(%rip), %rsi     # 0x93f98
callq 0x4400
movq %rax, %rdi
movq 0x64831(%rip), %rsi     # 0x93f98
callq 0x4400
movq -0x10(%rbp), %rdi
leaq 0x36eb3(%rip), %rsi     # 0x6662a
callq 0x43c0
movq %rax, %rdi
movq 0x64812(%rip), %rsi     # 0x93f98
callq 0x4400
movq -0x10(%rbp), %rdi
leaq 0x36ed2(%rip), %rsi     # 0x66668
callq 0x43c0
movq %rax, %rdi
movq 0x647f3(%rip), %rsi     # 0x93f98
callq 0x4400
movq -0x10(%rbp), %rdi
leaq 0x36ec8(%rip), %rsi     # 0x6667d
callq 0x43c0
movq %rax, %rdi
movq 0x647d4(%rip), %rsi     # 0x93f98
callq 0x4400
movq %rax, %rdi
movq 0x647c5(%rip), %rsi     # 0x93f98
callq 0x4400
movl $0x0, -0x14(%rbp)
movq -0x90(%rbp), %rdi
movl -0x14(%rbp), %eax
movq %rax, -0x98(%rbp)
addq $0x20, %rdi
callq 0x30500
movq %rax, %rcx
movq -0x98(%rbp), %rax
cmpq %rcx, %rax
jae 0x2f9d3
movq -0x10(%rbp), %rdi
leaq 0x36cdf(%rip), %rsi     # 0x664f6
callq 0x43c0
movq %rax, %rdi
movl -0x14(%rbp), %esi
callq 0x4540
movq -0x90(%rbp), %rdi
addq $0x20, %rdi
movl -0x14(%rbp), %eax
movl %eax, %esi
callq 0x30240
movq %rax, %rsi
leaq -0x38(%rbp), %rdi
callq 0x41a0
movq -0x90(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x2cc30
testb $0x1, %al
jne 0x2f861
jmp 0x2f949
cmpl $0x0, -0x14(%rbp)
jbe 0x2f949
movq -0x90(%rbp), %rdi
addq $0x68, %rdi
leaq -0x14(%rbp), %rsi
callq 0x307c0
movq %rax, -0xa0(%rbp)
jmp 0x2f888
movq -0xa0(%rbp), %rdx
leaq 0x36eaf(%rip), %rsi     # 0x66745
leaq -0x58(%rbp), %rdi
callq 0x13840
jmp 0x2f8a1
leaq -0x38(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x44c0
jmp 0x2f8b0
leaq -0x58(%rbp), %rdi
callq 0x4828
movq -0x10(%rbp), %rdi
leaq 0x36dc6(%rip), %rsi     # 0x6668a
callq 0x43c0
movq %rax, -0xa8(%rbp)
jmp 0x2f8d2
movq -0xa8(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x4380
movq %rax, -0xb0(%rbp)
jmp 0x2f8eb
movq -0xb0(%rbp), %rdi
leaq 0x36e50(%rip), %rsi     # 0x66749
callq 0x43c0
movq %rax, -0xb8(%rbp)
jmp 0x2f907
movq -0xb8(%rbp), %rdi
movq 0x64683(%rip), %rsi     # 0x93f98
callq 0x4400
jmp 0x2f91c
jmp 0x2f9ae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0x2f9c5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x4828
jmp 0x2f9c5
movq -0x10(%rbp), %rdi
leaq 0x36d36(%rip), %rsi     # 0x6668a
callq 0x43c0
movq %rax, -0xc0(%rbp)
jmp 0x2f962
movq -0xc0(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x4380
movq %rax, -0xc8(%rbp)
jmp 0x2f97b
movq -0xc8(%rbp), %rdi
leaq 0x36d0b(%rip), %rsi     # 0x66694
callq 0x43c0
movq %rax, -0xd0(%rbp)
jmp 0x2f997
movq -0xd0(%rbp), %rdi
movq 0x645f3(%rip), %rsi     # 0x93f98
callq 0x4400
jmp 0x2f9ac
jmp 0x2f9ae
leaq -0x38(%rbp), %rdi
callq 0x4828
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x2f7df
leaq -0x38(%rbp), %rdi
callq 0x4828
jmp 0x2fb73
movq -0x10(%rbp), %rdi
movq 0x645ba(%rip), %rsi     # 0x93f98
callq 0x4400
movl $0x0, -0x68(%rbp)
movq -0x90(%rbp), %rdi
movl -0x68(%rbp), %eax
movq %rax, -0xd8(%rbp)
addq $0x20, %rdi
callq 0x30500
movq %rax, %rcx
movq -0xd8(%rbp), %rax
cmpq %rcx, %rax
jae 0x2fb4b
movq -0x90(%rbp), %rdi
addq $0x20, %rdi
movl -0x68(%rbp), %eax
movl %eax, %esi
callq 0x30240
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rdi
addq $0x50, %rdi
callq 0x30260
movq %rax, -0x78(%rbp)
movq -0x70(%rbp), %rdi
addq $0x50, %rdi
callq 0x302c0
movq %rax, -0x80(%rbp)
leaq -0x78(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x30290
testb $0x1, %al
jne 0x2fa68
jmp 0x2fb3b
movq -0x10(%rbp), %rdi
leaq 0x36a83(%rip), %rsi     # 0x664f6
callq 0x43c0
movq %rax, -0xe8(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x302f0
movq -0xe8(%rbp), %rdi
movq (%rax), %rax
movl (%rax), %esi
callq 0x4540
movq %rax, %rdi
leaq 0x36bf4(%rip), %rsi     # 0x66697
callq 0x43c0
movq %rax, -0xe0(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x302f0
movq -0xe0(%rbp), %rdi
movq (%rax), %rax
movl 0x4(%rax), %esi
callq 0x4540
leaq -0x78(%rbp), %rdi
callq 0x302f0
movq (%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x88(%rbp)
cmpq $0x0, -0x88(%rbp)
je 0x2fb1d
movq -0x10(%rbp), %rdi
leaq 0x36b95(%rip), %rsi     # 0x6668b
callq 0x43c0
movq %rax, %rdi
movq -0x88(%rbp), %rax
movsd (%rax), %xmm0
callq 0x4780
movq %rax, %rdi
leaq 0x36b84(%rip), %rsi     # 0x6669c
callq 0x43c0
movq -0x10(%rbp), %rdi
movq 0x64470(%rip), %rsi     # 0x93f98
callq 0x4400
leaq -0x78(%rbp), %rdi
callq 0x30320
jmp 0x2fa41
jmp 0x2fb3d
movl -0x68(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x68(%rbp)
jmp 0x2f9ea
movq -0x10(%rbp), %rdi
leaq 0x36b4a(%rip), %rsi     # 0x666a0
callq 0x43c0
movq %rax, %rdi
movq 0x64433(%rip), %rsi     # 0x93f98
callq 0x4400
addq $0xf0, %rsp
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0x46e0
nopl (%rax)