int main(int argc, char const *argv[]) {
  double w = 37.5, x = 22.5, y = 1.7, z = 10.2;
  printf("%s%.1f\n%s%.1f\n%s%.1f\n%s%.1f\n", "w=", w, "x=", x, "y=", y,
         "z=", z);
  printf("%s%.3f\n%s%.3f\n%s%.3f\n", "The average of w,x:", average(2, w, x),
         "The average of w,x,y:", average(3, w, x, y),
         "The average of w,x,y,z:", average(4, w, x, y, z));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  0xeda(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xec5(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xeb0(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe9b(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm3
lea    0xe9b(%rip),%rdi
lea    0xeb1(%rip),%rsi
lea    0xead(%rip),%rdx
lea    0xea9(%rip),%rcx
lea    0xea5(%rip),%r8
mov    $0x4,%al
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mov    $0x2,%edi
mov    $0x2,%al
call   1040 <average@plt>
mov    %eax,-0x38(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
mov    $0x3,%edi
mov    $0x3,%al
call   1040 <average@plt>
mov    %eax,-0x34(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm3
mov    $0x4,%edi
mov    $0x4,%al
call   1040 <average@plt>
mov    -0x38(%rbp),%edx
mov    -0x34(%rbp),%r8d
lea    0xe3c(%rip),%rdi
lea    0xe4b(%rip),%rsi
lea    0xe58(%rip),%rcx
lea    0xe67(%rip),%r9
mov    %eax,(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xef6(%rip),%rdi
lea    0xf0c(%rip),%rsi
lea    0xf08(%rip),%rdx
lea    0xf04(%rip),%rcx
lea    0xf00(%rip),%r8
movsd  0xeb2(%rip),%xmm0
movsd  0xeb2(%rip),%xmm1
movsd  0xeb2(%rip),%xmm2
movsd  0xeb2(%rip),%xmm3
mov    $0x4,%al
call   1030 <printf@plt>
mov    $0x2,%edi
movsd  0xe86(%rip),%xmm0
movsd  0xe86(%rip),%xmm1
mov    $0x2,%al
call   1040 <average@plt>
mov    %eax,%ebx
mov    $0x3,%edi
movsd  0xe68(%rip),%xmm0
movsd  0xe68(%rip),%xmm1
movsd  0xe68(%rip),%xmm2
mov    $0x3,%al
call   1040 <average@plt>
mov    %eax,%ebp
mov    $0x4,%edi
movsd  0xe42(%rip),%xmm0
movsd  0xe42(%rip),%xmm1
movsd  0xe42(%rip),%xmm2
movsd  0xe42(%rip),%xmm3
mov    $0x4,%al
call   1040 <average@plt>
mov    %eax,(%rsp)
lea    0xe62(%rip),%rdi
lea    0xe71(%rip),%rsi
lea    0xe7e(%rip),%rcx
lea    0xe8d(%rip),%r9
mov    %ebx,%edx
mov    %ebp,%r8d
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [29 x i8] c"%s%.1f\0A%s%.1f\0A%s%.1f\0A%s%.1f\0A\00"
@.str.1 = [3 x i8] c"w=\00"
@.str.2 = [3 x i8] c"x=\00"
@.str.3 = [3 x i8] c"y=\00"
@.str.4 = [3 x i8] c"z=\00"
@.str.5 = [22 x i8] c"%s%.3f\0A%s%.3f\0A%s%.3f\0A\00"
@.str.6 = [20 x i8] c"The average of w,x:\00"
@.str.7 = [22 x i8] c"The average of w,x,y:\00"
@.str.8 = [24 x i8] c"The average of w,x,y,z:\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store double 3.750000e+01, double* %6
store double 2.250000e+01, double* %7
store double 1.700000e+00, double* %8
store double 1.020000e+01, double* %9
%10 = load double, double* %6
%11 = load double, double* %7
%12 = load double, double* %8
%13 = load double, double* %9
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), double %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), double %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), double %13)
%15 = load double, double* %6
%16 = load double, double* %7
%17 = call i32 (i32, double, double, ...) bitcast (i32 (...)* @average to i32 (i32, double, double, ...)*)(i32 2, double %15, double %16)
%18 = load double, double* %6
%19 = load double, double* %7
%20 = load double, double* %8
%21 = call i32 (i32, double, double, double, ...) bitcast (i32 (...)* @average to i32 (i32, double, double, double, ...)*)(i32 3, double %18, double %19, double %20)
%22 = load double, double* %6
%23 = load double, double* %7
%24 = load double, double* %8
%25 = load double, double* %9
%26 = call i32 (i32, double, double, double, double, ...) bitcast (i32 (...)* @average to i32 (i32, double, double, double, double, ...)*)(i32 4, double %22, double %23, double %24, double %25)
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i32 %17, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i32 %21, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.8, i64 0, i64 0), i32 %26)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"%s%.1f\0A%s%.1f\0A%s%.1f\0A%s%.1f\0A\00"
@.str.1 = [3 x i8] c"w=\00"
@.str.2 = [3 x i8] c"x=\00"
@.str.3 = [3 x i8] c"y=\00"
@.str.4 = [3 x i8] c"z=\00"
@.str.5 = [22 x i8] c"%s%.3f\0A%s%.3f\0A%s%.3f\0A\00"
@.str.6 = [20 x i8] c"The average of w,x:\00"
@.str.7 = [22 x i8] c"The average of w,x,y:\00"
@.str.8 = [24 x i8] c"The average of w,x,y,z:\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double 3.750000e+01, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), double 2.250000e+01, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), double 1.700000e+00, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), double 1.020000e+01)
%4 = tail call i32 (i32, double, double, ...) bitcast (i32 (...)* @average to i32 (i32, double, double, ...)*)(i32 2, double 3.750000e+01, double 2.250000e+01)
%5 = tail call i32 (i32, double, double, double, ...) bitcast (i32 (...)* @average to i32 (i32, double, double, double, ...)*)(i32 3, double 3.750000e+01, double 2.250000e+01, double 1.700000e+00)
%6 = tail call i32 (i32, double, double, double, double, ...) bitcast (i32 (...)* @average to i32 (i32, double, double, double, double, ...)*)(i32 4, double 3.750000e+01, double 2.250000e+01, double 1.700000e+00, double 1.020000e+01)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i32 %4, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i32 %5, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.8, i64 0, i64 0), i32 %6)
ret i32 0
}