#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 main();
int pow(double, double);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int problemD(void) {
  int var_y = 0, var_x = 0, var_A = 0, var_B = 0, var_C = 0, var_D = 0;
  printf("Input x: ");
  scanf("%d", &var_x);
  printf("Input A: ");
  scanf("%d", &var_A);
  printf("Input B: ");
  scanf("%d", &var_B);
  printf("Input C: ");
  scanf("%d", &var_C);
  printf("Input D: ");
  scanf("%d", &var_D);
  var_y = 3 * (var_A * pow((double)var_x, 3.0)) + (1.0 / 4) +
          (var_B * pow((double)var_x, 2.0)) + 10 * (var_C * var_x) - 5 * var_D;
  printf("y = 3 * Ax^3 + (1 / 4) + Bx^2 + 10 * Cx - 5 * D = 3 * %d(%d^3) + (1 "
         "/ 4) * %d(%d^2) + 10 * %d(%d) - 5 * %d = %d \n",
         var_A, var_x, var_B, var_x, var_C, var_x, var_D, var_y);
  return main();
}


x86 assembly (clang, -O0):
<problemD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe9b(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe7d(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe5f(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xe66(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe41(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xe52(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe23(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x2c(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xdf5(%rip),%xmm1
call   1060 <pow@plt>
mov    %eax,%ecx
mov    -0x2c(%rbp),%eax
imul   %ecx,%eax
imul   $0x3,%eax,%eax
cvtsi2sd %eax,%xmm0
movsd  0xdd1(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xdad(%rip),%xmm1
call   1060 <pow@plt>
movsd  -0x28(%rbp),%xmm0
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
imul   %ecx,%eax
cvtsi2sd %eax,%xmm1
addsd  %xmm1,%xmm0
mov    -0x14(%rbp),%eax
imul   -0x8(%rbp),%eax
imul   $0xa,%eax,%eax
cvtsi2sd %eax,%xmm1
addsd  %xmm1,%xmm0
imul   $0x5,-0x18(%rbp),%eax
cvtsi2sd %eax,%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%r8d
mov    -0x14(%rbp),%r9d
mov    -0x8(%rbp),%r11d
mov    -0x18(%rbp),%r10d
mov    -0x4(%rbp),%eax
lea    0xd98(%rip),%rdi
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <main@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<problemD>:
push   %rbx
sub    $0x20,%rsp
movl   $0x0,0x4(%rsp)
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0x14(%rsp)
movl   $0x0,0x10(%rsp)
lea    0xea4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xea0(%rip),%rbx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xe8f(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xe7e(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xe6d(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xe5c(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0xc(%rsp),%ebx
cvtsi2sdl 0x4(%rsp),%xmm0
movsd  0xdf3(%rip),%xmm1
call   1060 <pow@plt>
imul   %ebx,%eax
lea    (%rax,%rax,2),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  0xde1(%rip),%xmm0
movsd  %xmm0,0x18(%rsp)
mov    0x8(%rsp),%ebx
xorps  %xmm0,%xmm0
cvtsi2sdl 0x4(%rsp),%xmm0
movsd  0xdce(%rip),%xmm1
call   1060 <pow@plt>
imul   %ebx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  0x18(%rsp),%xmm0
mov    0x14(%rsp),%r9d
mov    0x4(%rsp),%edx
mov    %r9d,%eax
imul   %edx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
addsd  %xmm0,%xmm1
mov    0x10(%rsp),%ebx
lea    (%rbx,%rbx,4),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
subsd  %xmm0,%xmm1
cvttsd2si %xmm1,%r10d
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%ecx
sub    $0x8,%rsp
lea    0xdad(%rip),%rdi
mov    %edx,%r8d
xor    %eax,%eax
push   %r10
push   %rbx
push   %rdx
call   1030 <printf@plt>
add    $0x20,%rsp
xor    %eax,%eax
call   1040 <main@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Input x: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [10 x i8] c"Input A: \00"
@.str.3 = [10 x i8] c"Input B: \00"
@.str.4 = [10 x i8] c"Input C: \00"
@.str.5 = [10 x i8] c"Input D: \00"
@.str.6 = [114 x i8] c"y = 3 * Ax^3 + (1 / 4) + Bx^2 + 10 * Cx - 5 * D = 3 * %d(%d^3) + (1 / 4) * %d(%d^2) + 10 * %d(%d) - 5 * %d = %d \0A\00"
define i32 @problemD() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%17 = load i32, i32* %3
%18 = load i32, i32* %2
%19 = sitofp i32 %18 to double
%20 = call i32 @pow(double %19, double 3.000000e+00)
%21 = mul nsw i32 %17, %20
%22 = mul nsw i32 3, %21
%23 = sitofp i32 %22 to double
%24 = fadd double %23, 2.500000e-01
%25 = load i32, i32* %4
%26 = load i32, i32* %2
%27 = sitofp i32 %26 to double
%28 = call i32 @pow(double %27, double 2.000000e+00)
%29 = mul nsw i32 %25, %28
%30 = sitofp i32 %29 to double
%31 = fadd double %24, %30
%32 = load i32, i32* %5
%33 = load i32, i32* %2
%34 = mul nsw i32 %32, %33
%35 = mul nsw i32 10, %34
%36 = sitofp i32 %35 to double
%37 = fadd double %31, %36
%38 = load i32, i32* %6
%39 = mul nsw i32 5, %38
%40 = sitofp i32 %39 to double
%41 = fsub double %37, %40
%42 = fptosi double %41 to i32
store i32 %42, i32* %1
%43 = load i32, i32* %3
%44 = load i32, i32* %2
%45 = load i32, i32* %4
%46 = load i32, i32* %2
%47 = load i32, i32* %5
%48 = load i32, i32* %2
%49 = load i32, i32* %6
%50 = load i32, i32* %1
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([114 x i8], [114 x i8]* @.str.6, i64 0, i64 0), i32 %43, i32 %44, i32 %45, i32 %46, i32 %47, i32 %48, i32 %49, i32 %50)
%52 = call i32 (...) @main()
ret i32 %52
}

LLVM IR (-O2):
@.str = [10 x i8] c"Input x: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [10 x i8] c"Input A: \00"
@.str.3 = [10 x i8] c"Input B: \00"
@.str.4 = [10 x i8] c"Input C: \00"
@.str.5 = [10 x i8] c"Input D: \00"
@.str.6 = [114 x i8] c"y = 3 * Ax^3 + (1 / 4) + Bx^2 + 10 * Cx - 5 * D = 3 * %d(%d^3) + (1 / 4) * %d(%d^2) + 10 * %d(%d) - 5 * %d = %d \0A\00"
define i32 @problemD() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%7 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%8 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%9 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%10 = bitcast i32* %5 to i8*
store i32 0, i32* %5
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%21 = load i32, i32* %2
%22 = load i32, i32* %1
%23 = sitofp i32 %22 to double
%24 = call i32 @pow(double %23, double 3.000000e+00)
%25 = mul i32 %21, 3
%26 = mul i32 %25, %24
%27 = sitofp i32 %26 to double
%28 = fadd double %27, 2.500000e-01
%29 = load i32, i32* %3
%30 = load i32, i32* %1
%31 = sitofp i32 %30 to double
%32 = call i32 @pow(double %31, double 2.000000e+00)
%33 = mul nsw i32 %32, %29
%34 = sitofp i32 %33 to double
%35 = fadd double %28, %34
%36 = load i32, i32* %4
%37 = load i32, i32* %1
%38 = mul i32 %36, 10
%39 = mul i32 %38, %37
%40 = sitofp i32 %39 to double
%41 = fadd double %35, %40
%42 = load i32, i32* %5
%43 = mul nsw i32 %42, 5
%44 = sitofp i32 %43 to double
%45 = fsub double %41, %44
%46 = fptosi double %45 to i32
%47 = load i32, i32* %2
%48 = load i32, i32* %3
%49 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([114 x i8], [114 x i8]* @.str.6, i64 0, i64 0), i32 %47, i32 %37, i32 %48, i32 %37, i32 %36, i32 %37, i32 %42, i32 %46)
%50 = call i32 (...) @main()
ret i32 %50
}