#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(void) {
  char s[500];
  scanf("%s", s);
  while (!(s[0] == 'S' && s[1] == 'T' && s[2] == 'O' && s[3] == 'P' &&
           s[4] == '\0')) {
    int i = 0;
    while (s[i] != '\0') {
      if (s[i] >= 'a' && s[i] <= 'z') {
        s[i] -= 32;
      }
      i++;
    }
    printf("%s\n", s);
    scanf("%s", s);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
lea    -0x200(%rbp),%rsi
lea    0xec7(%rip),%rdi
call   1040 <scanf@plt>
movsbl -0x200(%rbp),%ecx
xor    %eax,%eax
cmp    $0x53,%ecx
mov    %al,-0x205(%rbp)
jne    11b1 <main+0x91>
movsbl -0x1ff(%rbp),%ecx
xor    %eax,%eax
cmp    $0x54,%ecx
mov    %al,-0x205(%rbp)
jne    11b1 <main+0x91>
movsbl -0x1fe(%rbp),%ecx
xor    %eax,%eax
cmp    $0x4f,%ecx
mov    %al,-0x205(%rbp)
jne    11b1 <main+0x91>
movsbl -0x1fd(%rbp),%ecx
xor    %eax,%eax
cmp    $0x50,%ecx
mov    %al,-0x205(%rbp)
jne    11b1 <main+0x91>
movsbl -0x1fc(%rbp),%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0x205(%rbp)
mov    -0x205(%rbp),%al
xor    $0xff,%al
test   $0x1,%al
jne    11c6 <main+0xa6>
jmp    1270 <main+0x150>
movl   $0x0,-0x204(%rbp)
movslq -0x204(%rbp),%rax
movsbl -0x200(%rbp,%rax,1),%eax
ff
cmp    $0x0,%eax
je     1245 <main+0x125>
movslq -0x204(%rbp),%rax
movsbl -0x200(%rbp,%rax,1),%eax
ff
cmp    $0x61,%eax
jl     1231 <main+0x111>
movslq -0x204(%rbp),%rax
movsbl -0x200(%rbp,%rax,1),%eax
ff
cmp    $0x7a,%eax
jg     1231 <main+0x111>
movslq -0x204(%rbp),%rax
movsbl -0x200(%rbp,%rax,1),%ecx
ff
sub    $0x20,%ecx
mov    %cl,-0x200(%rbp,%rax,1)
mov    -0x204(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x204(%rbp)
jmp    11d0 <main+0xb0>
lea    -0x200(%rbp),%rsi
lea    0xdb0(%rip),%rdi
call   1030 <printf@plt>
lea    -0x200(%rbp),%rsi
lea    0xd9a(%rip),%rdi
call   1040 <scanf@plt>
jmp    113e <main+0x1e>
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x208,%rsp
lea    0xecb(%rip),%rdi
lea    0x10(%rsp),%rsi
call   1040 <scanf@plt>
movdqa 0x10(%rsp),%xmm0
movd   %xmm0,%eax
cmp    $0x504f5453,%eax
jne    115b <main+0x3b>
cmpb   $0x0,0x14(%rsp)
je     11e8 <main+0xc8>
lea    0x11(%rsp),%r12
lea    0xe9c(%rip),%r14
lea    0x10(%rsp),%rbx
lea    0xe8d(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
test   %al,%al
je     11b0 <main+0x90>
mov    %r12,%rcx
jmp    119b <main+0x7b>
nopl   0x0(%rax)
movzbl (%rcx),%eax
add    $0x1,%rcx
test   %al,%al
je     11b0 <main+0x90>
lea    -0x61(%rax),%edx
cmp    $0x19,%dl
ja     1190 <main+0x70>
add    $0xe0,%al
mov    %al,-0x1(%rcx)
jmp    1190 <main+0x70>
nopw   0x0(%rax,%rax,1)
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
mov    0x14(%rsp),%cl
movdqa %xmm0,(%rsp)
mov    (%rsp),%al
cmp    $0x504f5453,%edx
jne    1180 <main+0x60>
test   %cl,%cl
jne    1180 <main+0x60>
add    $0x208,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

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