#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 /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int x;
  printf("Please input x: ");
  scanf("%d", &x);
  printf("If x=%d, then polunomial=%d\n", x,
         ((3 * x * x * x * x * x) + (2 * x * x * x * x) - (5 * x * x * x) -
          (x * x) + (7 * x) - 6));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
imul   $0x3,-0x8(%rbp),%edx
imul   -0x8(%rbp),%edx
imul   -0x8(%rbp),%edx
imul   -0x8(%rbp),%edx
imul   -0x8(%rbp),%edx
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
imul   -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
add    %eax,%edx
imul   $0x5,-0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
sub    %eax,%edx
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
sub    %eax,%edx
imul   $0x7,-0x8(%rbp),%eax
add    %eax,%edx
sub    $0x6,%edx
lea    0xe75(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
lea    (%rsi,%rsi,2),%eax
add    $0x2,%eax
imul   %esi,%eax
add    $0xfffffffb,%eax
mov    %esi,%edx
imul   %esi,%edx
imul   %eax,%edx
sub    %esi,%edx
add    $0x7,%edx
imul   %esi,%edx
add    $0xfffffffa,%edx
lea    0xeaa(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Please input x: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [29 x i8] c"If x=%d, then polunomial=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = mul nsw i32 3, %6
%8 = load i32, i32* %2
%9 = mul nsw i32 %7, %8
%10 = load i32, i32* %2
%11 = mul nsw i32 %9, %10
%12 = load i32, i32* %2
%13 = mul nsw i32 %11, %12
%14 = load i32, i32* %2
%15 = mul nsw i32 %13, %14
%16 = load i32, i32* %2
%17 = mul nsw i32 2, %16
%18 = load i32, i32* %2
%19 = mul nsw i32 %17, %18
%20 = load i32, i32* %2
%21 = mul nsw i32 %19, %20
%22 = load i32, i32* %2
%23 = mul nsw i32 %21, %22
%24 = add nsw i32 %15, %23
%25 = load i32, i32* %2
%26 = mul nsw i32 5, %25
%27 = load i32, i32* %2
%28 = mul nsw i32 %26, %27
%29 = load i32, i32* %2
%30 = mul nsw i32 %28, %29
%31 = sub nsw i32 %24, %30
%32 = load i32, i32* %2
%33 = load i32, i32* %2
%34 = mul nsw i32 %32, %33
%35 = sub nsw i32 %31, %34
%36 = load i32, i32* %2
%37 = mul nsw i32 7, %36
%38 = add nsw i32 %35, %37
%39 = sub nsw i32 %38, 6
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %39)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Please input x: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [29 x i8] c"If x=%d, then polunomial=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = mul nsw i32 %5, 3
%7 = add i32 %6, 2
%8 = mul i32 %7, %5
%9 = add i32 %8, -5
%10 = mul i32 %5, %5
%11 = mul i32 %10, %9
%12 = sub i32 7, %5
%13 = add i32 %12, %11
%14 = mul i32 %13, %5
%15 = add nsw i32 %14, -6
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %15)
ret i32 0
}