#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;
int cycle_length(int);
int /*<<< orphan*/ printf(char *, int, int, int);
scalar_t__ scanf(char *, int *, int *);
int /*<<< orphan*/ swap(int *, int *);
int main() {
  int i, j, k;
  int temp_i, temp_j;
  int max_cycle_len, cur_len;
  while (scanf("%d %d\n", &i, &j) != EOF) {
    max_cycle_len = 0;
    temp_i = i;
    temp_j = j;
    if (i > j)
      swap(&i, &j);
    for (k = i; k <= j; k++) {
      cur_len = cycle_length(k);
      if (cur_len > max_cycle_len)
        max_cycle_len = cur_len;
    }
    printf("%d %d %d\n", temp_i, temp_j, max_cycle_len);
  };
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xead(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <scanf@plt>
mov    0x2e7e(%rip),%rcx
cmp    (%rcx),%rax
je     11fb <main+0xbb>
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    119f <main+0x5f>
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1060 <swap@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     11e1 <main+0xa1>
mov    -0x10(%rbp),%edi
call   1030 <cycle_length@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jle    11ce <main+0x8e>
mov    -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    11d3 <main+0x93>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11a5 <main+0x65>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
lea    0xe0f(%rip),%rdi
call   1040 <printf@plt>
jmp    114f <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
push   %rax
lea    0xeb1(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    0x2e82(%rip),%rcx
cmp    (%rcx),%rax
jne    117c <main+0x3c>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x4(%rsp),%r14
mov    %rsp,%r13
jmp    11c1 <main+0x81>
cs nopw 0x0(%rax,%rax,1)
lea    0xe69(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %r12d,%ecx
call   1040 <printf@plt>
lea    0xe59(%rip),%rdi
mov    %r14,%rsi
mov    %r13,%rdx
call   1050 <scanf@plt>
mov    0x2e2c(%rip),%rcx
cmp    (%rcx),%rax
je     116b <main+0x2b>
mov    0x4(%rsp),%ebp
mov    (%rsp),%ebx
mov    %ebx,%eax
mov    %ebp,%r15d
cmp    %ebx,%ebp
jle    11e4 <main+0xa4>
mov    %r14,%rdi
mov    %r13,%rsi
call   1060 <swap@plt>
mov    0x4(%rsp),%r15d
mov    (%rsp),%eax
xor    %r12d,%r12d
cmp    %eax,%r15d
jg     1190 <main+0x50>
xor    %r12d,%r12d
nop
mov    %r15d,%edi
call   1030 <cycle_length@plt>
cmp    %r12d,%eax
cmovg  %eax,%r12d
lea    0x1(%r15),%eax
cmp    (%rsp),%r15d
mov    %eax,%r15d
jl     11f0 <main+0xb0>
jmp    1190 <main+0x50>

LLVM IR (-O0):
@.str = [7 x i8] c"%d %d\0A\00"
@EOF = global i64 0
@.str.1 = [10 x i8] c"%d %d %d\0A\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
%8 = alloca i32
store i32 0, i32* %1
br label %9
9: ; preds = %39, %0
%10 = call i64 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%11 = load i64, i64* @EOF
%12 = icmp ne i64 %10, %11
br i1 %12, label %13, label %44
13: ; preds = %9
store i32 0, i32* %7
%14 = load i32, i32* %2
store i32 %14, i32* %5
%15 = load i32, i32* %3
store i32 %15, i32* %6
%16 = load i32, i32* %2
%17 = load i32, i32* %3
%18 = icmp sgt i32 %16, %17
br i1 %18, label %19, label %21
19: ; preds = %13
%20 = call i32 @swap(i32* %2, i32* %3)
br label %21
21: ; preds = %19, %13
%22 = load i32, i32* %2
store i32 %22, i32* %4
br label %23
23: ; preds = %36, %21
%24 = load i32, i32* %4
%25 = load i32, i32* %3
%26 = icmp sle i32 %24, %25
br i1 %26, label %27, label %39
27: ; preds = %23
%28 = load i32, i32* %4
%29 = call i32 @cycle_length(i32 %28)
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = load i32, i32* %7
%32 = icmp sgt i32 %30, %31
br i1 %32, label %33, label %35
33: ; preds = %27
%34 = load i32, i32* %8
store i32 %34, i32* %7
br label %35
35: ; preds = %33, %27
br label %36
36: ; preds = %35
%37 = load i32, i32* %4
%38 = add nsw i32 %37, 1
store i32 %38, i32* %4
br label %23
39: ; preds = %23
%40 = load i32, i32* %5
%41 = load i32, i32* %6
%42 = load i32, i32* %7
%43 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %40, i32 %41, i32 %42)
br label %9
44: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\0A\00"
@EOF = global i64 0
@.str.1 = [10 x i8] c"%d %d %d\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 i64 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i64, i64* @EOF
%7 = icmp eq i64 %5, %6
br i1 %7, label %35, label %8
8: ; preds = %0, %29
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = icmp sgt i32 %9, %10
br i1 %11, label %12, label %16
12: ; preds = %8
%13 = call i32 @swap(i32* %1, i32* %2)
%14 = load i32, i32* %1
%15 = load i32, i32* %2
br label %16
16: ; preds = %12, %8
%17 = phi i32 [ %15, %12 ], [ %10, %8 ]
%18 = phi i32 [ %14, %12 ], [ %9, %8 ]
%19 = icmp sgt i32 %18, %17
br i1 %19, label %29, label %20
20: ; preds = %16, %20
%21 = phi i32 [ %26, %20 ], [ %18, %16 ]
%22 = phi i32 [ %25, %20 ], [ 0, %16 ]
%23 = call i32 @cycle_length(i32 %21)
%24 = icmp sgt i32 %23, %22
%25 = select i1 %24, i32 %23, i32 %22
%26 = add nsw i32 %21, 1
%27 = load i32, i32* %2
%28 = icmp slt i32 %21, %27
br i1 %28, label %20, label %29
29: ; preds = %20, %16
%30 = phi i32 [ 0, %16 ], [ %25, %20 ]
%31 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 %10, i32 %30)
%32 = call i64 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%33 = load i64, i64* @EOF
%34 = icmp eq i64 %32, %33
br i1 %34, label %35, label %8
35: ; preds = %29, %0
ret i32 0
}