#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 cubic(double);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, double, double);
double power4(double);
double power5(double);
double square(double);
int /*<<< orphan*/ stdout;
int main(int argc, char **argv) {
  double x = 9.8;
  fprintf(stdout, "Square of %5.2f is %18.6f\n", x, square(x));
  fprintf(stdout, "Cubic  of %5.2f is %18.6f\n", x, cubic(x));
  fprintf(stdout, "x^4    of %5.2f is %18.6f\n", x, power4(x));
  fprintf(stdout, "x^5    of %5.2f is %18.6f\n", x, power5(x));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  0xe92(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    0x2e66(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x54(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <square@plt>
mov    -0x54(%rbp),%edi
movaps %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
lea    0xe63(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2e2f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x44(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <cubic@plt>
mov    -0x44(%rbp),%edi
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
lea    0xe47(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2df8(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x34(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1060 <power4@plt>
mov    -0x34(%rbp),%edi
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
lea    0xe2b(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2dc1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1070 <power5@plt>
mov    -0x24(%rbp),%edi
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
lea    0xe0f(%rip),%rsi
call   1050 <fprintf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2e85(%rip),%r14
mov    (%r14),%ebx
movsd  0xe9a(%rip),%xmm0
call   1040 <square@plt>
movaps %xmm0,%xmm1
lea    0xe93(%rip),%rsi
mov    %ebx,%edi
movsd  0xe81(%rip),%xmm0
call   1050 <fprintf@plt>
mov    (%r14),%ebx
movsd  0xe71(%rip),%xmm0
call   1030 <cubic@plt>
movaps %xmm0,%xmm1
lea    0xe85(%rip),%rsi
mov    %ebx,%edi
movsd  0xe58(%rip),%xmm0
call   1050 <fprintf@plt>
mov    (%r14),%ebx
movsd  0xe48(%rip),%xmm0
call   1060 <power4@plt>
movaps %xmm0,%xmm1
lea    0xe77(%rip),%rsi
mov    %ebx,%edi
movsd  0xe2f(%rip),%xmm0
call   1050 <fprintf@plt>
mov    (%r14),%ebx
movsd  0xe1f(%rip),%xmm0
call   1070 <power5@plt>
movaps %xmm0,%xmm1
lea    0xe69(%rip),%rsi
mov    %ebx,%edi
movsd  0xe06(%rip),%xmm0
call   1050 <fprintf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [27 x i8] c"Square of %5.2f is %18.6f\0A\00"
@.str.1 = [27 x i8] c"Cubic of %5.2f is %18.6f\0A\00"
@.str.2 = [27 x i8] c"x^4 of %5.2f is %18.6f\0A\00"
@.str.3 = [27 x i8] c"x^5 of %5.2f is %18.6f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store double 9.800000e+00, double* %6
%7 = load i32, i32* @stdout
%8 = load double, double* %6
%9 = load double, double* %6
%10 = call double @square(double %9)
%11 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), double %8, double %10)
%12 = load i32, i32* @stdout
%13 = load double, double* %6
%14 = load double, double* %6
%15 = call double @cubic(double %14)
%16 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), double %13, double %15)
%17 = load i32, i32* @stdout
%18 = load double, double* %6
%19 = load double, double* %6
%20 = call double @power4(double %19)
%21 = call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), double %18, double %20)
%22 = load i32, i32* @stdout
%23 = load double, double* %6
%24 = load double, double* %6
%25 = call double @power5(double %24)
%26 = call i32 @fprintf(i32 %22, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), double %23, double %25)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [27 x i8] c"Square of %5.2f is %18.6f\0A\00"
@.str.1 = [27 x i8] c"Cubic of %5.2f is %18.6f\0A\00"
@.str.2 = [27 x i8] c"x^4 of %5.2f is %18.6f\0A\00"
@.str.3 = [27 x i8] c"x^5 of %5.2f is %18.6f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stdout
%4 = tail call double @square(double 9.800000e+00)
%5 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), double 9.800000e+00, double %4)
%6 = load i32, i32* @stdout
%7 = tail call double @cubic(double 9.800000e+00)
%8 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), double 9.800000e+00, double %7)
%9 = load i32, i32* @stdout
%10 = tail call double @power4(double 9.800000e+00)
%11 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), double 9.800000e+00, double %10)
%12 = load i32, i32* @stdout
%13 = tail call double @power5(double 9.800000e+00)
%14 = tail call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), double 9.800000e+00, double %13)
ret i32 0
}