#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 *, char *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ strcmp(char *, char *);
int /*<<< orphan*/ system(char *);
int tela_inicial() {
  char senha[100];
  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===| DIGITE SUA SENHA PARA ACESSAR OS COMANDOS DE ADMINISTRACAO "
         "|===\n");
  printf("\n===|         APERTE ENTER PARA REALIZAR EMPRESTIMOS             "
         "|===\n");
  printf("\n===|   DIGITE A LETRA 's' PARA SAIR DO SISTEMA BIBLIOTECARIO    "
         "|===\n");
  printf(
      "\n================================================================\n");
  printf("\n\n ===> DIGITE SUA OPCAO: ");
  scanf("%[^\n]s", senha);
  __fpurge(stdin);
  if (!strcmp(senha, "obelisco")) {
    return 0;
  } else if (!strcmp(senha, "s")) {
    return 2;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<tela_inicial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    0xea1(%rip),%rdi
call   1040 <system@plt>
lea    0xe9b(%rip),%rdi
call   1050 <printf@plt>
lea    0xed2(%rip),%rdi
call   1050 <printf@plt>
lea    0xf09(%rip),%rdi
call   1050 <printf@plt>
lea    0xe77(%rip),%rdi
call   1050 <printf@plt>
lea    0xf33(%rip),%rdi
call   1050 <printf@plt>
lea    0xf6e(%rip),%rdi
call   1050 <printf@plt>
lea    0xfa9(%rip),%rdi
call   1050 <printf@plt>
lea    0xe47(%rip),%rdi
call   1050 <printf@plt>
lea    0xfd8(%rip),%rdi
call   1050 <printf@plt>
lea    -0x70(%rbp),%rsi
lea    0xfe3(%rip),%rdi
call   1070 <scanf@plt>
mov    0x2e01(%rip),%rax
mov    (%rax),%edi
call   1030 <__fpurge@plt>
lea    -0x70(%rbp),%rdi
lea    0xfcc(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    1213 <tela_inicial+0xc3>
movl   $0x0,-0x4(%rbp)
jmp    123f <tela_inicial+0xef>
lea    -0x70(%rbp),%rdi
lea    0xfa5(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    1238 <tela_inicial+0xe8>
movl   $0x2,-0x4(%rbp)
jmp    123f <tela_inicial+0xef>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tela_inicial>:
push   %rbx
sub    $0x70,%rsp
lea    0xea4(%rip),%rdi
call   1050 <system@plt>
lea    0x101e(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
lea    0xef0(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xf1d(%rip),%rdi
call   1030 <puts@plt>
lea    0xf57(%rip),%rdi
call   1030 <puts@plt>
lea    0xf91(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xe43(%rip),%rdi
call   1060 <printf@plt>
lea    0xe52(%rip),%rdi
mov    %rsp,%rsi
call   1070 <scanf@plt>
mov    0x2e0a(%rip),%rax
mov    (%rax),%edi
call   1040 <__fpurge@plt>
movabs $0x6f6373696c65626f,%rcx
73 63 6f
xor    (%rsp),%rcx
movzbl 0x8(%rsp),%edx
xor    %esi,%esi
cmpw   $0x73,(%rsp)
sete   %sil
add    $0x1,%esi
xor    %eax,%eax
or     %rcx,%rdx
cmovne %esi,%eax
add    $0x70,%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 = [71 x i8] c"\0A===| DIGITE SUA SENHA PARA ACESSAR OS COMANDOS DE ADMINISTRACAO |===\0A\00"
@.str.5 = [71 x i8] c"\0A===| APERTE ENTER PARA REALIZAR EMPRESTIMOS |===\0A\00"
@.str.6 = [71 x i8] c"\0A===| DIGITE A LETRA 's' PARA SAIR DO SISTEMA BIBLIOTECARIO |===\0A\00"
@.str.7 = [27 x i8] c"\0A\0A ===> DIGITE SUA OPCAO: \00"
@.str.8 = [7 x i8] c"%[^\0A]s\00"
@stdin = global i32 0
@.str.9 = [9 x i8] c"obelisco\00"
@.str.10 = [2 x i8] c"s\00"
define i32 @tela_inicial() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.4, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.5, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.6, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0))
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%14 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8* %13)
%15 = load i32, i32* @stdin
%16 = call i32 @__fpurge(i32 %15)
%17 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%18 = call i32 @strcmp(i8* %17, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0))
%19 = icmp ne i32 %18, 0
br i1 %19, label %21, label %20
20: ; preds = %0
store i32 0, i32* %1
br label %27
21: ; preds = %0
%22 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%23 = call i32 @strcmp(i8* %22, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%24 = icmp ne i32 %23, 0
br i1 %24, label %26, label %25
25: ; preds = %21
store i32 2, i32* %1
br label %27
26: ; preds = %21
store i32 1, i32* %1
br label %27
27: ; preds = %26, %25, %20
%28 = load i32, i32* %1
ret i32 %28
}

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
@.str.7 = [27 x i8] c"\0A\0A ===> DIGITE SUA OPCAO: \00"
@.str.8 = [7 x i8] c"%[^\0A]s\00"
@stdin = global i32 0
@.str.9 = [9 x i8] c"obelisco\00"
@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 = [70 x i8] c"\0A===| DIGITE SUA SENHA PARA ACESSAR OS COMANDOS DE ADMINISTRACAO |===\00"
@str.15 = [70 x i8] c"\0A===| APERTE ENTER PARA REALIZAR EMPRESTIMOS |===\00"
@str.16 = [70 x i8] c"\0A===| DIGITE A LETRA 's' PARA SAIR DO SISTEMA BIBLIOTECARIO |===\00"
@str.17 = [66 x i8] c"\0A================================================================\00"
define i32 @tela_inicial() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%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.17, 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.17, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @str.14, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @str.15, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @str.16, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str.17, i64 0, i64 0))
%12 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8* %2)
%14 = load i32, i32* @stdin
%15 = call i32 @__fpurge(i32 %14)
%16 = call i32 @bcmp(i8* dereferenceable(9) %2, i8* dereferenceable(9) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), i64 9)
%17 = icmp eq i32 %16, 0
%18 = bitcast [100 x i8]* %1 to i16*
%19 = load i16, i16* %18
%20 = icmp eq i16 %19, 115
%21 = select i1 %20, i32 2, i32 1
%22 = select i1 %17, i32 0, i32 %21
ret i32 %22
}