#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 *, double);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double x, y;
  scanf("%lf", &x);
  if (x < 1)
    y = x;
  else if (x < 10)
    y = 2 * x - 1;
  else
    y = 3 * x - 11;
  printf("%lf\n", y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xef2(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  0xeb9(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1161 <main+0x41>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    11ba <main+0x9a>
movsd  0xe9f(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1193 <main+0x73>
movsd  -0x10(%rbp),%xmm0
addsd  %xmm0,%xmm0
movsd  0xe9b(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    11b5 <main+0x95>
movsd  -0x10(%rbp),%xmm0
movsd  0xe70(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe6c(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    11ba <main+0x9a>
movsd  -0x18(%rbp),%xmm0
lea    0xe66(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf00(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm0
movsd  0xec3(%rip),%xmm1
ucomisd %xmm0,%xmm1
ja     116f <main+0x4f>
movsd  0xebd(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    115f <main+0x3f>
addsd  %xmm0,%xmm0
addsd  0xec3(%rip),%xmm0
jmp    116f <main+0x4f>
mulsd  0xea9(%rip),%xmm0
addsd  0xea9(%rip),%xmm0
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [5 x i8] c"%lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%5 = load double, double* %2
%6 = fcmp olt double %5, 1.000000e+00
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = load double, double* %2
store double %8, double* %3
br label %19
9: ; preds = %0
%10 = load double, double* %2
%11 = fcmp olt double %10, 1.000000e+01
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load double, double* %2
%14 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %13, double -1.000000e+00)
store double %14, double* %3
br label %18
15: ; preds = %9
%16 = load double, double* %2
%17 = call double @llvm.fmuladd.f64(double 3.000000e+00, double %16, double -1.100000e+01)
store double %17, double* %3
br label %18
18: ; preds = %15, %12
br label %19
19: ; preds = %18, %7
%20 = load double, double* %3
%21 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [5 x i8] c"%lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = load double, double* %1
%5 = fcmp olt double %4, 1.000000e+00
br i1 %5, label %12, label %6
6: ; preds = %0
%7 = fcmp olt double %4, 1.000000e+01
br i1 %7, label %8, label %10
8: ; preds = %6
%9 = call double @llvm.fmuladd.f64(double %4, double 2.000000e+00, double -1.000000e+00)
br label %12
10: ; preds = %6
%11 = call double @llvm.fmuladd.f64(double %4, double 3.000000e+00, double -1.100000e+01)
br label %12
12: ; preds = %0, %8, %10
%13 = phi double [ %9, %8 ], [ %11, %10 ], [ %4, %0 ]
%14 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %13)
ret i32 0
}