#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*/ gets(char *);
int /*<<< orphan*/ printf(char *);
scalar_t__ strcmp(char *, char *);
int main() {
  char senha[10];
  int acertou = 0;
  printf("\n Entre com a senha : \n");
  gets(senha);
  if (strcmp(senha, "lasalle")) {
    printf("\n Ops! Senha incorreta! \n");
  } else {
    printf("\n Legal! Senha correta! \n");
    acertou = 1;
  }
  if (acertou) {
    printf("\n Privilegios de root permitido!! \n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
lea    -0xe(%rbp),%rdi
call   1050 <gets@plt>
lea    -0xe(%rbp),%rdi
lea    0xeb2(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     1186 <main+0x56>
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
jmp    1199 <main+0x69>
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     11af <main+0x7f>
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
lea    0x6(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
lea    0xeab(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     116b <main+0x3b>
lea    0xef2(%rip),%rdi
jmp    117e <main+0x4e>
lea    0xead(%rip),%rdi
call   1030 <puts@plt>
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"\0A Entre com a senha : \0A\00"
@.str.1 = [8 x i8] c"lasalle\00"
@.str.2 = [26 x i8] c"\0A Ops! Senha incorreta! \0A\00"
@.str.3 = [26 x i8] c"\0A Legal! Senha correta! \0A\00"
@.str.4 = [36 x i8] c"\0A Privilegios de root permitido!! \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
%4 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%6 = call i32 @gets(i8* %5)
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%8 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
br label %14
12: ; preds = %0
%13 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %3
br label %14
14: ; preds = %12, %10
%15 = load i32, i32* %3
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %14
%18 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0))
br label %19
19: ; preds = %17, %14
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [8 x i8] c"lasalle\00"
@str = [23 x i8] c"\0A Entre com a senha : \00"
@str.5 = [25 x i8] c"\0A Legal! Senha correta! \00"
@str.6 = [35 x i8] c"\0A Privilegios de root permitido!! \00"
@str.7 = [25 x i8] c"\0A Ops! Senha incorreta! \00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%4 = call i32 @gets(i8* %2)
%5 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.5, i64 0, i64 0))
br label %9
9: ; preds = %0, %7
%10 = phi i8* [ getelementptr inbounds ([35 x i8], [35 x i8]* @str.6, i64 0, i64 0), %7 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @str.7, i64 0, i64 0), %0 ]
%11 = call i32 @puts(i8* dereferenceable(1) %10)
ret i32 0
}