#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 getchar();
int /*<<< orphan*/ putchar(int);
int /*<<< orphan*/ puts(char *);
int main(int argc, char **argv) {
  int c, d = 0;
  puts("Zadejte text");
  do {
    c = getchar();
    if (c >= 65 && c <= 90) {
      putchar(c + 32);
    } else {
      putchar(c);
    }
  } while (c != 10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
lea    0xeac(%rip),%rdi
call   1040 <puts@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x41,-0x14(%rbp)
jl     1187 <main+0x57>
cmpl   $0x5a,-0x14(%rbp)
jg     1187 <main+0x57>
mov    -0x14(%rbp),%edi
add    $0x20,%edi
call   1030 <putchar@plt>
jmp    118f <main+0x5f>
mov    -0x14(%rbp),%edi
call   1030 <putchar@plt>
jmp    1194 <main+0x64>
cmpl   $0xa,-0x14(%rbp)
jne    1159 <main+0x29>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1040 <puts@plt>
nopl   (%rax)
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %eax,%ebx
lea    -0x41(%rbx),%eax
lea    0x20(%rbx),%edi
cmp    $0x1a,%eax
cmovae %ebx,%edi
call   1030 <putchar@plt>
cmp    $0xa,%ebx
jne    1140 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Zadejte text\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
%8 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %24, %2
%10 = call i32 (...) @getchar()
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = icmp sge i32 %11, 65
br i1 %12, label %13, label %20
13: ; preds = %9
%14 = load i32, i32* %6
%15 = icmp sle i32 %14, 90
br i1 %15, label %16, label %20
16: ; preds = %13
%17 = load i32, i32* %6
%18 = add nsw i32 %17, 32
%19 = call i32 @putchar(i32 %18)
br label %23
20: ; preds = %13, %9
%21 = load i32, i32* %6
%22 = call i32 @putchar(i32 %21)
br label %23
23: ; preds = %20, %16
br label %24
24: ; preds = %23
%25 = load i32, i32* %6
%26 = icmp ne i32 %25, 10
br i1 %26, label %9, label %27
27: ; preds = %24
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Zadejte text\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %4, %2
%5 = tail call i32 (...) @getchar()
%6 = add i32 %5, -65
%7 = icmp ult i32 %6, 26
%8 = add nuw nsw i32 %5, 32
%9 = select i1 %7, i32 %8, i32 %5
%10 = tail call i32 @putchar(i32 %9)
%11 = icmp eq i32 %5, 10
br i1 %11, label %12, label %4
12: ; preds = %4
ret i32 0
}