#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 acos(double);
double asin(double);
double atan(double);
int /*<<< orphan*/ getch();
int /*<<< orphan*/ printf(char *, double, double);
main() {
  double result1, result2, result3;
  double x = 0.5;
  result1 = acos(x);
  result2 = asin(x);
  result3 = atan(x);
  printf("The arc cosine of %lf is %lf\n", x, result1);
  printf("The arc sine of %lf is %lf\n", x, result2);
  printf("The arc tangent of %lf is %lf\n", x, result3);
  getch();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  0xea0(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1040 <acos@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1060 <asin@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1050 <atan@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
lea    0xe65(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    0xe6d(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
lea    0xe73(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1070 <getch@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xec7(%rip),%xmm0
call   1040 <atan@plt>
lea    0xedb(%rip),%rdi
movsd  0xebb(%rip),%xmm1
movsd  0xeab(%rip),%xmm0
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
movsd  0xea7(%rip),%xmm1
movsd  0xe8f(%rip),%xmm0
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
movsd  0xe93(%rip),%xmm1
movsd  0xe73(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <getch@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"The arc cosine of %lf is %lf\0A\00"
@.str.1 = [28 x i8] c"The arc sine of %lf is %lf\0A\00"
@.str.2 = [31 x i8] c"The arc tangent of %lf is %lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double 5.000000e-01, double* %4
%5 = load double, double* %4
%6 = call double @acos(double %5)
store double %6, double* %1
%7 = load double, double* %4
%8 = call double @asin(double %7)
store double %8, double* %2
%9 = load double, double* %4
%10 = call double @atan(double %9)
store double %10, double* %3
%11 = load double, double* %4
%12 = load double, double* %1
%13 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), double %11, double %12)
%14 = load double, double* %4
%15 = load double, double* %2
%16 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), double %14, double %15)
%17 = load double, double* %4
%18 = load double, double* %3
%19 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), double %17, double %18)
%20 = call i32 (...) @getch()
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"The arc cosine of %lf is %lf\0A\00"
@.str.1 = [28 x i8] c"The arc sine of %lf is %lf\0A\00"
@.str.2 = [31 x i8] c"The arc tangent of %lf is %lf\0A\00"
define i32 @main() {
%1 = tail call double @atan(double 5.000000e-01)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), double 5.000000e-01, double 0x3FF0C152382D7366)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), double 5.000000e-01, double 0x3FE0C152382D7366)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), double 5.000000e-01, double 0x3FDDAC670561BB4F)
%5 = tail call i32 (...) @getch()
ret i32 0
}