#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 **);
void main() {
  int i;
  char str[1000];
  while (1) {
    scanf("%s", &str);
    if (str[0] == 83 && str[1] == 84 && str[2] == 79 && str[3] == 80) {
      break;
    }
    for (i = 0; i < 50; i++) {
      if (str[i] >= 'a' && str[i] <= 'z') {
        str[i] = str[i] - 32;
      }
    }
    printf("\n%s", str);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
lea    -0x3f0(%rbp),%rsi
lea    0xec8(%rip),%rdi
call   1040 <scanf@plt>
movsbl -0x3f0(%rbp),%eax
cmp    $0x53,%eax
jne    1183 <main+0x63>
movsbl -0x3ef(%rbp),%eax
cmp    $0x54,%eax
jne    1183 <main+0x63>
movsbl -0x3ee(%rbp),%eax
cmp    $0x4f,%eax
jne    1183 <main+0x63>
movsbl -0x3ed(%rbp),%eax
cmp    $0x50,%eax
jne    1183 <main+0x63>
jmp    1205 <main+0xe5>
movl   $0x0,-0x4(%rbp)
cmpl   $0x32,-0x4(%rbp)
jge    11ed <main+0xcd>
movslq -0x4(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
cmp    $0x61,%eax
jl     11da <main+0xba>
movslq -0x4(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
cmp    $0x7a,%eax
jg     11da <main+0xba>
movslq -0x4(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
sub    $0x20,%eax
mov    %al,%cl
movslq -0x4(%rbp),%rax
mov    %cl,-0x3f0(%rbp,%rax,1)
jmp    11df <main+0xbf>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    118a <main+0x6a>
lea    -0x3f0(%rbp),%rsi
lea    0xe05(%rip),%rdi
call   1030 <printf@plt>
jmp    112b <main+0xb>
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x400,%rsp
lea    0xece(%rip),%rdi
lea    0x10(%rsp),%rsi
call   1040 <scanf@plt>
movdqa 0x10(%rsp),%xmm0
movd   %xmm0,%ecx
cmp    $0x504f5453,%ecx
je     11c6 <main+0xa6>
xor    %eax,%eax
lea    0xea8(%rip),%r14
lea    0x10(%rsp),%rbx
lea    0xe9d(%rip),%r15
jmp    117f <main+0x5f>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%rax
cmp    $0x32,%rax
je     1190 <main+0x70>
movzbl 0x10(%rsp,%rax,1),%ecx
lea    -0x61(%rcx),%edx
cmp    $0x19,%dl
ja     1170 <main+0x50>
add    $0xe0,%cl
mov    %cl,0x10(%rsp,%rax,1)
jmp    1170 <main+0x50>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
movdqa 0x10(%rsp),%xmm0
movd   %xmm0,%edx
movdqa %xmm0,(%rsp)
movzbl (%rsp),%ecx
mov    $0x0,%eax
cmp    $0x504f5453,%edx
jne    117f <main+0x5f>
add    $0x400,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

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