#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 *);
main() {
  int i;
  scanf("%d", &i);
  if (i < 0) {
    if (i % 2 == 0)
      i *= 2;
    else
      i *= 4;
  } else {
    if (i % 2 == 0)
      i *= 8;
    else
      i *= 16;
  }
  printf("%d\n", i);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jge    1179 <main+0x59>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    116b <main+0x4b>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1174 <main+0x54>
mov    -0x8(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    11a9 <main+0x89>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    119b <main+0x7b>
mov    -0x8(%rbp),%eax
shl    $0x3,%eax
mov    %eax,-0x8(%rbp)
jmp    11a4 <main+0x84>
mov    -0x8(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0x8(%rbp)
jmp    11a9 <main+0x89>
mov    -0x8(%rbp),%esi
lea    0xe50(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%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),%esi
test   %esi,%esi
js     1145 <main+0x25>
test   $0x1,%sil
jne    114f <main+0x2f>
shl    $0x3,%esi
jmp    1157 <main+0x37>
test   $0x1,%sil
jne    1154 <main+0x34>
add    %esi,%esi
jmp    1157 <main+0x37>
shl    $0x4,%esi
jmp    1157 <main+0x37>
shl    $0x2,%esi
mov    %esi,0x4(%rsp)
lea    0xea1(%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() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %17
6: ; preds = %0
%7 = load i32, i32* %2
%8 = srem i32 %7, 2
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = load i32, i32* %2
%12 = mul nsw i32 %11, 2
store i32 %12, i32* %2
br label %16
13: ; preds = %6
%14 = load i32, i32* %2
%15 = mul nsw i32 %14, 4
store i32 %15, i32* %2
br label %16
16: ; preds = %13, %10
br label %28
17: ; preds = %0
%18 = load i32, i32* %2
%19 = srem i32 %18, 2
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %17
%22 = load i32, i32* %2
%23 = mul nsw i32 %22, 8
store i32 %23, i32* %2
br label %27
24: ; preds = %17
%25 = load i32, i32* %2
%26 = mul nsw i32 %25, 16
store i32 %26, i32* %2
br label %27
27: ; preds = %24, %21
br label %28
28: ; preds = %27, %16
%29 = load i32, i32* %2
%30 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %29)
%31 = load i32, i32* %1
ret i32 %31
}

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