// File: /workspace/github_cpp_makefile_star2_O3/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, -0x78(%rbp)
movl %eax, -0x70(%rbp)
movq %rax, -0x68(%rbp)
movl %eax, -0x60(%rbp)
movq %rax, -0x58(%rbp)
leaq 0x10(%rdi), %rbx
movq %rbx, (%rdi)
leaq 0xad4(%rip), %rdx       # 0x50a9
movq %rdi, -0x30(%rbp)
movq %rdx, %rsi
callq 0x4b7e
movl %r15d, %r12d
negl %r12d
cmovsl %r15d, %r12d
movl $0x1, %r13d
cmpl $0xa, %r12d
jb 0x4641
movl $0x4, %r13d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %r12d, %ecx
cmpl $0x63, %ecx
jbe 0x4638
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x463e
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x4641
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r13d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x4605
addl $-0x3, %r13d
jmp 0x4641
addl $-0x2, %r13d
jmp 0x4641
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 0x4b0c
leaq 0xb3f(%rip), %rsi       # 0x51c8
movq %rbx, %rdi
callq 0x22b0
leaq -0x40(%rbp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x46b5
movq %rdx, -0x50(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x40(%rbp)
jmp 0x46bd
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
movq %rdx, -0x48(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq -0x30(%rbp), %rdi
callq 0x20a0
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
je 0x46f3
callq 0x2180
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rax
cmpq %rax, %rdi
je 0x470b
callq 0x2180
testl %r15d, %r15d
je 0x4749
leaq -0x78(%rbp), %r12
testb $0x1, %r15b
jne 0x4729
movq %r12, %rdi
xorl %esi, %esi
callq 0x4ab8
sarl %r15d
jmp 0x4744
movq %r12, %rdi
movl $0x1, %esi
callq 0x4ab8
movl %r15d, %eax
shrl $0x1f, %eax
addl %r15d, %eax
sarl %eax
movl %eax, %r15d
testl %r15d, %r15d
jne 0x4714
movl -0x68(%rbp), %r12d
subl -0x78(%rbp), %r12d
shll $0x3, %r12d
addl -0x60(%rbp), %r12d
cmpl %r14d, %r12d
jge 0x4784
leaq -0x78(%rbp), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x4ab8
incl %r12d
cmpl %r14d, %r12d
jl 0x4762
movl -0x68(%rbp), %r12d
subl -0x78(%rbp), %r12d
shll $0x3, %r12d
addl -0x60(%rbp), %r12d
movl %r12d, %eax
decl %eax
js 0x47f1
leaq -0x50(%rbp), %r14
decl %r12d
movq -0x78(%rbp), %rax
movl %r12d, %ecx
shrl $0x6, %ecx
movq (%rax,%rcx,8), %rbx
movq %r13, -0x50(%rbp)
movl $0x1, %esi
movq %r14, %rdi
movl $0x2d, %edx
callq 0x21d0
xorl %edx, %edx
btq %r12, %rbx
setb %dl
movq -0x50(%rbp), %rdi
movl $0x1, %esi
callq 0x4b0c
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq -0x30(%rbp), %rdi
callq 0x20a0
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
je 0x47ec
callq 0x2180
testl %r12d, %r12d
jg 0x478f
leaq 0x9d2(%rip), %rsi       # 0x51ca
movq -0x30(%rbp), %rdi
callq 0x22b0
movq -0x78(%rbp), %rdi
testq %rdi, %rdi
je 0x480f
callq 0x2180
movq -0x30(%rbp), %rax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x486d
movq %rax, %r14
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
je 0x483a
callq 0x2180
jmp 0x483a
movq %rax, %r14
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rax
cmpq %rax, %rdi
jne 0x4866
jmp 0x4870
jmp 0x486d
movq %rax, %r14
jmp 0x4882
jmp 0x486d
jmp 0x486d
movq %rax, %r14
movq -0x50(%rbp), %rdi
cmpq %r13, %rdi
je 0x4870
callq 0x2180
jmp 0x4870
movq %rax, %r14
movq -0x30(%rbp), %rax
movq (%rax), %rdi
cmpq -0x80(%rbp), %rdi
je 0x4882
callq 0x2180
movq -0x78(%rbp), %rdi
testq %rdi, %rdi
je 0x4890
callq 0x2180
movq %r14, %rdi
callq 0x2280