#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*/ Collapse(unsigned char *, unsigned char *);
int /*<<< orphan*/ Expand(unsigned char *, unsigned char *);
int /*<<< orphan*/ MakeKey(unsigned char *, unsigned char *);
int /*<<< orphan*/ encrypt(char *, int /*<<< orphan*/);
int /*<<< orphan*/ setkey(char *);
void DesEncrypt(unsigned char *clear, unsigned char *key,
                unsigned char *cipher) {
  unsigned char des_key[8];
  unsigned char crypt_key[66];
  unsigned char des_input[66];
  MakeKey(key, des_key);
  Expand(des_key, crypt_key);
  setkey((char *)crypt_key);
  Expand(clear, des_input);
  encrypt((char *)des_input, 0);
  Collapse(des_input, cipher);
}


x86 assembly (clang, -O0):
<DesEncrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <MakeKey@plt>
lea    -0x20(%rbp),%rdi
lea    -0x70(%rbp),%rsi
call   1060 <Expand@plt>
lea    -0x70(%rbp),%rdi
call   1070 <setkey@plt>
mov    -0x8(%rbp),%rdi
lea    -0xc0(%rbp),%rsi
call   1060 <Expand@plt>
lea    -0xc0(%rbp),%rdi
xor    %esi,%esi
call   1040 <encrypt@plt>
lea    -0xc0(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <Collapse@plt>
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DesEncrypt>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0xa8,%rsp
mov    %rdx,%r14
mov    %rdi,%r15
lea    0x8(%rsp),%r12
mov    %rsi,%rdi
mov    %r12,%rsi
call   1030 <MakeKey@plt>
lea    0x60(%rsp),%rbx
mov    %r12,%rdi
mov    %rbx,%rsi
call   1060 <Expand@plt>
mov    %rbx,%rdi
call   1070 <setkey@plt>
lea    0x10(%rsp),%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
call   1060 <Expand@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <encrypt@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <Collapse@plt>
add    $0xa8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @DesEncrypt(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [8 x i8]
%8 = alloca [66 x i8]
%9 = alloca [66 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%10 = load i8*, i8** %5
%11 = getelementptr inbounds [8 x i8], [8 x i8]* %7, i64 0, i64 0
%12 = call i32 @MakeKey(i8* %10, i8* %11)
%13 = getelementptr inbounds [8 x i8], [8 x i8]* %7, i64 0, i64 0
%14 = getelementptr inbounds [66 x i8], [66 x i8]* %8, i64 0, i64 0
%15 = call i32 @Expand(i8* %13, i8* %14)
%16 = getelementptr inbounds [66 x i8], [66 x i8]* %8, i64 0, i64 0
%17 = call i32 @setkey(i8* %16)
%18 = load i8*, i8** %4
%19 = getelementptr inbounds [66 x i8], [66 x i8]* %9, i64 0, i64 0
%20 = call i32 @Expand(i8* %18, i8* %19)
%21 = getelementptr inbounds [66 x i8], [66 x i8]* %9, i64 0, i64 0
%22 = call i32 @encrypt(i8* %21, i32 0)
%23 = getelementptr inbounds [66 x i8], [66 x i8]* %9, i64 0, i64 0
%24 = load i8*, i8** %6
%25 = call i32 @Collapse(i8* %23, i8* %24)
ret void
}

LLVM IR (-O2):
define void @DesEncrypt(i8* %0, i8* %1, i8* %2) {
%4 = alloca [8 x i8]
%5 = alloca [66 x i8]
%6 = alloca [66 x i8]
%7 = getelementptr inbounds [8 x i8], [8 x i8]* %4, i64 0, i64 0
%8 = getelementptr inbounds [66 x i8], [66 x i8]* %5, i64 0, i64 0
%9 = getelementptr inbounds [66 x i8], [66 x i8]* %6, i64 0, i64 0
%10 = call i32 @MakeKey(i8* %1, i8* %7)
%11 = call i32 @Expand(i8* %7, i8* %8)
%12 = call i32 @setkey(i8* %8)
%13 = call i32 @Expand(i8* %0, i8* %9)
%14 = call i32 @encrypt(i8* %9, i32 0)
%15 = call i32 @Collapse(i8* %9, i8* %2)
ret void
}