// File: grame-cncm[P]digraph/./dglib/digraphop.hh
// Function: std::pair<std::map<char, std::pair<std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>>>, int>, std::less<char>, std::allocator<std::pair<char const, std::pair<std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>>>, int>>>>, std::map<char, std::pair<std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>>>, int>, std::less<char>, std::allocator<std::pair<char const, std::pair<std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>>>, int>>>>> arrows<char, std::pair<std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>>>, int>>(digraph<char, std::pair<std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, int>>>, int>> const&)
inline std::pair<std::map<N, A>, std::map<N, A>> arrows(const digraph<N, A>& G)
{
    std::map<N, A> incoming;   // arrows arriving to a node
    std::map<N, A> outcoming;  // arrows departing from a node

    // Init incoming and outcoming arrows to empty
    for (const N& n : G.nodes()) {
        incoming[n]  = arrow_traits<A>::empty();
        outcoming[n] = arrow_traits<A>::empty();
    }
    // Collect incoming and outcoming arrows
    for (const N& n : G.nodes()) {
        for (const auto& c : G.connections(n)) {
            outcoming[n]      = arrow_traits<A>::combine(outcoming[n], c.second);
            incoming[c.first] = arrow_traits<A>::combine(incoming[c.first], c.second);
        }
    }
    return {incoming, outcoming};
}

