#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 */
long long phi(long long);
int /*<<< orphan*/ printf(char *, long long, long long, long long, long long);
int /*<<< orphan*/ scanf(char *, long long *, ...);
int main() {
  long long int a, b, i, n, d, bn, cnt;
  scanf("%lld", &n);
  while (n--) {
    scanf("%lld %lld", &a, &b);
    bn = 0, cnt = 0;
    for (i = a; i <= b; i++) {
      d = phi(i);
      if (d > cnt) {
        cnt = d;
        bn = i;
      }
    }
    printf("Between %lld and %lld, %lld has a maximum of %lld divisors.\n", a,
           b, bn, d);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xebf(%rip),%rdi
lea    -0x28(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x28(%rbp)
cmp    $0x0,%rax
je     1208 <main+0xd8>
lea    0xe8f(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1050 <scanf@plt>
movq   $0x0,-0x38(%rbp)
movq   $0x0,-0x40(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jg     11e7 <main+0xb7>
mov    -0x20(%rbp),%rdi
call   1040 <phi@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
cmp    -0x40(%rbp),%rax
jle    11d1 <main+0xa1>
mov    -0x30(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x38(%rbp)
jmp    11d6 <main+0xa6>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1198 <main+0x68>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x38(%rbp),%rcx
mov    -0x30(%rbp),%r8
lea    0xe0c(%rip),%rdi
call   1030 <printf@plt>
jmp    1151 <main+0x21>
xor    %eax,%eax
add    $0x40,%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    0xec0(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
subq   $0x1,0x8(%rsp)
jae    116a <main+0x3a>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe8f(%rip),%r15
lea    0x10(%rsp),%r12
mov    %rsp,%r13
jmp    11a0 <main+0x70>
nopl   0x0(%rax,%rax,1)
xor    %r14d,%r14d
lea    0xe80(%rip),%rdi
mov    %rbp,%rsi
mov    %r14,%rcx
mov    %rbx,%r8
call   1030 <printf@plt>
subq   $0x1,0x8(%rsp)
jb     1159 <main+0x29>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0x10(%rsp),%rbp
mov    (%rsp),%rdx
cmp    %rdx,%rbp
jg     1180 <main+0x50>
mov    %r12,%r13
mov    %r15,%r12
xor    %r15d,%r15d
xor    %r14d,%r14d
nopw   0x0(%rax,%rax,1)
mov    %rbp,%rdi
call   1040 <phi@plt>
mov    %rax,%rbx
cmp    %r15,%rax
cmovg  %rbp,%r14
cmovg  %rax,%r15
lea    0x1(%rbp),%rax
mov    (%rsp),%rdx
cmp    %rdx,%rbp
mov    %rax,%rbp
jl     11d0 <main+0xa0>
mov    0x10(%rsp),%rbp
mov    %r12,%r15
mov    %r13,%r12
mov    %rsp,%r13
jmp    1183 <main+0x53>

LLVM IR (-O0):
@.str = [5 x i8] c"%lld\00"
@.str.1 = [10 x i8] c"%lld %lld\00"
@.str.2 = [61 x i8] c"Between %lld and %lld, %lld has a maximum of %lld divisors.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i32 0, i32* %1
%9 = call i32 (i8*, i64*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %5)
br label %10
10: ; preds = %34, %0
%11 = load i64, i64* %5
%12 = add nsw i64 %11, -1
store i64 %12, i64* %5
%13 = icmp ne i64 %11, 0
br i1 %13, label %14, label %40
14: ; preds = %10
%15 = call i32 (i8*, i64*, ...) @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64* %2, i64* %3)
store i64 0, i64* %7
store i64 0, i64* %8
%16 = load i64, i64* %2
store i64 %16, i64* %4
br label %17
17: ; preds = %31, %14
%18 = load i64, i64* %4
%19 = load i64, i64* %3
%20 = icmp sle i64 %18, %19
br i1 %20, label %21, label %34
21: ; preds = %17
%22 = load i64, i64* %4
%23 = call i64 @phi(i64 %22)
store i64 %23, i64* %6
%24 = load i64, i64* %6
%25 = load i64, i64* %8
%26 = icmp sgt i64 %24, %25
br i1 %26, label %27, label %30
27: ; preds = %21
%28 = load i64, i64* %6
store i64 %28, i64* %8
%29 = load i64, i64* %4
store i64 %29, i64* %7
br label %30
30: ; preds = %27, %21
br label %31
31: ; preds = %30
%32 = load i64, i64* %4
%33 = add nsw i64 %32, 1
store i64 %33, i64* %4
br label %17
34: ; preds = %17
%35 = load i64, i64* %2
%36 = load i64, i64* %3
%37 = load i64, i64* %7
%38 = load i64, i64* %6
%39 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.2, i64 0, i64 0), i64 %35, i64 %36, i64 %37, i64 %38)
br label %10
40: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lld\00"
@.str.1 = [10 x i8] c"%lld %lld\00"
@.str.2 = [61 x i8] c"Between %lld and %lld, %lld has a maximum of %lld divisors.\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64
%4 = bitcast i64* %1 to i8*
%5 = bitcast i64* %2 to i8*
%6 = bitcast i64* %3 to i8*
%7 = call i32 (i8*, i64*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %3)
%8 = load i64, i64* %3
%9 = add nsw i64 %8, -1
store i64 %9, i64* %3
%10 = icmp eq i64 %8, 0
br i1 %10, label %39, label %11
11: ; preds = %0, %30
%12 = phi i64 [ %32, %30 ], [ undef, %0 ]
%13 = call i32 (i8*, i64*, ...) @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64* %1, i64* %2)
%14 = load i64, i64* %1
%15 = load i64, i64* %2
%16 = icmp sgt i64 %14, %15
br i1 %16, label %30, label %17
17: ; preds = %11, %17
%18 = phi i64 [ %24, %17 ], [ 0, %11 ]
%19 = phi i64 [ %23, %17 ], [ 0, %11 ]
%20 = phi i64 [ %25, %17 ], [ %14, %11 ]
%21 = call i64 @phi(i64 %20)
%22 = icmp sgt i64 %21, %18
%23 = select i1 %22, i64 %20, i64 %19
%24 = select i1 %22, i64 %21, i64 %18
%25 = add nsw i64 %20, 1
%26 = load i64, i64* %2
%27 = icmp slt i64 %20, %26
br i1 %27, label %17, label %28
28: ; preds = %17
%29 = load i64, i64* %1
br label %30
30: ; preds = %28, %11
%31 = phi i64 [ %14, %11 ], [ %29, %28 ]
%32 = phi i64 [ %12, %11 ], [ %21, %28 ]
%33 = phi i64 [ 0, %11 ], [ %23, %28 ]
%34 = phi i64 [ %15, %11 ], [ %26, %28 ]
%35 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.2, i64 0, i64 0), i64 %31, i64 %34, i64 %33, i64 %32)
%36 = load i64, i64* %3
%37 = add nsw i64 %36, -1
store i64 %37, i64* %3
%38 = icmp eq i64 %36, 0
br i1 %38, label %39, label %11
39: ; preds = %30, %0
ret i32 0
}