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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x1e0(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x1e0(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1e8(%rbp)
movsbl -0x1e0(%rbp),%eax
cmp    $0x53,%eax
jne    11ac <main+0x7c>
movsbl -0x1df(%rbp),%eax
cmp    $0x54,%eax
jne    11ac <main+0x7c>
movsbl -0x1de(%rbp),%eax
cmp    $0x4f,%eax
jne    11ac <main+0x7c>
movsbl -0x1dd(%rbp),%eax
cmp    $0x50,%eax
jne    11ac <main+0x7c>
jmp    124b <main+0x11b>
movl   $0x0,-0x1e4(%rbp)
mov    -0x1e4(%rbp),%eax
cmp    -0x1e8(%rbp),%eax
jge    1233 <main+0x103>
movslq -0x1e4(%rbp),%rax
movsbl -0x1e0(%rbp,%rax,1),%eax
ff
cmp    $0x61,%eax
jl     121a <main+0xea>
movslq -0x1e4(%rbp),%rax
movsbl -0x1e0(%rbp,%rax,1),%eax
ff
cmp    $0x7a,%eax
jg     121a <main+0xea>
movslq -0x1e4(%rbp),%rax
movsbl -0x1e0(%rbp,%rax,1),%eax
ff
sub    $0x20,%eax
mov    %al,%cl
movslq -0x1e4(%rbp),%rax
mov    %cl,-0x1e0(%rbp,%rax,1)
jmp    121f <main+0xef>
mov    -0x1e4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1e4(%rbp)
jmp    11b6 <main+0x86>
lea    -0x1e0(%rbp),%rsi
lea    0xdc2(%rip),%rdi
call   1040 <printf@plt>
jmp    1142 <main+0x12>
xor    %eax,%eax
add    $0x1f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x1e0,%rsp
lea    0xebd(%rip),%r14
mov    %rsp,%rbx
lea    0xeb6(%rip),%r15
jmp    115b <main+0x2b>
nop
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
movdqa (%rsp),%xmm0
movd   %xmm0,%ecx
cmp    $0x504f5453,%ecx
je     11af <main+0x7f>
test   %eax,%eax
jle    1150 <main+0x20>
mov    %eax,%eax
mov    $0x1,%edx
nopw   0x0(%rax,%rax,1)
lea    -0x61(%rcx),%esi
cmp    $0x19,%sil
ja     11a0 <main+0x70>
add    $0xe0,%cl
mov    %cl,-0x1(%rsp,%rdx,1)
cmp    %rdx,%rax
je     1150 <main+0x20>
movzbl (%rsp,%rdx,1),%ecx
add    $0x1,%rdx
jmp    1190 <main+0x60>
xor    %eax,%eax
add    $0x1e0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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