// File: /workspace/github_cpp_makefile_star2_O1/grame-cncm[P]digraph/./dglib/digraphop.hh
// Function: digraph<digraph<char, int>, int> mapnodes<digraph<char, int>, digraph<char, int>, int>(digraph<digraph<char, int>, int> const&, std::function<digraph<char, int> (digraph<char, int> const&)>)
inline digraph<M, A> mapnodes(const digraph<N, A>& g, std::function<M(const N&)> foo)
{
    digraph<M, A>  r;
    std::map<N, M> cache;
    // create a new graph with the transformed nodes
    for (const auto& n1 : g.nodes()) {
        M n2 = foo(n1);
        r.add(n2);
        cache.insert(std::make_pair(n1, n2));
    }

    // copy the connections
    for (const auto& n : g.nodes()) {
        for (const auto& cnx : g.connections(n)) {
            r.add(cache[n], cache[cnx.first], cnx.second);
        }
    }
    return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
callq 0x186c4
leaq 0x60(%rsp), %rax
movl $0x0, (%rax)
xorl %ecx, %ecx
movq %rcx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rcx, 0x20(%rax)
movq %r14, (%rsp)
movq (%r14), %r13
movq 0x18(%r13), %r12
addq $0x8, %r13
cmpq %r13, %r12
je 0x15483
leaq 0x38(%rsp), %rbp
cmpq $0x0, 0x10(%r15)
je 0x15539
leaq 0x20(%r12), %r14
leaq 0x8(%rsp), %rdi
movq %r15, %rsi
movq %r14, %rdx
callq *0x18(%r15)
movq 0x8(%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x18(%rsp)
movq %rax, 0x20(%rsp)
testq %rax, %rax
je 0x15409
movq 0x12bcd(%rip), %rcx     # 0x27fc8
cmpb $0x0, (%rcx)
je 0x15405
incl 0x8(%rax)
jmp 0x15409
lock
incl 0x8(%rax)
movq %rbx, %rdi
leaq 0x18(%rsp), %rsi
callq 0x18716
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x15425
callq 0x35d6
movq %rbp, %rdi
movq %r14, %rsi
leaq 0x8(%rsp), %rdx
callq 0x19986
leaq 0x58(%rsp), %rdi
movq %rbp, %rsi
callq 0x197cc
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x15451
callq 0x35d6
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x15460
callq 0x35d6
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x1546f
callq 0x35d6
movq %r12, %rdi
callq 0x21b0
movq %rax, %r12
cmpq %r13, %rax
jne 0x153bc
movq (%rsp), %rax
movq (%rax), %rcx
movq 0x18(%rcx), %rax
addq $0x8, %rcx
movq %rcx, 0x28(%rsp)
cmpq %rcx, %rax
je 0x1551a
leaq 0x58(%rsp), %r12
movq %rax, 0x30(%rsp)
leaq 0x20(%rax), %r13
movq (%rsp), %rax
movq (%rax), %rdi
addq $0x30, %rdi
movq %r13, %rsi
callq 0x19588
movq %rax, %rbp
movq 0x18(%rax), %r14
addq $0x8, %rbp
cmpq %rbp, %r14
je 0x15509
movq %r12, %rdi
movq %r13, %rsi
callq 0x19766
movq %rax, %r15
leaq 0x20(%r14), %rsi
movq %r12, %rdi
callq 0x19766
leaq 0x30(%r14), %rcx
movq (%rbx), %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x1911e
movq %r14, %rdi
callq 0x21b0
movq %rax, %r14
cmpq %rbp, %rax
jne 0x154cd
movq 0x30(%rsp), %rdi
callq 0x21b0
cmpq 0x28(%rsp), %rax
jne 0x154a1
leaq 0x58(%rsp), %rdi
callq 0x19bf4
movq %rbx, %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x2090
jmp 0x15576
jmp 0x15576
movq %rax, %r14
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x15563
callq 0x35d6
jmp 0x15563
movq %rax, %r14
leaq 0x38(%rsp), %rdi
callq 0x19742
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x15579
callq 0x35d6
jmp 0x15579
jmp 0x15576
movq %rax, %r14
leaq 0x58(%rsp), %rdi
callq 0x19bf4
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x15591
callq 0x35d6
movq %r14, %rdi
callq 0x2250
nop