#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 */
double bar(double volatile, int);
double foo(double volatile);
int /*<<< orphan*/ printf(char *, double volatile);
int main(int argc, char **argv) {
  volatile double x, y, z, t;
  x = 1.0;
  y = 1.0e16;
  z = foo(x);
  t = foo(y);
  printf("z = %e\n", z);
  printf("t = %e\n", t);
  volatile double a, b;
  a = bar(y, 8);
  b = bar(x, 9);
  printf("a = %e\n", a);
  printf("b = %e\n", b);
  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  0xeba(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xea5(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1050 <foo@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1050 <foo@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
lea    0xe86(%rip),%rdi
call   1040 <printf@plt>
movsd  -0x30(%rbp),%xmm0
lea    0xe7d(%rip),%rdi
call   1040 <printf@plt>
movsd  -0x20(%rbp),%xmm0
mov    $0x8,%edi
call   1030 <bar@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    $0x9,%edi
call   1030 <bar@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
lea    0xe4c(%rip),%rdi
call   1040 <printf@plt>
movsd  -0x40(%rbp),%xmm0
lea    0xe43(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movabs $0x3ff0000000000000,%rax
mov    %rax,0x10(%rsp)
movabs $0x4341c37937e08000,%rax
c3 41 43
mov    %rax,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1050 <foo@plt>
movsd  %xmm0,0x30(%rsp)
movsd  0x8(%rsp),%xmm0
call   1050 <foo@plt>
movsd  %xmm0,0x28(%rsp)
movsd  0x30(%rsp),%xmm0
lea    0xe7f(%rip),%rdi
call   1040 <printf@plt>
movsd  0x28(%rsp),%xmm0
lea    0xe75(%rip),%rdi
call   1040 <printf@plt>
movsd  0x8(%rsp),%xmm0
mov    $0x8,%edi
call   1030 <bar@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0x10(%rsp),%xmm0
mov    $0x9,%edi
call   1030 <bar@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0x20(%rsp),%xmm0
lea    0xe3f(%rip),%rdi
call   1040 <printf@plt>
movsd  0x18(%rsp),%xmm0
lea    0xe35(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"z = %e\0A\00"
@.str.1 = [8 x i8] c"t = %e\0A\00"
@.str.2 = [8 x i8] c"a = %e\0A\00"
@.str.3 = [8 x i8] c"b = %e\0A\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
%10 = alloca double
%11 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store volatile double 1.000000e+00, double* %6
store volatile double 1.000000e+16, double* %7
%12 = load volatile double, double* %6
%13 = call double @foo(double %12)
store volatile double %13, double* %8
%14 = load volatile double, double* %7
%15 = call double @foo(double %14)
store volatile double %15, double* %9
%16 = load volatile double, double* %8
%17 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %16)
%18 = load volatile double, double* %9
%19 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %18)
%20 = load volatile double, double* %7
%21 = call double @bar(double %20, i32 8)
store volatile double %21, double* %10
%22 = load volatile double, double* %6
%23 = call double @bar(double %22, i32 9)
store volatile double %23, double* %11
%24 = load volatile double, double* %10
%25 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), double %24)
%26 = load volatile double, double* %11
%27 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), double %26)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"z = %e\0A\00"
@.str.1 = [8 x i8] c"t = %e\0A\00"
@.str.2 = [8 x i8] c"a = %e\0A\00"
@.str.3 = [8 x i8] c"b = %e\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = bitcast double* %3 to i8*
%10 = bitcast double* %4 to i8*
%11 = bitcast double* %5 to i8*
%12 = bitcast double* %6 to i8*
store volatile double 1.000000e+00, double* %3
store volatile double 1.000000e+16, double* %4
%13 = load volatile double, double* %3
%14 = tail call double @foo(double %13)
store volatile double %14, double* %5
%15 = load volatile double, double* %4
%16 = tail call double @foo(double %15)
store volatile double %16, double* %6
%17 = load volatile double, double* %5
%18 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %17)
%19 = load volatile double, double* %6
%20 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %19)
%21 = bitcast double* %7 to i8*
%22 = bitcast double* %8 to i8*
%23 = load volatile double, double* %4
%24 = tail call double @bar(double %23, i32 8)
store volatile double %24, double* %7
%25 = load volatile double, double* %3
%26 = tail call double @bar(double %25, i32 9)
store volatile double %26, double* %8
%27 = load volatile double, double* %7
%28 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), double %27)
%29 = load volatile double, double* %8
%30 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), double %29)
ret i32 0
}