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

    auto h1 = cut(g, 64);     // cut vectorsize connections
    auto h2 = graph2dag(h1);  // find cycles
    auto h3 = mapnodes<digraph<char, int>, digraph<char, int>>(
        h2, [](const digraph<char, int>& gr) -> digraph<char, int> { return cut(gr, 1); });
    ss << "test3: h3= " << h3;
}

// Assembly:
subq $0x168, %rsp            # imm = 0x168
movq %rdi, 0x160(%rsp)
leaq 0x150(%rsp), %rdi
movq %rdi, 0x70(%rsp)
callq 0x24270
movq 0x70(%rsp), %rdi
movb $0x41, 0x14f(%rsp)
movb $0x42, 0x14e(%rsp)
movl $0x0, 0x148(%rsp)
leaq 0x14f(%rsp), %rsi
leaq 0x14e(%rsp), %rdx
leaq 0x148(%rsp), %rcx
callq 0x242b0
movq %rax, 0x78(%rsp)
jmp 0x1ded5
movq 0x78(%rsp), %rdi
movb $0x42, 0x13b(%rsp)
movb $0x43, 0x13a(%rsp)
movl $0x1, 0x134(%rsp)
leaq 0x13b(%rsp), %rsi
leaq 0x13a(%rsp), %rdx
leaq 0x134(%rsp), %rcx
callq 0x242b0
movq %rax, 0x68(%rsp)
jmp 0x1df19
movq 0x68(%rsp), %rdi
movb $0x43, 0x133(%rsp)
movb $0x41, 0x132(%rsp)
movl $0x0, 0x12c(%rsp)
leaq 0x133(%rsp), %rsi
leaq 0x132(%rsp), %rdx
leaq 0x12c(%rsp), %rcx
callq 0x242b0
movq %rax, 0x60(%rsp)
jmp 0x1df5d
movq 0x60(%rsp), %rdi
movb $0x44, 0x12b(%rsp)
movb $0x42, 0x12a(%rsp)
movl $0x0, 0x124(%rsp)
leaq 0x12b(%rsp), %rsi
leaq 0x12a(%rsp), %rdx
leaq 0x124(%rsp), %rcx
callq 0x242b0
movq %rax, 0x58(%rsp)
jmp 0x1dfa1
movq 0x58(%rsp), %rdi
movb $0x44, 0x123(%rsp)
movb $0x43, 0x122(%rsp)
movl $0x0, 0x11c(%rsp)
leaq 0x123(%rsp), %rsi
leaq 0x122(%rsp), %rdx
leaq 0x11c(%rsp), %rcx
callq 0x242b0
movq %rax, 0x50(%rsp)
jmp 0x1dfe5
movq 0x50(%rsp), %rdi
movb $0x44, 0x11b(%rsp)
movb $0x45, 0x11a(%rsp)
movl $0x1, 0x114(%rsp)
leaq 0x11b(%rsp), %rsi
leaq 0x11a(%rsp), %rdx
leaq 0x114(%rsp), %rcx
callq 0x242b0
movq %rax, 0x48(%rsp)
jmp 0x1e029
movq 0x48(%rsp), %rdi
movb $0x45, 0x113(%rsp)
movb $0x44, 0x112(%rsp)
movl $0x0, 0x10c(%rsp)
leaq 0x113(%rsp), %rsi
leaq 0x112(%rsp), %rdx
leaq 0x10c(%rsp), %rcx
callq 0x242b0
movq %rax, 0x40(%rsp)
jmp 0x1e06d
movq 0x40(%rsp), %rdi
movb $0x45, 0x10b(%rsp)
movb $0x46, 0x10a(%rsp)
movl $0x0, 0x104(%rsp)
leaq 0x10b(%rsp), %rsi
leaq 0x10a(%rsp), %rdx
leaq 0x104(%rsp), %rcx
callq 0x242b0
movq %rax, 0x38(%rsp)
jmp 0x1e0b1
movq 0x38(%rsp), %rdi
movb $0x46, 0x103(%rsp)
movb $0x47, 0x102(%rsp)
movl $0x0, 0xfc(%rsp)
leaq 0x103(%rsp), %rsi
leaq 0x102(%rsp), %rdx
leaq 0xfc(%rsp), %rcx
callq 0x242b0
movq %rax, 0x30(%rsp)
jmp 0x1e0f5
movq 0x30(%rsp), %rdi
movb $0x47, 0xfb(%rsp)
movb $0x46, 0xfa(%rsp)
movl $0x1, 0xf4(%rsp)
leaq 0xfb(%rsp), %rsi
leaq 0xfa(%rsp), %rdx
leaq 0xf4(%rsp), %rcx
callq 0x242b0
movq %rax, 0x28(%rsp)
jmp 0x1e139
movq 0x28(%rsp), %rdi
movb $0x48, 0xf3(%rsp)
movb $0x47, 0xf2(%rsp)
movl $0x0, 0xec(%rsp)
leaq 0xf3(%rsp), %rsi
leaq 0xf2(%rsp), %rdx
leaq 0xec(%rsp), %rcx
callq 0x242b0
movq %rax, 0x20(%rsp)
jmp 0x1e17d
movq 0x20(%rsp), %rdi
movb $0x48, 0xeb(%rsp)
movb $0x45, 0xea(%rsp)
movl $0x0, 0xe4(%rsp)
leaq 0xeb(%rsp), %rsi
leaq 0xea(%rsp), %rdx
leaq 0xe4(%rsp), %rcx
callq 0x242b0
movq %rax, 0x18(%rsp)
jmp 0x1e1c1
movq 0x18(%rsp), %rdi
movb $0x48, 0xe3(%rsp)
movb $0x48, 0xe2(%rsp)
movl $0x1, 0xdc(%rsp)
leaq 0xe3(%rsp), %rsi
leaq 0xe2(%rsp), %rdx
leaq 0xdc(%rsp), %rcx
callq 0x242b0
jmp 0x1e200
leaq 0xc8(%rsp), %rdi
leaq 0x150(%rsp), %rsi
movl $0x40, %edx
callq 0x24bc0
jmp 0x1e21c
leaq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
callq 0x24b10
jmp 0x1e233
leaq 0x88(%rsp), %rdi
movq %rdi, 0x10(%rsp)
leaq 0x87(%rsp), %rsi
callq 0x1e390
movq 0x10(%rsp), %rdx
leaq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
callq 0x24c60
jmp 0x1e269
leaq 0x88(%rsp), %rdi
callq 0x25040
movq 0x160(%rsp), %rdi
leaq 0x1fe96(%rip), %rsi     # 0x3e11b
callq 0x2180
movq %rax, 0x8(%rsp)
jmp 0x1e291
movq 0x8(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0x24810
jmp 0x1e2a5
leaq 0xa8(%rsp), %rdi
callq 0x24bb0
leaq 0xb8(%rsp), %rdi
callq 0x24bb0
leaq 0xc8(%rsp), %rdi
callq 0x24610
leaq 0x150(%rsp), %rdi
callq 0x24610
addq $0x168, %rsp            # imm = 0x168
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x140(%rsp)
movl %eax, 0x13c(%rsp)
jmp 0x1e36b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x140(%rsp)
movl %eax, 0x13c(%rsp)
jmp 0x1e35e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x140(%rsp)
movl %eax, 0x13c(%rsp)
leaq 0x88(%rsp), %rdi
callq 0x25040
jmp 0x1e351
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x140(%rsp)
movl %eax, 0x13c(%rsp)
leaq 0xa8(%rsp), %rdi
callq 0x24bb0
leaq 0xb8(%rsp), %rdi
callq 0x24bb0
leaq 0xc8(%rsp), %rdi
callq 0x24610
leaq 0x150(%rsp), %rdi
callq 0x24610
movq 0x140(%rsp), %rdi
callq 0x2290
nopw %cs:(%rax,%rax)