#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 M_PI;
int /*<<< orphan*/ acos(double);
double exp(double);
int /*<<< orphan*/ printf(char *, double, double, int, int /*<<< orphan*/);
double tan(double);
int main() {
  double a = M_PI / 2;
  double b;
  b = tan(a);
  a = exp(b);
  printf("%lf\n%lf\n%lf\n%lf\n", b, a, 1 / a, acos(b));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e92(%rip),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1060 <tan@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1050 <exp@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe5d(%rip),%xmm0
divsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x1c(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <acos@plt>
movsd  -0x30(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mov    -0x1c(%rbp),%esi
mov    %eax,%edx
lea    0xe39(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    0x2e9c(%rip),%rax
mov    (%rax),%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
cvtsi2sd %ecx,%xmm0
call   1060 <tan@plt>
movsd  %xmm0,(%rsp)
call   1050 <exp@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0xe88(%rip),%xmm1
divsd  %xmm0,%xmm1
cvttsd2si %xmm1,%ebx
movsd  (%rsp),%xmm0
call   1040 <acos@plt>
lea    0xe77(%rip),%rdi
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@M_PI = global i32 0
@.str = [17 x i8] c"%lf\0A%lf\0A%lf\0A%lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
%4 = load i32, i32* @M_PI
%5 = sdiv i32 %4, 2
%6 = sitofp i32 %5 to double
store double %6, double* %2
%7 = load double, double* %2
%8 = call double @tan(double %7)
store double %8, double* %3
%9 = load double, double* %3
%10 = call double @exp(double %9)
store double %10, double* %2
%11 = load double, double* %3
%12 = load double, double* %2
%13 = load double, double* %2
%14 = fdiv double 1.000000e+00, %13
%15 = fptosi double %14 to i32
%16 = load double, double* %3
%17 = call i32 @acos(double %16)
%18 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), double %11, double %12, i32 %15, i32 %17)
ret i32 0
}

LLVM IR (-O2):
@M_PI = global i32 0
@.str = [17 x i8] c"%lf\0A%lf\0A%lf\0A%lf\0A\00"
define i32 @main() {
%1 = load i32, i32* @M_PI
%2 = sdiv i32 %1, 2
%3 = sitofp i32 %2 to double
%4 = tail call double @tan(double %3)
%5 = tail call double @exp(double %4)
%6 = fdiv double 1.000000e+00, %5
%7 = fptosi double %6 to i32
%8 = tail call i32 @acos(double %4)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), double %4, double %5, i32 %7, i32 %8)
ret i32 0
}