int main() {
  char c[1000];
  printf("\nInput:");
  gets(c);
  int i = 0, k, y;
  k = strlen(c);
  while (i < k) {
    if (c[i] == 'S') {
      if (c[i + 1] == 'T') {
        if (c[i + 2] == 'O') {
          if (c[i + 3] == 'P')
            break;
        }
      }
    }
    i++;
  }
  for (y = 0; y < k; y++) {
    if (c[y] >= 'a' && c[y] <= 'z')
      printf("%c", c - 32);
    else
      printf("%c", c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x3f0(%rbp),%rdi
mov    $0x0,%al
call   1050 <gets@plt>
movl   $0x0,-0x3f4(%rbp)
lea    -0x3f0(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x3f8(%rbp)
mov    -0x3f4(%rbp),%eax
cmp    -0x3f8(%rbp),%eax
jge    1220 <main+0xf0>
movslq -0x3f4(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
cmp    $0x53,%eax
jne    120c <main+0xdc>
mov    -0x3f4(%rbp),%eax
add    $0x1,%eax
cltq
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
cmp    $0x54,%eax
jne    1207 <main+0xd7>
mov    -0x3f4(%rbp),%eax
add    $0x2,%eax
cltq
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
cmp    $0x4f,%eax
jne    1202 <main+0xd2>
mov    -0x3f4(%rbp),%eax
add    $0x3,%eax
cltq
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
cmp    $0x50,%eax
jne    11fd <main+0xcd>
jmp    1220 <main+0xf0>
jmp    1202 <main+0xd2>
jmp    1207 <main+0xd7>
jmp    120c <main+0xdc>
mov    -0x3f4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3f4(%rbp)
jmp    117a <main+0x4a>
movl   $0x0,-0x3fc(%rbp)
mov    -0x3fc(%rbp),%eax
cmp    -0x3f8(%rbp),%eax
jge    12b8 <main+0x188>
movslq -0x3fc(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
cmp    $0x61,%eax
jl     128a <main+0x15a>
movslq -0x3fc(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
cmp    $0x7a,%eax
jg     128a <main+0x15a>
lea    -0x3f0(%rbp),%rsi
add    $0xffffffffffffffe0,%rsi
lea    0xd8a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    129f <main+0x16f>
lea    -0x3f0(%rbp),%rsi
lea    0xd70(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    12a4 <main+0x174>
mov    -0x3fc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3fc(%rbp)
jmp    122a <main+0xfa>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x3f0,%rsp
lea    0xeb9(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rsp,%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <gets@plt>
mov    %r14,%rdi
call   1030 <strlen@plt>
test   %eax,%eax
jle    11a5 <main+0x75>
lea    -0x20(%rsp),%r15
mov    %eax,%r13d
lea    0xe92(%rip),%r12
xor    %ebx,%ebx
jmp    1193 <main+0x63>
nopw   0x0(%rax,%rax,1)
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r13
je     11a5 <main+0x75>
movzbl (%rsp,%rbx,1),%eax
add    $0x9f,%al
mov    %r15,%rsi
cmp    $0x1a,%al
jb     1180 <main+0x50>
mov    %r14,%rsi
jmp    1180 <main+0x50>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"\0AInput:\00"
@.str.1 = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @gets to i32 (i8*, ...)*)(i8* %2)
%5 = call i64 @strlen(i8* %2)
%6 = trunc i64 %5 to i32
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %21
8: ; preds = %0
%9 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 -32
%10 = and i64 %5, 4294967295
br label %11
11: ; preds = %8, %11
%12 = phi i64 [ 0, %8 ], [ %19, %11 ]
%13 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 %12
%14 = load i8, i8* %13
%15 = add i8 %14, -97
%16 = icmp ult i8 %15, 26
%17 = select i1 %16, i8* %9, i8* %2
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %17)
%19 = add nuw nsw i64 %12, 1
%20 = icmp eq i64 %19, %10
br i1 %20, label %21, label %11
21: ; preds = %11, %0
ret i32 0
}