#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 a, b, r;
  scanf("%d%d", &a, &b);
  if ((a - b) % 10 == 9) {
    printf("%d", a - b - 1);
  } else if ((a - b) % 10 == 0) {
    printf("%d", (a - b + 1));
  } else if ((a - b) % 10 == 1) {
    printf("%d", (a - b + 1));
  } else {
    printf("%d", (a - b - 1));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x9,%edx
jne    1174 <main+0x54>
mov    -0x8(%rbp),%esi
sub    -0xc(%rbp),%esi
sub    $0x1,%esi
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
jmp    11f5 <main+0xd5>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11a5 <main+0x85>
mov    -0x8(%rbp),%esi
sub    -0xc(%rbp),%esi
add    $0x1,%esi
lea    0xe67(%rip),%rdi
call   1030 <printf@plt>
jmp    11f0 <main+0xd0>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    11d6 <main+0xb6>
mov    -0x8(%rbp),%esi
sub    -0xc(%rbp),%esi
add    $0x1,%esi
lea    0xe36(%rip),%rdi
call   1030 <printf@plt>
jmp    11eb <main+0xcb>
mov    -0x8(%rbp),%esi
sub    -0xc(%rbp),%esi
sub    $0x1,%esi
lea    0xe1c(%rip),%rdi
call   1030 <printf@plt>
jmp    11f0 <main+0xd0>
jmp    11f5 <main+0xd5>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
sub    (%rsp),%eax
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
mov    %eax,%edx
sub    %ecx,%edx
xor    %ecx,%ecx
cmp    $0x2,%edx
setb   %cl
lea    (%rax,%rcx,2),%esi
add    $0xffffffff,%esi
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [3 x i8] c"%d\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 ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %6, %7
%9 = srem i32 %8, 10
%10 = icmp ugt i32 %9, 1
%11 = select i1 %10, i32 -1, i32 1
%12 = add nsw i32 %8, %11
%13 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %12)
ret i32 0
}