#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 niz[1000] = {0};
  int i = 0;
  while (1) {
    scanf("%s", niz);
    if (niz[0] == 'S' && niz[1] == 'T' && niz[2] == 'O' && niz[3] == 'P')
      break;
    while (i < strlen(niz)) {
      if (niz[i] >= 'a' && niz[i] <= 'z')
        niz[i] -= ('a' - 'A');
      i++;
    }
    i = 0;
    printf("%s ", niz);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
xor    %esi,%esi
mov    $0x3e8,%edx
call   1050 <memset@plt>
movl   $0x0,-0x3f4(%rbp)
lea    -0x3f0(%rbp),%rsi
lea    0xe83(%rip),%rdi
call   1060 <scanf@plt>
movsbl -0x3f0(%rbp),%eax
cmp    $0x53,%eax
jne    11c7 <main+0x87>
movsbl -0x3ef(%rbp),%eax
cmp    $0x54,%eax
jne    11c7 <main+0x87>
movsbl -0x3ee(%rbp),%eax
cmp    $0x4f,%eax
jne    11c7 <main+0x87>
movsbl -0x3ed(%rbp),%eax
cmp    $0x50,%eax
jne    11c7 <main+0x87>
jmp    1273 <main+0x133>
jmp    11cc <main+0x8c>
mov    -0x3f4(%rbp),%eax
mov    %eax,-0x3f8(%rbp)
lea    -0x3f0(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x3f8(%rbp),%eax
cmp    %ecx,%eax
jge    1251 <main+0x111>
movslq -0x3f4(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
cmp    $0x61,%eax
jl     123d <main+0xfd>
movslq -0x3f4(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
cmp    $0x7a,%eax
jg     123d <main+0xfd>
movslq -0x3f4(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%ecx
ff
sub    $0x20,%ecx
mov    %cl,-0x3f0(%rbp,%rax,1)
mov    -0x3f4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3f4(%rbp)
jmp    11cc <main+0x8c>
movl   $0x0,-0x3f4(%rbp)
lea    -0x3f0(%rbp),%rsi
lea    0xd9a(%rip),%rdi
call   1040 <printf@plt>
jmp    116f <main+0x2f>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rbx
mov    $0x3e8,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <memset@plt>
lea    0xe99(%rip),%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
movdqa (%rsp),%xmm0
movd   %xmm0,%eax
cmp    $0x504f5453,%eax
jne    1190 <main+0x50>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
mov    %rsp,%r12
lea    0xe69(%rip),%r14
lea    0xe5f(%rip),%r15
jmp    11d6 <main+0x96>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
mov    %r12,%rsi
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1060 <scanf@plt>
movdqa (%rsp),%xmm0
movd   %xmm0,%eax
cmp    $0x504f5453,%eax
je     117f <main+0x3f>
mov    %r12,%rdi
call   1030 <strlen@plt>
test   %eax,%eax
jle    11b0 <main+0x70>
xor    %ebx,%ebx
jmp    1203 <main+0xc3>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%rbx
mov    %r12,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jge    11b0 <main+0x70>
movzbl (%rsp,%rbx,1),%eax
lea    -0x61(%rax),%ecx
cmp    $0x19,%cl
ja     11f0 <main+0xb0>
add    $0xe0,%al
mov    %al,(%rsp,%rbx,1)
jmp    11f0 <main+0xb0>

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

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