#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 main() {
  char n[1000];
  int i = 0;
  do {
    scanf("\n%s", n);
    if (n[0] == 'S' && n[1] == 'T' && n[2] == 'O' && n[3] == 'P')
      break;
    else {
      for (int f = 0; f < 100; f++) {
        if (n[f] >= 'a' && n[f] <= 'z') {
          n[f] -= 32;
        }
      }
      printf("\n%s", n);
    }
  } while (1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x3f4(%rbp)
lea    -0x3f0(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1040 <scanf@plt>
movsbl -0x3f0(%rbp),%eax
cmp    $0x53,%eax
jne    1194 <main+0x74>
movsbl -0x3ef(%rbp),%eax
cmp    $0x54,%eax
jne    1194 <main+0x74>
movsbl -0x3ee(%rbp),%eax
cmp    $0x4f,%eax
jne    1194 <main+0x74>
movsbl -0x3ed(%rbp),%eax
cmp    $0x50,%eax
jne    1194 <main+0x74>
jmp    1234 <main+0x114>
movl   $0x0,-0x3f8(%rbp)
cmpl   $0x64,-0x3f8(%rbp)
jge    120d <main+0xed>
movslq -0x3f8(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
cmp    $0x61,%eax
jl     11f4 <main+0xd4>
movslq -0x3f8(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
cmp    $0x7a,%eax
jg     11f4 <main+0xd4>
movslq -0x3f8(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%ecx
ff
sub    $0x20,%ecx
mov    %cl,-0x3f0(%rbp,%rax,1)
jmp    11f9 <main+0xd9>
mov    -0x3f8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3f8(%rbp)
jmp    119e <main+0x7e>
lea    -0x3f0(%rbp),%rsi
lea    0xde5(%rip),%rdi
call   1030 <printf@plt>
jmp    1225 <main+0x105>
mov    $0x1,%al
test   $0x1,%al
jne    113c <main+0x1c>
jmp    1234 <main+0x114>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3f8,%rsp
lea    0xecf(%rip),%rdi
lea    0x10(%rsp),%rsi
call   1040 <scanf@plt>
movdqa 0x10(%rsp),%xmm0
movd   %xmm0,%ecx
cmp    $0x504f5453,%ecx
je     11b6 <main+0x96>
xor    %eax,%eax
lea    0xeaa(%rip),%r14
lea    0x10(%rsp),%rbx
jmp    116f <main+0x4f>
nopl   (%rax)
add    $0x1,%rax
cmp    $0x64,%rax
je     1180 <main+0x60>
movzbl 0x10(%rsp,%rax,1),%ecx
lea    -0x61(%rcx),%edx
cmp    $0x19,%dl
ja     1160 <main+0x40>
add    $0xe0,%cl
mov    %cl,0x10(%rsp,%rax,1)
jmp    1160 <main+0x40>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %r14,%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    116f <main+0x4f>
xor    %eax,%eax
add    $0x3f8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"\0A%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1000 x i8]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %5
5: ; preds = %62, %0
%6 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 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 %63
28: ; preds = %22, %17, %12, %5
store i32 0, i32* %4
br label %29
29: ; preds = %55, %28
%30 = load i32, i32* %4
%31 = icmp slt i32 %30, 100
br i1 %31, label %32, label %58
32: ; preds = %29
%33 = load i32, i32* %4
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 %34
%36 = load i8, i8* %35
%37 = sext i8 %36 to i32
%38 = icmp sge i32 %37, 97
br i1 %38, label %39, label %54
39: ; preds = %32
%40 = load i32, i32* %4
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 %41
%43 = load i8, i8* %42
%44 = sext i8 %43 to i32
%45 = icmp sle i32 %44, 122
br i1 %45, label %46, label %54
46: ; preds = %39
%47 = load i32, i32* %4
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 %48
%50 = load i8, i8* %49
%51 = sext i8 %50 to i32
%52 = sub nsw i32 %51, 32
%53 = trunc i32 %52 to i8
store i8 %53, i8* %49
br label %54
54: ; preds = %46, %39, %32
br label %55
55: ; preds = %54
%56 = load i32, i32* %4
%57 = add nsw i32 %56, 1
store i32 %57, i32* %4
br label %29
58: ; preds = %29
%59 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%60 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %59)
br label %61
61: ; preds = %58
br label %62
62: ; preds = %61
br i1 true, label %5, label %63
63: ; preds = %62, %27
ret i32 0
}

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