#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*/ getBin(int, char *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *args[]) {
  int a = 0;
  int b = 10;
  for (int c = 0; c <= b; c++) {
    char str[6];
    a = c;
    printf("a is now: %i \n\n", a);
    getBin(a, str);
    printf("%i as INT \t %x as HEX \t %s as BIN \n", a, a, str);
    a <<= 1;
    printf("shifted a left\n");
    getBin(a, str);
    printf("%i as INT \t %x as HEX \t %s as BIN \n", a, a, str);
    a <<= 1;
    printf("shifted a left\n");
    getBin(a, str);
    printf("%i as INT \t %x as HEX \t %s as BIN \n", a, a, str);
    a <<= 1;
    printf("shifted a left\n");
    getBin(a, str);
    printf("%i as INT \t %x as HEX \t %s as BIN \n", a, a, str);
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0xa,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jg     125f <main+0x13f>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%edi
lea    -0x22(%rbp),%rsi
call   1040 <getBin@plt>
mov    -0x14(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    -0x22(%rbp),%rcx
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x14(%rbp)
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%edi
lea    -0x22(%rbp),%rsi
call   1040 <getBin@plt>
mov    -0x14(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    -0x22(%rbp),%rcx
lea    0xe4a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x14(%rbp)
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%edi
lea    -0x22(%rbp),%rsi
call   1040 <getBin@plt>
mov    -0x14(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    -0x22(%rbp),%rcx
lea    0xe0f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x14(%rbp)
lea    0xe1c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%edi
lea    -0x22(%rbp),%rsi
call   1040 <getBin@plt>
mov    -0x14(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    -0x22(%rbp),%rcx
lea    0xdd4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdc4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    114b <main+0x2b>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %ebx,%ebx
xor    %r14d,%r14d
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
nop
lea    0xe99(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r12d,%edi
lea    0x2(%rsp),%r15
mov    %r15,%rsi
call   1060 <getBin@plt>
lea    0xe88(%rip),%rdi
mov    %r12d,%esi
mov    %r12d,%edx
mov    %r15,%rcx
mov    %r15,%r13
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe92(%rip),%rdi
call   1040 <puts@plt>
mov    %r14d,%edi
mov    %r15,%rsi
call   1060 <getBin@plt>
lea    0xe57(%rip),%r15
mov    %r15,%rdi
mov    %r14d,%esi
mov    %r14d,%edx
mov    %r13,%rcx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe61(%rip),%rdi
call   1040 <puts@plt>
mov    %ebx,%edi
mov    %r13,%rsi
call   1060 <getBin@plt>
mov    %r15,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
mov    %r13,%rcx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe3a(%rip),%rdi
call   1040 <puts@plt>
mov    %ebp,%edi
mov    %r13,%rsi
call   1060 <getBin@plt>
mov    %r15,%rdi
mov    %ebp,%esi
mov    %ebp,%edx
mov    %r13,%rcx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r12d
add    $0x2,%r14d
add    $0x4,%ebx
add    $0x8,%ebp
cmp    $0xb,%r12d
jne    1160 <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 = [16 x i8] c"a is now: %i \0A\0A\00"
@.str.1 = [36 x i8] c"%i as INT \09 %x as HEX \09 %s as BIN \0A\00"
@.str.2 = [16 x i8] c"shifted a left\0A\00"
@.str.3 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [6 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 10, i32* %7
store i32 0, i32* %8
br label %10
10: ; preds = %56, %2
%11 = load i32, i32* %8
%12 = load i32, i32* %7
%13 = icmp sle i32 %11, %12
br i1 %13, label %14, label %59
14: ; preds = %10
%15 = load i32, i32* %8
store i32 %15, i32* %6
%16 = load i32, i32* %6
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %16)
%18 = load i32, i32* %6
%19 = getelementptr inbounds [6 x i8], [6 x i8]* %9, i64 0, i64 0
%20 = call i32 @getBin(i32 %18, i8* %19)
%21 = load i32, i32* %6
%22 = load i32, i32* %6
%23 = getelementptr inbounds [6 x i8], [6 x i8]* %9, i64 0, i64 0
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 %21, i32 %22, i8* %23)
%25 = load i32, i32* %6
%26 = shl i32 %25, 1
store i32 %26, i32* %6
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%28 = load i32, i32* %6
%29 = getelementptr inbounds [6 x i8], [6 x i8]* %9, i64 0, i64 0
%30 = call i32 @getBin(i32 %28, i8* %29)
%31 = load i32, i32* %6
%32 = load i32, i32* %6
%33 = getelementptr inbounds [6 x i8], [6 x i8]* %9, i64 0, i64 0
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 %31, i32 %32, i8* %33)
%35 = load i32, i32* %6
%36 = shl i32 %35, 1
store i32 %36, i32* %6
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%38 = load i32, i32* %6
%39 = getelementptr inbounds [6 x i8], [6 x i8]* %9, i64 0, i64 0
%40 = call i32 @getBin(i32 %38, i8* %39)
%41 = load i32, i32* %6
%42 = load i32, i32* %6
%43 = getelementptr inbounds [6 x i8], [6 x i8]* %9, i64 0, i64 0
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 %41, i32 %42, i8* %43)
%45 = load i32, i32* %6
%46 = shl i32 %45, 1
store i32 %46, i32* %6
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%48 = load i32, i32* %6
%49 = getelementptr inbounds [6 x i8], [6 x i8]* %9, i64 0, i64 0
%50 = call i32 @getBin(i32 %48, i8* %49)
%51 = load i32, i32* %6
%52 = load i32, i32* %6
%53 = getelementptr inbounds [6 x i8], [6 x i8]* %9, i64 0, i64 0
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 %51, i32 %52, i8* %53)
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %56
56: ; preds = %14
%57 = load i32, i32* %8
%58 = add nsw i32 %57, 1
store i32 %58, i32* %8
br label %10
59: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"a is now: %i \0A\0A\00"
@.str.1 = [36 x i8] c"%i as INT \09 %x as HEX \09 %s as BIN \0A\00"
@str.5 = [15 x i8] c"shifted a left\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [6 x i8]
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
br label %6
5: ; preds = %6
ret i32 0
6: ; preds = %2, %6
%7 = phi i32 [ 0, %2 ], [ %24, %6 ]
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 @getBin(i32 %7, i8* %4)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %7, i8* %4)
%11 = shl nuw nsw i32 %7, 1
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.5, i64 0, i64 0))
%13 = call i32 @getBin(i32 %11, i8* %4)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 %11, i32 %11, i8* %4)
%15 = shl nuw nsw i32 %7, 2
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.5, i64 0, i64 0))
%17 = call i32 @getBin(i32 %15, i8* %4)
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 %15, i32 %15, i8* %4)
%19 = shl nuw nsw i32 %7, 3
%20 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.5, i64 0, i64 0))
%21 = call i32 @getBin(i32 %19, i8* %4)
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 %19, i32 %19, i8* %4)
%23 = call i32 @putchar(i32 10)
%24 = add nuw nsw i32 %7, 1
%25 = icmp eq i32 %24, 11
br i1 %25, label %5, label %6
}