#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 /*<<< orphan*/ check_cycle_length_max(int *, int *);
int /*<<< orphan*/ check_ji(int *, int *);
int /*<<< orphan*/ cycle_length_fun(int, int *);
int /*<<< orphan*/ printf(char *, int, ...);
scalar_t__ scanf(char *, int *, int *);
int main() {
  int min_i, max_j, cycle_length, cycle_length_max;
  while (scanf("%d %d", &min_i, &max_j) != EOF) {
    cycle_length_max = 0;
    printf("%d %d", min_i, max_j);
    if (min_i == 1 && max_j == 1) {
      cycle_length_max = 1;
    } else if (min_i == max_j) {
      cycle_length_fun(min_i, &cycle_length);
      check_cycle_length_max(&cycle_length, &cycle_length_max);
    } else {
      check_ji(&min_i, &max_j);
      for (int i = max_j; i >= min_i; i--) {
        cycle_length_fun(i, &cycle_length);
        check_cycle_length_max(&cycle_length, &cycle_length_max);
      }
    }
    printf(" %d\n", cycle_length_max);
  }
  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   1070 <scanf@plt>
mov    0x2e6e(%rip),%rcx
cmp    (%rcx),%rax
je     124e <main+0xfe>
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x1,-0x8(%rbp)
jne    11be <main+0x6e>
cmpl   $0x1,-0xc(%rbp)
jne    11be <main+0x6e>
movl   $0x1,-0x14(%rbp)
jmp    1238 <main+0xe8>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    11e8 <main+0x98>
mov    -0x8(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1060 <cycle_length_fun@plt>
lea    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <check_cycle_length_max@plt>
jmp    1233 <main+0xe3>
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1030 <check_ji@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     122e <main+0xde>
mov    -0x18(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1060 <cycle_length_fun@plt>
lea    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <check_cycle_length_max@plt>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    11fb <main+0xab>
jmp    1233 <main+0xe3>
jmp    1238 <main+0xe8>
mov    -0x14(%rbp),%esi
lea    0xdc4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    115f <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    0xe9b(%rip),%rdi
lea    0x8(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1070 <scanf@plt>
mov    0x2e6d(%rip),%rcx
cmp    (%rcx),%rax
jne    1191 <main+0x41>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe68(%rip),%r13
lea    0x8(%rsp),%r15
lea    0xc(%rsp),%r12
lea    0x14(%rsp),%rbx
lea    0x10(%rsp),%rbp
jmp    11ef <main+0x9f>
xchg   %ax,%ax
mov    %rbx,%rsi
call   1060 <cycle_length_fun@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1050 <check_cycle_length_max@plt>
mov    0x10(%rsp),%esi
lea    0xe38(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r13,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1070 <scanf@plt>
mov    0x2dfe(%rip),%rcx
cmp    (%rcx),%rax
je     1180 <main+0x30>
movl   $0x0,0x10(%rsp)
mov    0x8(%rsp),%esi
mov    0xc(%rsp),%edx
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%edi
mov    0xc(%rsp),%eax
cmp    $0x1,%edi
jne    1230 <main+0xe0>
cmp    $0x1,%eax
jne    1230 <main+0xe0>
movl   $0x1,0x10(%rsp)
jmp    11c3 <main+0x73>
cs nopw 0x0(%rax,%rax,1)
nop
cmp    %eax,%edi
je     11b0 <main+0x60>
mov    %r15,%rdi
mov    %r12,%rsi
call   1030 <check_ji@plt>
mov    0xc(%rsp),%r14d
cmp    0x8(%rsp),%r14d
jl     11c3 <main+0x73>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14d,%edi
mov    %rbx,%rsi
call   1060 <cycle_length_fun@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1050 <check_cycle_length_max@plt>
lea    -0x1(%r14),%eax
cmp    0x8(%rsp),%r14d
mov    %eax,%r14d
jg     1260 <main+0x110>
jmp    11c3 <main+0x73>

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

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