#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 atoi(char *);
int power(int, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int x = atoi(argv[1]);
  printf("%d", 3 * power(x, 5) + 2 * power(x, 4) - 5 * power(x, 3) -
                   power(x, 2) + 7 * x - 6);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    $0x5,%esi
call   1030 <power@plt>
imul   $0x3,%eax,%eax
mov    %eax,-0x20(%rbp)
mov    -0x14(%rbp),%edi
mov    $0x4,%esi
call   1030 <power@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
shl    $0x1,%ecx
add    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%edi
mov    $0x3,%esi
call   1030 <power@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
imul   $0x5,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
mov    $0x2,%esi
call   1030 <power@plt>
mov    -0x18(%rbp),%esi
sub    %eax,%esi
imul   $0x7,-0x14(%rbp),%eax
add    %eax,%esi
sub    $0x6,%esi
lea    0xe41(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%ebx
mov    %eax,%edi
mov    $0x5,%esi
call   1030 <power@plt>
lea    (%rax,%rax,2),%r15d
mov    %ebx,%edi
mov    $0x4,%esi
call   1030 <power@plt>
mov    %eax,%r14d
mov    %ebx,%edi
mov    $0x3,%esi
call   1030 <power@plt>
lea    (%rax,%rax,4),%ebp
mov    %ebx,%edi
mov    $0x2,%esi
call   1030 <power@plt>
lea    0x0(,%rbx,8),%ecx
sub    %ebx,%ecx
add    %r15d,%ecx
lea    (%rcx,%r14,2),%esi
sub    %ebp,%esi
sub    %eax,%esi
add    $0xfffffffa,%esi
lea    0xe66(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = call i32 @atoi(i8* %9)
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = call i32 @power(i32 %11, i32 5)
%13 = mul nsw i32 3, %12
%14 = load i32, i32* %6
%15 = call i32 @power(i32 %14, i32 4)
%16 = mul nsw i32 2, %15
%17 = add nsw i32 %13, %16
%18 = load i32, i32* %6
%19 = call i32 @power(i32 %18, i32 3)
%20 = mul nsw i32 5, %19
%21 = sub nsw i32 %17, %20
%22 = load i32, i32* %6
%23 = call i32 @power(i32 %22, i32 2)
%24 = sub nsw i32 %21, %23
%25 = load i32, i32* %6
%26 = mul nsw i32 7, %25
%27 = add nsw i32 %24, %26
%28 = sub nsw i32 %27, 6
%29 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %28)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = tail call i32 @power(i32 %5, i32 5)
%7 = mul nsw i32 %6, 3
%8 = tail call i32 @power(i32 %5, i32 4)
%9 = shl nsw i32 %8, 1
%10 = tail call i32 @power(i32 %5, i32 3)
%11 = mul i32 %10, -5
%12 = tail call i32 @power(i32 %5, i32 2)
%13 = mul nsw i32 %5, 7
%14 = add i32 %13, -6
%15 = add i32 %14, %7
%16 = add i32 %15, %9
%17 = add i32 %16, %11
%18 = sub i32 %17, %12
%19 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %18)
ret i32 0
}