// File: grame-cncm[P]digraph/tests.cpp
// Function: test14(std::ostream&)
void test14(std::ostream& ss)
{
    // roots and leaves
    digraph<char, int> h;
    h.add('A', 'B', 0).add('B', 'C', 0).add('C', 'D', 0).add('B', 'G', 1).add('C', 'B', 1);
    h.add('E', 'F', 0).add('F', 'G', 0).add('G', 'H', 0).add('G', 'F', 2);

    ss << "graph h   : " << h << std::endl;
    ss << dfcyclesschedule(h) << ", cost: " << schedulingcost(h, dfcyclesschedule(h)) << std::endl;
}

// Assembly:
subq $0x178, %rsp            # imm = 0x178
movq %rdi, 0x170(%rsp)
leaq 0x160(%rsp), %rdi
movq %rdi, 0x68(%rsp)
callq 0x24270
movq 0x68(%rsp), %rdi
movb $0x41, 0x15f(%rsp)
movb $0x42, 0x15e(%rsp)
movl $0x0, 0x158(%rsp)
leaq 0x15f(%rsp), %rsi
leaq 0x15e(%rsp), %rdx
leaq 0x158(%rsp), %rcx
callq 0x242b0
movq %rax, 0x70(%rsp)
jmp 0x22bf5
movq 0x70(%rsp), %rdi
movb $0x42, 0x14b(%rsp)
movb $0x43, 0x14a(%rsp)
movl $0x0, 0x144(%rsp)
leaq 0x14b(%rsp), %rsi
leaq 0x14a(%rsp), %rdx
leaq 0x144(%rsp), %rcx
callq 0x242b0
movq %rax, 0x60(%rsp)
jmp 0x22c39
movq 0x60(%rsp), %rdi
movb $0x43, 0x143(%rsp)
movb $0x44, 0x142(%rsp)
movl $0x0, 0x13c(%rsp)
leaq 0x143(%rsp), %rsi
leaq 0x142(%rsp), %rdx
leaq 0x13c(%rsp), %rcx
callq 0x242b0
movq %rax, 0x58(%rsp)
jmp 0x22c7d
movq 0x58(%rsp), %rdi
movb $0x42, 0x13b(%rsp)
movb $0x47, 0x13a(%rsp)
movl $0x1, 0x134(%rsp)
leaq 0x13b(%rsp), %rsi
leaq 0x13a(%rsp), %rdx
leaq 0x134(%rsp), %rcx
callq 0x242b0
movq %rax, 0x50(%rsp)
jmp 0x22cc1
movq 0x50(%rsp), %rdi
movb $0x43, 0x133(%rsp)
movb $0x42, 0x132(%rsp)
movl $0x1, 0x12c(%rsp)
leaq 0x133(%rsp), %rsi
leaq 0x132(%rsp), %rdx
leaq 0x12c(%rsp), %rcx
callq 0x242b0
jmp 0x22d00
movb $0x45, 0x12b(%rsp)
movb $0x46, 0x12a(%rsp)
movl $0x0, 0x124(%rsp)
leaq 0x160(%rsp), %rdi
leaq 0x12b(%rsp), %rsi
leaq 0x12a(%rsp), %rdx
leaq 0x124(%rsp), %rcx
callq 0x242b0
movq %rax, 0x48(%rsp)
jmp 0x22d47
movq 0x48(%rsp), %rdi
movb $0x46, 0x123(%rsp)
movb $0x47, 0x122(%rsp)
movl $0x0, 0x11c(%rsp)
leaq 0x123(%rsp), %rsi
leaq 0x122(%rsp), %rdx
leaq 0x11c(%rsp), %rcx
callq 0x242b0
movq %rax, 0x40(%rsp)
jmp 0x22d8b
movq 0x40(%rsp), %rdi
movb $0x47, 0x11b(%rsp)
movb $0x48, 0x11a(%rsp)
movl $0x0, 0x114(%rsp)
leaq 0x11b(%rsp), %rsi
leaq 0x11a(%rsp), %rdx
leaq 0x114(%rsp), %rcx
callq 0x242b0
movq %rax, 0x38(%rsp)
jmp 0x22dcf
movq 0x38(%rsp), %rdi
movb $0x47, 0x113(%rsp)
movb $0x46, 0x112(%rsp)
movl $0x2, 0x10c(%rsp)
leaq 0x113(%rsp), %rsi
leaq 0x112(%rsp), %rdx
leaq 0x10c(%rsp), %rcx
callq 0x242b0
jmp 0x22e0e
movq 0x170(%rsp), %rdi
leaq 0x1be06(%rip), %rsi     # 0x3ec23
callq 0x2180
movq %rax, 0x30(%rsp)
jmp 0x22e29
movq 0x30(%rsp), %rdi
leaq 0x160(%rsp), %rsi
callq 0x24300
movq %rax, 0x28(%rsp)
jmp 0x22e42
movq 0x28(%rsp), %rdi
movq 0x3316a(%rip), %rsi     # 0x55fb8
callq 0x21b0
jmp 0x22e55
movq 0x170(%rsp), %rax
movq %rax, 0x20(%rsp)
leaq 0xc0(%rsp), %rdi
leaq 0x160(%rsp), %rsi
callq 0x27ac0
jmp 0x22e79
movq 0x20(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
callq 0x27470
movq %rax, 0x18(%rsp)
jmp 0x22e92
movq 0x18(%rsp), %rdi
leaq 0x1bdac(%rip), %rsi     # 0x3ec4a
callq 0x2180
movq %rax, 0x10(%rsp)
jmp 0x22eaa
leaq 0x78(%rsp), %rdi
leaq 0x160(%rsp), %rsi
callq 0x27ac0
jmp 0x22ebe
leaq 0x160(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x27800
movl %eax, 0xc(%rsp)
jmp 0x22ed6
movl 0xc(%rsp), %esi
movq 0x10(%rsp), %rdi
callq 0x2280
movq %rax, (%rsp)
jmp 0x22eea
movq (%rsp), %rdi
movq 0x330c3(%rip), %rsi     # 0x55fb8
callq 0x21b0
jmp 0x22efc
leaq 0x78(%rsp), %rdi
callq 0x27930
leaq 0xc0(%rsp), %rdi
callq 0x27930
leaq 0x160(%rsp), %rdi
callq 0x24610
addq $0x178, %rsp            # imm = 0x178
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x150(%rsp)
movl %eax, 0x14c(%rsp)
jmp 0x22f7f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x150(%rsp)
movl %eax, 0x14c(%rsp)
jmp 0x22f72
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x150(%rsp)
movl %eax, 0x14c(%rsp)
leaq 0x78(%rsp), %rdi
callq 0x27930
leaq 0xc0(%rsp), %rdi
callq 0x27930
leaq 0x160(%rsp), %rdi
callq 0x24610
movq 0x150(%rsp), %rdi
callq 0x2290
nopl (%rax)