#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*/ printf(char *, ...);
int main7() {
  char nombre[20] = "";
  char eleccion;
  printf("Elige el numero en el menu:\n\n");
  printf("1 - Cargar fichero\n2 - Guardar en un fichero\n3 - Otras "
         "operaciones\n4 - Mostrar datos\n0 - Salir\n\n");
  printf("Opcion: ");
  eleccion = getchar();
  printf("\nHas elegido: %c", eleccion);
  printf("\nPulse una tecla para continuar %c", getchar());
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1040 <memset@plt>
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf14(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x21(%rbp)
movsbl -0x21(%rbp),%esi
lea    0xf01(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,%esi
lea    0xefb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main7>:
push   %rax
lea    0xf05(%rip),%rdi
call   1030 <puts@plt>
lea    0xf16(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
movsbl %al,%esi
lea    0xea1(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
lea    0xe9d(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Elige el numero en el menu:\0A\0A\00"
@.str.1 = [97 x i8] c"1 - Cargar fichero\0A2 - Guardar en un fichero\0A3 - Otras operaciones\0A4 - Mostrar datos\0A0 - Salir\0A\0A\00"
@.str.2 = [9 x i8] c"Opcion: \00"
@.str.3 = [17 x i8] c"\0AHas elegido: %c\00"
@.str.4 = [35 x i8] c"\0APulse una tecla para continuar %c\00"
define i32 @main7() {
%1 = alloca [20 x i8]
%2 = alloca i8
%3 = bitcast [20 x i8]* %1 to i8*
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([97 x i8], [97 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 (...) @getchar()
%8 = trunc i32 %7 to i8
store i8 %8, i8* %2
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %10)
%12 = call i32 (...) @getchar()
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0), i32 %12)
%14 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [9 x i8] c"Opcion: \00"
@.str.3 = [17 x i8] c"\0AHas elegido: %c\00"
@.str.4 = [35 x i8] c"\0APulse una tecla para continuar %c\00"
@str = [29 x i8] c"Elige el numero en el menu:\0A\00"
@str.5 = [96 x i8] c"1 - Cargar fichero\0A2 - Guardar en un fichero\0A3 - Otras operaciones\0A4 - Mostrar datos\0A0 - Salir\0A\00"
define i32 @main7() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([96 x i8], [96 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 (...) @getchar()
%5 = shl i32 %4, 24
%6 = ashr exact i32 %5, 24
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %6)
%8 = tail call i32 (...) @getchar()
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0), i32 %8)
%10 = tail call i32 (...) @getchar()
ret i32 0
}