#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*/ printAverageAmount(double *, int);
int main(void) {
  double a[5] = {100.00, 250.00, 320.00, 120.00, 1500.00};
  double b[3] = {8.00, 1.00, 1.00};
  double c[3] = {8.00, 1.50, 1.50};
  printAverageAmount(a, 5);
  printAverageAmount(b, 3);
  printAverageAmount(c, 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
movsd  0xed9(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xec4(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xeaf(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe9a(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe85(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    0xea9(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xea6(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xea3(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xea8(%rip),%rax
mov    %rax,-0x70(%rbp)
mov    0xea5(%rip),%rax
mov    %rax,-0x68(%rbp)
mov    0xea2(%rip),%rax
mov    %rax,-0x60(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x5,%esi
call   1030 <printAverageAmount@plt>
lea    -0x50(%rbp),%rdi
mov    $0x3,%esi
call   1030 <printAverageAmount@plt>
lea    -0x70(%rbp),%rdi
mov    $0x3,%esi
call   1030 <printAverageAmount@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x68,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movabs $0x4097700000000000,%rax
70 97 40
mov    %rax,0x60(%rsp)
mov    0xeee(%rip),%rax
mov    %rax,0x30(%rsp)
movaps 0xed2(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
mov    0xef6(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xeda(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x40(%rsp),%rdi
mov    $0x5,%esi
call   1030 <printAverageAmount@plt>
lea    0x20(%rsp),%rdi
mov    $0x3,%esi
call   1030 <printAverageAmount@plt>
mov    %rsp,%rdi
mov    $0x3,%esi
call   1030 <printAverageAmount@plt>
xor    %eax,%eax
add    $0x68,%rsp
ret

LLVM IR (-O0):
@__const.main.b = [3 x double] [double 8.000000e+00, double 1.000000e+00, double 1.000000e+00]
@__const.main.c = [3 x double] [double 8.000000e+00, double 1.500000e+00, double 1.500000e+00]
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x double]
%3 = alloca [3 x double]
%4 = alloca [3 x double]
store i32 0, i32* %1
%5 = bitcast [5 x double]* %2 to i8*
%6 = bitcast i8* %5 to [5 x double]*
%7 = getelementptr inbounds [5 x double], [5 x double]* %6, i32 0, i32 0
store double 1.000000e+02, double* %7
%8 = getelementptr inbounds [5 x double], [5 x double]* %6, i32 0, i32 1
store double 2.500000e+02, double* %8
%9 = getelementptr inbounds [5 x double], [5 x double]* %6, i32 0, i32 2
store double 3.200000e+02, double* %9
%10 = getelementptr inbounds [5 x double], [5 x double]* %6, i32 0, i32 3
store double 1.200000e+02, double* %10
%11 = getelementptr inbounds [5 x double], [5 x double]* %6, i32 0, i32 4
store double 1.500000e+03, double* %11
%12 = bitcast [3 x double]* %3 to i8*
%13 = bitcast [3 x double]* %4 to i8*
%14 = getelementptr inbounds [5 x double], [5 x double]* %2, i64 0, i64 0
%15 = call i32 @printAverageAmount(double* %14, i32 5)
%16 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 0
%17 = call i32 @printAverageAmount(double* %16, i32 3)
%18 = getelementptr inbounds [3 x double], [3 x double]* %4, i64 0, i64 0
%19 = call i32 @printAverageAmount(double* %18, i32 3)
ret i32 0
}

LLVM IR (-O2):
@__const.main.b = [3 x double] [double 8.000000e+00, double 1.000000e+00, double 1.000000e+00]
@__const.main.c = [3 x double] [double 8.000000e+00, double 1.500000e+00, double 1.500000e+00]
define i32 @main() {
%1 = alloca [5 x double]
%2 = alloca [3 x double]
%3 = alloca [3 x double]
%4 = bitcast [5 x double]* %1 to i8*
%5 = getelementptr inbounds [5 x double], [5 x double]* %1, i64 0, i64 0
%6 = bitcast [5 x double]* %1 to <2 x double>*
store <2 x double> <double 1.000000e+02, double 2.500000e+02>, <2 x double>* %6
%7 = getelementptr inbounds [5 x double], [5 x double]* %1, i64 0, i64 2
%8 = bitcast double* %7 to <2 x double>*
store <2 x double> <double 3.200000e+02, double 1.200000e+02>, <2 x double>* %8
%9 = getelementptr inbounds [5 x double], [5 x double]* %1, i64 0, i64 4
store double 1.500000e+03, double* %9
%10 = bitcast [3 x double]* %2 to i8*
%11 = bitcast [3 x double]* %3 to i8*
%12 = call i32 @printAverageAmount(double* %5, i32 5)
%13 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 0
%14 = call i32 @printAverageAmount(double* %13, i32 3)
%15 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 0
%16 = call i32 @printAverageAmount(double* %15, i32 3)
ret i32 0
}