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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x3f4(%rbp)
cmpl   $0x3e8,-0x3f4(%rbp)
jg     124c <main+0x12c>
lea    -0x3f0(%rbp),%rsi
lea    0xea6(%rip),%rdi
call   1040 <scanf@plt>
movsbl -0x3f0(%rbp),%eax
cmp    $0x53,%eax
jne    11a4 <main+0x84>
movsbl -0x3ef(%rbp),%eax
cmp    $0x54,%eax
jne    11a4 <main+0x84>
movsbl -0x3ee(%rbp),%eax
cmp    $0x4f,%eax
jne    11a4 <main+0x84>
movsbl -0x3ed(%rbp),%eax
cmp    $0x50,%eax
jne    11a4 <main+0x84>
jmp    124c <main+0x12c>
movl   $0x0,-0x3f8(%rbp)
cmpl   $0x3e8,-0x3f8(%rbp)
jge    1220 <main+0x100>
movslq -0x3f8(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
cmp    $0x61,%eax
jl     1207 <main+0xe7>
movslq -0x3f8(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
cmp    $0x7a,%eax
jg     1207 <main+0xe7>
movslq -0x3f8(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%ecx
ff
sub    $0x20,%ecx
mov    %cl,-0x3f0(%rbp,%rax,1)
jmp    120c <main+0xec>
mov    -0x3f8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3f8(%rbp)
jmp    11ae <main+0x8e>
lea    -0x3f0(%rbp),%rsi
lea    0xdd5(%rip),%rdi
call   1030 <printf@plt>
jmp    1238 <main+0x118>
mov    -0x3f4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3f4(%rbp)
jmp    113c <main+0x1c>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x3e8,%rsp
xor    %ebp,%ebp
lea    0xeca(%rip),%r14
mov    %rsp,%rbx
lea    0xec3(%rip),%r15
jmp    1166 <main+0x46>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x1,%ebp
cmp    $0x3e9,%ebp
je     11c5 <main+0xa5>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
movdqa (%rsp),%xmm0
movd   %xmm0,%ecx
cmp    $0x504f5453,%ecx
je     11c5 <main+0xa5>
mov    $0x2,%eax
nopw   0x0(%rax,%rax,1)
lea    -0x61(%rcx),%edx
cmp    $0x19,%dl
ja     119f <main+0x7f>
add    $0xe0,%cl
mov    %cl,-0x2(%rsp,%rax,1)
movzbl -0x1(%rsp,%rax,1),%ecx
lea    -0x61(%rcx),%edx
cmp    $0x19,%dl
ja     11b3 <main+0x93>
add    $0xe0,%cl
mov    %cl,-0x1(%rsp,%rax,1)
cmp    $0x3e8,%rax
je     1150 <main+0x30>
movzbl (%rsp,%rax,1),%ecx
add    $0x2,%rax
jmp    1190 <main+0x70>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

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