#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 clength(int);
int /*<<< orphan*/ printf(char *, int, int, int);
int scanf(char *, int *, int *);
int main() {
  int i, j, count, maxcl, clen, min, max;
  maxcl = 0;
  while (scanf("%d %d\n", &i, &j) == 2) {
    min = (i <= j) * i + (i > j) * j;
    max = (i <= j) * j + (i > j) * i;
    for (count = min; count <= max; count++) {
      clen = clength(count);
      if (clen > maxcl)
        maxcl = clen;
    }
    printf("%d %d %d\n", i, j, maxcl);
    maxcl = 0;
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xeb6(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <scanf@plt>
cmp    $0x2,%eax
jne    121a <main+0xea>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
imul   -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
cmp    -0xc(%rbp),%ecx
setg   %cl
and    $0x1,%cl
movzbl %cl,%ecx
imul   -0xc(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
imul   -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
cmp    -0xc(%rbp),%ecx
setg   %cl
and    $0x1,%cl
movzbl %cl,%ecx
imul   -0x8(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x20(%rbp),%eax
jg     11f9 <main+0xc9>
mov    -0x10(%rbp),%edi
call   1040 <clength@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    11e6 <main+0xb6>
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    11eb <main+0xbb>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11bd <main+0x8d>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0xdf7(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
jmp    1146 <main+0x16>
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    0xec1(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
cmp    $0x2,%eax
jne    11cc <main+0x9c>
lea    0xea8(%rip),%r15
lea    0x4(%rsp),%r12
mov    %rsp,%r13
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x4(%rsp),%eax
mov    (%rsp),%r14d
cmp    %r14d,%eax
mov    %eax,%ebx
cmovg  %r14d,%ebx
cmovg  %eax,%r14d
add    $0x1,%r14d
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1040 <clength@plt>
cmp    %ebp,%eax
cmovg  %eax,%ebp
add    $0x1,%ebx
cmp    %ebx,%r14d
jne    1190 <main+0x60>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xe4e(%rip),%rdi
mov    %ebp,%ecx
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
call   1050 <scanf@plt>
cmp    $0x2,%eax
je     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 = [7 x i8] c"%d %d\0A\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
store i32 0, i32* %5
br label %9
9: ; preds = %56, %0
%10 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%11 = icmp eq i32 %10, 2
br i1 %11, label %12, label %61
12: ; preds = %9
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = icmp sle i32 %13, %14
%16 = zext i1 %15 to i32
%17 = load i32, i32* %2
%18 = mul nsw i32 %16, %17
%19 = load i32, i32* %2
%20 = load i32, i32* %3
%21 = icmp sgt i32 %19, %20
%22 = zext i1 %21 to i32
%23 = load i32, i32* %3
%24 = mul nsw i32 %22, %23
%25 = add nsw i32 %18, %24
store i32 %25, i32* %7
%26 = load i32, i32* %2
%27 = load i32, i32* %3
%28 = icmp sle i32 %26, %27
%29 = zext i1 %28 to i32
%30 = load i32, i32* %3
%31 = mul nsw i32 %29, %30
%32 = load i32, i32* %2
%33 = load i32, i32* %3
%34 = icmp sgt i32 %32, %33
%35 = zext i1 %34 to i32
%36 = load i32, i32* %2
%37 = mul nsw i32 %35, %36
%38 = add nsw i32 %31, %37
store i32 %38, i32* %8
%39 = load i32, i32* %7
store i32 %39, i32* %4
br label %40
40: ; preds = %53, %12
%41 = load i32, i32* %4
%42 = load i32, i32* %8
%43 = icmp sle i32 %41, %42
br i1 %43, label %44, label %56
44: ; preds = %40
%45 = load i32, i32* %4
%46 = call i32 @clength(i32 %45)
store i32 %46, i32* %6
%47 = load i32, i32* %6
%48 = load i32, i32* %5
%49 = icmp sgt i32 %47, %48
br i1 %49, label %50, label %52
50: ; preds = %44
%51 = load i32, i32* %6
store i32 %51, i32* %5
br label %52
52: ; preds = %50, %44
br label %53
53: ; preds = %52
%54 = load i32, i32* %4
%55 = add nsw i32 %54, 1
store i32 %55, i32* %4
br label %40
56: ; preds = %40
%57 = load i32, i32* %2
%58 = load i32, i32* %3
%59 = load i32, i32* %5
%60 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %57, i32 %58, i32 %59)
store i32 0, i32* %5
br label %9
61: ; preds = %9
ret i32 0
}

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