#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*/ DES_C_DES(unsigned char *, unsigned char *, int);
void DES_C_DDES(unsigned char *key, unsigned char *data, int encrypt) {
  if (encrypt) {
    DES_C_DES(key, data, 1);
    DES_C_DES(key + 8, data, 0);
    DES_C_DES(key, data, 1);
  } else {
    DES_C_DES(key, data, 0);
    DES_C_DES(key + 8, data, 1);
    DES_C_DES(key, data, 0);
  }
  return;
}


x86 assembly (clang, -O0):
<DES_C_DDES>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1169 <DES_C_DDES+0x59>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <DES_C_DES@plt>
mov    -0x8(%rbp),%rdi
add    $0x8,%rdi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1030 <DES_C_DES@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <DES_C_DES@plt>
jmp    119d <DES_C_DDES+0x8d>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1030 <DES_C_DES@plt>
mov    -0x8(%rbp),%rdi
add    $0x8,%rdi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <DES_C_DES@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1030 <DES_C_DES@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DES_C_DDES>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebp,%ebp
xor    %ebx,%ebx
test   %edx,%edx
sete   %bpl
setne  %bl
mov    %ebx,%edx
call   1030 <DES_C_DES@plt>
lea    0x8(%r15),%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1030 <DES_C_DES@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <DES_C_DES@plt>

LLVM IR (-O0):
define void @DES_C_DDES(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %20
9: ; preds = %3
%10 = load i8*, i8** %4
%11 = load i8*, i8** %5
%12 = call i32 @DES_C_DES(i8* %10, i8* %11, i32 1)
%13 = load i8*, i8** %4
%14 = getelementptr inbounds i8, i8* %13, i64 8
%15 = load i8*, i8** %5
%16 = call i32 @DES_C_DES(i8* %14, i8* %15, i32 0)
%17 = load i8*, i8** %4
%18 = load i8*, i8** %5
%19 = call i32 @DES_C_DES(i8* %17, i8* %18, i32 1)
br label %31
20: ; preds = %3
%21 = load i8*, i8** %4
%22 = load i8*, i8** %5
%23 = call i32 @DES_C_DES(i8* %21, i8* %22, i32 0)
%24 = load i8*, i8** %4
%25 = getelementptr inbounds i8, i8* %24, i64 8
%26 = load i8*, i8** %5
%27 = call i32 @DES_C_DES(i8* %25, i8* %26, i32 1)
%28 = load i8*, i8** %4
%29 = load i8*, i8** %5
%30 = call i32 @DES_C_DES(i8* %28, i8* %29, i32 0)
br label %31
31: ; preds = %20, %9
ret void
}

LLVM IR (-O2):
define void @DES_C_DDES(i8* %0, i8* %1, i32 %2) {
%4 = icmp eq i32 %2, 0
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
%7 = zext i1 %4 to i32
%8 = tail call i32 @DES_C_DES(i8* %0, i8* %1, i32 %6)
%9 = getelementptr inbounds i8, i8* %0, i64 8
%10 = tail call i32 @DES_C_DES(i8* %9, i8* %1, i32 %7)
%11 = tail call i32 @DES_C_DES(i8* %0, i8* %1, i32 %6)
ret void
}