// File: /workspace/github_cpp_makefile_star2_O1/robertomaldonado[P]HypercubeTopologyRouting/transformations.cpp
// Function: int_to_bin_str[abi:cxx11](int, int)
std::string int_to_bin_str(int bit_size, int node){
    int tmp_count = 0;
    std::vector<bool> node_bits;
    std::string output_str = "";
    output_str += std::to_string(node) + "(";
    //Keep adding the bits based on the parity of bits
    while(node != 0){
        if( (node % 2) == 0 ){
            node_bits.push_back(0); node = floor(node/2);
        }else{
            node_bits.push_back(1); node = floor(node/2);
        }
    }
    //Push into the vector of node_bits
    tmp_count = node_bits.size();
    while(  tmp_count < bit_size ){
        node_bits.push_back(0);
        tmp_count++;
    }
    //Add the bits to the output string
    for(int i = node_bits.size()-1; i >= 0; i--)
        output_str += std::to_string(node_bits[i]);
    output_str += ")";

    return output_str;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movl %edx, %r15d
movl %esi, %r14d
xorl %eax, %eax
movq %rax, -0x58(%rbp)
movl %eax, -0x50(%rbp)
movq %rax, -0x48(%rbp)
movl %eax, -0x40(%rbp)
movq %rax, -0x38(%rbp)
leaq 0x10(%rdi), %rbx
movq %rbx, (%rdi)
leaq 0x19bc(%rip), %rdx      # 0x60a9
movq %rdi, -0x30(%rbp)
movq %rdx, %rsi
callq 0x4cd8
movl %r15d, %r12d
negl %r12d
cmovsl %r15d, %r12d
movl $0x1, %r13d
cmpl $0xa, %r12d
jb 0x4759
movl $0x4, %r13d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %r12d, %ecx
cmpl $0x63, %ecx
jbe 0x4750
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x4756
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x4759
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r13d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x471d
addl $-0x3, %r13d
jmp 0x4759
addl $-0x2, %r13d
jmp 0x4759
decl %r13d
movq %rbx, -0x80(%rbp)
movl %r15d, %ebx
shrl $0x1f, %ebx
leal (%rbx,%r13), %esi
leaq -0x90(%rbp), %rax
movq %rax, -0x10(%rax)
leaq -0xa0(%rbp), %rdi
movl $0x2d, %edx
callq 0x21d0
movl %ebx, %edi
leaq -0xa0(%rbp), %rbx
addq (%rbx), %rdi
movl %r13d, %esi
movl %r12d, %edx
callq 0x4c66
leaq 0x1a27(%rip), %rsi      # 0x61c8
movq %rbx, %rdi
callq 0x22b0
leaq -0x68(%rbp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x47cd
movq %rdx, -0x78(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x68(%rbp)
jmp 0x47d5
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
movq %rdx, -0x70(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x78(%rbp), %rsi
movq -0x70(%rbp), %rdx
movq -0x30(%rbp), %rdi
callq 0x20a0
movq -0x78(%rbp), %rdi
cmpq %r13, %rdi
je 0x480b
callq 0x2180
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rax
cmpq %rax, %rdi
je 0x4823
callq 0x2180
testl %r15d, %r15d
je 0x4861
leaq -0x58(%rbp), %r12
testb $0x1, %r15b
jne 0x4841
movq %r12, %rdi
xorl %esi, %esi
callq 0x4c12
sarl %r15d
jmp 0x485c
movq %r12, %rdi
movl $0x1, %esi
callq 0x4c12
movl %r15d, %eax
shrl $0x1f, %eax
addl %r15d, %eax
sarl %eax
movl %eax, %r15d
testl %r15d, %r15d
jne 0x482c
movl -0x48(%rbp), %r12d
subl -0x58(%rbp), %r12d
shll $0x3, %r12d
addl -0x40(%rbp), %r12d
cmpl %r14d, %r12d
jge 0x488c
leaq -0x58(%rbp), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x4c12
incl %r12d
cmpl %r14d, %r12d
jl 0x487a
movq -0x58(%rbp), %rax
movq -0x48(%rbp), %rcx
movl -0x40(%rbp), %edx
movl %ecx, %esi
subl %eax, %esi
leal (%rdx,%rsi,8), %esi
decl %esi
js 0x4919
leal (%rdx,%rcx,8), %r15d
shll $0x3, %eax
subl %eax, %r15d
movl %esi, %r12d
leaq -0x78(%rbp), %r14
movq -0x58(%rbp), %rax
movq %r12, %rcx
shrq $0x6, %rcx
movq (%rax,%rcx,8), %rbx
movq %r13, -0x78(%rbp)
movl $0x1, %esi
movq %r14, %rdi
movl $0x2d, %edx
callq 0x21d0
xorl %edx, %edx
btq %r12, %rbx
setb %dl
movq -0x78(%rbp), %rdi
movl $0x1, %esi
callq 0x4c66
movq -0x78(%rbp), %rsi
movq -0x70(%rbp), %rdx
movq -0x30(%rbp), %rdi
callq 0x20a0
movq -0x78(%rbp), %rdi
cmpq %r13, %rdi
je 0x490e
callq 0x2180
decl %r15d
decq %r12
testl %r15d, %r15d
jg 0x48b3
leaq 0x18aa(%rip), %rsi      # 0x61ca
movq -0x30(%rbp), %rdi
callq 0x22b0
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
je 0x494b
callq 0x2180
xorl %eax, %eax
movq %rax, -0x58(%rbp)
movl %eax, -0x50(%rbp)
movq %rax, -0x48(%rbp)
movl %eax, -0x40(%rbp)
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x49a9
movq %rax, %r14
movq -0x78(%rbp), %rdi
cmpq %r13, %rdi
je 0x4976
callq 0x2180
jmp 0x4976
movq %rax, %r14
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rax
cmpq %rax, %rdi
jne 0x49a2
jmp 0x49ac
jmp 0x49a9
movq %rax, %r14
jmp 0x49be
jmp 0x49a9
jmp 0x49a9
movq %rax, %r14
movq -0x78(%rbp), %rdi
cmpq %r13, %rdi
je 0x49ac
callq 0x2180
jmp 0x49ac
movq %rax, %r14
movq -0x30(%rbp), %rax
movq (%rax), %rdi
cmpq -0x80(%rbp), %rdi
je 0x49be
callq 0x2180
movq -0x58(%rbp), %rdi
testq %rdi, %rdi
je 0x49e0
callq 0x2180
xorl %eax, %eax
movq %rax, -0x58(%rbp)
movl %eax, -0x50(%rbp)
movq %rax, -0x48(%rbp)
movl %eax, -0x40(%rbp)
movq %rax, -0x38(%rbp)
movq %r14, %rdi
callq 0x2280