#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 /*<<< orphan*/ printf(char *, unsigned short);
int /*<<< orphan*/ scanf(char *, char *);
unsigned short strlen(char *);
unsigned short unqlen(char *);
int main() {
  char s[50000];
  scanf("%s", s);
  unsigned short i, max = 1, val;
  for (i = 0; i < strlen(s) - max; i++) {
    val = unqlen(s + i);
    if (val > max)
      max = val;
  }
  printf("%hd\n", max);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc370,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xc360(%rbp),%rsi
lea    0xea0(%rip),%rdi
call   1060 <scanf@plt>
movw   $0x1,-0xc364(%rbp)
movw   $0x0,-0xc362(%rbp)
movzwl -0xc362(%rbp),%eax
mov    %eax,-0xc36c(%rbp)
lea    -0xc360(%rbp),%rdi
call   1030 <strlen@plt>
mov    %ax,%cx
mov    -0xc36c(%rbp),%eax
movzwl %cx,%ecx
movzwl -0xc364(%rbp),%edx
sub    %edx,%ecx
cmp    %ecx,%eax
jge    120c <main+0xcc>
lea    -0xc360(%rbp),%rdi
movzwl -0xc362(%rbp),%eax
cltq
add    %rax,%rdi
call   1050 <unqlen@plt>
mov    %ax,-0xc366(%rbp)
movzwl -0xc366(%rbp),%eax
movzwl -0xc364(%rbp),%ecx
cmp    %ecx,%eax
jle    11f0 <main+0xb0>
mov    -0xc366(%rbp),%ax
mov    %ax,-0xc364(%rbp)
jmp    11f5 <main+0xb5>
mov    -0xc362(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0xc362(%rbp)
jmp    1177 <main+0x37>
lea    0xdf0(%rip),%rdi
movzwl -0xc364(%rbp),%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xc370,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0xc350,%rsp
lea    0xeaa(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    $0x1,%bp
cmp    $0x2,%ax
jb     11b8 <main+0x78>
mov    $0x1,%bx
mov    %rsp,%r14
mov    $0x1,%r15w
nop
lea    -0x1(%rbx),%eax
movzwl %ax,%eax
lea    (%rsp,%rax,1),%rdi
call   1050 <unqlen@plt>
mov    %eax,%ebp
cmp    %r15w,%ax
cmovbe %r15d,%ebp
movzwl %bx,%r12d
mov    %r14,%rdi
call   1030 <strlen@plt>
movzwl %ax,%eax
movzwl %bp,%ecx
sub    %ecx,%eax
add    $0x1,%ebx
mov    %ebp,%r15d
cmp    %r12d,%eax
jg     1180 <main+0x40>
movzwl %bp,%esi
lea    0xe41(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xc350,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [5 x i8] c"%hd\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [50000 x i8]
%3 = alloca i16
%4 = alloca i16
%5 = alloca i16
store i32 0, i32* %1
%6 = getelementptr inbounds [50000 x i8], [50000 x i8]* %2, i64 0, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
store i16 1, i16* %4
store i16 0, i16* %3
br label %8
8: ; preds = %33, %0
%9 = load i16, i16* %3
%10 = zext i16 %9 to i32
%11 = getelementptr inbounds [50000 x i8], [50000 x i8]* %2, i64 0, i64 0
%12 = call zeroext i16 @strlen(i8* %11)
%13 = zext i16 %12 to i32
%14 = load i16, i16* %4
%15 = zext i16 %14 to i32
%16 = sub nsw i32 %13, %15
%17 = icmp slt i32 %10, %16
br i1 %17, label %18, label %36
18: ; preds = %8
%19 = getelementptr inbounds [50000 x i8], [50000 x i8]* %2, i64 0, i64 0
%20 = load i16, i16* %3
%21 = zext i16 %20 to i32
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %19, i64 %22
%24 = call zeroext i16 @unqlen(i8* %23)
store i16 %24, i16* %5
%25 = load i16, i16* %5
%26 = zext i16 %25 to i32
%27 = load i16, i16* %4
%28 = zext i16 %27 to i32
%29 = icmp sgt i32 %26, %28
br i1 %29, label %30, label %32
30: ; preds = %18
%31 = load i16, i16* %5
store i16 %31, i16* %4
br label %32
32: ; preds = %30, %18
br label %33
33: ; preds = %32
%34 = load i16, i16* %3
%35 = add i16 %34, 1
store i16 %35, i16* %3
br label %8
36: ; preds = %8
%37 = load i16, i16* %4
%38 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i16 zeroext %37)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [5 x i8] c"%hd\0A\00"
define i32 @main() {
%1 = alloca [50000 x i8]
%2 = getelementptr inbounds [50000 x i8], [50000 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call zeroext i16 @strlen(i8* %2)
%5 = icmp ugt i16 %4, 1
br i1 %5, label %6, label %21
6: ; preds = %0, %6
%7 = phi i16 [ %14, %6 ], [ 0, %0 ]
%8 = phi i16 [ %13, %6 ], [ 1, %0 ]
%9 = zext i16 %7 to i64
%10 = getelementptr inbounds [50000 x i8], [50000 x i8]* %1, i64 0, i64 %9
%11 = call zeroext i16 @unqlen(i8* %10)
%12 = icmp ugt i16 %11, %8
%13 = select i1 %12, i16 %11, i16 %8
%14 = add i16 %7, 1
%15 = zext i16 %14 to i32
%16 = call zeroext i16 @strlen(i8* %2)
%17 = zext i16 %16 to i32
%18 = zext i16 %13 to i32
%19 = sub nsw i32 %17, %18
%20 = icmp sgt i32 %19, %15
br i1 %20, label %6, label %21
21: ; preds = %6, %0
%22 = phi i16 [ 1, %0 ], [ %13, %6 ]
%23 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i16 zeroext %22)
ret i32 0
}