#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 *, double);
double sum(int, double, double, double, ...);
int main(void) {
  double s, t;
  s = sum(3, 1.1, 2.5, 13.3);
  t = sum(6, 1.1, 2.1, 13.1, 4.1, 5.1, 6.1);
  printf("return value for "
         "sum(3, 1.1, 2.5, 13.3):             %g\n",
         s);
  printf("return value for"
         "sum(6, 1.1, 2.1, 13.1, 4.1, 5.1, 6.1):          %g\n",
         t);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3,%edi
movsd  0xec4(%rip),%xmm0
movsd  0xeec(%rip),%xmm1
movsd  0xeec(%rip),%xmm2
mov    $0x3,%al
call   1040 <sum@plt>
movsd  %xmm0,-0x10(%rbp)
mov    $0x6,%edi
movsd  0xe9b(%rip),%xmm0
movsd  0xe9b(%rip),%xmm1
movsd  0xe9b(%rip),%xmm2
movsd  0xe9b(%rip),%xmm3
movsd  0xe9b(%rip),%xmm4
movsd  0xe9b(%rip),%xmm5
mov    $0x6,%al
call   1040 <sum@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movsd  0xed4(%rip),%xmm0
movsd  0xed4(%rip),%xmm1
movsd  0xed4(%rip),%xmm2
mov    $0x3,%edi
mov    $0x3,%al
call   1040 <sum@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0xec2(%rip),%xmm1
movsd  0xec2(%rip),%xmm2
movsd  0xec2(%rip),%xmm3
movsd  0xec2(%rip),%xmm4
movsd  0xec2(%rip),%xmm5
mov    $0x6,%edi
movsd  0xe7d(%rip),%xmm0
mov    $0x6,%al
call   1040 <sum@plt>
movsd  %xmm0,0x8(%rsp)
lea    0xea9(%rip),%rdi
movsd  0x10(%rsp),%xmm0
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
movsd  0x8(%rsp),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [57 x i8] c"return value for sum(3, 1.1, 2.5, 13.3): %g\0A\00"
@.str.1 = [68 x i8] c"return value forsum(6, 1.1, 2.1, 13.1, 4.1, 5.1, 6.1): %g\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
%4 = call double (i32, double, double, double, ...) @sum(i32 3, double 1.100000e+00, double 2.500000e+00, double 1.330000e+01)
store double %4, double* %2
%5 = call double (i32, double, double, double, ...) @sum(i32 6, double 1.100000e+00, double 2.100000e+00, double 1.310000e+01, double 4.100000e+00, double 5.100000e+00, double 6.100000e+00)
store double %5, double* %3
%6 = load double, double* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), double %6)
%8 = load double, double* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.1, i64 0, i64 0), double %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [57 x i8] c"return value for sum(3, 1.1, 2.5, 13.3): %g\0A\00"
@.str.1 = [68 x i8] c"return value forsum(6, 1.1, 2.1, 13.1, 4.1, 5.1, 6.1): %g\0A\00"
define i32 @main() {
%1 = tail call double (i32, double, double, double, ...) @sum(i32 3, double 1.100000e+00, double 2.500000e+00, double 1.330000e+01)
%2 = tail call double (i32, double, double, double, ...) @sum(i32 6, double 1.100000e+00, double 2.100000e+00, double 1.310000e+01, double 4.100000e+00, double 5.100000e+00, double 6.100000e+00)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), double %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.1, i64 0, i64 0), double %2)
ret i32 0
}