#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 pow(double, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, double *);
int /*<<< orphan*/ setbuf(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int main(void) {
  double time, velocity, cheap_vel, acceleration;
  setbuf(stdout, 0);
  printf("Enter new time value in seconds: \n");
  scanf("%lf", &time);
  velocity = 0.00001 * pow(time, 3) - 0.00488 * pow(time, 2) + 0.75795 * time +
             181.3566;
  cheap_vel = ((0.00001 * time - 0.0048) * time + 0.75795) * time + 181.3566;
  acceleration = 3 - 0.000062 * velocity * velocity;
  printf("Time = %g\n", time);
  printf("Velocity = %8.3f m/s \n", velocity);
  printf("Cheap Velocity = %8.3f m/s \n", cheap_vel);
  printf("Acceleration = %8.3f m/s^2 \n", acceleration);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1030 <setbuf@plt>
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xee7(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
mov    $0x3,%edi
call   1060 <pow@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x2,%edi
call   1060 <pow@plt>
movsd  -0x30(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  0xe80(%rip),%xmm0
mulsd  %xmm2,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xe4d(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  0xe30(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe18(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe12(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe0e(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xde9(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdcc(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xdb3(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xd7e(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xdc8(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  -0x18(%rbp),%xmm0
lea    0xdc6(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  -0x20(%rbp),%xmm0
lea    0xdad(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  -0x28(%rbp),%xmm0
lea    0xdb7(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1040 <setbuf@plt>
lea    0xf16(%rip),%rdi
call   1030 <puts@plt>
lea    0xec1(%rip),%rdi
lea    0x10(%rsp),%rsi
call   1060 <scanf@plt>
movsd  0x10(%rsp),%xmm0
mov    $0x3,%edi
call   1070 <pow@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
mov    $0x2,%edi
call   1070 <pow@plt>
movapd %xmm0,%xmm4
mulsd  0xe4d(%rip),%xmm4
movsd  0xe4d(%rip),%xmm3
movsd  0x8(%rsp),%xmm0
mulsd  %xmm3,%xmm0
addsd  %xmm0,%xmm4
movsd  0x10(%rsp),%xmm0
movsd  0xe39(%rip),%xmm1
movapd %xmm0,%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm2,%xmm4
movsd  0xe2d(%rip),%xmm2
addsd  %xmm2,%xmm4
mulsd  %xmm0,%xmm3
addsd  0xe25(%rip),%xmm3
mulsd  %xmm0,%xmm3
addsd  %xmm1,%xmm3
mulsd  %xmm0,%xmm3
addsd  %xmm2,%xmm3
movsd  %xmm3,0x8(%rsp)
movsd  0xe0f(%rip),%xmm1
movsd  %xmm4,0x18(%rsp)
mulsd  %xmm4,%xmm1
mulsd  %xmm4,%xmm1
addsd  0xe01(%rip),%xmm1
movsd  %xmm1,0x20(%rsp)
lea    0xe00(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xe03(%rip),%rdi
movsd  0x18(%rsp),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xde9(%rip),%rdi
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xdf2(%rip),%rdi
movsd  0x20(%rsp),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [35 x i8] c"Enter new time value in seconds: \0A\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [11 x i8] c"Time = %g\0A\00"
@.str.3 = [23 x i8] c"Velocity = %8.3f m/s \0A\00"
@.str.4 = [29 x i8] c"Cheap Velocity = %8.3f m/s \0A\00"
@.str.5 = [29 x i8] c"Acceleration = %8.3f m/s^2 \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store i32 0, i32* %1
%6 = load i32, i32* @stdout
%7 = call i32 @setbuf(i32 %6, i32 0)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%10 = load double, double* %2
%11 = call double @pow(double %10, i32 3)
%12 = load double, double* %2
%13 = call double @pow(double %12, i32 2)
%14 = fmul double 4.880000e-03, %13
%15 = fneg double %14
%16 = call double @llvm.fmuladd.f64(double 1.000000e-05, double %11, double %15)
%17 = load double, double* %2
%18 = call double @llvm.fmuladd.f64(double 7.579500e-01, double %17, double %16)
%19 = fadd double %18, 0x4066AB694467381D
store double %19, double* %3
%20 = load double, double* %2
%21 = call double @llvm.fmuladd.f64(double 1.000000e-05, double %20, double -4.800000e-03)
%22 = load double, double* %2
%23 = call double @llvm.fmuladd.f64(double %21, double %22, double 7.579500e-01)
%24 = load double, double* %2
%25 = call double @llvm.fmuladd.f64(double %23, double %24, double 0x4066AB694467381D)
store double %25, double* %4
%26 = load double, double* %3
%27 = fmul double 6.200000e-05, %26
%28 = load double, double* %3
%29 = fneg double %27
%30 = call double @llvm.fmuladd.f64(double %29, double %28, double 3.000000e+00)
store double %30, double* %5
%31 = load double, double* %2
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), double %31)
%33 = load double, double* %3
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), double %33)
%35 = load double, double* %4
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), double %35)
%37 = load double, double* %5
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0), double %37)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [11 x i8] c"Time = %g\0A\00"
@.str.3 = [23 x i8] c"Velocity = %8.3f m/s \0A\00"
@.str.4 = [29 x i8] c"Cheap Velocity = %8.3f m/s \0A\00"
@.str.5 = [29 x i8] c"Acceleration = %8.3f m/s^2 \0A\00"
@str = [34 x i8] c"Enter new time value in seconds: \00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = load i32, i32* @stdout
%4 = tail call i32 @setbuf(i32 %3, i32 0)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%7 = load double, double* %1
%8 = call double @pow(double %7, i32 3)
%9 = load double, double* %1
%10 = call double @pow(double %9, i32 2)
%11 = fmul double %10, -4.880000e-03
%12 = call double @llvm.fmuladd.f64(double %8, double 1.000000e-05, double %11)
%13 = load double, double* %1
%14 = call double @llvm.fmuladd.f64(double %13, double 7.579500e-01, double %12)
%15 = fadd double %14, 0x4066AB694467381D
%16 = call double @llvm.fmuladd.f64(double %13, double 1.000000e-05, double -4.800000e-03)
%17 = call double @llvm.fmuladd.f64(double %16, double %13, double 7.579500e-01)
%18 = call double @llvm.fmuladd.f64(double %17, double %13, double 0x4066AB694467381D)
%19 = fmul double %15, -6.200000e-05
%20 = call double @llvm.fmuladd.f64(double %19, double %15, double 3.000000e+00)
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), double %13)
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), double %15)
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), double %18)
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0), double %20)
ret i32 0
}