#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 */
char *HashPassword(char *);
unsigned long JundgeResult();
int /*<<< orphan*/ OpenAllFile(char *, char *, char *);
int /*<<< orphan*/ SetEBmpFlagToBmpHeader();
int /*<<< orphan*/ WriteEBmpHeader();
int /*<<< orphan*/ WriteMaskFileToDst();
int /*<<< orphan*/ WriteSrcFileToDst(char *);
unsigned long encryption(char *src, char *mask, char *password, char *dst) {
  char *hashPwd = HashPassword(password);
  OpenAllFile(src, mask, dst);
  SetEBmpFlagToBmpHeader();
  WriteMaskFileToDst();
  WriteEBmpHeader();
  WriteSrcFileToDst(hashPwd);
  return JundgeResult();
}


x86 assembly (clang, -O0):
<encryption>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1070 <HashPassword@plt>
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <OpenAllFile@plt>
mov    $0x0,%al
call   1090 <SetEBmpFlagToBmpHeader@plt>
mov    $0x0,%al
call   1080 <WriteMaskFileToDst@plt>
mov    $0x0,%al
call   1060 <WriteEBmpHeader@plt>
mov    -0x28(%rbp),%rdi
call   1050 <WriteSrcFileToDst@plt>
mov    $0x0,%al
call   1030 <JundgeResult@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<encryption>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
mov    %rdx,%rdi
call   1070 <HashPassword@plt>
mov    %rax,%r12
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1040 <OpenAllFile@plt>
xor    %eax,%eax
call   1090 <SetEBmpFlagToBmpHeader@plt>
xor    %eax,%eax
call   1080 <WriteMaskFileToDst@plt>
xor    %eax,%eax
call   1060 <WriteEBmpHeader@plt>
mov    %r12,%rdi
call   1050 <WriteSrcFileToDst@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <JundgeResult@plt>

LLVM IR (-O0):
define i64 @encryption(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%10 = load i8*, i8** %7
%11 = call i8* @HashPassword(i8* %10)
store i8* %11, i8** %9
%12 = load i8*, i8** %5
%13 = load i8*, i8** %6
%14 = load i8*, i8** %8
%15 = call i32 @OpenAllFile(i8* %12, i8* %13, i8* %14)
%16 = call i32 (...) @SetEBmpFlagToBmpHeader()
%17 = call i32 (...) @WriteMaskFileToDst()
%18 = call i32 (...) @WriteEBmpHeader()
%19 = load i8*, i8** %9
%20 = call i32 @WriteSrcFileToDst(i8* %19)
%21 = call i64 (...) @JundgeResult()
ret i64 %21
}

LLVM IR (-O2):
define i64 @encryption(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i8* @HashPassword(i8* %2)
%6 = tail call i32 @OpenAllFile(i8* %0, i8* %1, i8* %3)
%7 = tail call i32 (...) @SetEBmpFlagToBmpHeader()
%8 = tail call i32 (...) @WriteMaskFileToDst()
%9 = tail call i32 (...) @WriteEBmpHeader()
%10 = tail call i32 @WriteSrcFileToDst(i8* %5)
%11 = tail call i64 (...) @JundgeResult()
ret i64 %11
}