// File: ldionne[P]hawick_circuits/hawick_circuits.cpp
// Function: void build_graph<boost::directed_graph<boost::no_property, boost::no_property, boost::no_property>, std::istream_iterator<unsigned int, char, std::char_traits<char>, long>>(boost::directed_graph<boost::no_property, boost::no_property, boost::no_property>&, unsigned int, std::istream_iterator<unsigned int, char, std::char_traits<char>, long>, std::istream_iterator<unsigned int, char, std::char_traits<char>, long>)
void build_graph(Graph& graph, unsigned int const nvertices,
                 VertexPairIterator first, VertexPairIterator last) {
    typedef boost::graph_traits<Graph> Traits;
    typedef typename Traits::vertex_descriptor vertex_descriptor;
    std::map<unsigned int, vertex_descriptor> vertices;

    for (unsigned int i = 0; i < nvertices; ++i)
        vertices[i] = add_vertex(graph);

    for (; first != last; ++first) {
        unsigned int u = *first++;

        BOOST_ASSERT_MSG(first != last,
            "there is a lonely vertex at the end of the edge list");

        unsigned int v = *first;

        BOOST_ASSERT_MSG(vertices.count(u) == 1 && vertices.count(v) == 1,
            "specified a vertex over the number of vertices in the graph");

        add_edge(vertices[u], vertices[v], graph);
    }
    BOOST_ASSERT(num_vertices(graph) == nvertices);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movq %rdx, -0xb0(%rbp)
movq %rcx, -0xa8(%rbp)
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x5a10
movl $0x0, -0x54(%rbp)
movl -0x54(%rbp), %eax
cmpl -0xc(%rbp), %eax
jae 0x382e
movq -0x8(%rbp), %rdi
callq 0x5a30
movq %rax, -0xb8(%rbp)
jmp 0x37e2
leaq -0x50(%rbp), %rdi
leaq -0x54(%rbp), %rsi
callq 0x5a50
movq %rax, -0xc0(%rbp)
jmp 0x37f8
movq -0xc0(%rbp), %rax
movq -0xb8(%rbp), %rcx
movq %rcx, (%rax)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x37c8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x5cb0
jmp 0x3a6a
jmp 0x3830
movq -0xa8(%rbp), %rsi
movq -0xb0(%rbp), %rdi
callq 0x5b30
movb %al, -0xc1(%rbp)
jmp 0x384b
movb -0xc1(%rbp), %al
testb $0x1, %al
jne 0x385a
jmp 0x3a16
movq -0xb0(%rbp), %rsi
leaq -0x78(%rbp), %rdi
xorl %edx, %edx
callq 0x5b60
jmp 0x386e
leaq -0x78(%rbp), %rdi
callq 0x5ba0
movq %rax, -0xd0(%rbp)
jmp 0x3880
movq -0xa8(%rbp), %rsi
movq -0xb0(%rbp), %rdi
movq -0xd0(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x68(%rbp)
callq 0x5b30
movb %al, -0xd1(%rbp)
jmp 0x38a7
movb -0xd1(%rbp), %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0xd2(%rbp)
jne 0x38bc
jmp 0x38c6
movb $0x1, %al
movb %al, -0xd2(%rbp)
jmp 0x38c6
movb -0xd2(%rbp), %al
testb $0x1, %al
jne 0x38d2
jmp 0x38d4
jmp 0x38f3
leaq 0xb7d4(%rip), %rdi      # 0xf0af
leaq 0xb817(%rip), %rsi      # 0xf0f9
movl $0x44, %edx
leaq 0xb81f(%rip), %rcx      # 0xf10d
callq 0x3150
movq -0xb0(%rbp), %rdi
callq 0x5ba0
movq %rax, -0xe0(%rbp)
jmp 0x3908
movq -0xe0(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x7c(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x5bc0
movq %rax, -0xe8(%rbp)
jmp 0x392a
movq -0xe8(%rbp), %rcx
xorl %eax, %eax
cmpq $0x1, %rcx
movb %al, -0xe9(%rbp)
jne 0x3974
leaq -0x50(%rbp), %rdi
leaq -0x7c(%rbp), %rsi
callq 0x5bc0
movq %rax, -0xf8(%rbp)
jmp 0x3955
movq -0xf8(%rbp), %rcx
xorl %eax, %eax
cmpq $0x1, %rcx
movb %al, -0xe9(%rbp)
jne 0x3974
movb $0x1, %al
movb %al, -0xe9(%rbp)
jmp 0x3974
movb -0xe9(%rbp), %al
testb $0x1, %al
jne 0x3980
jmp 0x3982
jmp 0x39a1
leaq 0xb872(%rip), %rdi      # 0xf1fb
leaq 0xb769(%rip), %rsi      # 0xf0f9
movl $0x49, %edx
leaq 0xb771(%rip), %rcx      # 0xf10d
callq 0x3150
leaq -0x50(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x5a50
movq %rax, -0x100(%rbp)
jmp 0x39b7
movq -0x100(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x110(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0x7c(%rbp), %rsi
callq 0x5a50
movq %rax, -0x108(%rbp)
jmp 0x39de
movq -0x110(%rbp), %rsi
movq -0x108(%rbp), %rax
movq (%rax), %rdx
movq -0x8(%rbp), %rcx
leaq -0xa0(%rbp), %rdi
callq 0x5c20
jmp 0x3a01
jmp 0x3a03
movq -0xb0(%rbp), %rdi
callq 0x5c60
jmp 0x3a11
jmp 0x3830
movq -0x8(%rbp), %rdi
callq 0x5c90
movq %rax, -0x118(%rbp)
jmp 0x3a28
movq -0x118(%rbp), %rax
movl -0xc(%rbp), %ecx
cmpq %rcx, %rax
jne 0x3a39
jmp 0x3a58
leaq 0xb82f(%rip), %rdi      # 0xf26f
leaq 0xb6b2(%rip), %rsi      # 0xf0f9
movl $0x4d, %edx
leaq 0xb6ba(%rip), %rcx      # 0xf10d
callq 0x3150
leaq -0x50(%rbp), %rdi
callq 0x5cb0
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0x32e0
nopw %cs:(%rax,%rax)
nopl (%rax)