#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 */
scalar_t__ isPairOfTwins(unsigned int);
int /*<<< orphan*/ printf(char *, unsigned int);
int /*<<< orphan*/ scanf(char *, unsigned int *, unsigned int *);
int main() {
  unsigned n, m;
  unsigned numberOfTwins = 0, i;
  scanf("%u %u", &n, &m);
  for (i = n; i <= m - 2; i++) {
    if (isPairOfTwins(i)) {
      numberOfTwins++;
    }
  }
  printf("%u\n", numberOfTwins);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x2,%ecx
cmp    %ecx,%eax
ja     119f <main+0x6f>
mov    -0x14(%rbp),%edi
call   1050 <isPairOfTwins@plt>
cmp    $0x0,%rax
je     118c <main+0x5c>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1191 <main+0x61>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1160 <main+0x30>
mov    -0x10(%rbp),%esi
lea    0xe5d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xec6(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%ebx
mov    (%rsp),%eax
add    $0xfffffffe,%eax
xor    %ebp,%ebp
cmp    %eax,%ebx
ja     117b <main+0x4b>
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    %ebx,%edi
call   1050 <isPairOfTwins@plt>
cmp    $0x1,%rax
sbb    $0xffffffff,%ebp
add    $0x1,%ebx
mov    (%rsp),%eax
add    $0xfffffffe,%eax
cmp    %eax,%ebx
jbe    1160 <main+0x30>
lea    0xe84(%rip),%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%u %u\00"
@.str.1 = [4 x i8] c"%u\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%7 = load i32, i32* %2
store i32 %7, i32* %5
br label %8
8: ; preds = %21, %0
%9 = load i32, i32* %5
%10 = load i32, i32* %3
%11 = sub i32 %10, 2
%12 = icmp ule i32 %9, %11
br i1 %12, label %13, label %24
13: ; preds = %8
%14 = load i32, i32* %5
%15 = call i64 @isPairOfTwins(i32 %14)
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %13
%18 = load i32, i32* %4
%19 = add i32 %18, 1
store i32 %19, i32* %4
br label %20
20: ; preds = %17, %13
br label %21
21: ; preds = %20
%22 = load i32, i32* %5
%23 = add i32 %22, 1
store i32 %23, i32* %5
br label %8
24: ; preds = %8
%25 = load i32, i32* %4
%26 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %25)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%u %u\00"
@.str.1 = [4 x i8] c"%u\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 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = add i32 %7, -2
%9 = icmp ugt i32 %6, %8
br i1 %9, label %21, label %10
10: ; preds = %0, %10
%11 = phi i32 [ %17, %10 ], [ %6, %0 ]
%12 = phi i32 [ %16, %10 ], [ 0, %0 ]
%13 = call i64 @isPairOfTwins(i32 %11)
%14 = icmp ne i64 %13, 0
%15 = zext i1 %14 to i32
%16 = add i32 %12, %15
%17 = add i32 %11, 1
%18 = load i32, i32* %2
%19 = add i32 %18, -2
%20 = icmp ugt i32 %17, %19
br i1 %20, label %21, label %10
21: ; preds = %10, %0
%22 = phi i32 [ 0, %0 ], [ %16, %10 ]
%23 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %22)
ret i32 0
}