#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 *);
char show_menu(char op) {
  printf("\n***************************\n");
  printf("    Escoja una opción\n\n");
  printf(
      "0) Salir\n1) Listar archivos\n2) Subir archivo\n3) Eliminar archivo\n");
  printf("\nSu opción: ");
  scanf(" %c", &op);
  return op;
}


x86 assembly (clang, -O0):
<show_menu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
lea    0xeea(%rip),%rdi
call   1030 <printf@plt>
lea    0xf20(%rip),%rdi
call   1030 <printf@plt>
lea    0xf22(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_menu>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
lea    0xef2(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9f(%rip),%rdi
call   1040 <printf@plt>
lea    0xea1(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x7(%rsp),%al
pop    %rcx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"\0A***************************\0A\00"
@.str.1 = [25 x i8] c" Escoja una opci\C3\B3n\0A\0A\00"
@.str.2 = [66 x i8] c"0) Salir\0A1) Listar archivos\0A2) Subir archivo\0A3) Eliminar archivo\0A\00"
@.str.3 = [14 x i8] c"\0ASu opci\C3\B3n: \00"
@.str.4 = [4 x i8] c" %c\00"
define signext i8 @show_menu(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %2)
%8 = load i8, i8* %2
ret i8 %8
}

LLVM IR (-O2):
@.str.3 = [14 x i8] c"\0ASu opci\C3\B3n: \00"
@.str.4 = [4 x i8] c" %c\00"
@str = [29 x i8] c"\0A***************************\00"
@str.5 = [24 x i8] c" Escoja una opci\C3\B3n\0A\00"
@str.6 = [65 x i8] c"0) Salir\0A1) Listar archivos\0A2) Subir archivo\0A3) Eliminar archivo\00"
define signext i8 @show_menu(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.5, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @str.6, i64 0, i64 0))
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %2)
%8 = load i8, i8* %2
ret i8 %8
}