#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*/ aschex_to_bcdhex11(char *, int, char *);
int /*<<< orphan*/ bcdhex_to_aschex11(char *, int, char *);
int /*<<< orphan*/ discrypt0(unsigned char *, unsigned char *);
int /*<<< orphan*/ expand0(unsigned char *, unsigned char *);
int /*<<< orphan*/ memset(unsigned char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ setkeystar(unsigned char *);
void _Des(unsigned char *key, unsigned char *text, unsigned char *mtext) {
  unsigned char tmp[64];
  unsigned char keybuf[9];
  unsigned char textbuf[9];
  unsigned char mtextbuf[9];
  memset(keybuf, 0, 9);
  memset(textbuf, 0, 9);
  memset(mtextbuf, 0, 9);
  aschex_to_bcdhex11((char *)key, 16, (char *)keybuf);
  aschex_to_bcdhex11((char *)text, 16, (char *)textbuf);
  expand0(keybuf, tmp);
  setkeystar(tmp);
  discrypt0(textbuf, mtextbuf);
  bcdhex_to_aschex11((char *)mtextbuf, 8, (char *)mtext);
}


x86 assembly (clang, -O0):
<_Des>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x69(%rbp),%rdi
xor    %esi,%esi
mov    $0x9,%edx
call   1070 <memset@plt>
lea    -0x72(%rbp),%rdi
xor    %esi,%esi
mov    $0x9,%edx
call   1070 <memset@plt>
lea    -0x7b(%rbp),%rdi
xor    %esi,%esi
mov    $0x9,%edx
call   1070 <memset@plt>
mov    -0x8(%rbp),%rdi
lea    -0x69(%rbp),%rdx
mov    $0x10,%esi
call   1040 <aschex_to_bcdhex11@plt>
mov    -0x10(%rbp),%rdi
lea    -0x72(%rbp),%rdx
mov    $0x10,%esi
call   1040 <aschex_to_bcdhex11@plt>
lea    -0x69(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1050 <expand0@plt>
lea    -0x60(%rbp),%rdi
call   1030 <setkeystar@plt>
lea    -0x72(%rbp),%rdi
lea    -0x7b(%rbp),%rsi
call   1080 <discrypt0@plt>
lea    -0x7b(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x8,%esi
call   1060 <bcdhex_to_aschex11@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Des>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%rbp
lea    0x17(%rsp),%r12
mov    %r12,%rdi
xor    %esi,%esi
mov    $0x9,%edx
call   1070 <memset@plt>
lea    0xe(%rsp),%r15
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x9,%edx
call   1070 <memset@plt>
lea    0x5(%rsp),%r13
mov    %r13,%rdi
xor    %esi,%esi
mov    $0x9,%edx
call   1070 <memset@plt>
mov    %rbp,%rdi
mov    $0x10,%esi
mov    %r12,%rdx
call   1040 <aschex_to_bcdhex11@plt>
mov    %rbx,%rdi
mov    $0x10,%esi
mov    %r15,%rdx
call   1040 <aschex_to_bcdhex11@plt>
lea    0x20(%rsp),%rbx
mov    %r12,%rdi
mov    %rbx,%rsi
call   1050 <expand0@plt>
mov    %rbx,%rdi
call   1030 <setkeystar@plt>
mov    %r15,%rdi
mov    %r13,%rsi
call   1080 <discrypt0@plt>
mov    %r13,%rdi
mov    $0x8,%esi
mov    %r14,%rdx
call   1060 <bcdhex_to_aschex11@plt>
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @_Des(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [64 x i8]
%8 = alloca [9 x i8]
%9 = alloca [9 x i8]
%10 = alloca [9 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%11 = getelementptr inbounds [9 x i8], [9 x i8]* %8, i64 0, i64 0
%12 = call i32 @memset(i8* %11, i32 0, i32 9)
%13 = getelementptr inbounds [9 x i8], [9 x i8]* %9, i64 0, i64 0
%14 = call i32 @memset(i8* %13, i32 0, i32 9)
%15 = getelementptr inbounds [9 x i8], [9 x i8]* %10, i64 0, i64 0
%16 = call i32 @memset(i8* %15, i32 0, i32 9)
%17 = load i8*, i8** %4
%18 = getelementptr inbounds [9 x i8], [9 x i8]* %8, i64 0, i64 0
%19 = call i32 @aschex_to_bcdhex11(i8* %17, i32 16, i8* %18)
%20 = load i8*, i8** %5
%21 = getelementptr inbounds [9 x i8], [9 x i8]* %9, i64 0, i64 0
%22 = call i32 @aschex_to_bcdhex11(i8* %20, i32 16, i8* %21)
%23 = getelementptr inbounds [9 x i8], [9 x i8]* %8, i64 0, i64 0
%24 = getelementptr inbounds [64 x i8], [64 x i8]* %7, i64 0, i64 0
%25 = call i32 @expand0(i8* %23, i8* %24)
%26 = getelementptr inbounds [64 x i8], [64 x i8]* %7, i64 0, i64 0
%27 = call i32 @setkeystar(i8* %26)
%28 = getelementptr inbounds [9 x i8], [9 x i8]* %9, i64 0, i64 0
%29 = getelementptr inbounds [9 x i8], [9 x i8]* %10, i64 0, i64 0
%30 = call i32 @discrypt0(i8* %28, i8* %29)
%31 = getelementptr inbounds [9 x i8], [9 x i8]* %10, i64 0, i64 0
%32 = load i8*, i8** %6
%33 = call i32 @bcdhex_to_aschex11(i8* %31, i32 8, i8* %32)
ret void
}

LLVM IR (-O2):
define void @_Des(i8* %0, i8* %1, i8* %2) {
%4 = alloca [64 x i8]
%5 = alloca [9 x i8]
%6 = alloca [9 x i8]
%7 = alloca [9 x i8]
%8 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
%9 = getelementptr inbounds [9 x i8], [9 x i8]* %5, i64 0, i64 0
%10 = getelementptr inbounds [9 x i8], [9 x i8]* %6, i64 0, i64 0
%11 = getelementptr inbounds [9 x i8], [9 x i8]* %7, i64 0, i64 0
%12 = call i32 @memset(i8* %9, i32 0, i32 9)
%13 = call i32 @memset(i8* %10, i32 0, i32 9)
%14 = call i32 @memset(i8* %11, i32 0, i32 9)
%15 = call i32 @aschex_to_bcdhex11(i8* %0, i32 16, i8* %9)
%16 = call i32 @aschex_to_bcdhex11(i8* %1, i32 16, i8* %10)
%17 = call i32 @expand0(i8* %9, i8* %8)
%18 = call i32 @setkeystar(i8* %8)
%19 = call i32 @discrypt0(i8* %10, i8* %11)
%20 = call i32 @bcdhex_to_aschex11(i8* %11, i32 8, i8* %2)
ret void
}