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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1050 <scanf@plt>
movsbl -0x3f0(%rbp),%eax
cmp    $0x53,%eax
jne    11a0 <main+0x70>
movsbl -0x3ef(%rbp),%eax
cmp    $0x54,%eax
jne    11a0 <main+0x70>
movsbl -0x3ee(%rbp),%eax
cmp    $0x4f,%eax
jne    11a0 <main+0x70>
movsbl -0x3ed(%rbp),%eax
cmp    $0x50,%eax
jne    11a0 <main+0x70>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbp
ret
movl   $0x0,-0x3f4(%rbp)
mov    -0x3f4(%rbp),%eax
mov    %eax,-0x3f8(%rbp)
lea    -0x3f0(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x3f8(%rbp),%eax
cmp    %ecx,%eax
jge    125c <main+0x12c>
movslq -0x3f4(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
cmp    $0x61,%eax
jl     121f <main+0xef>
movslq -0x3f4(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
cmp    $0x7a,%eax
jg     121f <main+0xef>
movslq -0x3f4(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
add    $0xffffffe0,%eax
mov    %eax,-0x3fc(%rbp)
jmp    1234 <main+0x104>
movslq -0x3f4(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
mov    %eax,-0x3fc(%rbp)
mov    -0x3fc(%rbp),%esi
lea    0xdc2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x3f4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3f4(%rbp)
jmp    11aa <main+0x7a>
lea    0xda3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1142 <main+0x12>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x3f0,%rsp
lea    0xebd(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
movdqa (%rsp),%xmm0
movd   %xmm0,%eax
cmp    $0x504f5453,%eax
jne    116a <main+0x3a>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
mov    %rsp,%r15
lea    0xe8c(%rip),%r14
jmp    11a5 <main+0x75>
cs nopw 0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
movdqa (%rsp),%xmm0
movd   %xmm0,%eax
cmp    $0x504f5453,%eax
je     115b <main+0x2b>
mov    %r15,%rdi
call   1040 <strlen@plt>
test   %eax,%eax
jle    1180 <main+0x50>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl (%rsp,%rbx,1),%eax
lea    -0x61(%rax),%ecx
lea    -0x20(%rax),%edi
cmp    $0x1a,%cl
cmovae %eax,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
mov    %r15,%rdi
call   1040 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     11c0 <main+0x90>
jmp    1180 <main+0x50>

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 [1000 x i8]
%3 = alloca i32
store i32 0, i32* %1
br label %4
4: ; preds = %0, %66
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, 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]* %2, 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]* %2, 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]* %2, 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]* %2, 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
ret i32 0
27: ; preds = %21, %16, %11, %4
store i32 0, i32* %3
br label %28
28: ; preds = %63, %27
%29 = load i32, i32* %3
%30 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%31 = call i32 @strlen(i8* %30)
%32 = icmp slt i32 %29, %31
br i1 %32, label %33, label %66
33: ; preds = %28
%34 = load i32, i32* %3
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 %35
%37 = load i8, i8* %36
%38 = sext i8 %37 to i32
%39 = icmp sge i32 %38, 97
br i1 %39, label %40, label %54
40: ; preds = %33
%41 = load i32, i32* %3
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 %42
%44 = load i8, i8* %43
%45 = sext i8 %44 to i32
%46 = icmp sle i32 %45, 122
br i1 %46, label %47, label %54
47: ; preds = %40
%48 = load i32, i32* %3
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 %49
%51 = load i8, i8* %50
%52 = sext i8 %51 to i32
%53 = add nsw i32 %52, -32
br label %60
54: ; preds = %40, %33
%55 = load i32, i32* %3
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 %56
%58 = load i8, i8* %57
%59 = sext i8 %58 to i32
br label %60
60: ; preds = %54, %47
%61 = phi i32 [ %53, %47 ], [ %59, %54 ]
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %61)
br label %63
63: ; preds = %60
%64 = load i32, i32* %3
%65 = add nsw i32 %64, 1
store i32 %65, i32* %3
br label %28
66: ; preds = %28
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %4
}

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