#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 *);
int main(void) {
  int start, end, temp, minPress;
  while (1) {
    scanf("%d %d", &start, &end);
    if (start < 0 && end < 0)
      break;
    if (start > end) {
      temp = start;
      start = end;
      end = temp;
    }
    minPress = end - start;
    temp = start + 1 + (99 - end);
    if (temp < minPress)
      minPress = temp;
    printf("%d\n", minPress);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jge    115c <main+0x3c>
cmpl   $0x0,-0xc(%rbp)
jge    115c <main+0x3c>
jmp    11bc <main+0x9c>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    117a <main+0x5a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    $0x63,%ecx
sub    -0xc(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11a8 <main+0x88>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe54(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xed1(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
mov    (%rsp),%ecx
test   %eax,%eax
jns    114b <main+0x2b>
test   %ecx,%ecx
js     11b7 <main+0x97>
lea    0xeb4(%rip),%r14
lea    0xea7(%rip),%r15
lea    0x4(%rsp),%r12
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmp    %ecx,%eax
jle    1180 <main+0x60>
mov    %ecx,0x4(%rsp)
mov    %eax,(%rsp)
mov    %ecx,%esi
jmp    1184 <main+0x64>
nop
mov    %eax,%esi
mov    %ecx,%eax
mov    %eax,%ecx
sub    %esi,%ecx
sub    %eax,%esi
add    $0x64,%esi
cmp    %ecx,%esi
cmovge %ecx,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
mov    (%rsp),%ecx
test   %eax,%eax
jns    1170 <main+0x50>
test   %ecx,%ecx
jns    1170 <main+0x50>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

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