#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 *, float);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int i, sum = 0, numbers[10];
  char letters[99] = "The average of the integers entered is ";
  float result;
  printf("Let's average %d itegers, shall we?\n\n", 10);
  for (i = 0; i < 10; i++) {
    printf("Enter integer #%d: ", i + 1);
    scanf("%d", &numbers[i]);
  }
  for (i = 0; i < 10; i++)
    sum += numbers[i];
  result = (float)sum / (float)10;
  i = 0;
  while (letters[i])
    printf("%c", letters[i++]);
  printf("%f\n", result);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
lea    -0xb0(%rbp),%rdi
lea    0xeb9(%rip),%rsi
mov    $0x63,%edx
call   1040 <memcpy@plt>
lea    0xf0b(%rip),%rdi
movss  0xe90(%rip),%xmm0
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    11c5 <main+0x95>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
cvtsi2ss %eax,%xmm0
lea    0xf02(%rip),%rdi
call   1030 <printf@plt>
movslq -0x8(%rbp),%rax
lea    -0x40(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xefb(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    117c <main+0x4c>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    11f2 <main+0xc2>
movslq -0x8(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11cc <main+0x9c>
cvtsi2ssl -0xc(%rbp),%xmm0
movss  0xe01(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0xb4(%rbp)
ff
movl   $0x0,-0x8(%rbp)
movslq -0x8(%rbp),%rax
cmpb   $0x0,-0xb0(%rbp,%rax,1)
je     124d <main+0x11d>
movslq -0x8(%rbp),%rax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
movsbl -0xb0(%rbp,%rax,1),%eax
ff
cvtsi2ss %eax,%xmm0
lea    0xe6d(%rip),%rdi
call   1030 <printf@plt>
jmp    1212 <main+0xe2>
movss  -0xb4(%rbp),%xmm0
ff
lea    0xe57(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
lea    0xf5e(%rip),%rdi
movss  0xec3(%rip),%xmm0
call   1030 <printf@plt>
lea    0xf70(%rip),%r14
movss  0xeb3(%rip),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
lea    0xf6d(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0xe95(%rip),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0xe7c(%rip),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0xe63(%rip),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0xe4a(%rip),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0xe31(%rip),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0xe18(%rip),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0xdff(%rip),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
lea    0x1c(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0xde6(%rip),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    %r14,%rdi
movss  0xda2(%rip),%xmm0
call   1030 <printf@plt>
lea    0x24(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    (%rsp),%eax
mov    %eax,0x2c(%rsp)
mov    0x4(%rsp),%r13d
mov    0x8(%rsp),%r12d
mov    0xc(%rsp),%r15d
mov    0x10(%rsp),%eax
mov    %eax,0x30(%rsp)
mov    0x14(%rsp),%eax
mov    %eax,0x34(%rsp)
mov    0x18(%rsp),%eax
mov    %eax,0x3c(%rsp)
mov    0x1c(%rsp),%eax
mov    %eax,0x40(%rsp)
mov    0x20(%rsp),%eax
mov    %eax,0x44(%rsp)
xor    %ebp,%ebp
mov    0x24(%rsp),%eax
mov    %eax,0x38(%rsp)
lea    0xd71(%rip),%r14
lea    0xe0a(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
movsbl 0x0(%rbp,%r14,1),%eax
add    $0x1,%rbp
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
cmp    $0x27,%rbp
jne    12d0 <main+0x1b0>
add    0x2c(%rsp),%r13d
add    %r13d,%r12d
add    %r12d,%r15d
mov    0x30(%rsp),%eax
add    %r15d,%eax
mov    0x34(%rsp),%ecx
add    %eax,%ecx
mov    0x3c(%rsp),%eax
add    %ecx,%eax
mov    0x40(%rsp),%ecx
add    %eax,%ecx
mov    0x44(%rsp),%eax
add    %ecx,%eax
mov    0x38(%rsp),%ecx
add    %eax,%ecx
xorps  %xmm0,%xmm0
cvtsi2ss %ecx,%xmm0
divss  0xcd2(%rip),%xmm0
lea    0xd9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.letters = [99 x i8] c"The average of the integers entered is \00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [38 x i8] c"Let's average %d itegers, shall we?\0A\0A\00"
@.str.1 = [20 x i8] c"Enter integer #%d: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [3 x i8] c"%c\00"
@.str.4 = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [10 x i32]
%5 = alloca [99 x i8]
%6 = alloca float
store i32 0, i32* %1
store i32 0, i32* %3
%7 = bitcast [99 x i8]* %5 to i8*
%8 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), float 1.000000e+01)
store i32 0, i32* %2
br label %9
9: ; preds = %21, %0
%10 = load i32, i32* %2
%11 = icmp slt i32 %10, 10
br i1 %11, label %12, label %24
12: ; preds = %9
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 1
%15 = sitofp i32 %14 to float
%16 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), float %15)
%17 = load i32, i32* %2
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 %18
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %19)
br label %21
21: ; preds = %12
%22 = load i32, i32* %2
%23 = add nsw i32 %22, 1
store i32 %23, i32* %2
br label %9
24: ; preds = %9
store i32 0, i32* %2
br label %25
25: ; preds = %35, %24
%26 = load i32, i32* %2
%27 = icmp slt i32 %26, 10
br i1 %27, label %28, label %38
28: ; preds = %25
%29 = load i32, i32* %2
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 %30
%32 = load i32, i32* %31
%33 = load i32, i32* %3
%34 = add nsw i32 %33, %32
store i32 %34, i32* %3
br label %35
35: ; preds = %28
%36 = load i32, i32* %2
%37 = add nsw i32 %36, 1
store i32 %37, i32* %2
br label %25
38: ; preds = %25
%39 = load i32, i32* %3
%40 = sitofp i32 %39 to float
%41 = fdiv float %40, 1.000000e+01
store float %41, float* %6
store i32 0, i32* %2
br label %42
42: ; preds = %48, %38
%43 = load i32, i32* %2
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [99 x i8], [99 x i8]* %5, i64 0, i64 %44
%46 = load i8, i8* %45
%47 = icmp ne i8 %46, 0
br i1 %47, label %48, label %56
48: ; preds = %42
%49 = load i32, i32* %2
%50 = add nsw i32 %49, 1
store i32 %50, i32* %2
%51 = sext i32 %49 to i64
%52 = getelementptr inbounds [99 x i8], [99 x i8]* %5, i64 0, i64 %51
%53 = load i8, i8* %52
%54 = sitofp i8 %53 to float
%55 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float %54)
br label %42
56: ; preds = %42
%57 = load float, float* %6
%58 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), float %57)
%59 = load i32, i32* %1
ret i32 %59
}

