#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 EXIT_SUCCESS;
double addition(int, double, ...);
int /*<<< orphan*/ printf(char *, double);
int main(int argc, char *argv[]) {
  double w = 10.5;
  double x = 20.5;
  double y = 30.5;
  double z = 40.5;
  printf("w = %f\n", addition(1, w));
  printf("w + x = %f\n", addition(2, w, x));
  printf("x + x + y = %f\n", addition(3, w, x, y));
  printf("x + x + y + z = %f\n", addition(4, w, x, y, z));
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%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
mov    $0x1,%edi
mov    $0x1,%al
call   1030 <addition@plt>
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mov    $0x2,%edi
mov    $0x2,%al
call   1030 <addition@plt>
lea    0xe84(%rip),%rdi
call   1040 <printf@plt>
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
mov    $0x3,%edi
mov    $0x3,%al
call   1030 <addition@plt>
lea    0xe69(%rip),%rdi
call   1040 <printf@plt>
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm3
mov    $0x4,%edi
mov    $0x4,%al
call   1030 <addition@plt>
lea    0xe4d(%rip),%rdi
call   1040 <printf@plt>
mov    0x2ddd(%rip),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
mov    $0x1,%edi
mov    $0x1,%al
call   1030 <addition@plt>
lea    0xee4(%rip),%rdi
call   1040 <printf@plt>
movsd  0xebf(%rip),%xmm1
mov    $0x2,%edi
movsd  0xeaa(%rip),%xmm0
mov    $0x2,%al
call   1030 <addition@plt>
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
movsd  0xe9f(%rip),%xmm2
mov    $0x3,%edi
movsd  0xe82(%rip),%xmm0
movsd  0xe82(%rip),%xmm1
mov    $0x3,%al
call   1030 <addition@plt>
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
movsd  0xe77(%rip),%xmm3
mov    $0x4,%edi
movsd  0xe52(%rip),%xmm0
movsd  0xe52(%rip),%xmm1
movsd  0xe52(%rip),%xmm2
mov    $0x4,%al
call   1030 <addition@plt>
lea    0xe78(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e08(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"w = %f\0A\00"
@.str.1 = [12 x i8] c"w + x = %f\0A\00"
@.str.2 = [16 x i8] c"x + x + y = %f\0A\00"
@.str.3 = [20 x i8] c"x + x + y + z = %f\0A\00"
@EXIT_SUCCESS = global i32 0
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 1.050000e+01, double* %6
store double 2.050000e+01, double* %7
store double 3.050000e+01, double* %8
store double 4.050000e+01, double* %9
%10 = load double, double* %6
%11 = call double (i32, double, ...) @addition(i32 1, double %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %11)
%13 = load double, double* %6
%14 = load double, double* %7
%15 = call double (i32, double, ...) @addition(i32 2, double %13, double %14)
%16 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), double %15)
%17 = load double, double* %6
%18 = load double, double* %7
%19 = load double, double* %8
%20 = call double (i32, double, ...) @addition(i32 3, double %17, double %18, double %19)
%21 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double %20)
%22 = load double, double* %6
%23 = load double, double* %7
%24 = load double, double* %8
%25 = load double, double* %9
%26 = call double (i32, double, ...) @addition(i32 4, double %22, double %23, double %24, double %25)
%27 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), double %26)
%28 = load i32, i32* @EXIT_SUCCESS
ret i32 %28
}

LLVM IR (-O2):
@.str = [8 x i8] c"w = %f\0A\00"
@.str.1 = [12 x i8] c"w + x = %f\0A\00"
@.str.2 = [16 x i8] c"x + x + y = %f\0A\00"
@.str.3 = [20 x i8] c"x + x + y + z = %f\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call double (i32, double, ...) @addition(i32 1, double 1.050000e+01)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %3)
%5 = tail call double (i32, double, ...) @addition(i32 2, double 1.050000e+01, double 2.050000e+01)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), double %5)
%7 = tail call double (i32, double, ...) @addition(i32 3, double 1.050000e+01, double 2.050000e+01, double 3.050000e+01)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double %7)
%9 = tail call double (i32, double, ...) @addition(i32 4, double 1.050000e+01, double 2.050000e+01, double 3.050000e+01, double 4.050000e+01)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), double %9)
%11 = load i32, i32* @EXIT_SUCCESS
ret i32 %11
}