#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 *, long long);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int ar[] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
  int a, b, i, r, z;
  long long int s = 0;
  scanf("%d", &a);
  scanf("%d", &b);
  for (i = a; i <= b; i++) {
    z = i;
    while (z > 0) {
      r = z % 10;
      z = z / 10;
      s += ar[r];
    }
  }
  printf("%lld\n", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
movq   $0x0,-0x50(%rbp)
lea    0xec5(%rip),%rdi
lea    -0x34(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xeb5(%rip),%rdi
lea    -0x38(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x34(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x38(%rbp),%eax
jg     11e3 <main+0xb3>
mov    -0x3c(%rbp),%eax
mov    %eax,-0x44(%rbp)
cmpl   $0x0,-0x44(%rbp)
jle    11d0 <main+0xa0>
mov    -0x44(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x40(%rbp)
mov    -0x44(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x44(%rbp)
movslq -0x40(%rbp),%rax
movslq -0x30(%rbp,%rax,4),%rax
add    -0x50(%rbp),%rax
mov    %rax,-0x50(%rbp)
jmp    1194 <main+0x64>
jmp    11d5 <main+0xa5>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1182 <main+0x52>
mov    -0x50(%rbp),%rsi
lea    0xe3d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xefc(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%r9d
mov    0x8(%rsp),%r8d
xor    %esi,%esi
cmp    %r8d,%r9d
jle    116b <main+0x4b>
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret
mov    $0xcccccccd,%r10d
lea    0xe88(%rip),%rdi
jmp    118c <main+0x6c>
nopw   0x0(%rax,%rax,1)
lea    0x1(%r9),%eax
cmp    %r8d,%r9d
mov    %eax,%r9d
je     1157 <main+0x37>
test   %r9d,%r9d
jle    1180 <main+0x60>
mov    %r9d,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ebx,%eax
imul   %r10,%rax
shr    $0x23,%rax
lea    (%rax,%rax,1),%ecx
lea    (%rcx,%rcx,4),%ecx
mov    %ebx,%edx
sub    %ecx,%edx
movslq (%rdi,%rdx,4),%rcx
add    %rcx,%rsi
cmp    $0x9,%ebx
mov    %eax,%ebx
ja     11a0 <main+0x80>
jmp    1180 <main+0x60>

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

LLVM IR (-O2):
@__const.main.ar = [10 x i32] [i32 6, i32 2, i32 5, i32 5, i32 4, i32 5, i32 6, i32 3, i32 7, i32 6]
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"%lld\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 ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = icmp sgt i32 %7, %8
br i1 %9, label %29, label %10
10: ; preds = %0, %25
%11 = phi i64 [ %26, %25 ], [ 0, %0 ]
%12 = phi i32 [ %27, %25 ], [ %7, %0 ]
%13 = icmp sgt i32 %12, 0
br i1 %13, label %14, label %25
14: ; preds = %10, %14
%15 = phi i64 [ %23, %14 ], [ %11, %10 ]
%16 = phi i32 [ %18, %14 ], [ %12, %10 ]
%17 = urem i32 %16, 10
%18 = udiv i32 %16, 10
%19 = zext i32 %17 to i64
%20 = getelementptr inbounds [10 x i32], [10 x i32]* @__const.main.ar, i64 0, i64 %19
%21 = load i32, i32* %20
%22 = sext i32 %21 to i64
%23 = add nsw i64 %15, %22
%24 = icmp ult i32 %16, 10
br i1 %24, label %25, label %14
25: ; preds = %14, %10
%26 = phi i64 [ %11, %10 ], [ %23, %14 ]
%27 = add i32 %12, 1
%28 = icmp eq i32 %12, %8
br i1 %28, label %29, label %10
29: ; preds = %25, %0
%30 = phi i64 [ 0, %0 ], [ %26, %25 ]
%31 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 %30)
ret i32 0
}