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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10c(%rbp)
movl   $0x0,-0x104(%rbp)
lea    -0x100(%rbp),%rsi
lea    0xead(%rip),%rdi
call   1040 <scanf@plt>
movslq -0x104(%rbp),%rax
movsbl -0x100(%rbp,%rax,1),%eax
ff
cmp    $0x53,%eax
jne    11d4 <main+0xb4>
mov    -0x104(%rbp),%eax
add    $0x1,%eax
cltq
movsbl -0x100(%rbp,%rax,1),%eax
ff
cmp    $0x54,%eax
jne    11d4 <main+0xb4>
mov    -0x104(%rbp),%eax
add    $0x2,%eax
cltq
movsbl -0x100(%rbp,%rax,1),%eax
ff
cmp    $0x4f,%eax
jne    11d4 <main+0xb4>
mov    -0x104(%rbp),%eax
add    $0x3,%eax
cltq
movsbl -0x100(%rbp,%rax,1),%eax
ff
cmp    $0x50,%eax
jne    11d4 <main+0xb4>
movl   $0x1,-0x10c(%rbp)
jmp    1263 <main+0x143>
movl   $0x0,-0x108(%rbp)
cmpl   $0xfa,-0x108(%rbp)
jge    1250 <main+0x130>
movslq -0x108(%rbp),%rax
movsbl -0x100(%rbp,%rax,1),%eax
ff
cmp    $0x61,%eax
jl     1237 <main+0x117>
movslq -0x108(%rbp),%rax
movsbl -0x100(%rbp,%rax,1),%eax
ff
cmp    $0x7a,%eax
jg     1237 <main+0x117>
movslq -0x108(%rbp),%rax
movsbl -0x100(%rbp,%rax,1),%ecx
ff
sub    $0x20,%ecx
mov    %cl,-0x100(%rbp,%rax,1)
jmp    123c <main+0x11c>
mov    -0x108(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x108(%rbp)
jmp    11de <main+0xbe>
lea    -0x100(%rbp),%rsi
lea    0xda2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x104(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x104(%rbp)
cmpl   $0x1,-0x10c(%rbp)
jne    113c <main+0x1c>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x110,%rsp
lea    0xece(%rip),%rdi
lea    0x10(%rsp),%rsi
call   1040 <scanf@plt>
movdqa 0x10(%rsp),%xmm0
movd   %xmm0,%ecx
cmp    $0x504f5453,%ecx
je     11d6 <main+0xb6>
xor    %eax,%eax
lea    0xea4(%rip),%r14
lea    0x10(%rsp),%rbx
lea    0xe99(%rip),%r15
jmp    1181 <main+0x61>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rax
cmp    $0xfa,%rax
je     11a0 <main+0x80>
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>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
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    1181 <main+0x61>
xor    %eax,%eax
add    $0x110,%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 [250 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %5
br label %6
6: ; preds = %76, %0
store i32 0, i32* %3
%7 = getelementptr inbounds [250 x i8], [250 x i8]* %2, i64 0, i64 0
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [250 x i8], [250 x i8]* %2, i64 0, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 83
br i1 %14, label %15, label %40
15: ; preds = %6
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [250 x i8], [250 x i8]* %2, i64 0, i64 %18
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 84
br i1 %22, label %23, label %40
23: ; preds = %15
%24 = load i32, i32* %3
%25 = add nsw i32 %24, 2
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [250 x i8], [250 x i8]* %2, i64 0, i64 %26
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 79
br i1 %30, label %31, label %40
31: ; preds = %23
%32 = load i32, i32* %3
%33 = add nsw i32 %32, 3
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [250 x i8], [250 x i8]* %2, i64 0, i64 %34
%36 = load i8, i8* %35
%37 = sext i8 %36 to i32
%38 = icmp eq i32 %37, 80
br i1 %38, label %39, label %40
39: ; preds = %31
store i32 1, i32* %5
br label %73
40: ; preds = %31, %23, %15, %6
store i32 0, i32* %4
br label %41
41: ; preds = %67, %40
%42 = load i32, i32* %4
%43 = icmp slt i32 %42, 250
br i1 %43, label %44, label %70
44: ; preds = %41
%45 = load i32, i32* %4
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds [250 x i8], [250 x i8]* %2, i64 0, i64 %46
%48 = load i8, i8* %47
%49 = sext i8 %48 to i32
%50 = icmp sge i32 %49, 97
br i1 %50, label %51, label %66
51: ; preds = %44
%52 = load i32, i32* %4
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds [250 x i8], [250 x i8]* %2, i64 0, i64 %53
%55 = load i8, i8* %54
%56 = sext i8 %55 to i32
%57 = icmp sle i32 %56, 122
br i1 %57, label %58, label %66
58: ; preds = %51
%59 = load i32, i32* %4
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds [250 x i8], [250 x i8]* %2, i64 0, i64 %60
%62 = load i8, i8* %61
%63 = sext i8 %62 to i32
%64 = sub nsw i32 %63, 32
%65 = trunc i32 %64 to i8
store i8 %65, i8* %61
br label %66
66: ; preds = %58, %51, %44
br label %67
67: ; preds = %66
%68 = load i32, i32* %4
%69 = add nsw i32 %68, 1
store i32 %69, i32* %4
br label %41
70: ; preds = %41
%71 = getelementptr inbounds [250 x i8], [250 x i8]* %2, i64 0, i64 0
%72 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %71)
br label %73
73: ; preds = %70, %39
%74 = load i32, i32* %3
%75 = add nsw i32 %74, 1
store i32 %75, i32* %3
br label %76
76: ; preds = %73
%77 = load i32, i32* %5
%78 = icmp ne i32 %77, 1
br i1 %78, label %6, label %79
79: ; preds = %76
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 [250 x i8]
%2 = getelementptr inbounds [250 x i8], [250 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 = bitcast [250 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 [250 x i8]* %1 to <4 x i8>*
br label %12
12: ; preds = %26, %9
%13 = phi i8 [ %10, %9 ], [ %27, %26 ]
%14 = phi i64 [ 0, %9 ], [ %28, %26 ]
%15 = add i8 %13, -97
%16 = icmp ult i8 %15, 26
br i1 %16, label %17, label %20
17: ; preds = %12
%18 = getelementptr inbounds [250 x i8], [250 x i8]* %1, i64 0, i64 %14
%19 = add nsw i8 %13, -32
store i8 %19, i8* %18
br label %20
20: ; preds = %12, %17
%21 = add nuw nsw i64 %14, 1
%22 = icmp eq i64 %21, 250
br i1 %22, label %29, label %23
23: ; preds = %20
%24 = getelementptr inbounds [250 x i8], [250 x i8]* %1, i64 0, i64 %21
%25 = load i8, i8* %24
br label %26
26: ; preds = %23, %29
%27 = phi i8 [ %25, %23 ], [ %36, %29 ]
%28 = phi i64 [ %21, %23 ], [ 0, %29 ]
br label %12
29: ; preds = %20
%30 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%31 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%32 = load <4 x i8>, <4 x i8>* %11
%33 = freeze <4 x i8> %32
%34 = bitcast <4 x i8> %33 to i32
%35 = icmp eq i32 %34, 1347376211
%36 = extractelement <4 x i8> %33, i64 0
br i1 %35, label %37, label %26
37: ; preds = %29, %0
ret i32 0
}