#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*/ *fopen(char const *, char *);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ readfile_aeshash(int /*<<< orphan*/ *, unsigned char *);
int /*<<< orphan*/ scanf(char *, unsigned char *);
int main(int argc, const char *argv[]) {
  FILE *fp1;
  if (argc != 2) {
    printf("have not enter all the  name strike any key exit");
    getchar();
    return -1;
  }
  if ((fp1 = fopen(argv[1], "r")) == NULL) {
    printf("\nCannot open input file strike any key exit!");
    getchar();
    return -1;
  }
  unsigned char key[16];
  printf("please input the key:\n");
  scanf("%s", key);
  readfile_aeshash(fp1, key);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     118f <main+0x3f>
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1200 <main+0xb0>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe93(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    11d0 <main+0x80>
lea    0xe7b(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1200 <main+0xb0>
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rsi
lea    0xe90(%rip),%rdi
call   1060 <scanf@plt>
mov    -0x18(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1040 <readfile_aeshash@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
cmp    $0x2,%edi
jne    11b1 <main+0x51>
mov    0x8(%rsi),%rdi
lea    0xeba(%rip),%rsi
call   1080 <fopen@plt>
test   %rax,%rax
je     11ba <main+0x5a>
mov    %rax,%rbx
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rdi
mov    %rsp,%r14
mov    %r14,%rsi
call   1070 <scanf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <readfile_aeshash@plt>
xor    %eax,%eax
jmp    11d2 <main+0x72>
lea    0xe48(%rip),%rdi
jmp    11c1 <main+0x61>
lea    0xe72(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
mov    $0xffffffff,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [49 x i8] c"have not enter all the name strike any key exit\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [45 x i8] c"\0ACannot open input file strike any key exit!\00"
@.str.3 = [23 x i8] c"please input the key:\0A\00"
@.str.4 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca [16 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 2
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%12 = call i32 (...) @getchar()
store i32 -1, i32* %3
br label %29
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32* @fopen(i8* %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %17, i32** %6
%18 = icmp eq i32* %17, null
br i1 %18, label %19, label %22
19: ; preds = %13
%20 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0))
%21 = call i32 (...) @getchar()
store i32 -1, i32* %3
br label %29
22: ; preds = %13
%23 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
%24 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%25 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %24)
%26 = load i32*, i32** %6
%27 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%28 = call i32 @readfile_aeshash(i32* %26, i8* %27)
store i32 0, i32* %3
br label %29
29: ; preds = %22, %19, %10
%30 = load i32, i32* %3
ret i32 %30
}

LLVM IR (-O2):
@.str = [49 x i8] c"have not enter all the name strike any key exit\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [45 x i8] c"\0ACannot open input file strike any key exit!\00"
@.str.4 = [3 x i8] c"%s\00"
@str = [22 x i8] c"please input the key:\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [16 x i8]
%4 = icmp eq i32 %0, 2
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 (...) @getchar()
br label %21
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32* @fopen(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i32* %11, null
br i1 %12, label %13, label %16
13: ; preds = %8
%14 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0))
%15 = tail call i32 (...) @getchar()
br label %21
16: ; preds = %8
%17 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %17)
%20 = call i32 @readfile_aeshash(i32* %11, i8* %17)
br label %21
21: ; preds = %16, %13, %5
%22 = phi i32 [ -1, %5 ], [ -1, %13 ], [ 0, %16 ]
ret i32 %22
}