#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 *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main(void) {
  int number = 10;
  int next_number = 12;
  float new_number;
  printf("%d\n", next_number);
  printf("%d\n", number);
  printf("%d\n", number + next_number);
  printf("Enter a new number: ");
  scanf("%d", &new_number);
  int a[10];
  int i;
  for (i = 0; i < 12; ++i) {
    a[i] = i;
  }
  for (i = 0; i < 10; ++i) {
    printf("%d\n", a[i]);
    if (i == 5) {
      printf("hey it's a four\n");
    }
  }
  printf("Number Entered was %d\n", new_number);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0xc,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xef5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xee4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
add    -0xc(%rbp),%esi
lea    0xed0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe8d(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0x44(%rbp)
cmpl   $0xc,-0x44(%rbp)
jge    11bb <main+0x9b>
mov    -0x44(%rbp),%ecx
movslq -0x44(%rbp),%rax
mov    %ecx,-0x40(%rbp,%rax,4)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1198 <main+0x78>
movl   $0x0,-0x44(%rbp)
cmpl   $0xa,-0x44(%rbp)
jge    120d <main+0xed>
movslq -0x44(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%esi
lea    0xe61(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x5,-0x44(%rbp)
jne    11fa <main+0xda>
lea    0xe25(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ff <main+0xdf>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    11c2 <main+0xa2>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe0c(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xeef(%rip),%rbx
mov    %rbx,%rdi
mov    $0xc,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x16,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe90(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe97(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe49(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
xor    %eax,%eax
call   1040 <printf@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xde0(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [21 x i8] c"Enter a new number: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [17 x i8] c"hey it's a four\0A\00"
@.str.4 = [23 x i8] c"Number Entered was %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = alloca [10 x i32]
%6 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 12, i32* %3
%7 = load i32, i32* %3
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = add nsw i32 %11, %12
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %4)
store i32 0, i32* %6
br label %17
17: ; preds = %25, %0
%18 = load i32, i32* %6
%19 = icmp slt i32 %18, 12
br i1 %19, label %20, label %28
20: ; preds = %17
%21 = load i32, i32* %6
%22 = load i32, i32* %6
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 %23
store i32 %21, i32* %24
br label %25
25: ; preds = %20
%26 = load i32, i32* %6
%27 = add nsw i32 %26, 1
store i32 %27, i32* %6
br label %17
28: ; preds = %17
store i32 0, i32* %6
br label %29
29: ; preds = %43, %28
%30 = load i32, i32* %6
%31 = icmp slt i32 %30, 10
br i1 %31, label %32, label %46
32: ; preds = %29
%33 = load i32, i32* %6
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 %34
%36 = load i32, i32* %35
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %36)
%38 = load i32, i32* %6
%39 = icmp eq i32 %38, 5
br i1 %39, label %40, label %42
40: ; preds = %32
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
br label %42
42: ; preds = %40, %32
br label %43
43: ; preds = %42
%44 = load i32, i32* %6
%45 = add nsw i32 %44, 1
store i32 %45, i32* %6
br label %29
46: ; preds = %29
%47 = load float, float* %4
%48 = fpext float %47 to double
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), double %48)
%50 = load i32, i32* %1
ret i32 %50
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [21 x i8] c"Enter a new number: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.4 = [23 x i8] c"Number Entered was %d\0A\00"
@str = [16 x i8] c"hey it's a four\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 12)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 10)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 22)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %1)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 5)
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 6)
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 7)
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 8)
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 9)
%19 = load float, float* %1
%20 = fpext float %19 to double
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), double %20)
ret i32 0
}