#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 *, char);
int /*<<< orphan*/ scanf(char *, char *);
int strlen(char *);
int main() {
  char s[100];
  int i, l;
  do {
    scanf("%s", s);
    l = strlen(s);
    if (s[0] == 'S' && s[1] == 'T' && s[2] == 'O' && s[3] == 'P') {
      break;
    } else {
      for (i = 0; i < strlen(s); i++) {
        if (s[i] >= 'a' && s[i] <= 'z')
          printf("%c", s[i] + ('A' - 'a'));
        else
          printf("%c", s[i]);
      }
    }
  } while (1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xeb3(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x70(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x78(%rbp)
movsbl -0x70(%rbp),%eax
cmp    $0x53,%eax
jne    1197 <main+0x67>
movsbl -0x6f(%rbp),%eax
cmp    $0x54,%eax
jne    1197 <main+0x67>
movsbl -0x6e(%rbp),%eax
cmp    $0x4f,%eax
jne    1197 <main+0x67>
movsbl -0x6d(%rbp),%eax
cmp    $0x50,%eax
jne    1197 <main+0x67>
jmp    123f <main+0x10f>
movl   $0x0,-0x74(%rbp)
mov    -0x74(%rbp),%eax
mov    %eax,-0x7c(%rbp)
lea    -0x70(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x7c(%rbp),%eax
cmp    %ecx,%eax
jge    1226 <main+0xf6>
movslq -0x74(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x61,%eax
jl     11fe <main+0xce>
movslq -0x74(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x7a,%eax
jg     11fe <main+0xce>
movslq -0x74(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
add    $0xffffffe0,%eax
lea    0xe12(%rip),%rdi
movsbl %al,%esi
call   1040 <printf@plt>
jmp    1213 <main+0xe3>
movslq -0x74(%rbp),%rax
lea    0xdfa(%rip),%rdi
movsbl -0x70(%rbp,%rax,1),%esi
call   1040 <printf@plt>
jmp    1218 <main+0xe8>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    119e <main+0x6e>
jmp    122b <main+0xfb>
jmp    1230 <main+0x100>
mov    $0x1,%al
test   $0x1,%al
jne    1142 <main+0x12>
jmp    123f <main+0x10f>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x68,%rsp
lea    0xebe(%rip),%r14
mov    %rsp,%r12
lea    0xeb7(%rip),%r15
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %r12,%rsi
call   1050 <scanf@plt>
mov    %r12,%rdi
call   1030 <strlen@plt>
movdqa (%rsp),%xmm0
movd   %xmm0,%eax
cmp    $0x504f5453,%eax
je     11c3 <main+0x93>
mov    %r12,%rdi
call   1030 <strlen@plt>
test   %eax,%eax
jle    1150 <main+0x20>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%rsp,%rbx,1),%eax
lea    -0x61(%rax),%ecx
lea    -0x20(%rax),%edx
cmp    $0x1a,%cl
movzbl %dl,%ecx
cmovae %eax,%ecx
movsbl %cl,%esi
mov    %r15,%rdi
call   1040 <printf@plt>
add    $0x1,%rbx
mov    %r12,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1190 <main+0x60>
jmp    1150 <main+0x20>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
br label %5
5: ; preds = %71, %0
%6 = getelementptr inbounds [100 x i8], [100 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)
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%9 = call i32 @strlen(i8* %8)
store i32 %9, i32* %4
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 83
br i1 %13, label %14, label %30
14: ; preds = %5
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 1
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 84
br i1 %18, label %19, label %30
19: ; preds = %14
%20 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 2
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %22, 79
br i1 %23, label %24, label %30
24: ; preds = %19
%25 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 3
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 80
br i1 %28, label %29, label %30
29: ; preds = %24
br label %72
30: ; preds = %24, %19, %14, %5
store i32 0, i32* %3
br label %31
31: ; preds = %66, %30
%32 = load i32, i32* %3
%33 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%34 = call i32 @strlen(i8* %33)
%35 = icmp slt i32 %32, %34
br i1 %35, label %36, label %69
36: ; preds = %31
%37 = load i32, i32* %3
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %38
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = icmp sge i32 %41, 97
br i1 %42, label %43, label %59
43: ; preds = %36
%44 = load i32, i32* %3
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %45
%47 = load i8, i8* %46
%48 = sext i8 %47 to i32
%49 = icmp sle i32 %48, 122
br i1 %49, label %50, label %59
50: ; preds = %43
%51 = load i32, i32* %3
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %52
%54 = load i8, i8* %53
%55 = sext i8 %54 to i32
%56 = add nsw i32 %55, -32
%57 = trunc i32 %56 to i8
%58 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %57)
br label %65
59: ; preds = %43, %36
%60 = load i32, i32* %3
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %61
%63 = load i8, i8* %62
%64 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %63)
br label %65
65: ; preds = %59, %50
br label %66
66: ; preds = %65
%67 = load i32, i32* %3
%68 = add nsw i32 %67, 1
store i32 %68, i32* %3
br label %31
69: ; preds = %31
br label %70
70: ; preds = %69
br label %71
71: ; preds = %70
br i1 true, label %5, label %72
72: ; preds = %71, %29
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = bitcast [100 x i8]* %1 to <4 x i8>*
br label %4
4: ; preds = %14, %0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%6 = call i32 @strlen(i8* %2)
%7 = load <4 x i8>, <4 x i8>* %3
%8 = freeze <4 x i8> %7
%9 = bitcast <4 x i8> %8 to i32
%10 = icmp eq i32 %9, 1347376211
br i1 %10, label %28, label %11
11: ; preds = %4
%12 = call i32 @strlen(i8* %2)
%13 = icmp sgt i32 %12, 0
br i1 %13, label %15, label %14
14: ; preds = %15, %11
br label %4
15: ; preds = %11, %15
%16 = phi i64 [ %24, %15 ], [ 0, %11 ]
%17 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %16
%18 = load i8, i8* %17
%19 = add i8 %18, -97
%20 = icmp ult i8 %19, 26
%21 = add nsw i8 %18, -32
%22 = select i1 %20, i8 %21, i8 %18
%23 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %22)
%24 = add nuw nsw i64 %16, 1
%25 = call i32 @strlen(i8* %2)
%26 = sext i32 %25 to i64
%27 = icmp slt i64 %24, %26
br i1 %27, label %15, label %14
28: ; preds = %4
ret i32 0
}