#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*/ displaySum(double, double);
int /*<<< orphan*/ printf(char *);
int main() {
  double t1 = 16.3, t2 = 98.23, t3 = 32.1, n1 = -3.2, n2 = 5.55;
  printf("Simple Function Example 3\n\n");
  displaySum(12.003, 54.7);
  displaySum(59.23, t1);
  displaySum(t2, 106.33);
  displaySum(t1, t2);
  displaySum(t1, t1);
  displaySum(n2, n1);
  displaySum(t1 + t2, t3 - t2 + 2.2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xf11(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xefc(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xee7(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xed2(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xebd(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe94(%rip),%xmm0
movsd  0xe94(%rip),%xmm1
call   1040 <displaySum@plt>
movsd  -0x10(%rbp),%xmm1
movsd  0xe72(%rip),%xmm0
call   1040 <displaySum@plt>
movsd  -0x18(%rbp),%xmm0
movsd  0xe58(%rip),%xmm1
call   1040 <displaySum@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1040 <displaySum@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <displaySum@plt>
movsd  -0x30(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
call   1040 <displaySum@plt>
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
subsd  -0x18(%rbp),%xmm1
movsd  0xe02(%rip),%xmm2
addsd  %xmm2,%xmm1
call   1040 <displaySum@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf28(%rip),%rdi
call   1030 <puts@plt>
movsd  0xecb(%rip),%xmm0
movsd  0xecb(%rip),%xmm1
call   1040 <displaySum@plt>
movsd  0xec6(%rip),%xmm0
movsd  0xec6(%rip),%xmm1
call   1040 <displaySum@plt>
movsd  0xec1(%rip),%xmm0
movsd  0xec1(%rip),%xmm1
call   1040 <displaySum@plt>
movsd  0xea4(%rip),%xmm0
movsd  0xea4(%rip),%xmm1
call   1040 <displaySum@plt>
movsd  0xe8f(%rip),%xmm0
movaps %xmm0,%xmm1
call   1040 <displaySum@plt>
movsd  0xe97(%rip),%xmm0
movsd  0xe97(%rip),%xmm1
call   1040 <displaySum@plt>
movsd  0xe92(%rip),%xmm0
movsd  0xe92(%rip),%xmm1
call   1040 <displaySum@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Simple Function Example 3\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store i32 0, i32* %1
store double 1.630000e+01, double* %2
store double 9.823000e+01, double* %3
store double 3.210000e+01, double* %4
store double -3.200000e+00, double* %5
store double 5.550000e+00, double* %6
%7 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @displaySum(double 1.200300e+01, double 5.470000e+01)
%9 = load double, double* %2
%10 = call i32 @displaySum(double 0x404D9D70A3D70A3D, double %9)
%11 = load double, double* %3
%12 = call i32 @displaySum(double %11, double 1.063300e+02)
%13 = load double, double* %2
%14 = load double, double* %3
%15 = call i32 @displaySum(double %13, double %14)
%16 = load double, double* %2
%17 = load double, double* %2
%18 = call i32 @displaySum(double %16, double %17)
%19 = load double, double* %6
%20 = load double, double* %5
%21 = call i32 @displaySum(double %19, double %20)
%22 = load double, double* %2
%23 = load double, double* %3
%24 = fadd double %22, %23
%25 = load double, double* %4
%26 = load double, double* %3
%27 = fsub double %25, %26
%28 = fadd double %27, 2.200000e+00
%29 = call i32 @displaySum(double %24, double %28)
ret i32 0
}

LLVM IR (-O2):
@str = [27 x i8] c"Simple Function Example 3\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @displaySum(double 1.200300e+01, double 5.470000e+01)
%3 = tail call i32 @displaySum(double 0x404D9D70A3D70A3D, double 1.630000e+01)
%4 = tail call i32 @displaySum(double 9.823000e+01, double 1.063300e+02)
%5 = tail call i32 @displaySum(double 1.630000e+01, double 9.823000e+01)
%6 = tail call i32 @displaySum(double 1.630000e+01, double 1.630000e+01)
%7 = tail call i32 @displaySum(double 5.550000e+00, double -3.200000e+00)
%8 = tail call i32 @displaySum(double 1.145300e+02, double 0xC04FF70A3D70A3D6)
ret i32 0
}