#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef unsigned int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long long, int /*<<< orphan*/,
                          unsigned int, unsigned int, unsigned int);
int /*<<< orphan*/ uint64_to_binary(unsigned int);
int main() {
  uint64_t result;
  unsigned size, length, rotation, e;
  for (size = 2; size <= 64; size *= 2)
    for (length = 1; length < size; ++length) {
      result = 0xffffffffffffffffULL >> (64 - length);
      for (e = size; e < 64; e *= 2)
        result |= result << e;
      for (rotation = 0; rotation < size; ++rotation) {
        printf("0x%016llx %s (size=%u, length=%u, rotation=%u)\n",
               (unsigned long long)result, uint64_to_binary(result), size,
               length, rotation);
        result = (result >> 63) | (result << 1);
      }
    }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0xc(%rbp)
cmpl   $0x40,-0xc(%rbp)
ja     1220 <main+0x100>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    120d <main+0xed>
mov    $0x40,%eax
sub    -0x10(%rbp),%eax
mov    %eax,%eax
mov    %eax,%ecx
mov    $0xffffffffffffffff,%rax
shr    %cl,%rax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x40,-0x18(%rbp)
jae    1198 <main+0x78>
mov    -0x8(%rbp),%eax
mov    -0x18(%rbp),%ecx
shl    %cl,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x18(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1172 <main+0x52>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    11fa <main+0xda>
mov    -0x8(%rbp),%eax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <uint64_to_binary@plt>
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0x14(%rbp),%r9d
lea    0xe2e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    $0x3f,%ecx
shr    %cl,%eax
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    119f <main+0x7f>
jmp    11ff <main+0xdf>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1147 <main+0x27>
jmp    1212 <main+0xf2>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    $0x2,%r12d
lea    0xec8(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %r12d,%r13d
mov    $0x1,%r15d
nopl   0x0(%rax)
mov    %r15d,%ecx
neg    %cl
mov    $0xffffffffffffffff,%rax
shr    %cl,%rax
mov    %r12d,%ecx
cmp    $0x3f,%r12d
ja     1180 <main+0x60>
nopl   0x0(%rax,%rax,1)
mov    %eax,%edx
shl    %cl,%edx
or     %edx,%eax
lea    (%rcx,%rcx,1),%edx
cmp    $0x20,%ecx
mov    %edx,%ecx
jb     1170 <main+0x50>
mov    %eax,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ebx,%edi
call   1040 <uint64_to_binary@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
mov    %r12d,%ecx
mov    %r15d,%r8d
mov    %ebp,%r9d
call   1030 <printf@plt>
add    $0x1,%ebp
cmp    %ebp,%r12d
jne    1190 <main+0x70>
add    $0x1,%r15
cmp    %r13,%r15
jne    1150 <main+0x30>
add    %r12d,%r12d
cmp    $0x41,%r12d
jb     1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [48 x i8] c"0x%016llx %s (size=%u, length=%u, rotation=%u)\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %3
br label %7
7: ; preds = %61, %0
%8 = load i32, i32* %3
%9 = icmp ule i32 %8, 64
br i1 %9, label %10, label %64
10: ; preds = %7
store i32 1, i32* %4
br label %11
11: ; preds = %57, %10
%12 = load i32, i32* %4
%13 = load i32, i32* %3
%14 = icmp ult i32 %12, %13
br i1 %14, label %15, label %60
15: ; preds = %11
%16 = load i32, i32* %4
%17 = sub i32 64, %16
%18 = zext i32 %17 to i64
%19 = lshr i64 -1, %18
%20 = trunc i64 %19 to i32
store i32 %20, i32* %2
%21 = load i32, i32* %3
store i32 %21, i32* %6
br label %22
22: ; preds = %31, %15
%23 = load i32, i32* %6
%24 = icmp ult i32 %23, 64
br i1 %24, label %25, label %34
25: ; preds = %22
%26 = load i32, i32* %2
%27 = load i32, i32* %6
%28 = shl i32 %26, %27
%29 = load i32, i32* %2
%30 = or i32 %29, %28
store i32 %30, i32* %2
br label %31
31: ; preds = %25
%32 = load i32, i32* %6
%33 = mul i32 %32, 2
store i32 %33, i32* %6
br label %22
34: ; preds = %22
store i32 0, i32* %5
br label %35
35: ; preds = %53, %34
%36 = load i32, i32* %5
%37 = load i32, i32* %3
%38 = icmp ult i32 %36, %37
br i1 %38, label %39, label %56
39: ; preds = %35
%40 = load i32, i32* %2
%41 = zext i32 %40 to i64
%42 = load i32, i32* %2
%43 = call i32 @uint64_to_binary(i32 %42)
%44 = load i32, i32* %3
%45 = load i32, i32* %4
%46 = load i32, i32* %5
%47 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i64 %41, i32 %43, i32 %44, i32 %45, i32 %46)
%48 = load i32, i32* %2
%49 = lshr i32 %48, 63
%50 = load i32, i32* %2
%51 = shl i32 %50, 1
%52 = or i32 %49, %51
store i32 %52, i32* %2
br label %53
53: ; preds = %39
%54 = load i32, i32* %5
%55 = add i32 %54, 1
store i32 %55, i32* %5
br label %35
56: ; preds = %35
br label %57
57: ; preds = %56
%58 = load i32, i32* %4
%59 = add i32 %58, 1
store i32 %59, i32* %4
br label %11
60: ; preds = %11
br label %61
61: ; preds = %60
%62 = load i32, i32* %3
%63 = mul i32 %62, 2
store i32 %63, i32* %3
br label %7
64: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [48 x i8] c"0x%016llx %s (size=%u, length=%u, rotation=%u)\0A\00"
define i32 @main() {
br label %1
1: ; preds = %31, %0
%2 = phi i32 [ 2, %0 ], [ %32, %31 ]
%3 = icmp ult i32 %2, 64
%4 = zext i32 %2 to i64
br label %5
5: ; preds = %1, %28
%6 = phi i64 [ 1, %1 ], [ %29, %28 ]
%7 = trunc i64 %6 to i32
%8 = sub nsw i64 64, %6
%9 = and i64 %8, 4294967295
%10 = lshr i64 -1, %9
%11 = trunc i64 %10 to i32
br i1 %3, label %15, label %12
12: ; preds = %15, %5
%13 = phi i32 [ %11, %5 ], [ %19, %15 ]
%14 = zext i32 %13 to i64
br label %22
15: ; preds = %5, %15
%16 = phi i32 [ %20, %15 ], [ %2, %5 ]
%17 = phi i32 [ %19, %15 ], [ %11, %5 ]
%18 = shl i32 %17, %16
%19 = or i32 %18, %17
%20 = shl nuw nsw i32 %16, 1
%21 = icmp ult i32 %16, 32
br i1 %21, label %15, label %12
22: ; preds = %12, %22
%23 = phi i32 [ 0, %12 ], [ %26, %22 ]
%24 = tail call i32 @uint64_to_binary(i32 %13)
%25 = tail call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i64 %14, i32 %24, i32 %2, i32 %7, i32 %23)
%26 = add nuw i32 %23, 1
%27 = icmp eq i32 %26, %2
br i1 %27, label %28, label %22
28: ; preds = %22
%29 = add nuw nsw i64 %6, 1
%30 = icmp eq i64 %29, %4
br i1 %30, label %31, label %5
31: ; preds = %28
%32 = shl i32 %2, 1
%33 = icmp ult i32 %32, 65
br i1 %33, label %1, label %34
34: ; preds = %31
ret i32 0
}