#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);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, const char *argv[]) {
  int i, n, sum = 1;
  scanf("%d", &n);
  for (i = 1; i < n; i++) {
    sum = 2 * sum + 2;
  }
  printf("%d\n", sum);
  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)
movl   $0x1,-0x1c(%rbp)
lea    0xebc(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    117a <main+0x5a>
mov    -0x1c(%rbp),%eax
shl    $0x1,%eax
add    $0x2,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1154 <main+0x34>
mov    -0x1c(%rbp),%esi
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edx
mov    $0x1,%esi
cmp    $0x2,%edx
jl     118a <main+0x6a>
lea    -0x1(%rdx),%ecx
add    $0xfffffffe,%edx
mov    %ecx,%eax
and    $0x7,%eax
cmp    $0x7,%edx
jae    1157 <main+0x37>
mov    $0x1,%esi
jmp    116e <main+0x4e>
and    $0xfffffff8,%ecx
mov    $0x1,%esi
nop
shl    $0x8,%esi
add    $0x1fe,%esi
add    $0xfffffff8,%ecx
jne    1160 <main+0x40>
test   %eax,%eax
je     118a <main+0x6a>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    %esi,%esi
add    $0x2,%esi
add    $0xffffffff,%eax
jne    1180 <main+0x60>
lea    0xe72(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %8
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %7)
store i32 1, i32* %6
br label %10
10: ; preds = %18, %2
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %21
14: ; preds = %10
%15 = load i32, i32* %8
%16 = mul nsw i32 2, %15
%17 = add nsw i32 %16, 2
store i32 %17, i32* %8
br label %18
18: ; preds = %14
%19 = load i32, i32* %6
%20 = add nsw i32 %19, 1
store i32 %20, i32* %6
br label %10
21: ; preds = %10
%22 = load i32, i32* %8
%23 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %22)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %33
8: ; preds = %2
%9 = add i32 %6, -1
%10 = add i32 %6, -2
%11 = and i32 %9, 7
%12 = icmp ult i32 %10, 7
br i1 %12, label %22, label %13
13: ; preds = %8
%14 = and i32 %9, -8
br label %15
15: ; preds = %15, %13
%16 = phi i32 [ 1, %13 ], [ %19, %15 ]
%17 = phi i32 [ 0, %13 ], [ %20, %15 ]
%18 = shl i32 %16, 8
%19 = add i32 %18, 510
%20 = add i32 %17, 8
%21 = icmp eq i32 %20, %14
br i1 %21, label %22, label %15
22: ; preds = %15, %8
%23 = phi i32 [ undef, %8 ], [ %19, %15 ]
%24 = phi i32 [ 1, %8 ], [ %19, %15 ]
%25 = icmp eq i32 %11, 0
br i1 %25, label %33, label %26
26: ; preds = %22, %26
%27 = phi i32 [ %30, %26 ], [ %24, %22 ]
%28 = phi i32 [ %31, %26 ], [ 0, %22 ]
%29 = shl nsw i32 %27, 1
%30 = add nsw i32 %29, 2
%31 = add i32 %28, 1
%32 = icmp eq i32 %31, %11
br i1 %32, label %33, label %26
33: ; preds = %22, %26, %2
%34 = phi i32 [ 1, %2 ], [ %23, %22 ], [ %30, %26 ]
%35 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %34)
ret i32 0
}