#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 izr[50];
  int i, k, ops = 1;
  int duljina;
  int stop;
  printf("Vyvedi izrechenie");
  while (1) {
    scanf("%s", izr);
    duljina = strlen(izr);
    while (izr[i] == duljina) {
      if (izr[i] = 'S')
        if (izr[i + 1] = 'T')
          if (izr[i + 2] = 'O')
            if (izr[i + 3] = 'P') {
              stop = 1;
              break;
            }
    }
    if (stop == 1)
      break;
    k = 0;
    while (k < duljina) {
      if (izr[k] < 'Z')
        printf("%c", izr[k]);
      else
        ;
      printf("%c", izr[k] - 32);
      k++;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x4c(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x40(%rbp),%rsi
lea    0xeb3(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x40(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x50(%rbp)
movslq -0x44(%rbp),%rax
movsbl -0x40(%rbp,%rax,1),%eax
cmp    -0x50(%rbp),%eax
jne    120e <main+0xde>
movslq -0x44(%rbp),%rax
movb   $0x53,-0x40(%rbp,%rax,1)
mov    $0x1,%al
test   $0x1,%al
jne    119a <main+0x6a>
jmp    1209 <main+0xd9>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
cltq
movb   $0x54,-0x40(%rbp,%rax,1)
mov    $0x1,%al
test   $0x1,%al
jne    11b6 <main+0x86>
jmp    1204 <main+0xd4>
mov    -0x44(%rbp),%eax
add    $0x2,%eax
cltq
movb   $0x4f,-0x40(%rbp,%rax,1)
mov    $0x1,%al
test   $0x1,%al
jne    11d2 <main+0xa2>
jmp    11ff <main+0xcf>
mov    -0x44(%rbp),%eax
add    $0x3,%eax
cltq
movb   $0x50,-0x40(%rbp,%rax,1)
mov    $0x1,%al
test   $0x1,%al
jne    11ee <main+0xbe>
jmp    11fa <main+0xca>
movl   $0x1,-0x54(%rbp)
jmp    120e <main+0xde>
jmp    11ff <main+0xcf>
jmp    1204 <main+0xd4>
jmp    1209 <main+0xd9>
jmp    1170 <main+0x40>
cmpl   $0x1,-0x54(%rbp)
jne    121d <main+0xed>
jmp    1290 <main+0x160>
movl   $0x0,-0x48(%rbp)
mov    -0x48(%rbp),%eax
cmp    -0x50(%rbp),%eax
jge    128b <main+0x15b>
movslq -0x48(%rbp),%rax
movsbl -0x40(%rbp,%rax,1),%eax
cmp    $0x5a,%eax
jge    125e <main+0x12e>
movslq -0x48(%rbp),%rax
movsbl -0x40(%rbp,%rax,1),%esi
lea    0xdc3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1263 <main+0x133>
jmp    1263 <main+0x133>
movslq -0x48(%rbp),%rax
movsbl -0x40(%rbp,%rax,1),%esi
sub    $0x20,%esi
lea    0xd9f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    1224 <main+0xf4>
jmp    1154 <main+0x24>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec8(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [18 x i8] c"Vyvedi izrechenie\00"
@.str.1 = [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 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 @strlen(i8* %2)
ret i32 0
}