#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 *);
scalar_t__ strcmp(char *, char *);
int strlen(char *);
void main() {
  char izrechenie[100];
  int i, lenght;
  while (1) {
    printf("Vuvedete izrechenie \n");
    scanf("%s", izrechenie);
    if (strcmp(izrechenie, "STOP") == 0) {
      printf("\nDovijdane :)");
      break;
    }
    lenght = strlen(izrechenie);
    for (i = 0; i < lenght; i++) {
      if (izrechenie[i] >= 'a' && izrechenie[i] <= 'z') {
        izrechenie[i] -= ('a' - 'A');
      }
    }
    printf("%s\n", izrechenie);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x70(%rbp),%rsi
lea    0xeb2(%rip),%rdi
call   1060 <scanf@plt>
lea    -0x70(%rbp),%rdi
lea    0xea5(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1196 <main+0x56>
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1213 <main+0xd3>
lea    -0x70(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x78(%rbp)
movl   $0x0,-0x74(%rbp)
mov    -0x74(%rbp),%eax
cmp    -0x78(%rbp),%eax
jge    11fc <main+0xbc>
movslq -0x74(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x61,%eax
jl     11e9 <main+0xa9>
movslq -0x74(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x7a,%eax
jg     11e9 <main+0xa9>
movslq -0x74(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%ecx
sub    $0x20,%ecx
mov    %cl,-0x70(%rbp,%rax,1)
jmp    11ee <main+0xae>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    11a9 <main+0x69>
lea    -0x70(%rbp),%rsi
lea    0xe25(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    114b <main+0xb>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x68,%rsp
lea    0xed4(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb2(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1070 <scanf@plt>
lea    0xea3(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1392 <main+0x242>
mov    %rsp,%rbx
lea    0xe9b(%rip),%r14
lea    0xe7e(%rip),%r15
lea    0xe7a(%rip),%r12
jmp    11df <main+0x8f>
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1070 <scanf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1392 <main+0x242>
mov    %rbx,%rdi
call   1040 <strlen@plt>
test   %eax,%eax
jle    11b0 <main+0x60>
mov    %eax,%ecx
cmp    $0x8,%eax
jae    1200 <main+0xb0>
xor    %eax,%eax
jmp    137d <main+0x22d>
nopl   0x0(%rax)
mov    %ecx,%eax
and    $0xfffffff8,%eax
xor    %edx,%edx
movdqa 0xdf1(%rip),%xmm4
movdqa 0xdf9(%rip),%xmm5
pcmpeqd %xmm6,%xmm6
jmp    122d <main+0xdd>
nopl   (%rax)
add    $0x8,%rdx
cmp    %rdx,%rax
je     1360 <main+0x210>
movq   (%rsp,%rdx,1),%xmm0
movdqa %xmm0,%xmm1
paddb  %xmm4,%xmm1
movdqa %xmm1,%xmm2
pmaxub %xmm5,%xmm2
pcmpeqb %xmm1,%xmm2
movd   %xmm2,%esi
not    %sil
test   $0x1,%sil
je     125f <main+0x10f>
movd   %xmm0,%esi
add    $0xe0,%sil
mov    %sil,(%rsp,%rdx,1)
movdqa %xmm2,%xmm1
pxor   %xmm6,%xmm1
movdqa %xmm1,%xmm3
pslld  $0x8,%xmm3
movd   %xmm3,%esi
shr    $0x10,%esi
test   $0x1,%sil
je     128d <main+0x13d>
movd   %xmm0,%esi
shr    $0x8,%esi
add    $0xe0,%sil
mov    %sil,0x1(%rsp,%rdx,1)
pshuflw $0x55,%xmm2,%xmm3
pxor   %xmm6,%xmm3
pextrw $0x2,%xmm3,%esi
test   $0x1,%sil
je     12b1 <main+0x161>
movd   %xmm0,%esi
shr    $0x10,%esi
add    $0xe0,%sil
mov    %sil,0x2(%rsp,%rdx,1)
movdqa %xmm1,%xmm3
psllq  $0x18,%xmm3
pextrw $0x3,%xmm3,%esi
test   $0x1,%sil
je     12d5 <main+0x185>
movd   %xmm0,%esi
shr    $0x18,%esi
add    $0xe0,%sil
mov    %sil,0x3(%rsp,%rdx,1)
pshufd $0x55,%xmm2,%xmm2
pxor   %xmm6,%xmm2
pextrw $0x4,%xmm2,%esi
test   $0x1,%sil
je     12f7 <main+0x1a7>
pextrw $0x2,%xmm0,%esi
add    $0xe0,%sil
mov    %sil,0x4(%rsp,%rdx,1)
movdqa %xmm1,%xmm2
pslldq $0x5,%xmm2
pextrw $0x5,%xmm2,%esi
test   $0x1,%sil
je     131c <main+0x1cc>
pextrw $0x2,%xmm0,%esi
shr    $0x8,%esi
add    $0xe0,%sil
mov    %sil,0x5(%rsp,%rdx,1)
pextrw $0x3,%xmm1,%esi
test   $0x1,%sil
je     1335 <main+0x1e5>
pextrw $0x3,%xmm0,%esi
add    $0xe0,%sil
mov    %sil,0x6(%rsp,%rdx,1)
pslldq $0x7,%xmm1
pextrw $0x7,%xmm1,%esi
test   $0x1,%sil
je     1220 <main+0xd0>
pextrw $0x3,%xmm0,%esi
shr    $0x8,%esi
add    $0xe0,%sil
mov    %sil,0x7(%rsp,%rdx,1)
jmp    1220 <main+0xd0>
nop
cmp    %rcx,%rax
jne    137d <main+0x22d>
jmp    11b0 <main+0x60>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rax
cmp    %rax,%rcx
je     11b0 <main+0x60>
movzbl (%rsp,%rax,1),%edx
lea    -0x61(%rdx),%esi
cmp    $0x19,%sil
ja     1370 <main+0x220>
add    $0xe0,%dl
mov    %dl,(%rsp,%rax,1)
jmp    1370 <main+0x220>
lea    0xc8f(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Vuvedete izrechenie \0A\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [5 x i8] c"STOP\00"
@.str.3 = [14 x i8] c"\0ADovijdane :)\00"
@.str.4 = [4 x i8] c"%s\0A\00"
define void @main() {
%1 = alloca [100 x i8]
%2 = alloca i32
%3 = alloca i32
br label %4
4: ; preds = %0, %46
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%9 = call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %4
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
br label %49
13: ; preds = %4
%14 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%15 = call i32 @strlen(i8* %14)
store i32 %15, i32* %3
store i32 0, i32* %2
br label %16
16: ; preds = %43, %13
%17 = load i32, i32* %2
%18 = load i32, i32* %3
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %46
20: ; preds = %16
%21 = load i32, i32* %2
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %22
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp sge i32 %25, 97
br i1 %26, label %27, label %42
27: ; preds = %20
%28 = load i32, i32* %2
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %29
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = icmp sle i32 %32, 122
br i1 %33, label %34, label %42
34: ; preds = %27
%35 = load i32, i32* %2
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %36
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = sub nsw i32 %39, 32
%41 = trunc i32 %40 to i8
store i8 %41, i8* %37
br label %42
42: ; preds = %34, %27, %20
br label %43
43: ; preds = %42
%44 = load i32, i32* %2
%45 = add nsw i32 %44, 1
store i32 %45, i32* %2
br label %16
46: ; preds = %16
%47 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %47)
br label %4
49: ; preds = %11
ret void
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [5 x i8] c"STOP\00"
@.str.3 = [14 x i8] c"\0ADovijdane :)\00"
@str = [21 x i8] c"Vuvedete izrechenie \00"
define void @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 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 i64 @strcmp(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %96, %0
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
ret void
9: ; preds = %0, %96
%10 = call i32 @strlen(i8* %2)
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %96
12: ; preds = %9
%13 = zext i32 %10 to i64
%14 = icmp ult i32 %10, 8
br i1 %14, label %83, label %15
15: ; preds = %12
%16 = and i64 %13, 4294967288
br label %17
17: ; preds = %78, %15
%18 = phi i64 [ 0, %15 ], [ %79, %78 ]
%19 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %18
%20 = bitcast i8* %19 to <8 x i8>*
%21 = load <8 x i8>, <8 x i8>* %20
%22 = add <8 x i8> %21, <i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97>
%23 = icmp ult <8 x i8> %22, <i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26>
%24 = extractelement <8 x i1> %23, i64 0
br i1 %24, label %25, label %29
25: ; preds = %17
%26 = extractelement <8 x i8> %21, i64 0
%27 = add nsw i8 %26, -32
%28 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %18
store i8 %27, i8* %28
br label %29
29: ; preds = %25, %17
%30 = extractelement <8 x i1> %23, i64 1
br i1 %30, label %31, label %36
31: ; preds = %29
%32 = or i64 %18, 1
%33 = extractelement <8 x i8> %21, i64 1
%34 = add nsw i8 %33, -32
%35 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %32
store i8 %34, i8* %35
br label %36
36: ; preds = %31, %29
%37 = extractelement <8 x i1> %23, i64 2
br i1 %37, label %38, label %43
38: ; preds = %36
%39 = or i64 %18, 2
%40 = extractelement <8 x i8> %21, i64 2
%41 = add nsw i8 %40, -32
%42 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %39
store i8 %41, i8* %42
br label %43
43: ; preds = %38, %36
%44 = extractelement <8 x i1> %23, i64 3
br i1 %44, label %45, label %50
45: ; preds = %43
%46 = or i64 %18, 3
%47 = extractelement <8 x i8> %21, i64 3
%48 = add nsw i8 %47, -32
%49 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %46
store i8 %48, i8* %49
br label %50
50: ; preds = %45, %43
%51 = extractelement <8 x i1> %23, i64 4
br i1 %51, label %52, label %57
52: ; preds = %50
%53 = or i64 %18, 4
%54 = extractelement <8 x i8> %21, i64 4
%55 = add nsw i8 %54, -32
%56 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %53
store i8 %55, i8* %56
br label %57
57: ; preds = %52, %50
%58 = extractelement <8 x i1> %23, i64 5
br i1 %58, label %59, label %64
59: ; preds = %57
%60 = or i64 %18, 5
%61 = extractelement <8 x i8> %21, i64 5
%62 = add nsw i8 %61, -32
%63 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %60
store i8 %62, i8* %63
br label %64
64: ; preds = %59, %57
%65 = extractelement <8 x i1> %23, i64 6
br i1 %65, label %66, label %71
66: ; preds = %64
%67 = or i64 %18, 6
%68 = extractelement <8 x i8> %21, i64 6
%69 = add nsw i8 %68, -32
%70 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %67
store i8 %69, i8* %70
br label %71
71: ; preds = %66, %64
%72 = extractelement <8 x i1> %23, i64 7
br i1 %72, label %73, label %78
73: ; preds = %71
%74 = or i64 %18, 7
%75 = extractelement <8 x i8> %21, i64 7
%76 = add nsw i8 %75, -32
%77 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %74
store i8 %76, i8* %77
br label %78
78: ; preds = %73, %71
%79 = add nuw i64 %18, 8
%80 = icmp eq i64 %79, %16
br i1 %80, label %81, label %17
81: ; preds = %78
%82 = icmp eq i64 %16, %13
br i1 %82, label %96, label %83
83: ; preds = %12, %81
%84 = phi i64 [ 0, %12 ], [ %16, %81 ]
br label %85
85: ; preds = %83, %93
%86 = phi i64 [ %94, %93 ], [ %84, %83 ]
%87 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %86
%88 = load i8, i8* %87
%89 = add i8 %88, -97
%90 = icmp ult i8 %89, 26
br i1 %90, label %91, label %93
91: ; preds = %85
%92 = add nsw i8 %88, -32
store i8 %92, i8* %87
br label %93
93: ; preds = %85, %91
%94 = add nuw nsw i64 %86, 1
%95 = icmp eq i64 %94, %13
br i1 %95, label %96, label %85
96: ; preds = %93, %81, %9
%97 = call i32 @puts(i8* %2)
%98 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%99 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%100 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%101 = icmp eq i64 %100, 0
br i1 %101, label %7, label %9
}