#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 cycleLength(int);
int /*<<< orphan*/ printf(char *, int, int, int);
scalar_t__ scanf(char *, int *, int *);
int main(void) {
  int i, j, low, high, len, maxLen, n;
  while (scanf("%d %d", &i, &j) > 0) {
    if (i > j) {
      high = i;
      low = j;
    } else {
      high = j;
      low = i;
    }
    maxLen = 0;
    for (n = low; n <= high; ++n) {
      len = cycleLength(n);
      if (len > maxLen) {
        maxLen = len;
      }
    }
    printf("%d %d %d\n", i, j, maxLen);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <scanf@plt>
cmp    $0x0,%rax
jle    11e9 <main+0xb9>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    117a <main+0x4a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1186 <main+0x56>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     11cf <main+0x9f>
mov    -0x20(%rbp),%edi
call   1040 <cycleLength@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jle    11bc <main+0x8c>
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    11c1 <main+0x91>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1193 <main+0x63>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x1c(%rbp),%ecx
lea    0xe27(%rip),%rdi
call   1030 <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
push   %rax
lea    0xebe(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
test   %rax,%rax
jle    11cc <main+0x9c>
lea    0xea5(%rip),%r15
lea    0x4(%rsp),%r12
mov    %rsp,%r13
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x4(%rsp),%ebp
mov    (%rsp),%eax
cmp    %eax,%ebp
mov    %eax,%r14d
cmovg  %ebp,%r14d
cmovg  %eax,%ebp
add    $0x1,%r14d
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    %ebp,%edi
call   1040 <cycleLength@plt>
cmp    %ebx,%eax
cmovg  %eax,%ebx
add    $0x1,%ebp
cmp    %ebp,%r14d
jne    1190 <main+0x60>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xe54(%rip),%rdi
mov    %ebx,%ecx
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
call   1050 <scanf@plt>
test   %rax,%rax
jg     1170 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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