#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*/ puts(char *);
int /*<<< orphan*/ scanf(char *, char *);
char toupper(char);
int main() {
  char resp;
  char c;
  printf("¿Cuál es tu género (H/M)?: ");
  scanf("%c", &resp);
  resp = toupper(resp);
  switch (resp) {
  case 'H':
    puts("Eres un estudiante");
    break;
  case 'M':
    puts("Eres una estudiante");
    break;
  default:
    puts("No quieres mencionarlo");
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1050 <printf@plt>
lea    0xebd(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1060 <scanf@plt>
movsbl -0x5(%rbp),%edi
call   1030 <toupper@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x48,%eax
je     119d <main+0x5d>
jmp    118c <main+0x4c>
mov    -0xc(%rbp),%eax
sub    $0x4d,%eax
je     11ae <main+0x6e>
jmp    11bf <main+0x7f>
lea    0xe7e(%rip),%rdi
call   1040 <puts@plt>
jmp    11cb <main+0x8b>
lea    0xe80(%rip),%rdi
call   1040 <puts@plt>
jmp    11cb <main+0x8b>
lea    0xe83(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1050 <printf@plt>
lea    0xecb(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1060 <scanf@plt>
movsbl 0x7(%rsp),%edi
call   1030 <toupper@plt>
mov    %al,0x7(%rsp)
cmp    $0x4d,%al
lea    0xec0(%rip),%rcx
lea    0xecd(%rip),%rdx
cmove  %rcx,%rdx
cmp    $0x48,%al
lea    0xe99(%rip),%rdi
cmovne %rdx,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"\C2\BFCu\C3\A1l es tu g\C3\A9nero (H/M)?: \00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [19 x i8] c"Eres un estudiante\00"
@.str.3 = [20 x i8] c"Eres una estudiante\00"
@.str.4 = [23 x i8] c"No quieres mencionarlo\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%6 = load i8, i8* %2
%7 = call signext i8 @toupper(i8 signext %6)
store i8 %7, i8* %2
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
switch i32 %9, label %14 [
i32 72, label %10
i32 77, label %12
]
10: ; preds = %0
%11 = call i32 @puts(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
br label %16
12: ; preds = %0
%13 = call i32 @puts(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
br label %16
14: ; preds = %0
%15 = call i32 @puts(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0))
br label %16
16: ; preds = %14, %12, %10
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"\C2\BFCu\C3\A1l es tu g\C3\A9nero (H/M)?: \00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [19 x i8] c"Eres un estudiante\00"
@.str.3 = [20 x i8] c"Eres una estudiante\00"
@.str.4 = [23 x i8] c"No quieres mencionarlo\00"
define i32 @main() {
%1 = alloca i8
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 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
%5 = call signext i8 @toupper(i8 signext %4)
store i8 %5, i8* %1
%6 = icmp eq i8 %5, 77
%7 = select i1 %6, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0)
%8 = icmp eq i8 %5, 72
%9 = select i1 %8, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* %7
%10 = call i32 @puts(i8* dereferenceable(1) %9)
ret i32 0
}