#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 *, int *);
int /*<<< orphan*/ system(char *);
Menu_Comum(char str[]) {
  int op;
  system("clear");
  printf("\n\t\t\t\t|%s|\t\t\t\n\n", str);
  printf("\t|1| Cadastrar\n\t|2| Remover\n\t|3| Buscar\n\t|4| Alterar\n\t|5| "
         "Menu Principal\n\t|6| Imprimir Cadastros\n\t|7| Sair\n\n");
  printf(" Digite a opção desejada: ");
  scanf("%d", &op);
  system("clear");
  return op;
}


x86 assembly (clang, -O0):
<Menu_Comum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
call   1030 <system@plt>
mov    -0x8(%rbp),%rsi
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf13(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf22(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xe73(%rip),%rdi
call   1030 <system@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Menu_Comum>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xeb2(%rip),%r14
mov    %r14,%rdi
call   1040 <system@plt>
lea    0xea9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xec7(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9b(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xeaa(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    %r14,%rdi
call   1040 <system@plt>
mov    0x4(%rsp),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"clear\00"
@.str.1 = [15 x i8] c"\0A\09\09\09\09|%s|\09\09\09\0A\0A\00"
@.str.2 = [109 x i8] c"\09|1| Cadastrar\0A\09|2| Remover\0A\09|3| Buscar\0A\09|4| Alterar\0A\09|5| Menu Principal\0A\09|6| Imprimir Cadastros\0A\09|7| Sair\0A\0A\00"
@.str.3 = [29 x i8] c" Digite a op\C3\A7\C3\A3o desejada: \00"
@.str.4 = [3 x i8] c"%d\00"
define i32 @Menu_Comum(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([109 x i8], [109 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %3)
%10 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
@.str.1 = [15 x i8] c"\0A\09\09\09\09|%s|\09\09\09\0A\0A\00"
@.str.3 = [29 x i8] c" Digite a op\C3\A7\C3\A3o desejada: \00"
@.str.4 = [3 x i8] c"%d\00"
@str = [108 x i8] c"\09|1| Cadastrar\0A\09|2| Remover\0A\09|3| Buscar\0A\09|4| Alterar\0A\09|5| Menu Principal\0A\09|6| Imprimir Cadastros\0A\09|7| Sair\0A\00"
define i32 @Menu_Comum(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([108 x i8], [108 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %2)
%9 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* %2
ret i32 %10
}