// Assembly:
subq $0x228, %rsp            # imm = 0x228
movq %rdi, 0x50(%rsp)
movq %rdi, %rax
movq %rax, 0x58(%rsp)
movq %rdi, 0x220(%rsp)
movq %rsi, 0x218(%rsp)
leaq 0x1e8(%rsp), %rdi
callq 0x7c10
leaq 0x1b8(%rsp), %rdi
callq 0x7c10
movq 0x218(%rsp), %rdi
callq 0xa130
movq %rax, 0x60(%rsp)
jmp 0x16102
movq 0x60(%rsp), %rax
movq %rax, 0x1b0(%rsp)
movq 0x1b0(%rsp), %rdi
callq 0xa150
movq %rax, 0x198(%rsp)
movq 0x1b0(%rsp), %rdi
callq 0xa180
movq %rax, 0x190(%rsp)
leaq 0x198(%rsp), %rdi
leaq 0x190(%rsp), %rsi
callq 0xa1b0
testb $0x1, %al
jne 0x16157
jmp 0x16279
leaq 0x198(%rsp), %rdi
callq 0xa1d0
movq %rax, 0x188(%rsp)
leaq 0x150(%rsp), %rdi
callq 0x1c600
jmp 0x1617b
movq 0x188(%rsp), %rsi
leaq 0x1e8(%rsp), %rdi
callq 0x6710
movq %rax, 0x48(%rsp)
jmp 0x16197
movq 0x48(%rsp), %rdi
leaq 0x150(%rsp), %rsi
movq %rsi, 0x40(%rsp)
callq 0x66d0
movq 0x40(%rsp), %rdi
callq 0x2c20
leaq 0x118(%rsp), %rdi
callq 0x1c600
jmp 0x161c7
movq 0x188(%rsp), %rsi
leaq 0x1b8(%rsp), %rdi
callq 0x6710
movq %rax, 0x38(%rsp)
jmp 0x161e3
movq 0x38(%rsp), %rdi
leaq 0x118(%rsp), %rsi
callq 0x66d0
leaq 0x118(%rsp), %rdi
callq 0x2c20
leaq 0x198(%rsp), %rdi
callq 0xa350
jmp 0x16139
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1a8(%rsp)
movl %eax, 0x1a4(%rsp)
jmp 0x1650e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1a8(%rsp)
movl %eax, 0x1a4(%rsp)
leaq 0x150(%rsp), %rdi
callq 0x2c20
jmp 0x1650e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1a8(%rsp)
movl %eax, 0x1a4(%rsp)
leaq 0x118(%rsp), %rdi
callq 0x2c20
jmp 0x1650e
movq 0x218(%rsp), %rdi
callq 0xa130
movq %rax, 0x30(%rsp)
jmp 0x1628d
movq 0x30(%rsp), %rax
movq %rax, 0x110(%rsp)
movq 0x110(%rsp), %rdi
callq 0xa150
movq %rax, 0x108(%rsp)
movq 0x110(%rsp), %rdi
callq 0xa180
movq %rax, 0x100(%rsp)
leaq 0x108(%rsp), %rdi
leaq 0x100(%rsp), %rsi
callq 0xa1b0
testb $0x1, %al
jne 0x162e2
jmp 0x164cb
leaq 0x108(%rsp), %rdi
callq 0xa1d0
movq %rax, 0xf8(%rsp)
movq 0x218(%rsp), %rdi
movq 0xf8(%rsp), %rsi
callq 0xa1f0
movq %rax, 0x28(%rsp)
jmp 0x16313
movq 0x28(%rsp), %rax
movq %rax, 0xf0(%rsp)
movq 0xf0(%rsp), %rdi
callq 0xa220
movq %rax, 0xe8(%rsp)
movq 0xf0(%rsp), %rdi
callq 0xa250
movq %rax, 0xe0(%rsp)
leaq 0xe8(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
callq 0xa280
testb $0x1, %al
jne 0x16368
jmp 0x164b7
leaq 0xe8(%rsp), %rdi
callq 0xa2a0
movq %rax, 0xd8(%rsp)
movq 0xf8(%rsp), %rsi
leaq 0x1b8(%rsp), %rdi
callq 0x6710
movq %rax, 0x20(%rsp)
jmp 0x16399
movq 0x20(%rsp), %rsi
movq 0xd8(%rsp), %rdx
addq $0x8, %rdx
leaq 0xa0(%rsp), %rdi
callq 0x6240
jmp 0x163b9
movq 0xf8(%rsp), %rsi
leaq 0x1b8(%rsp), %rdi
callq 0x6710
movq %rax, 0x18(%rsp)
jmp 0x163d5
movq 0x18(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
movq %rsi, 0x8(%rsp)
callq 0x66d0
movq 0x8(%rsp), %rdi
callq 0x2c20
movq 0xd8(%rsp), %rsi
leaq 0x1e8(%rsp), %rdi
callq 0x6710
movq %rax, 0x10(%rsp)
jmp 0x16412
movq 0x10(%rsp), %rsi
movq 0xd8(%rsp), %rdx
addq $0x8, %rdx
leaq 0x68(%rsp), %rdi
callq 0x6240
jmp 0x1642f
movq 0xd8(%rsp), %rsi
leaq 0x1e8(%rsp), %rdi
callq 0x6710
movq %rax, (%rsp)
jmp 0x1644a
movq (%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x66d0
leaq 0x68(%rsp), %rdi
callq 0x2c20
leaq 0xe8(%rsp), %rdi
callq 0xa320
jmp 0x1634a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1a8(%rsp)
movl %eax, 0x1a4(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0x2c20
jmp 0x1650e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1a8(%rsp)
movl %eax, 0x1a4(%rsp)
leaq 0x68(%rsp), %rdi
callq 0x2c20
jmp 0x1650e
jmp 0x164b9
leaq 0x108(%rsp), %rdi
callq 0xa350
jmp 0x162c4
movq 0x50(%rsp), %rdi
leaq 0x1e8(%rsp), %rsi
leaq 0x1b8(%rsp), %rdx
callq 0x1c690
jmp 0x164e7
leaq 0x1b8(%rsp), %rdi
callq 0x5890
leaq 0x1e8(%rsp), %rdi
callq 0x5890
movq 0x58(%rsp), %rax
addq $0x228, %rsp            # imm = 0x228
retq
leaq 0x1b8(%rsp), %rdi
callq 0x5890
leaq 0x1e8(%rsp), %rdi
callq 0x5890
movq 0x1a8(%rsp), %rdi
callq 0x2290
nopw %cs:(%rax,%rax)
nop