#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int /*<<< orphan*/ stdin;
int main(int argc, char *argv[]) {
  int i, a, b;
  fflush(stdin);
  for (i = 0; i < 200; i++) {
    scanf("%d %d", &a, &b);
    if (a == -1 && b == -1)
      return 0;
    else {
      if (abs(a - b) > 50)
        printf("%d\n", ((100 - a) < (100 - b) ? (100 - a) : (100 - b)));
      else
        printf("%d\n", abs(a - b));
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0xc8,-0x14(%rbp)
jge    1238 <main+0xf8>
lea    0xe81(%rip),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   1060 <scanf@plt>
cmpl   $0xffffffff,-0x18(%rbp)
jne    11ac <main+0x6c>
cmpl   $0xffffffff,-0x1c(%rbp)
jne    11ac <main+0x6c>
movl   $0x0,-0x4(%rbp)
jmp    123f <main+0xff>
mov    -0x18(%rbp),%edi
sub    -0x1c(%rbp),%edi
call   1030 <abs@plt>
cmp    $0x32,%eax
jle    1207 <main+0xc7>
mov    $0x64,%eax
sub    -0x18(%rbp),%eax
mov    $0x64,%ecx
sub    -0x1c(%rbp),%ecx
cmp    %ecx,%eax
jge    11e8 <main+0xa8>
mov    $0x64,%eax
sub    -0x18(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    11f3 <main+0xb3>
mov    $0x64,%eax
sub    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%esi
lea    0xe09(%rip),%rdi
call   1040 <printf@plt>
jmp    1220 <main+0xe0>
mov    -0x18(%rbp),%edi
sub    -0x1c(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,%esi
lea    0xdeb(%rip),%rdi
call   1040 <printf@plt>
jmp    1225 <main+0xe5>
jmp    122a <main+0xea>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    116b <main+0x2b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0xc8,%ebp
lea    0xeaa(%rip),%r14
lea    0xc(%rsp),%r15
lea    0x8(%rsp),%rbx
lea    0xe9f(%rip),%r12
jmp    119f <main+0x6f>
nopl   0x0(%rax)
mov    $0x64,%edx
sub    %ecx,%edx
sub    %eax,%ecx
mov    %ecx,%edi
neg    %edi
cmovs  %ecx,%edi
mov    $0x64,%esi
sub    %eax,%esi
cmp    %esi,%edx
cmovl  %edx,%esi
cmp    $0x33,%edi
cmovb  %edi,%esi
mov    %r12,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebp
je     11bf <main+0x8f>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1050 <scanf@plt>
mov    0xc(%rsp),%ecx
mov    0x8(%rsp),%eax
cmp    $0xffffffff,%ecx
jne    1170 <main+0x40>
cmp    $0xffffffff,%eax
jne    1170 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* @stdin
%10 = call i32 @fflush(i32 %9)
store i32 0, i32* %6
br label %11
11: ; preds = %51, %2
%12 = load i32, i32* %6
%13 = icmp slt i32 %12, 200
br i1 %13, label %14, label %54
14: ; preds = %11
%15 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %7, i32* %8)
%16 = load i32, i32* %7
%17 = icmp eq i32 %16, -1
br i1 %17, label %18, label %22
18: ; preds = %14
%19 = load i32, i32* %8
%20 = icmp eq i32 %19, -1
br i1 %20, label %21, label %22
21: ; preds = %18
store i32 0, i32* %3
br label %55
22: ; preds = %18, %14
%23 = load i32, i32* %7
%24 = load i32, i32* %8
%25 = sub nsw i32 %23, %24
%26 = call i32 @abs(i32 %25)
%27 = icmp sgt i32 %26, 50
br i1 %27, label %28, label %43
28: ; preds = %22
%29 = load i32, i32* %7
%30 = sub nsw i32 100, %29
%31 = load i32, i32* %8
%32 = sub nsw i32 100, %31
%33 = icmp slt i32 %30, %32
br i1 %33, label %34, label %37
34: ; preds = %28
%35 = load i32, i32* %7
%36 = sub nsw i32 100, %35
br label %40
37: ; preds = %28
%38 = load i32, i32* %8
%39 = sub nsw i32 100, %38
br label %40
40: ; preds = %37, %34
%41 = phi i32 [ %36, %34 ], [ %39, %37 ]
%42 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %41)
br label %49
43: ; preds = %22
%44 = load i32, i32* %7
%45 = load i32, i32* %8
%46 = sub nsw i32 %44, %45
%47 = call i32 @abs(i32 %46)
%48 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %47)
br label %49
49: ; preds = %43, %40
br label %50
50: ; preds = %49
br label %51
51: ; preds = %50
%52 = load i32, i32* %6
%53 = add nsw i32 %52, 1
store i32 %53, i32* %6
br label %11
54: ; preds = %11
store i32 0, i32* %3
br label %55
55: ; preds = %54, %21
%56 = load i32, i32* %3
ret i32 %56
}

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