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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1050 <memset@plt>
movl   $0x0,-0x74(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xe8c(%rip),%rdi
call   1060 <scanf@plt>
movsbl -0x70(%rbp),%eax
cmp    $0x53,%eax
jne    11b2 <main+0x72>
movsbl -0x6f(%rbp),%eax
cmp    $0x54,%eax
jne    11b2 <main+0x72>
movsbl -0x6e(%rbp),%eax
cmp    $0x4f,%eax
jne    11b2 <main+0x72>
movsbl -0x6d(%rbp),%eax
cmp    $0x50,%eax
jne    11b2 <main+0x72>
jmp    1231 <main+0xf1>
jmp    11b7 <main+0x77>
mov    -0x74(%rbp),%eax
mov    %eax,-0x78(%rbp)
lea    -0x70(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x78(%rbp),%eax
cmp    %ecx,%eax
jge    1215 <main+0xd5>
movslq -0x74(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x61,%eax
jl     1207 <main+0xc7>
movslq -0x74(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x7a,%eax
jg     1207 <main+0xc7>
movslq -0x74(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%ecx
sub    $0x20,%ecx
mov    %cl,-0x70(%rbp,%rax,1)
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    11b7 <main+0x77>
movl   $0x0,-0x74(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xddc(%rip),%rdi
call   1040 <printf@plt>
jmp    1169 <main+0x29>
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
xorps  %xmm0,%xmm0
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movl   $0x0,0x60(%rsp)
lea    0xe96(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
movdqa (%rsp),%xmm0
movd   %xmm0,%eax
cmp    $0x504f5453,%eax
jne    1190 <main+0x60>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
mov    %rsp,%r12
lea    0xe69(%rip),%r14
lea    0xe5f(%rip),%r15
jmp    11d6 <main+0xa6>
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   1050 <scanf@plt>
movdqa (%rsp),%xmm0
movd   %xmm0,%eax
cmp    $0x504f5453,%eax
je     1182 <main+0x52>
mov    %r12,%rdi
call   1030 <strlen@plt>
test   %eax,%eax
jle    11b0 <main+0x80>
xor    %ebx,%ebx
jmp    1203 <main+0xd3>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%rbx
mov    %r12,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jge    11b0 <main+0x80>
movzbl (%rsp,%rbx,1),%eax
lea    -0x61(%rax),%ecx
cmp    $0x19,%cl
ja     11f0 <main+0xc0>
add    $0xe0,%al
mov    %al,(%rsp,%rbx,1)
jmp    11f0 <main+0xc0>

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 [100 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [100 x i8]* %2 to i8*
store i32 0, i32* %3
br label %5
5: ; preds = %0, %59
%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 = 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 [100 x i8], [100 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 [100 x i8], [100 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 [100 x i8], [100 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 [100 x i8], [100 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 [100 x i8], [100 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 [100 x i8], [100 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 [100 x i8], [100 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 [100 x i8], [100 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 [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 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 [100 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 [100 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 [100 x i8], [100 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
}