#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(int);
double asin(int);
double atan(int);
double cos(int);
double exp(int);
double log(int);
double log10(int);
double pow(double, double);
int /*<<< orphan*/ printf(char *, ...);
double sin(int);
double sqrt(double);
double tan(int);
int main(void) {
  printf("It's time to do your math homework!\n");
  printf("Section 1: Square Roots\n");
  printf("The square root of 49.0 is %f\n", sqrt(49.0));
  printf("The square root of 149.0 is %f\n", sqrt(149.0));
  printf("The square root of 0.149 is %f\n", sqrt(.149));
  printf("\n\nSection 2: Kenny Powers\n");
  printf("4 raised to the 3rd power is %.1f\n", pow(4.0, 3.0));
  printf("7 raised to the 5th power is %.1f\n", pow(7.0, 5.0));
  printf("34 raised to the 1/2 power is %.1f\n", pow(34.0, 0.5));
  printf("\n\nSection 3: Trigonometry\n");
  printf("The cosine of a 60-degree angle is %.3f\n",
         cos((60 * (3.14159 / 180.0))));
  printf("The sine of a 90-degree angle is %.3f\n",
         sin((90 * (3.14159 / 180.0))));
  printf("The tangent of a 75-degree angle is %.3f\n",
         tan((75 * (3.14159 / 180.0))));
  printf("The arc cosine of a 45-degree angle is %.3f\n",
         acos((45 * (3.14159 / 180.0))));
  printf("The arc sine of a 30-degree angle is %.3f\n",
         asin((30 * (3.14159 / 180.0))));
  printf("The arc tangent of a 15-degree angle is %.3f\n",
         atan((15 * (3.14159 / 180.0))));
  printf("\n\nSection 4: Log functions\n");
  printf("e raised to 2 is %.3f\n", exp(2));
  printf("The natural log of 5 is %.3f\n", log(5));
  printf("The base-10 log of 5 is %.3f\n", log10(5));
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  0xe4d(%rip),%xmm0
call   10e0 <sqrt@plt>
lea    0xe87(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0xe2a(%rip),%xmm0
call   10e0 <sqrt@plt>
lea    0xe8b(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0xe07(%rip),%xmm0
call   10e0 <sqrt@plt>
lea    0xe90(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  0xdce(%rip),%xmm0
movsd  0xdce(%rip),%xmm1
call   10c0 <pow@plt>
lea    0xe9a(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0xd9b(%rip),%xmm0
movsd  0xd9b(%rip),%xmm1
call   10c0 <pow@plt>
lea    0xe9a(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0xd68(%rip),%xmm0
movsd  0xd68(%rip),%xmm1
call   10c0 <pow@plt>
lea    0xe9a(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   10a0 <cos@plt>
lea    0xeb3(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <sin@plt>
lea    0xec4(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1090 <tan@plt>
lea    0xed3(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <acos@plt>
lea    0xee8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1070 <asin@plt>
lea    0xf00(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1060 <atan@plt>
lea    0xf16(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xf36(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x2,%edi
call   1080 <exp@plt>
lea    0xf3a(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    $0x5,%edi
call   10b0 <log@plt>
lea    0xf39(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    $0x5,%edi
call   10d0 <log10@plt>
lea    0xf3f(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x1094(%rip),%rdi
call   1030 <puts@plt>
lea    0x10ac(%rip),%rdi
call   1030 <puts@plt>
lea    0xe60(%rip),%rdi
movsd  0xe28(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe69(%rip),%rdi
movsd  0xe1a(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe73(%rip),%rdi
movsd  0xe0c(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0x1076(%rip),%rdi
call   1030 <puts@plt>
lea    0xe71(%rip),%rdi
movsd  0xdf2(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe7e(%rip),%rdi
movsd  0xde4(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe8b(%rip),%rdi
movsd  0xdd6(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0x1042(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   10b0 <cos@plt>
lea    0xe83(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x1,%edi
call   1060 <sin@plt>
lea    0xe94(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x1,%edi
call   10a0 <tan@plt>
lea    0xea3(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <acos@plt>
lea    0xeb8(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %edi,%edi
call   1080 <asin@plt>
lea    0xed0(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %edi,%edi
call   1070 <atan@plt>
lea    0xee6(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xfc9(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%edi
call   1090 <exp@plt>
lea    0xef0(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x5,%edi
call   10c0 <log@plt>
lea    0xeef(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x5,%edi
call   10d0 <log10@plt>
lea    0xef5(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"It's time to do your math homework!\0A\00"
@.str.1 = [25 x i8] c"Section 1: Square Roots\0A\00"
@.str.2 = [31 x i8] c"The square root of 49.0 is %f\0A\00"
@.str.3 = [32 x i8] c"The square root of 149.0 is %f\0A\00"
@.str.4 = [32 x i8] c"The square root of 0.149 is %f\0A\00"
@.str.5 = [27 x i8] c"\0A\0ASection 2: Kenny Powers\0A\00"
@.str.6 = [35 x i8] c"4 raised to the 3rd power is %.1f\0A\00"
@.str.7 = [35 x i8] c"7 raised to the 5th power is %.1f\0A\00"
@.str.8 = [36 x i8] c"34 raised to the 1/2 power is %.1f\0A\00"
@.str.9 = [27 x i8] c"\0A\0ASection 3: Trigonometry\0A\00"
@.str.10 = [41 x i8] c"The cosine of a 60-degree angle is %.3f\0A\00"
@.str.11 = [39 x i8] c"The sine of a 90-degree angle is %.3f\0A\00"
@.str.12 = [42 x i8] c"The tangent of a 75-degree angle is %.3f\0A\00"
@.str.13 = [45 x i8] c"The arc cosine of a 45-degree angle is %.3f\0A\00"
@.str.14 = [43 x i8] c"The arc sine of a 30-degree angle is %.3f\0A\00"
@.str.15 = [46 x i8] c"The arc tangent of a 15-degree angle is %.3f\0A\00"
@.str.16 = [28 x i8] c"\0A\0ASection 4: Log functions\0A\00"
@.str.17 = [23 x i8] c"e raised to 2 is %.3f\0A\00"
@.str.18 = [30 x i8] c"The natural log of 5 is %.3f\0A\00"
@.str.19 = [30 x i8] c"The base-10 log of 5 is %.3f\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%4 = call double @sqrt(double 4.900000e+01)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), double %4)
%6 = call double @sqrt(double 1.490000e+02)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), double %6)
%8 = call double @sqrt(double 1.490000e-01)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0), double %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0))
%11 = call double @pow(double 4.000000e+00, double 3.000000e+00)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.6, i64 0, i64 0), double %11)
%13 = call double @pow(double 7.000000e+00, double 5.000000e+00)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.7, i64 0, i64 0), double %13)
%15 = call double @pow(double 3.400000e+01, double 5.000000e-01)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.8, i64 0, i64 0), double %15)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0))
%18 = call double @cos(i32 1)
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.10, i64 0, i64 0), double %18)
%20 = call double @sin(i32 1)
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.11, i64 0, i64 0), double %20)
%22 = call double @tan(i32 1)
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.12, i64 0, i64 0), double %22)
%24 = call double @acos(i32 0)
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.13, i64 0, i64 0), double %24)
%26 = call double @asin(i32 0)
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.14, i64 0, i64 0), double %26)
%28 = call double @atan(i32 0)
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.15, i64 0, i64 0), double %28)
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.16, i64 0, i64 0))
%31 = call double @exp(i32 2)
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.17, i64 0, i64 0), double %31)
%33 = call double @log(i32 5)
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.18, i64 0, i64 0), double %33)
%35 = call double @log10(i32 5)
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.19, i64 0, i64 0), double %35)
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [31 x i8] c"The square root of 49.0 is %f\0A\00"
@.str.3 = [32 x i8] c"The square root of 149.0 is %f\0A\00"
@.str.4 = [32 x i8] c"The square root of 0.149 is %f\0A\00"
@.str.6 = [35 x i8] c"4 raised to the 3rd power is %.1f\0A\00"
@.str.7 = [35 x i8] c"7 raised to the 5th power is %.1f\0A\00"
@.str.8 = [36 x i8] c"34 raised to the 1/2 power is %.1f\0A\00"
@.str.10 = [41 x i8] c"The cosine of a 60-degree angle is %.3f\0A\00"
@.str.11 = [39 x i8] c"The sine of a 90-degree angle is %.3f\0A\00"
@.str.12 = [42 x i8] c"The tangent of a 75-degree angle is %.3f\0A\00"
@.str.13 = [45 x i8] c"The arc cosine of a 45-degree angle is %.3f\0A\00"
@.str.14 = [43 x i8] c"The arc sine of a 30-degree angle is %.3f\0A\00"
@.str.15 = [46 x i8] c"The arc tangent of a 15-degree angle is %.3f\0A\00"
@.str.17 = [23 x i8] c"e raised to 2 is %.3f\0A\00"
@.str.18 = [30 x i8] c"The natural log of 5 is %.3f\0A\00"
@.str.19 = [30 x i8] c"The base-10 log of 5 is %.3f\0A\00"
@str = [36 x i8] c"It's time to do your math homework!\00"
@str.20 = [24 x i8] c"Section 1: Square Roots\00"
@str.21 = [26 x i8] c"\0A\0ASection 2: Kenny Powers\00"
@str.22 = [26 x i8] c"\0A\0ASection 3: Trigonometry\00"
@str.23 = [27 x i8] c"\0A\0ASection 4: Log functions\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.20, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), double 7.000000e+00)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), double 0x402869C1A85CC346)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0), double 0x3FD8B44F1374AF5F)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.21, i64 0, i64 0))
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.6, i64 0, i64 0), double 6.400000e+01)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.7, i64 0, i64 0), double 1.680700e+04)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.8, i64 0, i64 0), double 0x401752E50DB3A3A2)
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.22, i64 0, i64 0))
%11 = tail call double @cos(i32 1)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.10, i64 0, i64 0), double %11)
%13 = tail call double @sin(i32 1)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.11, i64 0, i64 0), double %13)
%15 = tail call double @tan(i32 1)
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.12, i64 0, i64 0), double %15)
%17 = tail call double @acos(i32 0)
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.13, i64 0, i64 0), double %17)
%19 = tail call double @asin(i32 0)
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.14, i64 0, i64 0), double %19)
%21 = tail call double @atan(i32 0)
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.15, i64 0, i64 0), double %21)
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.23, i64 0, i64 0))
%24 = tail call double @exp(i32 2)
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.17, i64 0, i64 0), double %24)
%26 = tail call double @log(i32 5)
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.18, i64 0, i64 0), double %26)
%28 = tail call double @log10(i32 5)
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.19, i64 0, i64 0), double %28)
ret i32 0
}