// File: robertomaldonado[P]HypercubeTopologyRouting/transformations.cpp
// Function: map_to_bin_str[abi:cxx11](std::map<int, std::vector<int, std::allocator<int>>, std::less<int>, std::allocator<std::pair<int const, std::vector<int, std::allocator<int>>>>>&, int)
std::string map_to_bin_str(std::map<int, std::vector<int> > &nodes_map , int n_size){
    int bit_size = log2(n_size); //Stores how many bits long is each node 
    std::string output = "";
    //For each node in the map, print it with the corresponding neighbors
    for(std::map<int,std::vector<int> >::iterator nodes_map_it = nodes_map.begin(); nodes_map_it != nodes_map.end(); ++nodes_map_it){
        //Print the current node in binary
        output += int_to_bin_str( bit_size, nodes_map_it->first);
        output += ": ";
        //Print the neighbors in binary of the current node
        for( std::vector<int>::iterator nei_it = nodes_map_it->second.begin(); nei_it != nodes_map_it->second.end(); ++nei_it){
            output += int_to_bin_str( bit_size, *nei_it);
            if(nei_it+1 != nodes_map_it->second.end() )
                output += " ";
        }
        output += "\n";
    }
    return output;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0xb0(%rbp)
movq %rdi, %rax
movq %rax, -0xb8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl -0x14(%rbp), %edi
callq 0x39c0
cvttsd2si %xmm0, %eax
movl %eax, -0x18(%rbp)
movb $0x0, -0x19(%rbp)
leaq -0x1a(%rbp), %rdi
movq %rdi, -0xa8(%rbp)
callq 0x22a0
movq -0xb0(%rbp), %rdi
movq -0xa8(%rbp), %rdx
leaq 0x2904(%rip), %rsi      # 0xb0c3
callq 0x2200
jmp 0x87c6
leaq -0x1a(%rbp), %rdi
callq 0x21e0
movq -0x10(%rbp), %rdi
callq 0x4160
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
callq 0x6620
movq %rax, -0x40(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x9040
testb $0x1, %al
jne 0x87ff
jmp 0x89d7
movl -0x18(%rbp), %eax
movl %eax, -0xbc(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x9070
movl -0xbc(%rbp), %esi
movl (%rax), %edx
leaq -0x60(%rbp), %rdi
callq 0x8a20
jmp 0x8824
movq -0xb0(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x21f0
jmp 0x8836
leaq -0x60(%rbp), %rdi
callq 0x2120
movq -0xb0(%rbp), %rdi
leaq 0x287f(%rip), %rsi      # 0xb0cc
callq 0x2190
jmp 0x8854
leaq -0x38(%rbp), %rdi
callq 0x9070
movq %rax, %rdi
addq $0x8, %rdi
callq 0x5310
movq %rax, -0x68(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x9070
movq %rax, %rdi
addq $0x8, %rdi
callq 0x51a0
movq %rax, -0x70(%rbp)
leaq -0x68(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x90a0
testb $0x1, %al
jne 0x889c
jmp 0x89b2
movl -0x18(%rbp), %eax
movl %eax, -0xc0(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x90e0
movl -0xc0(%rbp), %esi
movl (%rax), %edx
leaq -0x90(%rbp), %rdi
callq 0x8a20
jmp 0x88c4
movq -0xb0(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x21f0
jmp 0x88d9
leaq -0x90(%rbp), %rdi
callq 0x2120
leaq -0x68(%rbp), %rdi
movl $0x1, %esi
callq 0x7c20
movq %rax, -0x98(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x9070
movq %rax, %rdi
addq $0x8, %rdi
callq 0x51a0
movq %rax, -0xa0(%rbp)
leaq -0x98(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x90a0
testb $0x1, %al
jne 0x892f
jmp 0x89a2
movq -0xb0(%rbp), %rdi
leaq 0x27c1(%rip), %rsi      # 0xb0fe
callq 0x2190
jmp 0x8944
jmp 0x89a2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x1a(%rbp), %rdi
callq 0x21e0
jmp 0x8a09
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x89fd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x2120
jmp 0x89fd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x2120
jmp 0x89fd
jmp 0x89a4
leaq -0x68(%rbp), %rdi
callq 0x9100
jmp 0x886d
movq -0xb0(%rbp), %rdi
leaq 0x2702(%rip), %rsi      # 0xb0c2
callq 0x2190
jmp 0x89c7
jmp 0x89c9
leaq -0x38(%rbp), %rdi
callq 0x7440
jmp 0x87dc
movb $0x1, -0x19(%rbp)
testb $0x1, -0x19(%rbp)
jne 0x89ed
movq -0xb0(%rbp), %rdi
callq 0x2120
movq -0xb8(%rbp), %rax
addq $0xc0, %rsp
popq %rbp
retq
movq -0xb0(%rbp), %rdi
callq 0x2120
movq -0x28(%rbp), %rdi
callq 0x2290
nopw %cs:(%rax,%rax)