#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 /*<<< orphan*/ scanf(char *, int *);
int main() {
  int N = 0, cont = 0;
  scanf(" %d", &N);
  if (N <= 10)
    printf("7");
  else if (N <= 30) {
    cont = N - 10;
    N = cont * 1 + 7;
    printf("%d", N);
  } else if (N <= 100) {
    cont = N - 30;
    N = cont * 2 + 7 + 20;
    printf("%d", N);
  } else {
    cont = N - 100;
    N = cont * 5 + 7 + 20 + 140;
    printf("%d", N);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xebc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0xa,-0x8(%rbp)
jg     116a <main+0x4a>
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    120d <main+0xed>
cmpl   $0x1e,-0x8(%rbp)
jg     119f <main+0x7f>
mov    -0x8(%rbp),%eax
sub    $0xa,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x0,%eax
add    $0x7,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1208 <main+0xe8>
cmpl   $0x64,-0x8(%rbp)
jg     11d7 <main+0xb7>
mov    -0x8(%rbp),%eax
sub    $0x1e,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
add    $0x7,%eax
add    $0x14,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe36(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1203 <main+0xe3>
mov    -0x8(%rbp),%eax
sub    $0x64,%eax
mov    %eax,-0xc(%rbp)
imul   $0x5,-0xc(%rbp),%eax
add    $0x7,%eax
add    $0x14,%eax
add    $0x8c,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe05(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1208 <main+0xe8>
jmp    120d <main+0xed>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xec0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%esi
cmp    $0xa,%esi
jg     115f <main+0x2f>
mov    $0x37,%edi
call   1030 <putchar@plt>
jmp    119b <main+0x6b>
cmp    $0x1e,%esi
ja     1174 <main+0x44>
add    $0xfffffffd,%esi
mov    %esi,0x4(%rsp)
lea    0xe8f(%rip),%rdi
jmp    1194 <main+0x64>
cmp    $0x64,%esi
ja     1180 <main+0x50>
add    %esi,%esi
add    $0xffffffdf,%esi
jmp    1189 <main+0x59>
lea    (%rsi,%rsi,4),%esi
add    $0xfffffeb3,%esi
mov    %esi,0x4(%rsp)
lea    0xe6d(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c" %d\00"
@.str.1 = [2 x i8] c"7\00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = icmp sle i32 %5, 10
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %44
9: ; preds = %0
%10 = load i32, i32* %2
%11 = icmp sle i32 %10, 30
br i1 %11, label %12, label %20
12: ; preds = %9
%13 = load i32, i32* %2
%14 = sub nsw i32 %13, 10
store i32 %14, i32* %3
%15 = load i32, i32* %3
%16 = mul nsw i32 %15, 1
%17 = add nsw i32 %16, 7
store i32 %17, i32* %2
%18 = load i32, i32* %2
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %18)
br label %43
20: ; preds = %9
%21 = load i32, i32* %2
%22 = icmp sle i32 %21, 100
br i1 %22, label %23, label %32
23: ; preds = %20
%24 = load i32, i32* %2
%25 = sub nsw i32 %24, 30
store i32 %25, i32* %3
%26 = load i32, i32* %3
%27 = mul nsw i32 %26, 2
%28 = add nsw i32 %27, 7
%29 = add nsw i32 %28, 20
store i32 %29, i32* %2
%30 = load i32, i32* %2
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %30)
br label %42
32: ; preds = %20
%33 = load i32, i32* %2
%34 = sub nsw i32 %33, 100
store i32 %34, i32* %3
%35 = load i32, i32* %3
%36 = mul nsw i32 %35, 5
%37 = add nsw i32 %36, 7
%38 = add nsw i32 %37, 20
%39 = add nsw i32 %38, 140
store i32 %39, i32* %2
%40 = load i32, i32* %2
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %40)
br label %42
42: ; preds = %32, %23
br label %43
43: ; preds = %42, %12
br label %44
44: ; preds = %43, %7
ret i32 0
}

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