#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 cycle(int);
int /*<<< orphan*/ printf(char *, int, int, int);
int scanf(char *, int *, int *);
main() {
  int m, n, max, temp;
  int mOriginal, nOriginal;
  int i;
  while (scanf("%d %d", &m, &n) == 2) {
    mOriginal = m;
    nOriginal = n;
    if (m > n) {
      temp = m;
      m = n;
      n = temp;
    }
    max = cycle(m);
    for (i = m + 1; i <= n; i++) {
      temp = cycle(i);
      if (temp > max)
        max = temp;
    }
    printf("%d %d %d\n", mOriginal, nOriginal, max);
  }
}


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   1040 <scanf@plt>
cmp    $0x2,%eax
jne    11f0 <main+0xc0>
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1186 <main+0x56>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <cycle@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     11d6 <main+0xa6>
mov    -0x20(%rbp),%edi
call   1050 <cycle@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    11c3 <main+0x93>
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    11c8 <main+0x98>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    119a <main+0x6a>
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe20(%rip),%rdi
call   1030 <printf@plt>
jmp    113f <main+0xf>
mov    -0x4(%rbp),%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   1040 <scanf@plt>
cmp    $0x2,%eax
jne    11eb <main+0xbb>
lea    0x4(%rsp),%r12
mov    %rsp,%r13
jmp    119a <main+0x6a>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0xe8f(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %r14d,%ecx
call   1030 <printf@plt>
lea    0xe76(%rip),%rdi
mov    %r12,%rsi
mov    %r13,%rdx
call   1040 <scanf@plt>
cmp    $0x2,%eax
jne    11eb <main+0xbb>
mov    0x4(%rsp),%ebp
mov    (%rsp),%ebx
mov    %ebp,%edi
cmp    %ebx,%ebp
jle    11b0 <main+0x80>
mov    %ebx,0x4(%rsp)
mov    %ebp,(%rsp)
mov    %ebx,%edi
call   1050 <cycle@plt>
mov    %eax,%r14d
mov    0x4(%rsp),%r15d
cmp    (%rsp),%r15d
jge    1170 <main+0x40>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%r15d
mov    %r15d,%edi
call   1050 <cycle@plt>
cmp    %r14d,%eax
cmovg  %eax,%r14d
cmp    (%rsp),%r15d
jl     11d0 <main+0xa0>
jmp    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 = %43, %0
%10 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%11 = icmp eq i32 %10, 2
br i1 %11, label %12, label %48
12: ; preds = %9
%13 = load i32, i32* %2
store i32 %13, i32* %6
%14 = load i32, i32* %3
store i32 %14, i32* %7
%15 = load i32, i32* %2
%16 = load i32, i32* %3
%17 = icmp sgt i32 %15, %16
br i1 %17, label %18, label %22
18: ; preds = %12
%19 = load i32, i32* %2
store i32 %19, i32* %5
%20 = load i32, i32* %3
store i32 %20, i32* %2
%21 = load i32, i32* %5
store i32 %21, i32* %3
br label %22
22: ; preds = %18, %12
%23 = load i32, i32* %2
%24 = call i32 @cycle(i32 %23)
store i32 %24, i32* %4
%25 = load i32, i32* %2
%26 = add nsw i32 %25, 1
store i32 %26, i32* %8
br label %27
27: ; preds = %40, %22
%28 = load i32, i32* %8
%29 = load i32, i32* %3
%30 = icmp sle i32 %28, %29
br i1 %30, label %31, label %43
31: ; preds = %27
%32 = load i32, i32* %8
%33 = call i32 @cycle(i32 %32)
store i32 %33, i32* %5
%34 = load i32, i32* %5
%35 = load i32, i32* %4
%36 = icmp sgt i32 %34, %35
br i1 %36, label %37, label %39
37: ; preds = %31
%38 = load i32, i32* %5
store i32 %38, i32* %4
br label %39
39: ; preds = %37, %31
br label %40
40: ; preds = %39
%41 = load i32, i32* %8
%42 = add nsw i32 %41, 1
store i32 %42, i32* %8
br label %27
43: ; preds = %27
%44 = load i32, i32* %6
%45 = load i32, i32* %7
%46 = load i32, i32* %4
%47 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %44, i32 %45, i32 %46)
br label %9
48: ; preds = %9
%49 = load i32, i32* %1
ret i32 %49
}

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