#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 */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *, unsigned long);
scalar_t__ scanf(char *, unsigned long *);
int main() {
  unsigned long int n, i = 0, j, k;
  while (scanf("%lu", &n) != EOF) {
    while (n > 0) {
      if (n <= 100) {
        n += 11;
        i++;
      } else {
        n -= 10;
        i++;
      }
    }
    printf("%lu\n", i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x18(%rbp)
lea    0xec2(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    0x2e9a(%rip),%rcx
cmp    (%rcx),%rax
je     11c1 <main+0xa1>
jmp    115c <main+0x3c>
cmpq   $0x0,-0x10(%rbp)
jbe    11ac <main+0x8c>
cmpq   $0x64,-0x10(%rbp)
ja     118f <main+0x6f>
mov    -0x10(%rbp),%rax
add    $0xb,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    11a7 <main+0x87>
mov    -0x10(%rbp),%rax
sub    $0xa,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    115c <main+0x3c>
mov    -0x18(%rbp),%rsi
lea    0xe4d(%rip),%rdi
call   1030 <printf@plt>
jmp    1137 <main+0x17>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xece(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
mov    0x2ea7(%rip),%r13
cmp    0x0(%r13),%rax
jne    1158 <main+0x38>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %ebx,%ebx
lea    0xea3(%rip),%r14
lea    0xe98(%rip),%r15
mov    %rsp,%r12
mov    $0xb,%ebp
jmp    119c <main+0x7c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1040 <scanf@plt>
cmp    0x0(%r13),%rax
je     1147 <main+0x27>
mov    (%rsp),%rax
test   %rax,%rax
je     1180 <main+0x60>
cs nopw 0x0(%rax,%rax,1)
nop
cmp    $0x65,%rax
mov    $0xfffffffffffffff6,%rcx
cmovb  %rbp,%rcx
add    $0x1,%rbx
add    %rcx,%rax
jne    11b0 <main+0x90>
movq   $0x0,(%rsp)
jmp    1180 <main+0x60>

LLVM IR (-O0):
@.str = [4 x i8] c"%lu\00"
@EOF = global i64 0
@.str.1 = [5 x i8] c"%lu\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i32 0, i32* %1
store i64 0, i64* %3
br label %6
6: ; preds = %28, %0
%7 = call i64 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %2)
%8 = load i64, i64* @EOF
%9 = icmp ne i64 %7, %8
br i1 %9, label %10, label %31
10: ; preds = %6
br label %11
11: ; preds = %27, %10
%12 = load i64, i64* %2
%13 = icmp ugt i64 %12, 0
br i1 %13, label %14, label %28
14: ; preds = %11
%15 = load i64, i64* %2
%16 = icmp ule i64 %15, 100
br i1 %16, label %17, label %22
17: ; preds = %14
%18 = load i64, i64* %2
%19 = add i64 %18, 11
store i64 %19, i64* %2
%20 = load i64, i64* %3
%21 = add i64 %20, 1
store i64 %21, i64* %3
br label %27
22: ; preds = %14
%23 = load i64, i64* %2
%24 = sub i64 %23, 10
store i64 %24, i64* %2
%25 = load i64, i64* %3
%26 = add i64 %25, 1
store i64 %26, i64* %3
br label %27
27: ; preds = %22, %17
br label %11
28: ; preds = %11
%29 = load i64, i64* %3
%30 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %29)
br label %6
31: ; preds = %6
ret i32 0
}

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