// File: grame-cncm[P]digraph/tests.cpp
// Function: test15(std::ostream&)
void test15(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('D', 'U', 0).add('U', 'D', 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 << "deep-first    : " << dfcyclesschedule(h) << ", cost: " << schedulingcost(h, dfcyclesschedule(h))
       << std::endl;
    ss << "breadth-first : " << bfcyclesschedule(h) << ", cost: " << schedulingcost(h, bfcyclesschedule(h))
       << std::endl;
}

// Assembly:
subq $0x248, %rsp            # imm = 0x248
movq %rdi, 0x240(%rsp)
leaq 0x230(%rsp), %rdi
movq %rdi, 0x98(%rsp)
callq 0x24270
movq 0x98(%rsp), %rdi
movb $0x41, 0x22f(%rsp)
movb $0x42, 0x22e(%rsp)
movl $0x0, 0x228(%rsp)
leaq 0x22f(%rsp), %rsi
leaq 0x22e(%rsp), %rdx
leaq 0x228(%rsp), %rcx
callq 0x242b0
movq %rax, 0xa0(%rsp)
jmp 0x2333e
movq 0xa0(%rsp), %rdi
movb $0x42, 0x21b(%rsp)
movb $0x43, 0x21a(%rsp)
movl $0x0, 0x214(%rsp)
leaq 0x21b(%rsp), %rsi
leaq 0x21a(%rsp), %rdx
leaq 0x214(%rsp), %rcx
callq 0x242b0
movq %rax, 0x90(%rsp)
jmp 0x23388
movq 0x90(%rsp), %rdi
movb $0x43, 0x213(%rsp)
movb $0x44, 0x212(%rsp)
movl $0x0, 0x20c(%rsp)
leaq 0x213(%rsp), %rsi
leaq 0x212(%rsp), %rdx
leaq 0x20c(%rsp), %rcx
callq 0x242b0
movq %rax, 0x88(%rsp)
jmp 0x233d2
movq 0x88(%rsp), %rdi
movb $0x42, 0x20b(%rsp)
movb $0x47, 0x20a(%rsp)
movl $0x1, 0x204(%rsp)
leaq 0x20b(%rsp), %rsi
leaq 0x20a(%rsp), %rdx
leaq 0x204(%rsp), %rcx
callq 0x242b0
movq %rax, 0x80(%rsp)
jmp 0x2341c
movq 0x80(%rsp), %rdi
movb $0x43, 0x203(%rsp)
movb $0x42, 0x202(%rsp)
movl $0x1, 0x1fc(%rsp)
leaq 0x203(%rsp), %rsi
leaq 0x202(%rsp), %rdx
leaq 0x1fc(%rsp), %rcx
callq 0x242b0
jmp 0x2345e
movb $0x44, 0x1fb(%rsp)
movb $0x55, 0x1fa(%rsp)
movl $0x0, 0x1f4(%rsp)
leaq 0x230(%rsp), %rdi
leaq 0x1fb(%rsp), %rsi
leaq 0x1fa(%rsp), %rdx
leaq 0x1f4(%rsp), %rcx
callq 0x242b0
movq %rax, 0x78(%rsp)
jmp 0x234a5
movq 0x78(%rsp), %rdi
movb $0x55, 0x1f3(%rsp)
movb $0x44, 0x1f2(%rsp)
movl $0x1, 0x1ec(%rsp)
leaq 0x1f3(%rsp), %rsi
leaq 0x1f2(%rsp), %rdx
leaq 0x1ec(%rsp), %rcx
callq 0x242b0
jmp 0x234e4
movb $0x45, 0x1eb(%rsp)
movb $0x46, 0x1ea(%rsp)
movl $0x0, 0x1e4(%rsp)
leaq 0x230(%rsp), %rdi
leaq 0x1eb(%rsp), %rsi
leaq 0x1ea(%rsp), %rdx
leaq 0x1e4(%rsp), %rcx
callq 0x242b0
movq %rax, 0x70(%rsp)
jmp 0x2352b
movq 0x70(%rsp), %rdi
movb $0x46, 0x1e3(%rsp)
movb $0x47, 0x1e2(%rsp)
movl $0x0, 0x1dc(%rsp)
leaq 0x1e3(%rsp), %rsi
leaq 0x1e2(%rsp), %rdx
leaq 0x1dc(%rsp), %rcx
callq 0x242b0
movq %rax, 0x68(%rsp)
jmp 0x2356f
movq 0x68(%rsp), %rdi
movb $0x47, 0x1db(%rsp)
movb $0x48, 0x1da(%rsp)
movl $0x0, 0x1d4(%rsp)
leaq 0x1db(%rsp), %rsi
leaq 0x1da(%rsp), %rdx
leaq 0x1d4(%rsp), %rcx
callq 0x242b0
movq %rax, 0x60(%rsp)
jmp 0x235b3
movq 0x60(%rsp), %rdi
movb $0x47, 0x1d3(%rsp)
movb $0x46, 0x1d2(%rsp)
movl $0x2, 0x1cc(%rsp)
leaq 0x1d3(%rsp), %rsi
leaq 0x1d2(%rsp), %rdx
leaq 0x1cc(%rsp), %rcx
callq 0x242b0
jmp 0x235f2
movq 0x240(%rsp), %rdi
leaq 0x1b622(%rip), %rsi     # 0x3ec23
callq 0x2180
movq %rax, 0x58(%rsp)
jmp 0x2360d
movq 0x58(%rsp), %rdi
leaq 0x230(%rsp), %rsi
callq 0x24300
movq %rax, 0x50(%rsp)
jmp 0x23626
movq 0x50(%rsp), %rdi
movq 0x32986(%rip), %rsi     # 0x55fb8
callq 0x21b0
jmp 0x23639
movq 0x240(%rsp), %rdi
leaq 0x1b7df(%rip), %rsi     # 0x3ee27
callq 0x2180
movq %rax, 0x48(%rsp)
jmp 0x23654
leaq 0x180(%rsp), %rdi
leaq 0x230(%rsp), %rsi
callq 0x27ac0
jmp 0x2366b
movq 0x48(%rsp), %rdi
leaq 0x180(%rsp), %rsi
callq 0x27470
movq %rax, 0x40(%rsp)
jmp 0x23684
movq 0x40(%rsp), %rdi
leaq 0x1b5ba(%rip), %rsi     # 0x3ec4a
callq 0x2180
movq %rax, 0x38(%rsp)
jmp 0x2369c
leaq 0x138(%rsp), %rdi
leaq 0x230(%rsp), %rsi
callq 0x27ac0
jmp 0x236b3
leaq 0x230(%rsp), %rdi
leaq 0x138(%rsp), %rsi
callq 0x27800
movl %eax, 0x34(%rsp)
jmp 0x236ce
movl 0x34(%rsp), %esi
movq 0x38(%rsp), %rdi
callq 0x2280
movq %rax, 0x28(%rsp)
jmp 0x236e3
movq 0x28(%rsp), %rdi
movq 0x328c9(%rip), %rsi     # 0x55fb8
callq 0x21b0
jmp 0x236f6
leaq 0x138(%rsp), %rdi
callq 0x27930
leaq 0x180(%rsp), %rdi
callq 0x27930
movq 0x240(%rsp), %rdi
leaq 0x1b719(%rip), %rsi     # 0x3ee38
callq 0x2180
movq %rax, 0x20(%rsp)
jmp 0x2372b
leaq 0xf0(%rsp), %rdi
leaq 0x230(%rsp), %rsi
callq 0x27cf0
jmp 0x23742
movq 0x20(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
callq 0x27470
movq %rax, 0x18(%rsp)
jmp 0x2375b
movq 0x18(%rsp), %rdi
leaq 0x1b4e3(%rip), %rsi     # 0x3ec4a
callq 0x2180
movq %rax, 0x10(%rsp)
jmp 0x23773
leaq 0xa8(%rsp), %rdi
leaq 0x230(%rsp), %rsi
callq 0x27cf0
jmp 0x2378a
leaq 0x230(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0x27800
movl %eax, 0xc(%rsp)
jmp 0x237a5
movl 0xc(%rsp), %esi
movq 0x10(%rsp), %rdi
callq 0x2280
movq %rax, (%rsp)
jmp 0x237b9
movq (%rsp), %rdi
movq 0x327f4(%rip), %rsi     # 0x55fb8
callq 0x21b0
jmp 0x237cb
leaq 0xa8(%rsp), %rdi
callq 0x27930
leaq 0xf0(%rsp), %rdi
callq 0x27930
leaq 0x230(%rsp), %rdi
callq 0x24610
addq $0x248, %rsp            # imm = 0x248
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x220(%rsp)
movl %eax, 0x21c(%rsp)
jmp 0x2389d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x220(%rsp)
movl %eax, 0x21c(%rsp)
jmp 0x2384a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x220(%rsp)
movl %eax, 0x21c(%rsp)
leaq 0x138(%rsp), %rdi
callq 0x27930
leaq 0x180(%rsp), %rdi
callq 0x27930
jmp 0x2389d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x220(%rsp)
movl %eax, 0x21c(%rsp)
jmp 0x23890
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x220(%rsp)
movl %eax, 0x21c(%rsp)
leaq 0xa8(%rsp), %rdi
callq 0x27930
leaq 0xf0(%rsp), %rdi
callq 0x27930
leaq 0x230(%rsp), %rdi
callq 0x24610
movq 0x220(%rsp), %rdi
callq 0x2290
nopw (%rax,%rax)