#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ F_OK;
int access(char *, int /*<<< orphan*/);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ mpb_clear_screen();
scalar_t__ mpb_create_passwd();
scalar_t__ mpb_input_passwd();
int /*<<< orphan*/ printf(char *);
int mpb_log_in(void) {
  int ret;
  FILE *fpr = NULL;
  mpb_clear_screen();
  ret = access("./.passwd", F_OK);
  if (ret == 0) {
    if (0 != mpb_input_passwd()) {
      printf("\n"
             "\033[31m"
             "Maybe you forgot the key!"
             "\033[0m"
             "\n");
      exit(1);
    }
  } else {
    if (mpb_create_passwd()) {
      printf("Create password faild.");
      exit(-1);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<mpb_log_in>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1050 <mpb_clear_screen@plt>
mov    0x2e5a(%rip),%rax
mov    (%rax),%esi
lea    0xe79(%rip),%rdi
call   1060 <access@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    11c9 <mpb_log_in+0x69>
mov    $0x0,%al
call   1080 <mpb_input_passwd@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     11c4 <mpb_log_in+0x64>
lea    0xe55(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
jmp    11f5 <mpb_log_in+0x95>
mov    $0x0,%al
call   1030 <mpb_create_passwd@plt>
cmp    $0x0,%rax
je     11f0 <mpb_log_in+0x90>
lea    0xe4e(%rip),%rdi
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
jmp    11f5 <mpb_log_in+0x95>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpb_log_in>:
push   %rax
xor    %eax,%eax
call   1060 <mpb_clear_screen@plt>
mov    0x2e59(%rip),%rax
mov    (%rax),%esi
lea    0xe78(%rip),%rdi
call   1070 <access@plt>
test   %eax,%eax
je     11b3 <mpb_log_in+0x43>
xor    %eax,%eax
call   1040 <mpb_create_passwd@plt>
test   %rax,%rax
je     11bf <mpb_log_in+0x4f>
lea    0xe66(%rip),%rdi
call   1050 <printf@plt>
mov    $0xffffffff,%edi
call   1080 <exit@plt>
xor    %eax,%eax
call   1090 <mpb_input_passwd@plt>
test   %rax,%rax
jne    11c3 <mpb_log_in+0x53>
xor    %eax,%eax
pop    %rcx
ret
lea    0xe57(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"./.passwd\00"
@F_OK = global i32 0
@.str.1 = [37 x i8] c"\0A\1B[31mMaybe you forgot the key!\1B[0m\0A\00"
@.str.2 = [23 x i8] c"Create password faild.\00"
define i32 @mpb_log_in() {
%1 = alloca i32
%2 = alloca i32*
store i32* null, i32** %2
%3 = call i32 (...) @mpb_clear_screen()
%4 = load i32, i32* @F_OK
%5 = call i32 @access(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %4)
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %0
%9 = call i64 (...) @mpb_input_passwd()
%10 = icmp ne i64 0, %9
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %8
br label %22
15: ; preds = %0
%16 = call i64 (...) @mpb_create_passwd()
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %15
%19 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%20 = call i32 @exit(i32 -1)
unreachable
21: ; preds = %15
br label %22
22: ; preds = %21, %14
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"./.passwd\00"
@F_OK = global i32 0
@.str.2 = [23 x i8] c"Create password faild.\00"
@str = [36 x i8] c"\0A\1B[31mMaybe you forgot the key!\1B[0m\00"
define i32 @mpb_log_in() {
%1 = tail call i32 (...) @mpb_clear_screen()
%2 = load i32, i32* @F_OK
%3 = tail call i32 @access(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %0
%6 = tail call i64 (...) @mpb_input_passwd()
%7 = icmp eq i64 %6, 0
br i1 %7, label %17, label %8
8: ; preds = %5
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %0
%12 = tail call i64 (...) @mpb_create_passwd()
%13 = icmp eq i64 %12, 0
br i1 %13, label %17, label %14
14: ; preds = %11
%15 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%16 = tail call i32 @exit(i32 -1)
unreachable
17: ; preds = %11, %5
ret i32 0
}