#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 main(void) {
  char cadena;
  printf("Introduzca un carácter (y, s, n):");
  scanf("%s", &cadena);
  if (cadena == 'y' || cadena == 'n' || cadena == 's') {
    printf("Es correcto\n");
  } else {
    printf("Es incorrecto\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x79,%eax
je     1172 <main+0x52>
movsbl -0x5(%rbp),%eax
cmp    $0x6e,%eax
je     1172 <main+0x52>
movsbl -0x5(%rbp),%eax
cmp    $0x73,%eax
jne    1183 <main+0x63>
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
jmp    118f <main+0x6f>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
lea    0xedf(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x7(%rsp),%al
add    $0x92,%al
cmp    $0xb,%al
ja     116f <main+0x3f>
movzbl %al,%eax
mov    $0x821,%ecx
bt     %rax,%rcx
jae    116f <main+0x3f>
lea    0xec7(%rip),%rdi
jmp    1176 <main+0x46>
lea    0xeb0(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Introduzca un car\C3\A1cter (y, s, n):\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [13 x i8] c"Es correcto\0A\00"
@.str.3 = [15 x i8] c"Es incorrecto\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 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 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 121
br i1 %7, label %16, label %8
8: ; preds = %0
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 110
br i1 %11, label %16, label %12
12: ; preds = %8
%13 = load i8, i8* %2
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 115
br i1 %15, label %16, label %18
16: ; preds = %12, %8, %0
%17 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
br label %20
18: ; preds = %12
%19 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
br label %20
20: ; preds = %18, %16
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"Introduzca un car\C3\A1cter (y, s, n):\00"
@.str.1 = [3 x i8] c"%s\00"
@str = [14 x i8] c"Es incorrecto\00"
@str.4 = [12 x i8] c"Es correcto\00"
define i32 @main() {
%1 = alloca i8
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%4 = load i8, i8* %1
switch i8 %4, label %5 [
i8 121, label %6
i8 115, label %6
i8 110, label %6
]
5: ; preds = %0
br label %6
6: ; preds = %0, %0, %0, %5
%7 = phi i8* [ getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0), %5 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @str.4, i64 0, i64 0), %0 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @str.4, i64 0, i64 0), %0 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @str.4, i64 0, i64 0), %0 ]
%8 = call i32 @puts(i8* dereferenceable(1) %7)
ret i32 0
}