#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 power_even(int, int);
int power_odd(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int number;
  printf("enter a number:\n");
  scanf("%d", &number);
  int total = 3 * power_odd(number, 5) + 2 * power_even(number, 4) -
              5 * power_odd(number, 3) - power_even(number, 2) + 7 * number - 6;
  printf("total:%d\n", total);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xead(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
mov    $0x5,%esi
call   1060 <power_odd@plt>
imul   $0x3,%eax,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x4,%esi
call   1040 <power_even@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
shl    $0x1,%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x3,%esi
call   1060 <power_odd@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
imul   $0x5,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x2,%esi
call   1040 <power_even@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
sub    %ecx,%eax
imul   $0x7,-0x8(%rbp),%ecx
add    %ecx,%eax
sub    $0x6,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe36(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xeae(%rip),%rdi
call   1030 <puts@plt>
lea    0xe95(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf@plt>
mov    0xc(%rsp),%edi
mov    $0x5,%esi
call   1070 <power_odd@plt>
lea    (%rax,%rax,2),%r14d
mov    0xc(%rsp),%edi
mov    $0x4,%esi
call   1050 <power_even@plt>
mov    %eax,%ebx
mov    0xc(%rsp),%edi
mov    $0x3,%esi
call   1070 <power_odd@plt>
lea    (%rax,%rax,4),%ebp
mov    0xc(%rsp),%edi
mov    $0x2,%esi
call   1050 <power_even@plt>
mov    0xc(%rsp),%ecx
lea    0x0(,%rcx,8),%edx
sub    %ecx,%edx
lea    (%r14,%rbx,2),%ecx
sub    %ebp,%ecx
sub    %eax,%ecx
lea    (%rcx,%rdx,1),%esi
add    $0xfffffffa,%esi
lea    0xe2b(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [17 x i8] c"enter a number:\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [10 x i8] c"total:%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 = call i32 @power_odd(i32 %6, i32 5)
%8 = mul nsw i32 3, %7
%9 = load i32, i32* %2
%10 = call i32 @power_even(i32 %9, i32 4)
%11 = mul nsw i32 2, %10
%12 = add nsw i32 %8, %11
%13 = load i32, i32* %2
%14 = call i32 @power_odd(i32 %13, i32 3)
%15 = mul nsw i32 5, %14
%16 = sub nsw i32 %12, %15
%17 = load i32, i32* %2
%18 = call i32 @power_even(i32 %17, i32 2)
%19 = sub nsw i32 %16, %18
%20 = load i32, i32* %2
%21 = mul nsw i32 7, %20
%22 = add nsw i32 %19, %21
%23 = sub nsw i32 %22, 6
store i32 %23, i32* %3
%24 = load i32, i32* %3
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %24)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [10 x i8] c"total:%d\0A\00"
@str = [16 x i8] c"enter a number:\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 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 = call i32 @power_odd(i32 %5, i32 5)
%7 = mul nsw i32 %6, 3
%8 = load i32, i32* %1
%9 = call i32 @power_even(i32 %8, i32 4)
%10 = shl nsw i32 %9, 1
%11 = load i32, i32* %1
%12 = call i32 @power_odd(i32 %11, i32 3)
%13 = mul i32 %12, -5
%14 = load i32, i32* %1
%15 = call i32 @power_even(i32 %14, i32 2)
%16 = load i32, i32* %1
%17 = mul nsw i32 %16, 7
%18 = add i32 %7, -6
%19 = add i32 %18, %10
%20 = add i32 %19, %13
%21 = sub i32 %20, %15
%22 = add i32 %21, %17
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %22)
ret i32 0
}