#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 *, ...);
int /*<<< orphan*/ qd_exp(double *, double *);
int /*<<< orphan*/ qd_log(double *, double *);
int log_exp_of_pi(void) {
  const double qd_pi_0 = 3.141592653589793116e+00;
  const double qd_pi_1 = 1.224646799147353207e-16;
  const double qd_pi_2 = -2.994769809718339666e-33;
  const double qd_pi_3 = 1.112454220863365282e-49;
  double qd_pi[4];
  double exp_of_pi[4];
  double log_of_exp_of_pi[4];
  qd_pi[0] = qd_pi_0;
  qd_pi[1] = qd_pi_1;
  qd_pi[2] = qd_pi_2;
  qd_pi[3] = qd_pi_3;
  printf("\ntesting log(exp(pi)) = pi ...\n");
  qd_exp(qd_pi, exp_of_pi);
  printf("pi[0] = %22.14e  exp(pi)[0] = %22.14e\n", qd_pi[0], exp_of_pi[0]);
  printf("pi[1] = %22.14e  exp(pi)[1] = %22.14e\n", qd_pi[1], exp_of_pi[1]);
  printf("pi[2] = %22.14e  exp(pi)[2] = %22.14e\n", qd_pi[2], exp_of_pi[2]);
  printf("pi[3] = %22.14e  exp(pi)[3] = %22.14e\n", qd_pi[3], exp_of_pi[3]);
  qd_log(exp_of_pi, log_of_exp_of_pi);
  printf("pi[0] = %22.14e  log(exp(pi))[0] = %22.14e\n", qd_pi[0],
         log_of_exp_of_pi[0]);
  printf("pi[1] = %22.14e  log(exp(pi))[1] = %22.14e\n", qd_pi[1],
         log_of_exp_of_pi[1]);
  printf("pi[2] = %22.14e  log(exp(pi))[2] = %22.14e\n", qd_pi[2],
         log_of_exp_of_pi[2]);
  printf("pi[3] = %22.14e  log(exp(pi))[3] = %22.14e\n", qd_pi[3],
         log_of_exp_of_pi[3]);
  return 0;
}


