#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 word[50];
  int counter = 0;
  int lenght = 0;
  scanf("%[^'STOP']s", word);
  lenght = strlen(word);
  for (counter = 0; counter < lenght - 1; counter++) {
    printf("%c", word[counter] - 32);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x44(%rbp)
movl   $0x0,-0x48(%rbp)
lea    -0x40(%rbp),%rsi
lea    0xea8(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x40(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x48(%rbp)
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
mov    -0x48(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    11aa <main+0x7a>
movslq -0x44(%rbp),%rax
movsbl -0x40(%rbp,%rax,1),%eax
sub    $0x20,%eax
lea    0xe78(%rip),%rdi
movsbl %al,%esi
call   1040 <printf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1170 <main+0x40>
mov    -0x4(%rbp),%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,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cmp    $0x2,%eax
jl     118a <main+0x5a>
mov    %eax,%r15d
add    $0xffffffff,%r15d
xor    %ebx,%ebx
lea    0xea4(%rip),%r14
nopl   0x0(%rax,%rax,1)
movzbl (%rsp,%rbx,1),%eax
add    $0xe0,%al
movsbl %al,%esi
mov    %r14,%rdi
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1170 <main+0x40>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"%[^'STOP']s\00"
@.str.1 = [3 x i8] c"%c\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 ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @strlen(i8* %2)
%5 = icmp sgt i32 %4, 1
br i1 %5, label %6, label %17
6: ; preds = %0
%7 = add nsw i32 %4, -1
%8 = zext i32 %7 to i64
br label %9
9: ; preds = %6, %9
%10 = phi i64 [ 0, %6 ], [ %15, %9 ]
%11 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 %10
%12 = load i8, i8* %11
%13 = add i8 %12, -32
%14 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %13)
%15 = add nuw nsw i64 %10, 1
%16 = icmp eq i64 %15, %8
br i1 %16, label %17, label %9
17: ; preds = %9, %0
ret i32 0
}