#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 */

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printBinary(unsigned long long int n) {
  int i = 0;
  while (i < 64) {
    if (n & 1)
      printf("1");
    else
      printf("0");
    if (i % 4 == 3)
      printf(" ");
    n >>= 1;
    i++;
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printBinary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x40,-0xc(%rbp)
jge    1196 <printBinary+0x86>
mov    -0x8(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     1150 <printBinary+0x40>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
jmp    115c <printBinary+0x4c>
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x3,%edx
jne    117c <printBinary+0x6c>
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <printBinary+0x13>
lea    0xe69(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printBinary>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %ebp,%ebp
jmp    112b <printBinary+0x1b>
nopw   0x0(%rax,%rax,1)
shr    %rbx
add    $0x1,%ebp
cmp    $0x40,%ebp
je     114c <printBinary+0x3c>
mov    %ebx,%edi
and    $0x1,%edi
or     $0x30,%edi
call   1030 <putchar@plt>
mov    %ebp,%eax
not    %eax
test   $0x3,%al
jne    1120 <printBinary+0x10>
mov    $0x20,%edi
call   1030 <putchar@plt>
jmp    1120 <printBinary+0x10>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"1\00"
@.str.1 = [2 x i8] c"0\00"
@.str.2 = [2 x i8] c" \00"
@.str.3 = [2 x i8] c"\0A\00"
define void @printBinary(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
store i32 0, i32* %3
br label %4
4: ; preds = %21, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 64
br i1 %6, label %7, label %26
7: ; preds = %4
%8 = load i64, i64* %2
%9 = and i64 %8, 1
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %15
13: ; preds = %7
%14 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %13, %11
%16 = load i32, i32* %3
%17 = srem i32 %16, 4
%18 = icmp eq i32 %17, 3
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %21
21: ; preds = %19, %15
%22 = load i64, i64* %2
%23 = lshr i64 %22, 1
store i64 %23, i64* %2
%24 = load i32, i32* %3
%25 = add nsw i32 %24, 1
store i32 %25, i32* %3
br label %4
26: ; preds = %4
%27 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @printBinary(i64 %0) {
br label %2
2: ; preds = %1, %13
%3 = phi i32 [ 0, %1 ], [ %15, %13 ]
%4 = phi i64 [ %0, %1 ], [ %14, %13 ]
%5 = and i64 %4, 1
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i32 48, i32 49
%8 = tail call i32 @putchar(i32 %7)
%9 = and i32 %3, 3
%10 = icmp eq i32 %9, 3
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = tail call i32 @putchar(i32 32)
br label %13
13: ; preds = %11, %2
%14 = lshr i64 %4, 1
%15 = add nuw nsw i32 %3, 1
%16 = icmp eq i32 %15, 64
br i1 %16, label %17, label %2
17: ; preds = %13
%18 = tail call i32 @putchar(i32 10)
ret void
}