x86 assembly (clang, -O0):
<log_exp_of_pi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movsd  0xed5(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xec0(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xeab(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe96(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xea1(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xe8c(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe77(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe62(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x40(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1040 <qd_exp@plt>
movsd  -0x40(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm1
lea    0xe71(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movsd  -0x38(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
lea    0xe80(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movsd  -0x30(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
lea    0xe8f(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movsd  -0x28(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
lea    0xe9e(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
lea    -0x60(%rbp),%rdi
lea    -0x80(%rbp),%rsi
call   1050 <qd_log@plt>
movsd  -0x40(%rbp),%xmm0
movsd  -0x80(%rbp),%xmm1
lea    0xea0(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movsd  -0x38(%rbp),%xmm0
movsd  -0x78(%rbp),%xmm1
lea    0xeb4(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movsd  -0x30(%rbp),%xmm0
movsd  -0x70(%rbp),%xmm1
lea    0xec8(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movsd  -0x28(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm1
lea    0xedc(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_exp_of_pi>:
push   %rbx
sub    $0x60,%rsp
movaps 0xeb4(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps 0xeb9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x1009(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rdi
lea    0x40(%rsp),%rbx
mov    %rbx,%rsi
call   1050 <qd_exp@plt>
movsd  (%rsp),%xmm0
movsd  0x40(%rsp),%xmm1
lea    0xe96(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0x8(%rsp),%xmm0
movsd  0x48(%rsp),%xmm1
lea    0xea3(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x50(%rsp),%xmm1
lea    0xeb0(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0x18(%rsp),%xmm0
movsd  0x58(%rsp),%xmm1
lea    0xebd(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <qd_log@plt>
movsd  (%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
lea    0xebe(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0x8(%rsp),%xmm0
movsd  0x28(%rsp),%xmm1
lea    0xed0(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x30(%rsp),%xmm1
lea    0xee2(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0x18(%rsp),%xmm0
movsd  0x38(%rsp),%xmm1
lea    0xef4(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"\0Atesting log(exp(pi)) = pi ...\0A\00"
@.str.1 = [39 x i8] c"pi[0] = %22.14e exp(pi)[0] = %22.14e\0A\00"
@.str.2 = [39 x i8] c"pi[1] = %22.14e exp(pi)[1] = %22.14e\0A\00"
@.str.3 = [39 x i8] c"pi[2] = %22.14e exp(pi)[2] = %22.14e\0A\00"
@.str.4 = [39 x i8] c"pi[3] = %22.14e exp(pi)[3] = %22.14e\0A\00"
@.str.5 = [44 x i8] c"pi[0] = %22.14e log(exp(pi))[0] = %22.14e\0A\00"
@.str.6 = [44 x i8] c"pi[1] = %22.14e log(exp(pi))[1] = %22.14e\0A\00"
@.str.7 = [44 x i8] c"pi[2] = %22.14e log(exp(pi))[2] = %22.14e\0A\00"
@.str.8 = [44 x i8] c"pi[3] = %22.14e log(exp(pi))[3] = %22.14e\0A\00"
define i32 @log_exp_of_pi() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca [4 x double]
%6 = alloca [4 x double]
%7 = alloca [4 x double]
store double 0x400921FB54442D18, double* %1
store double 0x3CA1A62633145C07, double* %2
store double 0xB92F1976B7ED8FBC, double* %3
store double 0x35C4CF98E804177D, double* %4
%8 = getelementptr inbounds [4 x double], [4 x double]* %5, i64 0, i64 0
store double 0x400921FB54442D18, double* %8
%9 = getelementptr inbounds [4 x double], [4 x double]* %5, i64 0, i64 1
store double 0x3CA1A62633145C07, double* %9
%10 = getelementptr inbounds [4 x double], [4 x double]* %5, i64 0, i64 2
store double 0xB92F1976B7ED8FBC, double* %10
%11 = getelementptr inbounds [4 x double], [4 x double]* %5, i64 0, i64 3
store double 0x35C4CF98E804177D, double* %11
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%13 = getelementptr inbounds [4 x double], [4 x double]* %5, i64 0, i64 0
%14 = getelementptr inbounds [4 x double], [4 x double]* %6, i64 0, i64 0
%15 = call i32 @qd_exp(double* %13, double* %14)
%16 = getelementptr inbounds [4 x double], [4 x double]* %5, i64 0, i64 0
%17 = load double, double* %16
%18 = getelementptr inbounds [4 x double], [4 x double]* %6, i64 0, i64 0
%19 = load double, double* %18
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), double %17, double %19)
%21 = getelementptr inbounds [4 x double], [4 x double]* %5, i64 0, i64 1
%22 = load double, double* %21
%23 = getelementptr inbounds [4 x double], [4 x double]* %6, i64 0, i64 1
%24 = load double, double* %23
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), double %22, double %24)
%26 = getelementptr inbounds [4 x double], [4 x double]* %5, i64 0, i64 2
%27 = load double, double* %26
%28 = getelementptr inbounds [4 x double], [4 x double]* %6, i64 0, i64 2
%29 = load double, double* %28
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0), double %27, double %29)
%31 = getelementptr inbounds [4 x double], [4 x double]* %5, i64 0, i64 3
%32 = load double, double* %31
%33 = getelementptr inbounds [4 x double], [4 x double]* %6, i64 0, i64 3
%34 = load double, double* %33
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.4, i64 0, i64 0), double %32, double %34)
%36 = getelementptr inbounds [4 x double], [4 x double]* %6, i64 0, i64 0
%37 = getelementptr inbounds [4 x double], [4 x double]* %7, i64 0, i64 0
%38 = call i32 @qd_log(double* %36, double* %37)
%39 = getelementptr inbounds [4 x double], [4 x double]* %5, i64 0, i64 0
%40 = load double, double* %39
%41 = getelementptr inbounds [4 x double], [4 x double]* %7, i64 0, i64 0
%42 = load double, double* %41
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.5, i64 0, i64 0), double %40, double %42)
%44 = getelementptr inbounds [4 x double], [4 x double]* %5, i64 0, i64 1
%45 = load double, double* %44
%46 = getelementptr inbounds [4 x double], [4 x double]* %7, i64 0, i64 1
%47 = load double, double* %46
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.6, i64 0, i64 0), double %45, double %47)
%49 = getelementptr inbounds [4 x double], [4 x double]* %5, i64 0, i64 2
%50 = load double, double* %49
%51 = getelementptr inbounds [4 x double], [4 x double]* %7, i64 0, i64 2
%52 = load double, double* %51
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.7, i64 0, i64 0), double %50, double %52)
%54 = getelementptr inbounds [4 x double], [4 x double]* %5, i64 0, i64 3
%55 = load double, double* %54
%56 = getelementptr inbounds [4 x double], [4 x double]* %7, i64 0, i64 3
%57 = load double, double* %56
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.8, i64 0, i64 0), double %55, double %57)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [39 x i8] c"pi[0] = %22.14e exp(pi)[0] = %22.14e\0A\00"
@.str.2 = [39 x i8] c"pi[1] = %22.14e exp(pi)[1] = %22.14e\0A\00"
@.str.3 = [39 x i8] c"pi[2] = %22.14e exp(pi)[2] = %22.14e\0A\00"
@.str.4 = [39 x i8] c"pi[3] = %22.14e exp(pi)[3] = %22.14e\0A\00"
@.str.5 = [44 x i8] c"pi[0] = %22.14e log(exp(pi))[0] = %22.14e\0A\00"
@.str.6 = [44 x i8] c"pi[1] = %22.14e log(exp(pi))[1] = %22.14e\0A\00"
@.str.7 = [44 x i8] c"pi[2] = %22.14e log(exp(pi))[2] = %22.14e\0A\00"
@.str.8 = [44 x i8] c"pi[3] = %22.14e log(exp(pi))[3] = %22.14e\0A\00"
@str = [31 x i8] c"\0Atesting log(exp(pi)) = pi ...\00"
define i32 @log_exp_of_pi() {
%1 = alloca [4 x double]
%2 = alloca [4 x double]
%3 = alloca [4 x double]
%4 = bitcast [4 x double]* %1 to i8*
%5 = bitcast [4 x double]* %2 to i8*
%6 = bitcast [4 x double]* %3 to i8*
%7 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 0
%8 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 1
%9 = bitcast [4 x double]* %1 to <2 x double>*
store <2 x double> <double 0x400921FB54442D18, double 0x3CA1A62633145C07>, <2 x double>* %9
%10 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 2
%11 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 3
%12 = bitcast double* %10 to <2 x double>*
store <2 x double> <double 0xB92F1976B7ED8FBC, double 0x35C4CF98E804177D>, <2 x double>* %12
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%14 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 0, i64 0
%15 = call i32 @qd_exp(double* %7, double* %14)
%16 = load double, double* %7
%17 = load double, double* %14
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), double %16, double %17)
%19 = load double, double* %8
%20 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 0, i64 1
%21 = load double, double* %20
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), double %19, double %21)
%23 = load double, double* %10
%24 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 0, i64 2
%25 = load double, double* %24
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0), double %23, double %25)
%27 = load double, double* %11
%28 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 0, i64 3
%29 = load double, double* %28
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.4, i64 0, i64 0), double %27, double %29)
%31 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 0
%32 = call i32 @qd_log(double* %14, double* %31)
%33 = load double, double* %7
%34 = load double, double* %31
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.5, i64 0, i64 0), double %33, double %34)
%36 = load double, double* %8
%37 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 1
%38 = load double, double* %37
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.6, i64 0, i64 0), double %36, double %38)
%40 = load double, double* %10
%41 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 2
%42 = load double, double* %41
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.7, i64 0, i64 0), double %40, double %42)
%44 = load double, double* %11
%45 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 3
%46 = load double, double* %45
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.8, i64 0, i64 0), double %44, double %46)
ret i32 0
}