#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 EXIT_SUCCESS;
int getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main(int argc, char **argv) {
  char cadena[51];
  int i = 1, car;
  printf("Introduce una frase: ");
  scanf("%c", cadena);
  while (i < 51 - 1 && (car = getchar()) != '\0') {
    cadena[i] = car;
    i++;
  }
  cadena[i] = 0;
  printf("El texto introducido es %s", cadena);
  for (i = 0; cadena[i] != '\0'; i++) {
    if (cadena[i] >= 'a' && cadena[i] <= 'Z') {
    }
  }
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x54(%rbp)
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x50(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1050 <scanf@plt>
xor    %eax,%eax
cmpl   $0x32,-0x54(%rbp)
mov    %al,-0x59(%rbp)
jge    118d <main+0x5d>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x58(%rbp)
cmp    $0x0,%eax
setne  %al
mov    %al,-0x59(%rbp)
mov    -0x59(%rbp),%al
test   $0x1,%al
jne    119d <main+0x6d>
jmp    11b8 <main+0x88>
mov    -0x58(%rbp),%eax
mov    %al,%cl
movslq -0x54(%rbp),%rax
mov    %cl,-0x50(%rbp,%rax,1)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    116b <main+0x3b>
movslq -0x54(%rbp),%rax
movb   $0x0,-0x50(%rbp,%rax,1)
lea    -0x50(%rbp),%rsi
lea    0xe4d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x54(%rbp)
movslq -0x54(%rbp),%rax
movsbl -0x50(%rbp,%rax,1),%eax
cmp    $0x0,%eax
je     1228 <main+0xf8>
movslq -0x54(%rbp),%rax
movsbl -0x50(%rbp,%rax,1),%eax
cmp    $0x61,%eax
jl     1215 <main+0xe5>
movslq -0x54(%rbp),%rax
movsbl -0x50(%rbp,%rax,1),%eax
cmp    $0x5a,%eax
jg     1215 <main+0xe5>
jmp    1215 <main+0xe5>
jmp    121a <main+0xea>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    11da <main+0xaa>
mov    0x2db1(%rip),%rax
mov    (%rax),%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   1030 <printf@plt>
lea    0xecc(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
mov    $0x1,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
test   %eax,%eax
je     117d <main+0x4d>
mov    %al,(%rsp,%rbx,1)
add    $0x1,%rbx
cmp    $0x32,%rbx
jne    1160 <main+0x30>
mov    $0x32,%ebx
mov    %ebx,%eax
movb   $0x0,(%rsp,%rax,1)
lea    0xe8f(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2e45(%rip),%rax
mov    (%rax),%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Introduce una frase: \00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [27 x i8] c"El texto introducido es %s\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [51 x i8]
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %7
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%10 = getelementptr inbounds [51 x i8], [51 x i8]* %6, 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)
br label %12
12: ; preds = %20, %2
%13 = load i32, i32* %7
%14 = icmp slt i32 %13, 50
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = call i32 (...) @getchar()
store i32 %16, i32* %8
%17 = icmp ne i32 %16, 0
br label %18
18: ; preds = %15, %12
%19 = phi i1 [ false, %12 ], [ %17, %15 ]
br i1 %19, label %20, label %28
20: ; preds = %18
%21 = load i32, i32* %8
%22 = trunc i32 %21 to i8
%23 = load i32, i32* %7
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [51 x i8], [51 x i8]* %6, i64 0, i64 %24
store i8 %22, i8* %25
%26 = load i32, i32* %7
%27 = add nsw i32 %26, 1
store i32 %27, i32* %7
br label %12
28: ; preds = %18
%29 = load i32, i32* %7
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [51 x i8], [51 x i8]* %6, i64 0, i64 %30
store i8 0, i8* %31
%32 = getelementptr inbounds [51 x i8], [51 x i8]* %6, i64 0, i64 0
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i8* %32)
store i32 0, i32* %7
br label %34
34: ; preds = %57, %28
%35 = load i32, i32* %7
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [51 x i8], [51 x i8]* %6, i64 0, i64 %36
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = icmp ne i32 %39, 0
br i1 %40, label %41, label %60
41: ; preds = %34
%42 = load i32, i32* %7
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [51 x i8], [51 x i8]* %6, i64 0, i64 %43
%45 = load i8, i8* %44
%46 = sext i8 %45 to i32
%47 = icmp sge i32 %46, 97
br i1 %47, label %48, label %56
48: ; preds = %41
%49 = load i32, i32* %7
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [51 x i8], [51 x i8]* %6, i64 0, i64 %50
%52 = load i8, i8* %51
%53 = sext i8 %52 to i32
%54 = icmp sle i32 %53, 90
br i1 %54, label %55, label %56
55: ; preds = %48
br label %56
56: ; preds = %55, %48, %41
br label %57
57: ; preds = %56
%58 = load i32, i32* %7
%59 = add nsw i32 %58, 1
store i32 %59, i32* %7
br label %34
60: ; preds = %34
%61 = load i32, i32* @EXIT_SUCCESS
ret i32 %61
}

LLVM IR (-O2):
@.str = [22 x i8] c"Introduce una frase: \00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [27 x i8] c"El texto introducido es %s\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [51 x i8]
%4 = getelementptr inbounds [51 x i8], [51 x i8]* %3, i64 0, i64 0
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
br label %7
7: ; preds = %2, %11
%8 = phi i64 [ 1, %2 ], [ %14, %11 ]
%9 = call i32 (...) @getchar()
%10 = icmp eq i32 %9, 0
br i1 %10, label %16, label %11
11: ; preds = %7
%12 = trunc i32 %9 to i8
%13 = getelementptr inbounds [51 x i8], [51 x i8]* %3, i64 0, i64 %8
store i8 %12, i8* %13
%14 = add nuw nsw i64 %8, 1
%15 = icmp eq i64 %14, 50
br i1 %15, label %16, label %7
16: ; preds = %11, %7
%17 = phi i64 [ 50, %11 ], [ %8, %7 ]
%18 = and i64 %17, 4294967295
%19 = getelementptr inbounds [51 x i8], [51 x i8]* %3, i64 0, i64 %18
store i8 0, i8* %19
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i8* %4)
%21 = load i32, i32* @EXIT_SUCCESS
ret i32 %21
}