#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 main() {
  int x, y, i = 1, c = 0, t;
  scanf("%d %d", &x, &y);
  if (x > y) {
    t = x;
    x = y;
    y = t;
  }
  while (i > 0) {
    scanf("%d", &i);
    c += (x <= i && i <= y) ? 1 : 0;
  }
  printf("%d", c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xebc(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1171 <main+0x51>
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1176 <main+0x56>
cmpl   $0x0,-0x10(%rbp)
jle    11ca <main+0xaa>
lea    0xe7c(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x8(%rbp),%ecx
xor    %eax,%eax
cmp    -0x10(%rbp),%ecx
mov    %al,-0x19(%rbp)
jg     11af <main+0x8f>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
setle  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1176 <main+0x56>
mov    -0x14(%rbp),%esi
lea    0xe2f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movl   $0x1,0xc(%rsp)
lea    0xec8(%rip),%rdi
lea    0x8(%rsp),%rsi
lea    0x4(%rsp),%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x8(%rsp),%eax
mov    0x4(%rsp),%ecx
cmp    %ecx,%eax
jle    115d <main+0x3d>
mov    %ecx,0x8(%rsp)
mov    %eax,0x4(%rsp)
lea    0xe9f(%rip),%r14
lea    0xc(%rsp),%r15
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    %eax,0x8(%rsp)
setle  %cl
cmp    0x4(%rsp),%eax
setle  %dl
and    %cl,%dl
movzbl %dl,%ecx
add    %ecx,%ebx
test   %eax,%eax
jg     1170 <main+0x50>
lea    0xe62(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [6 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
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %4
store i32 0, i32* %5
%7 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = icmp sgt i32 %8, %9
br i1 %10, label %11, label %15
11: ; preds = %0
%12 = load i32, i32* %2
store i32 %12, i32* %6
%13 = load i32, i32* %3
store i32 %13, i32* %2
%14 = load i32, i32* %6
store i32 %14, i32* %3
br label %15
15: ; preds = %11, %0
br label %16
16: ; preds = %28, %15
%17 = load i32, i32* %4
%18 = icmp sgt i32 %17, 0
br i1 %18, label %19, label %34
19: ; preds = %16
%20 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%21 = load i32, i32* %2
%22 = load i32, i32* %4
%23 = icmp sle i32 %21, %22
br i1 %23, label %24, label %28
24: ; preds = %19
%25 = load i32, i32* %4
%26 = load i32, i32* %3
%27 = icmp sle i32 %25, %26
br label %28
28: ; preds = %24, %19
%29 = phi i1 [ false, %19 ], [ %27, %24 ]
%30 = zext i1 %29 to i64
%31 = select i1 %29, i32 1, i32 0
%32 = load i32, i32* %5
%33 = add nsw i32 %32, %31
store i32 %33, i32* %5
br label %16
34: ; preds = %16
%35 = load i32, i32* %5
%36 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %35)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 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 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
store i32 1, i32* %3
%7 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = icmp sgt i32 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %0
store i32 %9, i32* %1
store i32 %8, i32* %2
br label %12
12: ; preds = %0, %11
br label %13
13: ; preds = %12, %13
%14 = phi i32 [ %23, %13 ], [ 0, %12 ]
%15 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%16 = load i32, i32* %1
%17 = load i32, i32* %3
%18 = icmp sle i32 %16, %17
%19 = load i32, i32* %2
%20 = icmp sle i32 %17, %19
%21 = select i1 %18, i1 %20, i1 false
%22 = zext i1 %21 to i32
%23 = add nuw nsw i32 %14, %22
%24 = icmp sgt i32 %17, 0
br i1 %24, label %13, label %25
25: ; preds = %13
%26 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %23)
ret i32 0
}