#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 *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int strlen(char *);
int main() {
  char c[100];
  int goon, i = 0, j, k = 0;
  do {
    scanf("%s", c);
    i = 0;
    j = strlen(c);
    while (i < j) {
      if (c[i] == 'S') {
        if (c[i + 1] == 'T') {
          if (c[i + 2] == 'O') {
            if (c[i + 3] == 'P') {
              goon = 1;
              break;
            }
          }
        }
      }
      i++;
    }
    k = 0;
    while (k < j && goon != 1) {
      if (c[k] < 'Z')
        printf("%c", c[k]);
      else
        printf("%c", c[k] - 32);
      k++;
    }
    printf("\n");
  } while (goon != 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x78(%rbp)
movl   $0x0,-0x80(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xea5(%rip),%rdi
call   1050 <scanf@plt>
movl   $0x0,-0x78(%rbp)
lea    -0x70(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x7c(%rbp)
mov    -0x78(%rbp),%eax
cmp    -0x7c(%rbp),%eax
jge    11fc <main+0xcc>
movslq -0x78(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x53,%eax
jne    11ee <main+0xbe>
mov    -0x78(%rbp),%eax
add    $0x1,%eax
cltq
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x54,%eax
jne    11e9 <main+0xb9>
mov    -0x78(%rbp),%eax
add    $0x2,%eax
cltq
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x4f,%eax
jne    11e4 <main+0xb4>
mov    -0x78(%rbp),%eax
add    $0x3,%eax
cltq
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x50,%eax
jne    11df <main+0xaf>
movl   $0x1,-0x74(%rbp)
jmp    11fc <main+0xcc>
jmp    11e4 <main+0xb4>
jmp    11e9 <main+0xb9>
jmp    11ee <main+0xbe>
mov    -0x78(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x78(%rbp)
jmp    1173 <main+0x43>
movl   $0x0,-0x80(%rbp)
mov    -0x80(%rbp),%ecx
xor    %eax,%eax
cmp    -0x7c(%rbp),%ecx
mov    %al,-0x81(%rbp)
jge    1224 <main+0xf4>
cmpl   $0x1,-0x74(%rbp)
setne  %al
mov    %al,-0x81(%rbp)
mov    -0x81(%rbp),%al
test   $0x1,%al
jne    1237 <main+0x107>
jmp    128d <main+0x15d>
movslq -0x80(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x5a,%eax
jge    1265 <main+0x135>
movslq -0x80(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%esi
lea    0xdaa(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    127f <main+0x14f>
movslq -0x80(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%esi
sub    $0x20,%esi
lea    0xd8b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x80(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x80(%rbp)
jmp    1203 <main+0xd3>
lea    0xd72(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x1,-0x74(%rbp)
jne    1150 <main+0x20>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
lea    0xec4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
store i32 0, i32* %6
br label %7
7: ; preds = %91, %0
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %8)
store i32 0, i32* %4
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%11 = call i32 @strlen(i8* %10)
store i32 %11, i32* %5
br label %12
12: ; preds = %51, %7
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %54
16: ; preds = %12
%17 = load i32, i32* %4
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %18
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 83
br i1 %22, label %23, label %51
23: ; preds = %16
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 1
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %26
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 84
br i1 %30, label %31, label %50
31: ; preds = %23
%32 = load i32, i32* %4
%33 = add nsw i32 %32, 2
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %34
%36 = load i8, i8* %35
%37 = sext i8 %36 to i32
%38 = icmp eq i32 %37, 79
br i1 %38, label %39, label %49
39: ; preds = %31
%40 = load i32, i32* %4
%41 = add nsw i32 %40, 3
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %42
%44 = load i8, i8* %43
%45 = sext i8 %44 to i32
%46 = icmp eq i32 %45, 80
br i1 %46, label %47, label %48
47: ; preds = %39
store i32 1, i32* %3
br label %54
48: ; preds = %39
br label %49
49: ; preds = %48, %31
br label %50
50: ; preds = %49, %23
br label %51
51: ; preds = %50, %16
%52 = load i32, i32* %4
%53 = add nsw i32 %52, 1
store i32 %53, i32* %4
br label %12
54: ; preds = %47, %12
store i32 0, i32* %6
br label %55
55: ; preds = %86, %54
%56 = load i32, i32* %6
%57 = load i32, i32* %5
%58 = icmp slt i32 %56, %57
br i1 %58, label %59, label %62
59: ; preds = %55
%60 = load i32, i32* %3
%61 = icmp ne i32 %60, 1
br label %62
62: ; preds = %59, %55
%63 = phi i1 [ false, %55 ], [ %61, %59 ]
br i1 %63, label %64, label %89
64: ; preds = %62
%65 = load i32, i32* %6
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %66
%68 = load i8, i8* %67
%69 = sext i8 %68 to i32
%70 = icmp slt i32 %69, 90
br i1 %70, label %71, label %78
71: ; preds = %64
%72 = load i32, i32* %6
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %73
%75 = load i8, i8* %74
%76 = sext i8 %75 to i32
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %76)
br label %86
78: ; preds = %64
%79 = load i32, i32* %6
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %80
%82 = load i8, i8* %81
%83 = sext i8 %82 to i32
%84 = sub nsw i32 %83, 32
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %84)
br label %86
86: ; preds = %78, %71
%87 = load i32, i32* %6
%88 = add nsw i32 %87, 1
store i32 %88, i32* %6
br label %55
89: ; preds = %62
%90 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %91
91: ; preds = %89
%92 = load i32, i32* %3
%93 = icmp ne i32 %92, 1
br i1 %93, label %7, label %94
94: ; preds = %91
ret i32 0
}

LLVM IR (-O2):
@.str = [3 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 = call i32 @strlen(i8* %2)
%5 = call i32 @putchar(i32 10)
ret i32 0
}