#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(void) {
  int x;
  int poly;
  printf("Enter a number: ");
  scanf("%d", &x);
  poly = (3 * (x * x * x * x * x)) + (2 * (x * x * x * x)) - (5 * (x * x * x)) -
         (x * x) + (7 * x) - 6;
  printf("%d\n", poly);
  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),%eax
imul   -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
imul   $0x3,%eax,%eax
mov    -0x8(%rbp),%ecx
imul   -0x8(%rbp),%ecx
imul   -0x8(%rbp),%ecx
imul   -0x8(%rbp),%ecx
shl    $0x1,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%ecx
imul   -0x8(%rbp),%ecx
imul   -0x8(%rbp),%ecx
imul   $0x5,%ecx,%ecx
sub    %ecx,%eax
mov    -0x8(%rbp),%ecx
imul   -0x8(%rbp),%ecx
sub    %ecx,%eax
imul   $0x7,-0x8(%rbp),%ecx
add    %ecx,%eax
sub    $0x6,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe6e(%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),%eax
mov    %eax,%ecx
imul   %eax,%ecx
lea    (%rax,%rax,2),%esi
add    $0x2,%esi
imul   %eax,%esi
add    $0xfffffffb,%esi
imul   %ecx,%esi
add    $0x7,%esi
imul   %eax,%esi
sub    %ecx,%esi
add    $0xfffffffa,%esi
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"Enter a number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = mul nsw i32 %6, %7
%9 = load i32, i32* %2
%10 = mul nsw i32 %8, %9
%11 = load i32, i32* %2
%12 = mul nsw i32 %10, %11
%13 = load i32, i32* %2
%14 = mul nsw i32 %12, %13
%15 = mul nsw i32 3, %14
%16 = load i32, i32* %2
%17 = load i32, i32* %2
%18 = mul nsw i32 %16, %17
%19 = load i32, i32* %2
%20 = mul nsw i32 %18, %19
%21 = load i32, i32* %2
%22 = mul nsw i32 %20, %21
%23 = mul nsw i32 2, %22
%24 = add nsw i32 %15, %23
%25 = load i32, i32* %2
%26 = load i32, i32* %2
%27 = mul nsw i32 %25, %26
%28 = load i32, i32* %2
%29 = mul nsw i32 %27, %28
%30 = mul nsw i32 5, %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
store i32 %39, i32* %3
%40 = load i32, i32* %3
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %40)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%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, %5
%7 = mul i32 %5, 3
%8 = add i32 %7, 2
%9 = mul i32 %8, %5
%10 = add i32 %9, -5
%11 = mul i32 %10, %6
%12 = add i32 %11, 7
%13 = mul i32 %12, %5
%14 = sub nuw i32 -6, %6
%15 = add i32 %14, %13
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %15)
ret i32 0
}