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

/* Variables and functions */
int /*<<< orphan*/ Des(unsigned char *, unsigned char *, unsigned char *);
int /*<<< orphan*/ _Des(unsigned char *, unsigned char *, unsigned char *);
int /*<<< orphan*/ memset(unsigned char *, int /*<<< orphan*/, int);
void _TDes(unsigned char *key, unsigned char *text, unsigned char *mtext) {
  unsigned char tmp[64], tmp2[64];
  memset(tmp, 0, sizeof(tmp));
  memset(tmp2, 0, sizeof(tmp2));
  _Des(key, text, tmp);
  Des(key + 16, tmp, tmp2);
  _Des(key, tmp2, mtext);
}


x86 assembly (clang, -O0):
<_TDes>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x60(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1040 <memset@plt>
lea    -0xa0(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1040 <memset@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x60(%rbp),%rdx
call   1050 <_Des@plt>
mov    -0x8(%rbp),%rdi
add    $0x10,%rdi
lea    -0x60(%rbp),%rsi
lea    -0xa0(%rbp),%rdx
call   1030 <Des@plt>
mov    -0x8(%rbp),%rdi
lea    -0xa0(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1050 <_Des@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_TDes>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x80,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0x40(%rsp),%r12
mov    %r12,%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1040 <memset@plt>
mov    %rsp,%r13
mov    %r13,%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1050 <_Des@plt>
lea    0x10(%rbx),%rdi
mov    %r12,%rsi
mov    %r13,%rdx
call   1030 <Des@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %r14,%rdx
call   1050 <_Des@plt>
add    $0x80,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @_TDes(i8* %0, i8* %1, i8* %2) {
%4 = alloca [64 x i8]
%5 = alloca [64 x i8]
%6 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
%7 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%8 = call i32 @memset(i8* %6, i32 0, i32 64)
%9 = call i32 @memset(i8* %7, i32 0, i32 64)
%10 = call i32 @_Des(i8* %0, i8* %1, i8* %6)
%11 = getelementptr inbounds i8, i8* %0, i64 16
%12 = call i32 @Des(i8* %11, i8* %6, i8* %7)
%13 = call i32 @_Des(i8* %0, i8* %7, i8* %2)
ret void
}