#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*/ printf(char *, int, int, int);
scalar_t__ scanf(char *, int *, int *);
int step(int);
int main(int argc, const char *argv[]) {
  int n, i, j, max, tmp;
  while (scanf("%d%d", &n, &j) != EOF) {
    i = n;
    max = step(i);
    for (i++; i <= j; i++) {
      tmp = step(i);
      if (tmp > max)
        max = tmp;
    }
    printf("%d %d %d\n", n, j, max);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   1050 <scanf@plt>
mov    0x2e87(%rip),%rcx
cmp    (%rcx),%rax
je     11da <main+0xaa>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%edi
call   1040 <step@plt>
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     11c0 <main+0x90>
mov    -0x18(%rbp),%edi
call   1040 <step@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    11ad <main+0x7d>
mov    -0x24(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    11b2 <main+0x82>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1184 <main+0x54>
mov    -0x14(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
lea    0xe35(%rip),%rdi
call   1030 <printf@plt>
jmp    1146 <main+0x16>
xor    %eax,%eax
add    $0x30,%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>
mov    0x2e92(%rip),%r14
cmp    (%r14),%rax
jne    116c <main+0x3c>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe8d(%rip),%r15
lea    0x4(%rsp),%r12
mov    %rsp,%r13
jmp    11a5 <main+0x75>
nopl   (%rax)
mov    0x4(%rsp),%esi
lea    0xe7a(%rip),%rdi
mov    %ebp,%ecx
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
call   1050 <scanf@plt>
cmp    (%r14),%rax
je     115b <main+0x2b>
mov    0x4(%rsp),%ebx
mov    %ebx,%edi
call   1040 <step@plt>
mov    %eax,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%rsp),%edx
cmp    %edx,%ebx
jge    1180 <main+0x50>
add    $0x1,%ebx
mov    %ebx,%edi
call   1040 <step@plt>
cmp    %ebp,%eax
cmovg  %eax,%ebp
jmp    11c0 <main+0x90>

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

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