#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*/ __fpurge(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ system(char *);
int tela_cadastro() {
  int escolha;
  system("clear");
  printf(
      "\n================================================================\n");
  printf(
      "\n|   Sistema Bibliotecario do Instituto Federal de Educacao,    |\n");
  printf("|          Ciencia e Tecnologia do Estado de Sao Paulo         |\n");
  printf(
      "\n================================================================\n");
  printf("\n         =|= SELECIONE UMA DAS OPCOES ABAIXO =|=\n");
  printf("\n===| 1 |='Cadastrar Usuario'=");
  printf("\n===| 2 |='Cadastrar Livro'=");
  printf("\n===| 3 |='Alterar a Quantidade de um Livro'=");
  printf("\n===| 4 |='Sair Deste Menu'=\n");
  printf(
      "\n================================================================\n");
  printf("\n\n ===> DIGITE SUA OPCAO: ");
  scanf("%d", &escolha);
  __fpurge(stdin);
  return escolha;
}


x86 assembly (clang, -O0):
<tela_cadastro>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
call   1040 <system@plt>
lea    0xeab(%rip),%rdi
call   1050 <printf@plt>
lea    0xee2(%rip),%rdi
call   1050 <printf@plt>
lea    0xf19(%rip),%rdi
call   1050 <printf@plt>
lea    0xe87(%rip),%rdi
call   1050 <printf@plt>
lea    0xf43(%rip),%rdi
call   1050 <printf@plt>
lea    0xf6a(%rip),%rdi
call   1050 <printf@plt>
lea    0xf7d(%rip),%rdi
call   1050 <printf@plt>
lea    0xf8e(%rip),%rdi
call   1050 <printf@plt>
lea    0xfb0(%rip),%rdi
call   1050 <printf@plt>
lea    0xe3f(%rip),%rdi
call   1050 <printf@plt>
lea    0xfb6(%rip),%rdi
call   1050 <printf@plt>
lea    0xfc5(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1060 <scanf@plt>
mov    0x2df9(%rip),%rax
mov    (%rax),%edi
call   1030 <__fpurge@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tela_cadastro>:
push   %rbx
sub    $0x10,%rsp
lea    0xea4(%rip),%rdi
call   1050 <system@plt>
lea    0xff8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xf17(%rip),%rdi
call   1030 <puts@plt>
lea    0xf4d(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xf7a(%rip),%rdi
call   1030 <puts@plt>
lea    0xe63(%rip),%rdi
call   1060 <printf@plt>
lea    0xe76(%rip),%rdi
call   1060 <printf@plt>
lea    0xe87(%rip),%rdi
call   1060 <printf@plt>
lea    0xf7c(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xe95(%rip),%rdi
call   1060 <printf@plt>
lea    0xea4(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1070 <scanf@plt>
mov    0x2df0(%rip),%rax
mov    (%rax),%edi
call   1040 <__fpurge@plt>
mov    0xc(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"clear\00"
@.str.1 = [67 x i8] c"\0A================================================================\0A\00"
@.str.2 = [67 x i8] c"\0A| Sistema Bibliotecario do Instituto Federal de Educacao, |\0A\00"
@.str.3 = [66 x i8] c"| Ciencia e Tecnologia do Estado de Sao Paulo |\0A\00"
@.str.4 = [51 x i8] c"\0A =|= SELECIONE UMA DAS OPCOES ABAIXO =|=\0A\00"
@.str.5 = [31 x i8] c"\0A===| 1 |='Cadastrar Usuario'=\00"
@.str.6 = [29 x i8] c"\0A===| 2 |='Cadastrar Livro'=\00"
@.str.7 = [46 x i8] c"\0A===| 3 |='Alterar a Quantidade de um Livro'=\00"
@.str.8 = [30 x i8] c"\0A===| 4 |='Sair Deste Menu'=\0A\00"
@.str.9 = [27 x i8] c"\0A\0A ===> DIGITE SUA OPCAO: \00"
@.str.10 = [3 x i8] c"%d\00"
@stdin = global i32 0
define i32 @tela_cadastro() {
%1 = alloca i32
%2 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.4, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.7, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.8, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i32* %1)
%15 = load i32, i32* @stdin
%16 = call i32 @__fpurge(i32 %15)
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
@.str.5 = [31 x i8] c"\0A===| 1 |='Cadastrar Usuario'=\00"
@.str.6 = [29 x i8] c"\0A===| 2 |='Cadastrar Livro'=\00"
@.str.7 = [46 x i8] c"\0A===| 3 |='Alterar a Quantidade de um Livro'=\00"
@.str.9 = [27 x i8] c"\0A\0A ===> DIGITE SUA OPCAO: \00"
@.str.10 = [3 x i8] c"%d\00"
@stdin = global i32 0
@str.11 = [66 x i8] c"\0A| Sistema Bibliotecario do Instituto Federal de Educacao, |\00"
@str.12 = [65 x i8] c"| Ciencia e Tecnologia do Estado de Sao Paulo |\00"
@str.14 = [50 x i8] c"\0A =|= SELECIONE UMA DAS OPCOES ABAIXO =|=\00"
@str.15 = [29 x i8] c"\0A===| 4 |='Sair Deste Menu'=\00"
@str.16 = [66 x i8] c"\0A================================================================\00"
define i32 @tela_cadastro() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str.16, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str.11, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @str.12, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str.16, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.14, i64 0, i64 0))
%9 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0))
%10 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0))
%11 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.7, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.15, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str.16, i64 0, i64 0))
%14 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i32* %1)
%16 = load i32, i32* @stdin
%17 = call i32 @__fpurge(i32 %16)
%18 = load i32, i32* %1
ret i32 %18
}