#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 cycles(int);
int /*<<< orphan*/ destroy();
int /*<<< orphan*/ init();
int /*<<< orphan*/ printf(char *, int, ...);
int scanf(char *, int *, int *);
int /*<<< orphan*/ swap(int *, int *);
int main() {
  init();
  int n, m, i, t, cyc, mx;
  while (scanf("%d %d", &n, &m) == 2) {
    mx = 0;
    printf("%d %d", n, m);
    if (n > m)
      swap(&n, &m);
    for (i = n; i <= m; i++) {
      cyc = cycles(i);
      if (cyc >= mx) {
        mx = cyc;
      }
    }
    printf(" %d\n", mx);
  }
  destroy();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <init@plt>
lea    0xe83(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1060 <scanf@plt>
cmp    $0x2,%eax
jne    121f <main+0xbf>
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe59(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    11c7 <main+0x67>
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1080 <swap@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1209 <main+0xa9>
mov    -0x10(%rbp),%edi
call   1070 <cycles@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jl     11f6 <main+0x96>
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    11fb <main+0x9b>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11cd <main+0x6d>
mov    -0x1c(%rbp),%esi
lea    0xdf3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1176 <main+0x16>
mov    $0x0,%al
call   1040 <destroy@plt>
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
xor    %eax,%eax
call   1050 <init@plt>
lea    0xe87(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1060 <scanf@plt>
cmp    $0x2,%eax
jne    1228 <main+0xc8>
lea    0xe6a(%rip),%r13
lea    0x4(%rsp),%r14
mov    %rsp,%r15
lea    0xe61(%rip),%r12
jmp    11cf <main+0x6f>
nopw   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r13,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1060 <scanf@plt>
cmp    $0x2,%eax
jne    1228 <main+0xc8>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
mov    %r13,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x4(%rsp),%ebx
mov    (%rsp),%eax
cmp    %eax,%ebx
jle    11fd <main+0x9d>
mov    %r14,%rdi
mov    %r15,%rsi
call   1080 <swap@plt>
mov    0x4(%rsp),%ebx
mov    (%rsp),%eax
xor    %ebp,%ebp
cmp    %eax,%ebx
jg     11b0 <main+0x50>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%edi
call   1070 <cycles@plt>
cmp    %ebp,%eax
cmovge %eax,%ebp
lea    0x1(%rbx),%eax
cmp    (%rsp),%ebx
mov    %eax,%ebx
jl     1210 <main+0xb0>
jmp    11b0 <main+0x50>
xor    %eax,%eax
call   1040 <destroy@plt>
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 = [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
%7 = alloca i32
store i32 0, i32* %1
%8 = call i32 (...) @init()
br label %9
9: ; preds = %39, %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 %42
12: ; preds = %9
store i32 0, i32* %7
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%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* %2
%17 = load i32, i32* %3
%18 = icmp sgt i32 %16, %17
br i1 %18, label %19, label %21
19: ; preds = %12
%20 = call i32 @swap(i32* %2, i32* %3)
br label %21
21: ; preds = %19, %12
%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 @cycles(i32 %28)
store i32 %29, i32* %6
%30 = load i32, i32* %6
%31 = load i32, i32* %7
%32 = icmp sge i32 %30, %31
br i1 %32, label %33, label %35
33: ; preds = %27
%34 = load i32, i32* %6
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* %7
%41 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %40)
br label %9
42: ; preds = %9
%43 = call i32 (...) @destroy()
ret i32 0
}

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