#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__ ceil(int /*<<< orphan*/);
scalar_t__ floor(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int scanf(char *, int *, int *);
int /*<<< orphan*/ sqrt(int);
int main() {
  int a, b;
  while (scanf("%i %i", &a, &b) == 2) {
    if (a == 0 || b == 0)
      break;
    printf("%i\n", (int)(floor(sqrt(b)) - ceil(sqrt(a))) + 1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <scanf@plt>
cmp    $0x2,%eax
jne    11d7 <main+0x87>
cmpl   $0x0,-0x8(%rbp)
je     1190 <main+0x40>
cmpl   $0x0,-0xc(%rbp)
jne    1195 <main+0x45>
jmp    11d7 <main+0x87>
mov    -0xc(%rbp),%edi
call   1060 <sqrt@plt>
mov    %eax,%edi
call   1070 <floor@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
call   1060 <sqrt@plt>
mov    %eax,%edi
call   1030 <ceil@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
sub    %rcx,%rax
mov    %eax,%esi
add    $0x1,%esi
lea    0xe39(%rip),%rdi
call   1040 <printf@plt>
jmp    115f <main+0xf>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xe9c(%rip),%rdi
lea    0x8(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1050 <scanf@plt>
cmp    $0x2,%eax
jne    11e0 <main+0x90>
lea    0xe87(%rip),%r14
lea    0xe7a(%rip),%r15
lea    0x8(%rsp),%r12
lea    0xc(%rsp),%r13
cmpl   $0x0,0x8(%rsp)
je     11e0 <main+0x90>
mov    0xc(%rsp),%edi
test   %edi,%edi
je     11e0 <main+0x90>
call   1060 <sqrt@plt>
mov    %eax,%edi
call   1070 <floor@plt>
mov    %rax,%rbx
mov    0x8(%rsp),%edi
call   1060 <sqrt@plt>
mov    %eax,%edi
call   1030 <ceil@plt>
sub    %eax,%ebx
add    $0x1,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
call   1050 <scanf@plt>
cmp    $0x2,%eax
je     1190 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%i %i\00"
@.str.1 = [4 x i8] c"%i\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 = icmp eq i32 %5, 2
br i1 %6, label %7, label %25
7: ; preds = %0, %13
%8 = load i32, i32* %1
%9 = icmp eq i32 %8, 0
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 0
%12 = select i1 %9, i1 true, i1 %11
br i1 %12, label %25, label %13
13: ; preds = %7
%14 = call i32 @sqrt(i32 %10)
%15 = call i64 @floor(i32 %14)
%16 = load i32, i32* %1
%17 = call i32 @sqrt(i32 %16)
%18 = call i64 @ceil(i32 %17)
%19 = sub nsw i64 %15, %18
%20 = trunc i64 %19 to i32
%21 = add nsw i32 %20, 1
%22 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %21)
%23 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%24 = icmp eq i32 %23, 2
br i1 %24, label %7, label %25
25: ; preds = %13, %7, %0
ret i32 0
}