#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 max(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
scalar_t__ scanf(char *, char **);
int /*<<< orphan*/ strlen(char *);
int main(int argc, const char *argv[]) {
  int n;
  char str[1001];
  while (scanf("%s", &str) != EOF) {
    printf("%d\n", max(str, strlen(str)));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x400(%rbp),%rsi
lea    0xe99(%rip),%rdi
call   1060 <scanf@plt>
mov    0x2e75(%rip),%rcx
cmp    (%rcx),%rax
je     11b7 <main+0x77>
lea    -0x400(%rbp),%rax
mov    %rax,-0x408(%rbp)
lea    -0x400(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x408(%rbp),%rdi
mov    %eax,%esi
call   1050 <max@plt>
mov    %eax,%esi
lea    0xe56(%rip),%rdi
call   1040 <printf@plt>
jmp    1159 <main+0x19>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x3f8,%rsp
lea    0xeab(%rip),%rdi
mov    %rsp,%rsi
call   1060 <scanf@plt>
mov    0x2e84(%rip),%r12
cmp    (%r12),%rax
je     11ad <main+0x6d>
mov    %rsp,%rbx
lea    0xe8f(%rip),%r14
lea    0xe85(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <max@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
cmp    (%r12),%rax
jne    1180 <main+0x40>
xor    %eax,%eax
add    $0x3f8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@EOF = global i64 0
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [1001 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %8
8: ; preds = %13, %2
%9 = bitcast [1001 x i8]* %7 to i8**
%10 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %9)
%11 = load i64, i64* @EOF
%12 = icmp ne i64 %10, %11
br i1 %12, label %13, label %19
13: ; preds = %8
%14 = getelementptr inbounds [1001 x i8], [1001 x i8]* %7, i64 0, i64 0
%15 = getelementptr inbounds [1001 x i8], [1001 x i8]* %7, i64 0, i64 0
%16 = call i32 @strlen(i8* %15)
%17 = call i32 @max(i8* %14, i32 %16)
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %17)
br label %8
19: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@EOF = global i64 0
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [1001 x i8]
%4 = getelementptr inbounds [1001 x i8], [1001 x i8]* %3, i64 0, i64 0
%5 = bitcast [1001 x i8]* %3 to i8**
%6 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %5)
%7 = load i64, i64* @EOF
%8 = icmp eq i64 %6, %7
br i1 %8, label %16, label %9
9: ; preds = %2, %9
%10 = call i32 @strlen(i8* %4)
%11 = call i32 @max(i8* %4, i32 %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %5)
%14 = load i64, i64* @EOF
%15 = icmp eq i64 %13, %14
br i1 %15, label %16, label %9
16: ; preds = %9, %2
ret i32 0
}