#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*/ getchar();
int power(int, int);
int /*<<< orphan*/ printf(char *, ...);
main() {
  int n;
  n = 9;
  printf("n=%d, %d\n", n++, power(2, n));
  n = 9;
  n++;
  printf("n=%d, %d\n", n, power(2, n));
  n = 9;
  printf("n=%d, %d\n", ++n, power(2, n));
  n = 9;
  ++n;
  printf("n=%d, %d\n", n, power(2, n));
  printf("\nPress any key to end...");
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x9,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x2,%edi
call   1030 <power@plt>
mov    -0x14(%rbp),%esi
mov    %eax,%edx
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x9,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x2,%edi
call   1030 <power@plt>
mov    -0x10(%rbp),%esi
mov    %eax,%edx
lea    0xe66(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x9,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x2,%edi
call   1030 <power@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xe33(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x9,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x2,%edi
call   1030 <power@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xdfd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xdf9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x2,%edi
mov    $0xa,%esi
call   1030 <power@plt>
lea    0xeb9(%rip),%rbx
mov    %rbx,%rdi
mov    $0x9,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x2,%edi
mov    $0xa,%esi
call   1030 <power@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x2,%edi
mov    $0xa,%esi
call   1030 <power@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x2,%edi
mov    $0xa,%esi
call   1030 <power@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe4b(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"n=%d, %d\0A\00"
@.str.1 = [25 x i8] c"\0APress any key to end...\00"
define i32 @main() {
%1 = tail call i32 @power(i32 2, i32 10)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 9, i32 %1)
%3 = tail call i32 @power(i32 2, i32 10)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 10, i32 %3)
%5 = tail call i32 @power(i32 2, i32 10)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 10, i32 %5)
%7 = tail call i32 @power(i32 2, i32 10)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 10, i32 %7)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%10 = tail call i32 (...) @getchar()
ret i32 0
}