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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%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)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1188 <main+0x68>
mov    -0x8(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    118e <main+0x6e>
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    11fd <main+0xdd>
lea    0xe5e(%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,-0x21(%rbp)
jg     11e2 <main+0xc2>
mov    -0x10(%rbp),%ecx
xor    %eax,%eax
cmp    -0xc(%rbp),%ecx
mov    %al,-0x21(%rbp)
jg     11e2 <main+0xc2>
mov    -0x10(%rbp),%eax
cltd
idivl  -0x1c(%rbp)
cmp    $0x0,%edx
sete   %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1194 <main+0x74>
mov    -0x14(%rbp),%esi
lea    0xdfc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
movl   $0x1,0xc(%rsp)
lea    0xec5(%rip),%rdi
xor    %ebx,%ebx
lea    0x8(%rsp),%rsi
lea    0x4(%rsp),%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x8(%rsp),%ecx
mov    0x4(%rsp),%eax
cmp    %eax,%ecx
jle    1167 <main+0x47>
mov    %eax,0x8(%rsp)
mov    %ecx,0x4(%rsp)
mov    %ecx,%r12d
jmp    116c <main+0x4c>
mov    %eax,%r12d
mov    %ecx,%eax
cmp    %r12d,%eax
cmovl  %eax,%r12d
lea    0xe89(%rip),%r14
lea    0xc(%rsp),%r15
jmp    119a <main+0x7a>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl %bpl,%eax
add    %eax,%ebx
test   %ecx,%ecx
jle    11c7 <main+0xa7>
xor    %ebp,%ebp
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0xc(%rsp),%ecx
cmp    %ecx,0x8(%rsp)
jg     1190 <main+0x70>
cmp    0x4(%rsp),%ecx
jg     1190 <main+0x70>
mov    %ecx,%eax
cltd
idiv   %r12d
test   %edx,%edx
sete   %bpl
jmp    1190 <main+0x70>
lea    0xe35(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
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
%7 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %4
store i32 0, i32* %5
%8 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = icmp sgt i32 %9, %10
br i1 %11, label %12, label %16
12: ; preds = %0
%13 = load i32, i32* %2
store i32 %13, i32* %6
%14 = load i32, i32* %3
store i32 %14, i32* %2
%15 = load i32, i32* %6
store i32 %15, i32* %3
br label %16
16: ; preds = %12, %0
%17 = load i32, i32* %2
%18 = load i32, i32* %3
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %22
20: ; preds = %16
%21 = load i32, i32* %2
br label %24
22: ; preds = %16
%23 = load i32, i32* %3
br label %24
24: ; preds = %22, %20
%25 = phi i32 [ %21, %20 ], [ %23, %22 ]
store i32 %25, i32* %7
br label %26
26: ; preds = %43, %24
%27 = load i32, i32* %4
%28 = icmp sgt i32 %27, 0
br i1 %28, label %29, label %49
29: ; preds = %26
%30 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%31 = load i32, i32* %2
%32 = load i32, i32* %4
%33 = icmp sle i32 %31, %32
br i1 %33, label %34, label %43
34: ; preds = %29
%35 = load i32, i32* %4
%36 = load i32, i32* %3
%37 = icmp sle i32 %35, %36
br i1 %37, label %38, label %43
38: ; preds = %34
%39 = load i32, i32* %4
%40 = load i32, i32* %7
%41 = srem i32 %39, %40
%42 = icmp eq i32 %41, 0
br label %43
43: ; preds = %38, %34, %29
%44 = phi i1 [ false, %34 ], [ false, %29 ], [ %42, %38 ]
%45 = zext i1 %44 to i64
%46 = select i1 %44, i32 1, i32 0
%47 = load i32, i32* %5
%48 = add nsw i32 %47, %46
store i32 %48, i32* %5
br label %26
49: ; preds = %26
%50 = load i32, i32* %5
%51 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %50)
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
%13 = phi i32 [ %8, %11 ], [ %9, %0 ]
%14 = phi i32 [ %9, %11 ], [ %8, %0 ]
%15 = icmp slt i32 %14, %13
%16 = select i1 %15, i32 %14, i32 %13
br label %17
17: ; preds = %12, %29
%18 = phi i32 [ %32, %29 ], [ 0, %12 ]
%19 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%20 = load i32, i32* %1
%21 = load i32, i32* %3
%22 = icmp sgt i32 %20, %21
%23 = load i32, i32* %2
%24 = icmp sgt i32 %21, %23
%25 = select i1 %22, i1 true, i1 %24
br i1 %25, label %29, label %26
26: ; preds = %17
%27 = srem i32 %21, %16
%28 = icmp eq i32 %27, 0
br label %29
29: ; preds = %26, %17
%30 = phi i1 [ false, %17 ], [ %28, %26 ]
%31 = zext i1 %30 to i32
%32 = add nuw nsw i32 %18, %31
%33 = icmp sgt i32 %21, 0
br i1 %33, label %17, label %34
34: ; preds = %29
%35 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %32)
ret i32 0
}