#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__ EOF;
scalar_t__ nbits(unsigned long long);
int /*<<< orphan*/ printf(char *, scalar_t__);
scalar_t__ scanf(char *, unsigned long long *, unsigned long long *);
int main(void) {
  unsigned long long a, b;
  while (scanf("%llu %llu", &a, &b) != EOF) {
    printf("%llu\n", nbits(b) - nbits(a - 1));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1050 <scanf@plt>
mov    0x2e8e(%rip),%rcx
cmp    (%rcx),%rax
je     1195 <main+0x65>
mov    -0x18(%rbp),%rdi
call   1030 <nbits@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
sub    $0x1,%rdi
call   1030 <nbits@plt>
mov    -0x20(%rbp),%rsi
sub    %rax,%rsi
lea    0xe7f(%rip),%rdi
call   1040 <printf@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xebb(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1050 <scanf@plt>
mov    0x2e8d(%rip),%rbp
cmp    0x0(%rbp),%rax
je     11bd <main+0x8d>
lea    0xea2(%rip),%r14
lea    0xe91(%rip),%r15
lea    0x10(%rsp),%r12
lea    0x8(%rsp),%r13
nopl   0x0(%rax)
mov    0x8(%rsp),%rdi
call   1030 <nbits@plt>
mov    %rax,%rbx
mov    0x10(%rsp),%rdi
add    $0xffffffffffffffff,%rdi
call   1030 <nbits@plt>
sub    %rax,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
call   1050 <scanf@plt>
cmp    0x0(%rbp),%rax
jne    1180 <main+0x50>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%llu %llu\00"
@EOF = global i64 0
@.str.1 = [6 x i8] c"%llu\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
store i32 0, i32* %1
br label %4
4: ; preds = %8, %0
%5 = call i64 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64* %2, i64* %3)
%6 = load i64, i64* @EOF
%7 = icmp ne i64 %5, %6
br i1 %7, label %8, label %16
8: ; preds = %4
%9 = load i64, i64* %3
%10 = call i64 @nbits(i64 %9)
%11 = load i64, i64* %2
%12 = sub i64 %11, 1
%13 = call i64 @nbits(i64 %12)
%14 = sub nsw i64 %10, %13
%15 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 %14)
br label %4
16: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"%llu %llu\00"
@EOF = global i64 0
@.str.1 = [6 x i8] c"%llu\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = bitcast i64* %1 to i8*
%4 = bitcast i64* %2 to i8*
%5 = call i64 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64* %1, i64* %2)
%6 = load i64, i64* @EOF
%7 = icmp eq i64 %5, %6
br i1 %7, label %19, label %8
8: ; preds = %0, %8
%9 = load i64, i64* %2
%10 = call i64 @nbits(i64 %9)
%11 = load i64, i64* %1
%12 = add i64 %11, -1
%13 = call i64 @nbits(i64 %12)
%14 = sub nsw i64 %10, %13
%15 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 %14)
%16 = call i64 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64* %1, i64* %2)
%17 = load i64, i64* @EOF
%18 = icmp eq i64 %16, %17
br i1 %18, label %19, label %8
19: ; preds = %8, %0
ret i32 0
}