// File: robertomaldonado[P]HypercubeTopologyRouting/links.cpp
// Function: create_map(std::map<int, std::vector<int, std::allocator<int>>, std::less<int>, std::allocator<std::pair<int const, std::vector<int, std::allocator<int>>>>>&)
void create_map(  map<int, vector<int> > &nodes_map){

    vector<int> vector_nodes;
    vector<int> x_ors;
    vector<int> tmp_neighbors;

    //Initialize the vector for nodes
    for(int i=0; i < total_nodes; i++)
        vector_nodes.push_back(i);
    //Initialize the bits to Xor against
    int last_bit = 1;
    for(int i=0; i < bits_for_node; i++){
        x_ors.push_back(last_bit);
        last_bit = last_bit << 1;
    }
    //For each node, get the neighbors
    for(int j=0; j < vector_nodes.size(); j++){
        //Generate the neighbors
        for(int i=0; i < x_ors.size(); i++)
            tmp_neighbors.push_back( vector_nodes[j]^x_ors[i] );
        //Add node and neigborg to map
        nodes_map[ vector_nodes[j] ] = tmp_neighbors;
        tmp_neighbors.clear();
    }
    vector_nodes.clear();
    x_ors.clear();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x3a30
leaq -0x38(%rbp), %rdi
callq 0x3a30
leaq -0x50(%rbp), %rdi
callq 0x3a30
movl $0x0, -0x54(%rbp)
movl -0x54(%rbp), %eax
cmpl 0xd14e(%rip), %eax      # 0x10198
jge 0x3094
leaq -0x20(%rbp), %rdi
leaq -0x54(%rbp), %rsi
callq 0x3a50
jmp 0x305b
jmp 0x305d
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x3041
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x3dd0
leaq -0x38(%rbp), %rdi
callq 0x3dd0
leaq -0x20(%rbp), %rdi
callq 0x3dd0
jmp 0x31fe
movl $0x1, -0x68(%rbp)
movl $0x0, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
cmpl 0xd0f1(%rip), %eax      # 0x1019c
jge 0x30cf
leaq -0x38(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x3a50
jmp 0x30bc
movl -0x68(%rbp), %eax
shll %eax
movl %eax, -0x68(%rbp)
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x30a2
movl $0x0, -0x70(%rbp)
movslq -0x70(%rbp), %rax
movq %rax, -0x80(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x42b0
movq %rax, %rcx
movq -0x80(%rbp), %rax
cmpq %rcx, %rax
jae 0x31c8
movl $0x0, -0x74(%rbp)
movslq -0x74(%rbp), %rax
movq %rax, -0x88(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x42b0
movq %rax, %rcx
movq -0x88(%rbp), %rax
cmpq %rcx, %rax
jae 0x316f
movslq -0x70(%rbp), %rsi
leaq -0x20(%rbp), %rdi
callq 0x42d0
movl (%rax), %eax
movl %eax, -0x8c(%rbp)
movslq -0x74(%rbp), %rsi
leaq -0x38(%rbp), %rdi
callq 0x42d0
movq %rax, %rcx
movl -0x8c(%rbp), %eax
movl (%rcx), %ecx
xorl %ecx, %eax
movl %eax, -0x78(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x44c0
jmp 0x3162
jmp 0x3164
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
jmp 0x30fe
movq -0x8(%rbp), %rax
movq %rax, -0xa0(%rbp)
movslq -0x70(%rbp), %rsi
leaq -0x20(%rbp), %rdi
callq 0x42d0
movq -0xa0(%rbp), %rdi
movq %rax, %rsi
callq 0x41d0
movq %rax, -0x98(%rbp)
jmp 0x319f
movq -0x98(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x3f10
jmp 0x31b1
leaq -0x50(%rbp), %rdi
callq 0x44f0
movl -0x70(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x70(%rbp)
jmp 0x30d6
leaq -0x20(%rbp), %rdi
callq 0x44f0
leaq -0x38(%rbp), %rdi
callq 0x44f0
leaq -0x50(%rbp), %rdi
callq 0x3dd0
leaq -0x38(%rbp), %rdi
callq 0x3dd0
leaq -0x20(%rbp), %rdi
callq 0x3dd0
addq $0xa0, %rsp
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0x2290
nopw (%rax,%rax)