#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 unsigned int answer[]) {
  size_t j;
  unsigned int total = 0;
  printf("%s\n%s\n%s\n", "********", " Mean", "********");
  for (j = 0; j < 100; ++j) {
    total += answer[j];
  }
  printf("The mean is the averange 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 ( %u ). The mean value for\n"
         "this run is: %u / %u = %.4f\n\n",
         100, total, 100, (double)total / 100);
}


x86 assembly (clang, -O0):
<mean>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xede(%rip),%rdi
lea    0xee1(%rip),%rcx
lea    0xee3(%rip),%rdx
mov    %rcx,%rsi
mov    $0x0,%al
call   1030 <printf@plt>
movq   $0x0,-0x10(%rbp)
cmpq   $0x64,-0x10(%rbp)
jae    1177 <mean+0x67>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    114a <mean+0x3a>
mov    -0x14(%rbp),%eax
mov    %eax,%edx
cvtsi2sd %rax,%xmm0
movsd  0xe77(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xe8d(%rip),%rdi
mov    $0x64,%ecx
mov    %ecx,%esi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x20,%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 (%rbx),%xmm0
movdqu 0x10(%rbx),%xmm1
paddd  %xmm0,%xmm1
movdqu 0x20(%rbx),%xmm0
movdqu 0x30(%rbx),%xmm2
paddd  %xmm0,%xmm2
paddd  %xmm1,%xmm2
movdqu 0x40(%rbx),%xmm0
movdqu 0x50(%rbx),%xmm1
paddd  %xmm0,%xmm1
movdqu 0x60(%rbx),%xmm0
paddd  %xmm1,%xmm0
paddd  %xmm2,%xmm0
movdqu 0x70(%rbx),%xmm1
movdqu 0x80(%rbx),%xmm2
paddd  %xmm1,%xmm2
movdqu 0x90(%rbx),%xmm1
paddd  %xmm2,%xmm1
movdqu 0xa0(%rbx),%xmm2
paddd  %xmm1,%xmm2
paddd  %xmm0,%xmm2
movdqu 0xb0(%rbx),%xmm0
movdqu 0xc0(%rbx),%xmm1
paddd  %xmm0,%xmm1
movdqu 0xd0(%rbx),%xmm0
paddd  %xmm1,%xmm0
movdqu 0xe0(%rbx),%xmm1
paddd  %xmm0,%xmm1
movdqu 0xf0(%rbx),%xmm0
paddd  %xmm1,%xmm0
paddd  %xmm2,%xmm0
movdqu 0x100(%rbx),%xmm1
movdqu 0x110(%rbx),%xmm2
paddd  %xmm1,%xmm2
movdqu 0x120(%rbx),%xmm1
paddd  %xmm2,%xmm1
movdqu 0x130(%rbx),%xmm2
paddd  %xmm1,%xmm2
movdqu 0x140(%rbx),%xmm1
paddd  %xmm2,%xmm1
movdqu 0x150(%rbx),%xmm2
paddd  %xmm1,%xmm2
paddd  %xmm0,%xmm2
movdqu 0x160(%rbx),%xmm0
movdqu 0x170(%rbx),%xmm1
paddd  %xmm0,%xmm1
movdqu 0x180(%rbx),%xmm0
paddd  %xmm1,%xmm0
paddd  %xmm2,%xmm0
pshufd $0xee,%xmm0,%xmm1
paddd  %xmm0,%xmm1
pshufd $0x55,%xmm1,%xmm0
paddd  %xmm1,%xmm0
movd   %xmm0,%edx
xorps  %xmm0,%xmm0
cvtsi2sd %rdx,%xmm0
divsd  0xd98(%rip),%xmm0
lea    0xdb2(%rip),%rdi
mov    $0x64,%esi
mov    $0x64,%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 = [6 x i8] c" Mean\00"
@.str.3 = [196 x i8] c"The mean is the averange value of the data\0Aitems. The mean is equal to the total of\0Aall the data items divided by the number\0Aof data items ( %u ). The mean value for\0Athis run is: %u / %u = %.4f\0A\0A\00"
define void @mean(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
%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 ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
store i64 0, i64* %3
br label %6
6: ; preds = %16, %1
%7 = load i64, i64* %3
%8 = icmp ult i64 %7, 100
br i1 %8, label %9, label %19
9: ; preds = %6
%10 = load i32*, i32** %2
%11 = load i64, i64* %3
%12 = getelementptr inbounds i32, i32* %10, i64 %11
%13 = load i32, i32* %12
%14 = load i32, i32* %4
%15 = add i32 %14, %13
store i32 %15, i32* %4
br label %16
16: ; preds = %9
%17 = load i64, i64* %3
%18 = add i64 %17, 1
store i64 %18, i64* %3
br label %6
19: ; preds = %6
%20 = load i32, i32* %4
%21 = load i32, i32* %4
%22 = uitofp i32 %21 to double
%23 = fdiv double %22, 1.000000e+02
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([196 x i8], [196 x i8]* @.str.3, i64 0, i64 0), i32 100, i32 %20, i32 100, double %23)
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 = [6 x i8] c" Mean\00"
@.str.3 = [196 x i8] c"The mean is the averange value of the data\0Aitems. The mean is equal to the total of\0Aall the data items divided by the number\0Aof data items ( %u ). The mean value for\0Athis run is: %u / %u = %.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 ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%3 = bitcast i32* %0 to <4 x i32>*
%4 = load <4 x i32>, <4 x i32>* %3
%5 = getelementptr inbounds i32, i32* %0, i64 4
%6 = bitcast i32* %5 to <4 x i32>*
%7 = load <4 x i32>, <4 x i32>* %6
%8 = add <4 x i32> %7, %4
%9 = getelementptr inbounds i32, i32* %0, i64 8
%10 = bitcast i32* %9 to <4 x i32>*
%11 = load <4 x i32>, <4 x i32>* %10
%12 = add <4 x i32> %11, %8
%13 = getelementptr inbounds i32, i32* %0, i64 12
%14 = bitcast i32* %13 to <4 x i32>*
%15 = load <4 x i32>, <4 x i32>* %14
%16 = add <4 x i32> %15, %12
%17 = getelementptr inbounds i32, i32* %0, i64 16
%18 = bitcast i32* %17 to <4 x i32>*
%19 = load <4 x i32>, <4 x i32>* %18
%20 = add <4 x i32> %19, %16
%21 = getelementptr inbounds i32, i32* %0, i64 20
%22 = bitcast i32* %21 to <4 x i32>*
%23 = load <4 x i32>, <4 x i32>* %22
%24 = add <4 x i32> %23, %20
%25 = getelementptr inbounds i32, i32* %0, i64 24
%26 = bitcast i32* %25 to <4 x i32>*
%27 = load <4 x i32>, <4 x i32>* %26
%28 = add <4 x i32> %27, %24
%29 = getelementptr inbounds i32, i32* %0, i64 28
%30 = bitcast i32* %29 to <4 x i32>*
%31 = load <4 x i32>, <4 x i32>* %30
%32 = add <4 x i32> %31, %28
%33 = getelementptr inbounds i32, i32* %0, i64 32
%34 = bitcast i32* %33 to <4 x i32>*
%35 = load <4 x i32>, <4 x i32>* %34
%36 = add <4 x i32> %35, %32
%37 = getelementptr inbounds i32, i32* %0, i64 36
%38 = bitcast i32* %37 to <4 x i32>*
%39 = load <4 x i32>, <4 x i32>* %38
%40 = add <4 x i32> %39, %36
%41 = getelementptr inbounds i32, i32* %0, i64 40
%42 = bitcast i32* %41 to <4 x i32>*
%43 = load <4 x i32>, <4 x i32>* %42
%44 = add <4 x i32> %43, %40
%45 = getelementptr inbounds i32, i32* %0, i64 44
%46 = bitcast i32* %45 to <4 x i32>*
%47 = load <4 x i32>, <4 x i32>* %46
%48 = add <4 x i32> %47, %44
%49 = getelementptr inbounds i32, i32* %0, i64 48
%50 = bitcast i32* %49 to <4 x i32>*
%51 = load <4 x i32>, <4 x i32>* %50
%52 = add <4 x i32> %51, %48
%53 = getelementptr inbounds i32, i32* %0, i64 52
%54 = bitcast i32* %53 to <4 x i32>*
%55 = load <4 x i32>, <4 x i32>* %54
%56 = add <4 x i32> %55, %52
%57 = getelementptr inbounds i32, i32* %0, i64 56
%58 = bitcast i32* %57 to <4 x i32>*
%59 = load <4 x i32>, <4 x i32>* %58
%60 = add <4 x i32> %59, %56
%61 = getelementptr inbounds i32, i32* %0, i64 60
%62 = bitcast i32* %61 to <4 x i32>*
%63 = load <4 x i32>, <4 x i32>* %62
%64 = add <4 x i32> %63, %60
%65 = getelementptr inbounds i32, i32* %0, i64 64
%66 = bitcast i32* %65 to <4 x i32>*
%67 = load <4 x i32>, <4 x i32>* %66
%68 = add <4 x i32> %67, %64
%69 = getelementptr inbounds i32, i32* %0, i64 68
%70 = bitcast i32* %69 to <4 x i32>*
%71 = load <4 x i32>, <4 x i32>* %70
%72 = add <4 x i32> %71, %68
%73 = getelementptr inbounds i32, i32* %0, i64 72
%74 = bitcast i32* %73 to <4 x i32>*
%75 = load <4 x i32>, <4 x i32>* %74
%76 = add <4 x i32> %75, %72
%77 = getelementptr inbounds i32, i32* %0, i64 76
%78 = bitcast i32* %77 to <4 x i32>*
%79 = load <4 x i32>, <4 x i32>* %78
%80 = add <4 x i32> %79, %76
%81 = getelementptr inbounds i32, i32* %0, i64 80
%82 = bitcast i32* %81 to <4 x i32>*
%83 = load <4 x i32>, <4 x i32>* %82
%84 = add <4 x i32> %83, %80
%85 = getelementptr inbounds i32, i32* %0, i64 84
%86 = bitcast i32* %85 to <4 x i32>*
%87 = load <4 x i32>, <4 x i32>* %86
%88 = add <4 x i32> %87, %84
%89 = getelementptr inbounds i32, i32* %0, i64 88
%90 = bitcast i32* %89 to <4 x i32>*
%91 = load <4 x i32>, <4 x i32>* %90
%92 = add <4 x i32> %91, %88
%93 = getelementptr inbounds i32, i32* %0, i64 92
%94 = bitcast i32* %93 to <4 x i32>*
%95 = load <4 x i32>, <4 x i32>* %94
%96 = add <4 x i32> %95, %92
%97 = getelementptr inbounds i32, i32* %0, i64 96
%98 = bitcast i32* %97 to <4 x i32>*
%99 = load <4 x i32>, <4 x i32>* %98
%100 = add <4 x i32> %99, %96
%101 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %100)
%102 = uitofp i32 %101 to double
%103 = fdiv double %102, 1.000000e+02
%104 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([196 x i8], [196 x i8]* @.str.3, i64 0, i64 0), i32 100, i32 %101, i32 100, double %103)
ret void
}