#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, difference;
  while (scanf("%d %d", &a, &b) == 2) {
    difference = abs(a - b);
    if (a == -1 && b == -1) {
      break;
    } else if (difference > 50) {
      printf("%d\n", 100 - difference);
    } else {
      printf("%d\n", difference);
    }
  }
  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    11bf <main+0x8f>
mov    -0x8(%rbp),%edi
sub    -0xc(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1183 <main+0x53>
cmpl   $0xffffffff,-0xc(%rbp)
jne    1183 <main+0x53>
jmp    11bf <main+0x8f>
cmpl   $0x32,-0x10(%rbp)
jle    11a6 <main+0x76>
mov    $0x64,%esi
sub    -0x10(%rbp),%esi
lea    0xe6a(%rip),%rdi
call   1040 <printf@plt>
jmp    11b5 <main+0x85>
mov    -0x10(%rbp),%esi
lea    0xe56(%rip),%rdi
call   1040 <printf@plt>
jmp    11ba <main+0x8a>
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    11a4 <main+0x84>
lea    0xebe(%rip),%r14
lea    0xeb1(%rip),%r15
lea    0x4(%rsp),%r12
mov    %rsp,%rbx
jmp    1188 <main+0x68>
nopl   0x0(%rax)
mov    $0x64,%esi
sub    %eax,%esi
cmp    $0x33,%eax
cmovb  %eax,%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    11a4 <main+0x84>
mov    0x4(%rsp),%edx
mov    (%rsp),%ecx
mov    %edx,%esi
sub    %ecx,%esi
mov    %esi,%eax
neg    %eax
cmovs  %esi,%eax
cmp    $0xffffffff,%edx
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
%4 = alloca i32
store i32 0, i32* %1
br label %5
5: ; preds = %30, %0
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%7 = icmp eq i32 %6, 2
br i1 %7, label %8, label %31
8: ; preds = %5
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = sub nsw i32 %9, %10
%12 = call i32 @abs(i32 %11)
store i32 %12, i32* %4
%13 = load i32, i32* %2
%14 = icmp eq i32 %13, -1
br i1 %14, label %15, label %19
15: ; preds = %8
%16 = load i32, i32* %3
%17 = icmp eq i32 %16, -1
br i1 %17, label %18, label %19
18: ; preds = %15
br label %31
19: ; preds = %15, %8
%20 = load i32, i32* %4
%21 = icmp sgt i32 %20, 50
br i1 %21, label %22, label %26
22: ; preds = %19
%23 = load i32, i32* %4
%24 = sub nsw i32 100, %23
%25 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %24)
br label %29
26: ; preds = %19
%27 = load i32, i32* %4
%28 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %27)
br label %29
29: ; preds = %26, %22
br label %30
30: ; preds = %29
br label %5
31: ; preds = %18, %5
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 %22
7: ; preds = %0, %15
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = sub nsw i32 %8, %9
%11 = call i32 @llvm.abs.i32(i32 %10, i1 true)
%12 = icmp eq i32 %8, -1
%13 = icmp eq i32 %9, -1
%14 = select i1 %12, i1 %13, i1 false
br i1 %14, label %22, label %15
15: ; preds = %7
%16 = icmp ugt i32 %11, 50
%17 = sub nsw i32 100, %11
%18 = select i1 %16, i32 %17, i32 %11
%19 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %18)
%20 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%21 = icmp eq i32 %20, 2
br i1 %21, label %7, label %22
22: ; preds = %15, %7, %0
ret i32 0
}