LLVM IR (-O2):
@__const.main.letters = [99 x i8] c"The average of the integers entered is \00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [38 x i8] c"Let's average %d itegers, shall we?\0A\0A\00"
@.str.1 = [20 x i8] c"Enter integer #%d: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [3 x i8] c"%c\00"
@.str.4 = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), float 1.000000e+01)
%4 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), float 1.000000e+00)
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), float 2.000000e+00)
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 1
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), float 3.000000e+00)
%11 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 2
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), float 4.000000e+00)
%14 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 3
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %14)
%16 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), float 5.000000e+00)
%17 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 4
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %17)
%19 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), float 6.000000e+00)
%20 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 5
%21 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %20)
%22 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), float 7.000000e+00)
%23 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 6
%24 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %23)
%25 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), float 8.000000e+00)
%26 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 7
%27 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %26)
%28 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), float 9.000000e+00)
%29 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 8
%30 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %29)
%31 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), float 1.000000e+01)
%32 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 9
%33 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %32)
%34 = load i32, i32* %5
%35 = load i32, i32* %8
%36 = load i32, i32* %11
%37 = load i32, i32* %14
%38 = load i32, i32* %17
%39 = load i32, i32* %20
%40 = load i32, i32* %23
%41 = load i32, i32* %26
%42 = load i32, i32* %29
%43 = load i32, i32* %32
br label %44
44: ; preds = %0, %44
%45 = phi i64 [ 0, %0 ], [ %48, %44 ]
%46 = getelementptr inbounds [99 x i8], [99 x i8]* @__const.main.letters, i64 0, i64 %45
%47 = load i8, i8* %46
%48 = add nuw nsw i64 %45, 1
%49 = sitofp i8 %47 to float
%50 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float %49)
%51 = icmp eq i64 %48, 39
br i1 %51, label %52, label %44
52: ; preds = %44
%53 = add nsw i32 %35, %34
%54 = add nsw i32 %36, %53
%55 = add nsw i32 %37, %54
%56 = add nsw i32 %38, %55
%57 = add nsw i32 %39, %56
%58 = add nsw i32 %40, %57
%59 = add nsw i32 %41, %58
%60 = add nsw i32 %42, %59
%61 = add nsw i32 %43, %60
%62 = sitofp i32 %61 to float
%63 = fdiv float %62, 1.000000e+01
%64 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), float %63)
ret i32 0
}