#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 abs(int);
int /*<<< orphan*/ printf(char *, int);
int scanf(char *, int *, int *);
int main() {
  int a, b;
  while (scanf("%d %d", &a, &b) == 2) {
    if (a == -1 && b == -1)
      break;
    a = abs(a - b);
    b = 99 - a;
    if (a < b)
      printf("%d\n", a);
    else
      printf("%d\n", b + 1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <scanf@plt>
cmp    $0x2,%eax
jne    11c5 <main+0x95>
cmpl   $0xffffffff,-0x8(%rbp)
jne    1175 <main+0x45>
cmpl   $0xffffffff,-0xc(%rbp)
jne    1175 <main+0x45>
jmp    11c5 <main+0x95>
mov    -0x8(%rbp),%edi
sub    -0xc(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,-0x8(%rbp)
mov    $0x63,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11ae <main+0x7e>
mov    -0x8(%rbp),%esi
lea    0xe62(%rip),%rdi
call   1040 <printf@plt>
jmp    11c0 <main+0x90>
mov    -0xc(%rbp),%esi
add    $0x1,%esi
lea    0xe4b(%rip),%rdi
call   1040 <printf@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x10,%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>
cmp    $0x2,%eax
jne    11af <main+0x8f>
lea    0xebe(%rip),%r14
lea    0xeb1(%rip),%r15
lea    0x4(%rsp),%r12
mov    %rsp,%rbx
jmp    119e <main+0x7e>
nopl   0x0(%rax)
sub    %ecx,%eax
mov    %eax,%ecx
neg    %ecx
cmovs  %eax,%ecx
mov    %ecx,0x4(%rsp)
mov    $0x63,%eax
sub    %ecx,%eax
mov    %eax,(%rsp)
mov    $0x64,%esi
sub    %ecx,%esi
cmp    %eax,%ecx
cmovl  %ecx,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1040 <scanf@plt>
cmp    $0x2,%eax
jne    11af <main+0x8f>
mov    0x4(%rsp),%eax
mov    (%rsp),%ecx
cmp    $0xffffffff,%eax
jne    1160 <main+0x40>
cmp    $0xffffffff,%ecx
jne    1160 <main+0x40>
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
store i32 0, i32* %1
br label %4
4: ; preds = %31, %0
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%6 = icmp eq i32 %5, 2
br i1 %6, label %7, label %32
7: ; preds = %4
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %14
10: ; preds = %7
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %14
13: ; preds = %10
br label %32
14: ; preds = %10, %7
%15 = load i32, i32* %2
%16 = load i32, i32* %3
%17 = sub nsw i32 %15, %16
%18 = call i32 @abs(i32 %17)
store i32 %18, i32* %2
%19 = load i32, i32* %2
%20 = sub nsw i32 99, %19
store i32 %20, i32* %3
%21 = load i32, i32* %2
%22 = load i32, i32* %3
%23 = icmp slt i32 %21, %22
br i1 %23, label %24, label %27
24: ; preds = %14
%25 = load i32, i32* %2
%26 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %25)
br label %31
27: ; preds = %14
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 1
%30 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %29)
br label %31
31: ; preds = %27, %24
br label %4
32: ; preds = %13, %4
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 = icmp eq i32 %5, 2
br i1 %6, label %7, label %23
7: ; preds = %0, %13
%8 = load i32, i32* %1
%9 = icmp eq i32 %8, -1
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, -1
%12 = select i1 %9, i1 %11, i1 false
br i1 %12, label %23, label %13
13: ; preds = %7
%14 = sub nsw i32 %8, %10
%15 = call i32 @llvm.abs.i32(i32 %14, i1 true)
store i32 %15, i32* %1
%16 = sub nsw i32 99, %15
store i32 %16, i32* %2
%17 = icmp slt i32 %15, %16
%18 = sub nsw i32 100, %15
%19 = select i1 %17, i32 %15, i32 %18
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %19)
%21 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%22 = icmp eq i32 %21, 2
br i1 %22, label %7, label %23
23: ; preds = %13, %7, %0
ret i32 0
}