#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 x, y;
  scanf("%d", &x);
  if (x < 1)
    y = x;
  else if (x >= 1 && x < 10)
    y = x * 2 - 1;
  else
    y = x * 3 - 11;
  printf("%d", y);
  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)
lea    0xec3(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x1,-0x14(%rbp)
jge    115b <main+0x3b>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    118f <main+0x6f>
cmpl   $0x1,-0x14(%rbp)
jl     1180 <main+0x60>
cmpl   $0xa,-0x14(%rbp)
jge    1180 <main+0x60>
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
sub    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    118a <main+0x6a>
imul   $0x3,-0x14(%rbp),%eax
sub    $0xb,%eax
mov    %eax,-0x18(%rbp)
jmp    118f <main+0x6f>
mov    -0x18(%rbp),%esi
lea    0xe67(%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),%esi
test   %esi,%esi
jle    114c <main+0x2c>
cmp    $0x9,%esi
ja     1146 <main+0x26>
add    %esi,%esi
add    $0xffffffff,%esi
jmp    114c <main+0x2c>
lea    (%rsi,%rsi,2),%esi
add    $0xfffffff5,%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
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
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%9 = load i32, i32* %6
%10 = icmp slt i32 %9, 1
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i32, i32* %6
store i32 %12, i32* %7
br label %28
13: ; preds = %2
%14 = load i32, i32* %6
%15 = icmp sge i32 %14, 1
br i1 %15, label %16, label %23
16: ; preds = %13
%17 = load i32, i32* %6
%18 = icmp slt i32 %17, 10
br i1 %18, label %19, label %23
19: ; preds = %16
%20 = load i32, i32* %6
%21 = mul nsw i32 %20, 2
%22 = sub nsw i32 %21, 1
store i32 %22, i32* %7
br label %27
23: ; preds = %16, %13
%24 = load i32, i32* %6
%25 = mul nsw i32 %24, 3
%26 = sub nsw i32 %25, 11
store i32 %26, i32* %7
br label %27
27: ; preds = %23, %19
br label %28
28: ; preds = %27, %11
%29 = load i32, i32* %7
%30 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %29)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\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 slt i32 %6, 1
br i1 %7, label %16, label %8
8: ; preds = %2
%9 = icmp ult i32 %6, 10
br i1 %9, label %10, label %13
10: ; preds = %8
%11 = shl nuw nsw i32 %6, 1
%12 = add nsw i32 %11, -1
br label %16
13: ; preds = %8
%14 = mul nsw i32 %6, 3
%15 = add nsw i32 %14, -11
br label %16
16: ; preds = %2, %10, %13
%17 = phi i32 [ %12, %10 ], [ %15, %13 ], [ %6, %2 ]
%18 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %17)
ret i32 0
}