int main(void) {
  int i, l;
  char s[80];
  for (; ~scanf("%s", s);) {
    l = strlen(s);
    for (i = 0; i < l; i++) {
      s[i] = toupper(s[i]);
    }
  }
  printf("%d\n", countyen(atoi(s), 6 - 1));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rsi
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1070 <scanf@plt>
xor    $0xffffffff,%eax
cmp    $0x0,%eax
je     11d7 <main+0x77>
lea    -0x60(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11d2 <main+0x72>
movslq -0x8(%rbp),%rax
movsbl -0x60(%rbp,%rax,1),%edi
call   1030 <toupper@plt>
mov    %al,%cl
movslq -0x8(%rbp),%rax
mov    %cl,-0x60(%rbp,%rax,1)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11a0 <main+0x40>
jmp    116f <main+0xf>
lea    -0x60(%rbp),%rdi
mov    $0x0,%al
call   1080 <atoi@plt>
mov    %eax,%edi
mov    $0x5,%esi
mov    $0x0,%al
call   1060 <countyen@plt>
mov    %eax,%esi
lea    0xe0a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x58,%rsp
lea    0xe8e(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
cmp    $0xffffffff,%eax
je     11d7 <main+0x77>
mov    %rsp,%r15
lea    0xe75(%rip),%r14
jmp    11a2 <main+0x42>
nopl   (%rax)
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
cmp    $0xffffffff,%eax
je     11d7 <main+0x77>
mov    %r15,%rdi
call   1040 <strlen@plt>
test   %eax,%eax
jle    1190 <main+0x30>
mov    %eax,%r12d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl (%rsp,%rbx,1),%edi
call   1030 <toupper@plt>
mov    %al,(%rsp,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r12
jne    11c0 <main+0x60>
jmp    1190 <main+0x30>
mov    %rsp,%rdi
xor    %eax,%eax
call   1080 <atoi@plt>
mov    %eax,%edi
mov    $0x5,%esi
xor    %eax,%eax
call   1060 <countyen@plt>
lea    0xe0d(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = icmp eq i32 %3, -1
br i1 %4, label %23, label %8
5: ; preds = %14, %8
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%7 = icmp eq i32 %6, -1
br i1 %7, label %23, label %8
8: ; preds = %0, %5
%9 = call i64 @strlen(i8* %2)
%10 = trunc i64 %9 to i32
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %8
%13 = and i64 %9, 4294967295
br label %14
14: ; preds = %12, %14
%15 = phi i64 [ 0, %12 ], [ %21, %14 ]
%16 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = call i32 @toupper(i32 %18)
%20 = trunc i32 %19 to i8
store i8 %20, i8* %16
%21 = add nuw nsw i64 %15, 1
%22 = icmp eq i64 %21, %13
br i1 %22, label %5, label %14
23: ; preds = %5, %0
%24 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %2)
%25 = call i32 (i32, i32, ...) bitcast (i32 (...)* @countyen to i32 (i32, i32, ...)*)(i32 %24, i32 5)
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %25)
ret i32 0
}