#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 strlen(char *);
int main() {
  char c[50];
  int i;
  while (1) {
    scanf("%s", c);
    if (c[0] == 'S' && c[1] == 'T' && c[2] == 'O' && c[3] == 'P') {
      break;
    }
    for (i = 0; i < strlen(c); i++) {
      if (c[i] >= 'a' && c[i] <= 'z') {
        c[i] = c[i] - 32;
      }
    }
    printf("%s", c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1050 <scanf@plt>
movsbl -0x40(%rbp),%eax
cmp    $0x53,%eax
jne    1188 <main+0x58>
movsbl -0x3f(%rbp),%eax
cmp    $0x54,%eax
jne    1188 <main+0x58>
movsbl -0x3e(%rbp),%eax
cmp    $0x4f,%eax
jne    1188 <main+0x58>
movsbl -0x3d(%rbp),%eax
cmp    $0x50,%eax
jne    1188 <main+0x58>
jmp    120d <main+0xdd>
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
mov    %eax,-0x48(%rbp)
lea    -0x40(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x48(%rbp),%eax
cmp    %ecx,%eax
jge    11f8 <main+0xc8>
movslq -0x44(%rbp),%rax
movsbl -0x40(%rbp,%rax,1),%eax
cmp    $0x61,%eax
jl     11e5 <main+0xb5>
movslq -0x44(%rbp),%rax
movsbl -0x40(%rbp,%rax,1),%eax
cmp    $0x7a,%eax
jg     11e5 <main+0xb5>
movslq -0x44(%rbp),%rax
movsbl -0x40(%rbp,%rax,1),%eax
sub    $0x20,%eax
mov    %al,%cl
movslq -0x44(%rbp),%rax
mov    %cl,-0x40(%rbp,%rax,1)
jmp    11ea <main+0xba>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    118f <main+0x5f>
lea    -0x40(%rbp),%rsi
lea    0xdfd(%rip),%rdi
call   1040 <printf@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x40,%rsp
lea    0xec0(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
movdqa (%rsp),%xmm0
movd   %xmm0,%eax
cmp    $0x504f5453,%eax
jne    1164 <main+0x34>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
mov    %rsp,%r15
lea    0xe92(%rip),%r14
jmp    1196 <main+0x66>
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <printf@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
movdqa (%rsp),%xmm0
movd   %xmm0,%eax
cmp    $0x504f5453,%eax
je     1158 <main+0x28>
mov    %r15,%rdi
call   1030 <strlen@plt>
test   %eax,%eax
jle    1170 <main+0x40>
xor    %ebx,%ebx
jmp    11c3 <main+0x93>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%rbx
mov    %r15,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jge    1170 <main+0x40>
movzbl (%rsp,%rbx,1),%eax
lea    -0x61(%rax),%ecx
cmp    $0x19,%cl
ja     11b0 <main+0x80>
add    $0xe0,%al
mov    %al,(%rsp,%rbx,1)
jmp    11b0 <main+0x80>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [50 x i8]
%3 = alloca i32
store i32 0, i32* %1
br label %4
4: ; preds = %0, %62
%5 = getelementptr inbounds [50 x i8], [50 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 [50 x i8], [50 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 [50 x i8], [50 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 [50 x i8], [50 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 [50 x i8], [50 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
br label %65
27: ; preds = %21, %16, %11, %4
store i32 0, i32* %3
br label %28
28: ; preds = %59, %27
%29 = load i32, i32* %3
%30 = getelementptr inbounds [50 x i8], [50 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 %62
33: ; preds = %28
%34 = load i32, i32* %3
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [50 x i8], [50 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 %58
40: ; preds = %33
%41 = load i32, i32* %3
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [50 x i8], [50 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 %58
47: ; preds = %40
%48 = load i32, i32* %3
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 %49
%51 = load i8, i8* %50
%52 = sext i8 %51 to i32
%53 = sub nsw i32 %52, 32
%54 = trunc i32 %53 to i8
%55 = load i32, i32* %3
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 %56
store i8 %54, i8* %57
br label %58
58: ; preds = %47, %40, %33
br label %59
59: ; preds = %58
%60 = load i32, i32* %3
%61 = add nsw i32 %60, 1
store i32 %61, i32* %3
br label %28
62: ; preds = %28
%63 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%64 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %63)
br label %4
65: ; preds = %26
ret i32 0
}

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