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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rsi
lea    0xec1(%rip),%rdi
call   1040 <scanf@plt>
movsbl -0x3f0(%rbp),%eax
cmp    $0x53,%eax
jne    118a <main+0x6a>
movsbl -0x3ef(%rbp),%eax
cmp    $0x54,%eax
jne    118a <main+0x6a>
movsbl -0x3ee(%rbp),%eax
cmp    $0x4f,%eax
jne    118a <main+0x6a>
movsbl -0x3ed(%rbp),%eax
cmp    $0x50,%eax
jne    118a <main+0x6a>
jmp    121e <main+0xfe>
movl   $0x0,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    11f7 <main+0xd7>
movslq -0x8(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
cmp    $0x61,%eax
jl     11e4 <main+0xc4>
movslq -0x8(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
cmp    $0x7a,%eax
jg     11e4 <main+0xc4>
movslq -0x8(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
sub    $0x20,%eax
mov    %al,%cl
movslq -0x8(%rbp),%rax
mov    %cl,-0x3f0(%rbp,%rax,1)
jmp    11e9 <main+0xc9>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1191 <main+0x71>
jmp    11fc <main+0xdc>
lea    -0x3f0(%rbp),%rsi
lea    0xdf6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%al
test   $0x1,%al
jne    1132 <main+0x12>
jmp    121e <main+0xfe>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x400,%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    $0x3e8,%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    $0x400,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [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 ([3 x i8], [3 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 %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 [1000 x i8], [1000 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, 1000
br i1 %22, label %29, label %23
23: ; preds = %20
%24 = getelementptr inbounds [1000 x i8], [1000 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
}