#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 *);
scalar_t__ strcmp(char *, char *);
int strlen(char *);
int main() {
  char curr[100];
  int i, flag = 0;
  while (flag == 0) {
    scanf("%s", curr);
    if (strcmp(curr, "STOP") == 0)
      flag = 1;
    for (i = 0; i < strlen(curr); i++) {
      if (curr[i] < 'A' || curr[i] > 'Z') {
        curr[i] = curr[i] - ('a' - 'A');
      }
    }
    if (flag == 0) {
      printf("%s", curr);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x78(%rbp)
cmpl   $0x0,-0x78(%rbp)
jne    1223 <main+0xe3>
lea    -0x70(%rbp),%rsi
lea    0xe92(%rip),%rdi
call   1060 <scanf@plt>
lea    -0x70(%rbp),%rdi
lea    0xe85(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1194 <main+0x54>
movl   $0x1,-0x78(%rbp)
movl   $0x0,-0x74(%rbp)
mov    -0x74(%rbp),%eax
mov    %eax,-0x7c(%rbp)
lea    -0x70(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x7c(%rbp),%eax
cmp    %ecx,%eax
jge    1204 <main+0xc4>
movslq -0x74(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x41,%eax
jl     11db <main+0x9b>
movslq -0x74(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x5a,%eax
jle    11f1 <main+0xb1>
movslq -0x74(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
sub    $0x20,%eax
mov    %al,%cl
movslq -0x74(%rbp),%rax
mov    %cl,-0x70(%rbp,%rax,1)
jmp    11f6 <main+0xb6>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    119b <main+0x5b>
cmpl   $0x0,-0x78(%rbp)
jne    121e <main+0xde>
lea    -0x70(%rbp),%rsi
lea    0xde7(%rip),%rdi
call   1040 <printf@plt>
jmp    1159 <main+0x19>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x70,%rsp
lea    0xeac(%rip),%r14
mov    %rsp,%r13
lea    0xea5(%rip),%r15
xchg   %ax,%ax
mov    %r14,%rdi
mov    %r13,%rsi
call   1060 <scanf@plt>
mov    %r13,%rdi
mov    %r15,%rsi
call   1050 <strcmp@plt>
mov    %rax,%r12
mov    %r13,%rdi
call   1030 <strlen@plt>
test   %eax,%eax
jle    11c0 <main+0x80>
xor    %ebx,%ebx
jmp    11a3 <main+0x63>
nopl   0x0(%rax)
add    $0x1,%rbx
mov    %r13,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jge    11c0 <main+0x80>
movzbl (%rsp,%rbx,1),%eax
lea    -0x5b(%rax),%ecx
cmp    $0xe5,%cl
ja     1190 <main+0x50>
add    $0xe0,%al
mov    %al,(%rsp,%rbx,1)
jmp    1190 <main+0x50>
cs nopw 0x0(%rax,%rax,1)
test   %r12,%r12
je     11d2 <main+0x92>
mov    %r14,%rdi
mov    %r13,%rsi
call   1040 <printf@plt>
jmp    1160 <main+0x20>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [5 x i8] c"STOP\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
br label %3
3: ; preds = %23, %0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = call i32 @strlen(i8* %2)
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %22
9: ; preds = %3, %17
%10 = phi i64 [ %18, %17 ], [ 0, %3 ]
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %10
%12 = load i8, i8* %11
%13 = add i8 %12, -91
%14 = icmp ult i8 %13, -26
br i1 %14, label %15, label %17
15: ; preds = %9
%16 = add i8 %12, -32
store i8 %16, i8* %11
br label %17
17: ; preds = %9, %15
%18 = add nuw nsw i64 %10, 1
%19 = call i32 @strlen(i8* %2)
%20 = sext i32 %19 to i64
%21 = icmp slt i64 %18, %20
br i1 %21, label %9, label %22
22: ; preds = %17, %3
br i1 %6, label %25, label %23
23: ; preds = %22
%24 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %3
25: ; preds = %22
ret i32 0
}