#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 mean(const int answer[]) {
  int j;
  int total = 0;
  printf("%s\n%s\n%s\n", "********", "  Mean", "********");
  for (j = 0; j < 99; j++) {
    total += answer[j];
  }
  printf("The mean is the average value of the data\n"
         "items. The mean is equal to the total of\n"
         "all the data items divided by the number\n"
         "of data items ( %d ). The mean value for\n"
         "this run is: %d / %d = %.4f\n\n",
         99, total, 99, (double)total / 99);
}


x86 assembly (clang, -O0):
<mean>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xede(%rip),%rdi
lea    0xee1(%rip),%rcx
lea    0xee3(%rip),%rdx
mov    %rcx,%rsi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x63,-0xc(%rbp)
jge    1172 <mean+0x62>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1149 <mean+0x39>
mov    -0x10(%rbp),%edx
cvtsi2sdl -0x10(%rbp),%xmm0
movsd  0xe7e(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xe95(%rip),%rdi
mov    $0x63,%ecx
mov    %ecx,%esi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mean>:
push   %rbx
mov    %rdi,%rbx
lea    0xeed(%rip),%rdi
lea    0xef9(%rip),%rdx
lea    0xee9(%rip),%rcx
mov    %rcx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
movdqu 0x170(%rbx),%xmm1
movdqu 0x160(%rbx),%xmm0
paddd  %xmm1,%xmm0
movdqu 0x150(%rbx),%xmm2
movdqu 0x140(%rbx),%xmm3
movdqu 0x130(%rbx),%xmm4
movdqu 0x120(%rbx),%xmm5
movdqu 0x110(%rbx),%xmm6
movdqu 0x100(%rbx),%xmm1
paddd  %xmm6,%xmm1
paddd  %xmm5,%xmm1
paddd  %xmm4,%xmm1
paddd  %xmm3,%xmm1
paddd  %xmm2,%xmm1
movdqu 0xf0(%rbx),%xmm3
movdqu 0xe0(%rbx),%xmm4
movdqu 0xd0(%rbx),%xmm5
movdqu 0xc0(%rbx),%xmm6
movdqu 0xb0(%rbx),%xmm2
paddd  %xmm6,%xmm2
paddd  %xmm5,%xmm2
paddd  %xmm4,%xmm2
paddd  %xmm3,%xmm2
movdqu 0xa0(%rbx),%xmm3
movdqu 0x90(%rbx),%xmm4
movdqu 0x80(%rbx),%xmm5
movdqu 0x70(%rbx),%xmm6
paddd  %xmm5,%xmm6
paddd  %xmm4,%xmm6
paddd  %xmm3,%xmm6
movdqu 0x60(%rbx),%xmm3
movdqu 0x50(%rbx),%xmm4
movdqu 0x40(%rbx),%xmm5
paddd  %xmm4,%xmm5
paddd  %xmm3,%xmm5
movdqu (%rbx),%xmm3
movdqu 0x10(%rbx),%xmm4
paddd  %xmm3,%xmm4
movdqu 0x20(%rbx),%xmm3
movdqu 0x30(%rbx),%xmm7
paddd  %xmm3,%xmm7
paddd  %xmm4,%xmm7
paddd  %xmm5,%xmm7
paddd  %xmm6,%xmm7
paddd  %xmm2,%xmm7
paddd  %xmm1,%xmm7
paddd  %xmm0,%xmm7
pshufd $0xee,%xmm7,%xmm0
paddd  %xmm7,%xmm0
pshufd $0x55,%xmm0,%xmm1
paddd  %xmm0,%xmm1
movd   %xmm1,%edx
add    0x180(%rbx),%edx
add    0x184(%rbx),%edx
add    0x188(%rbx),%edx
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
divsd  0xd93(%rip),%xmm0
lea    0xdae(%rip),%rdi
mov    $0x63,%esi
mov    $0x63,%ecx
mov    $0x1,%al
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"%s\0A%s\0A%s\0A\00"
@.str.1 = [9 x i8] c"********\00"
@.str.2 = [7 x i8] c" Mean\00"
@.str.3 = [195 x i8] c"The mean is the average value of the data\0Aitems. The mean is equal to the total of\0Aall the data items divided by the number\0Aof data items ( %d ). The mean value for\0Athis run is: %d / %d = %.4f\0A\0A\00"
define void @mean(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %3
br label %6
6: ; preds = %17, %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 99
br i1 %8, label %9, label %20
9: ; preds = %6
%10 = load i32*, i32** %2
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %10, i64 %12
%14 = load i32, i32* %13
%15 = load i32, i32* %4
%16 = add nsw i32 %15, %14
store i32 %16, i32* %4
br label %17
17: ; preds = %9
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %6
20: ; preds = %6
%21 = load i32, i32* %4
%22 = load i32, i32* %4
%23 = sitofp i32 %22 to double
%24 = fdiv double %23, 9.900000e+01
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([195 x i8], [195 x i8]* @.str.3, i64 0, i64 0), i32 99, i32 %21, i32 99, double %24)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"%s\0A%s\0A%s\0A\00"
@.str.1 = [9 x i8] c"********\00"
@.str.2 = [7 x i8] c" Mean\00"
@.str.3 = [195 x i8] c"The mean is the average value of the data\0Aitems. The mean is equal to the total of\0Aall the data items divided by the number\0Aof data items ( %d ). The mean value for\0Athis run is: %d / %d = %.4f\0A\0A\00"
define void @mean(i32* nocapture %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%3 = getelementptr inbounds i32, i32* %0, i64 92
%4 = bitcast i32* %3 to <4 x i32>*
%5 = load <4 x i32>, <4 x i32>* %4
%6 = getelementptr inbounds i32, i32* %0, i64 88
%7 = bitcast i32* %6 to <4 x i32>*
%8 = load <4 x i32>, <4 x i32>* %7
%9 = getelementptr inbounds i32, i32* %0, i64 84
%10 = bitcast i32* %9 to <4 x i32>*
%11 = load <4 x i32>, <4 x i32>* %10
%12 = getelementptr inbounds i32, i32* %0, i64 80
%13 = bitcast i32* %12 to <4 x i32>*
%14 = load <4 x i32>, <4 x i32>* %13
%15 = getelementptr inbounds i32, i32* %0, i64 76
%16 = bitcast i32* %15 to <4 x i32>*
%17 = load <4 x i32>, <4 x i32>* %16
%18 = getelementptr inbounds i32, i32* %0, i64 72
%19 = bitcast i32* %18 to <4 x i32>*
%20 = load <4 x i32>, <4 x i32>* %19
%21 = getelementptr inbounds i32, i32* %0, i64 68
%22 = bitcast i32* %21 to <4 x i32>*
%23 = load <4 x i32>, <4 x i32>* %22
%24 = getelementptr inbounds i32, i32* %0, i64 64
%25 = bitcast i32* %24 to <4 x i32>*
%26 = load <4 x i32>, <4 x i32>* %25
%27 = getelementptr inbounds i32, i32* %0, i64 60
%28 = bitcast i32* %27 to <4 x i32>*
%29 = load <4 x i32>, <4 x i32>* %28
%30 = getelementptr inbounds i32, i32* %0, i64 56
%31 = bitcast i32* %30 to <4 x i32>*
%32 = load <4 x i32>, <4 x i32>* %31
%33 = getelementptr inbounds i32, i32* %0, i64 52
%34 = bitcast i32* %33 to <4 x i32>*
%35 = load <4 x i32>, <4 x i32>* %34
%36 = getelementptr inbounds i32, i32* %0, i64 48
%37 = bitcast i32* %36 to <4 x i32>*
%38 = load <4 x i32>, <4 x i32>* %37
%39 = getelementptr inbounds i32, i32* %0, i64 44
%40 = bitcast i32* %39 to <4 x i32>*
%41 = load <4 x i32>, <4 x i32>* %40
%42 = getelementptr inbounds i32, i32* %0, i64 40
%43 = bitcast i32* %42 to <4 x i32>*
%44 = load <4 x i32>, <4 x i32>* %43
%45 = getelementptr inbounds i32, i32* %0, i64 36
%46 = bitcast i32* %45 to <4 x i32>*
%47 = load <4 x i32>, <4 x i32>* %46
%48 = getelementptr inbounds i32, i32* %0, i64 32
%49 = bitcast i32* %48 to <4 x i32>*
%50 = load <4 x i32>, <4 x i32>* %49
%51 = getelementptr inbounds i32, i32* %0, i64 28
%52 = bitcast i32* %51 to <4 x i32>*
%53 = load <4 x i32>, <4 x i32>* %52
%54 = getelementptr inbounds i32, i32* %0, i64 24
%55 = bitcast i32* %54 to <4 x i32>*
%56 = load <4 x i32>, <4 x i32>* %55
%57 = getelementptr inbounds i32, i32* %0, i64 20
%58 = bitcast i32* %57 to <4 x i32>*
%59 = load <4 x i32>, <4 x i32>* %58
%60 = getelementptr inbounds i32, i32* %0, i64 16
%61 = bitcast i32* %60 to <4 x i32>*
%62 = load <4 x i32>, <4 x i32>* %61
%63 = getelementptr inbounds i32, i32* %0, i64 12
%64 = bitcast i32* %63 to <4 x i32>*
%65 = load <4 x i32>, <4 x i32>* %64
%66 = getelementptr inbounds i32, i32* %0, i64 8
%67 = bitcast i32* %66 to <4 x i32>*
%68 = load <4 x i32>, <4 x i32>* %67
%69 = getelementptr inbounds i32, i32* %0, i64 4
%70 = bitcast i32* %69 to <4 x i32>*
%71 = load <4 x i32>, <4 x i32>* %70
%72 = bitcast i32* %0 to <4 x i32>*
%73 = load <4 x i32>, <4 x i32>* %72
%74 = add <4 x i32> %71, %73
%75 = add <4 x i32> %68, %74
%76 = add <4 x i32> %65, %75
%77 = add <4 x i32> %62, %76
%78 = add <4 x i32> %59, %77
%79 = add <4 x i32> %56, %78
%80 = add <4 x i32> %53, %79
%81 = add <4 x i32> %50, %80
%82 = add <4 x i32> %47, %81
%83 = add <4 x i32> %44, %82
%84 = add <4 x i32> %41, %83
%85 = add <4 x i32> %38, %84
%86 = add <4 x i32> %35, %85
%87 = add <4 x i32> %32, %86
%88 = add <4 x i32> %29, %87
%89 = add <4 x i32> %26, %88
%90 = add <4 x i32> %23, %89
%91 = add <4 x i32> %20, %90
%92 = add <4 x i32> %17, %91
%93 = add <4 x i32> %14, %92
%94 = add <4 x i32> %11, %93
%95 = add <4 x i32> %8, %94
%96 = add <4 x i32> %5, %95
%97 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %96)
%98 = getelementptr inbounds i32, i32* %0, i64 96
%99 = load i32, i32* %98
%100 = add nsw i32 %99, %97
%101 = getelementptr inbounds i32, i32* %0, i64 97
%102 = load i32, i32* %101
%103 = add nsw i32 %102, %100
%104 = getelementptr inbounds i32, i32* %0, i64 98
%105 = load i32, i32* %104
%106 = add nsw i32 %105, %103
%107 = sitofp i32 %106 to double
%108 = fdiv double %107, 9.900000e+01
%109 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([195 x i8], [195 x i8]* @.str.3, i64 0, i64 0), i32 99, i32 %106, i32 99, double %108)
ret void
}