#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*/ memcpy(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ yxyDES2_DecryptAnyLength(char *, int);
int /*<<< orphan*/ yxyDES2_GetPlaintextAnyLength();
int /*<<< orphan*/ yxyDES2_Initialize();
int /*<<< orphan*/ yxyDES2_InitializeKey(char *);
int DESDecryptData(const char *pszInputKey, const char *pszInputCiphertext,
                   int Cipherlen, char *pszInputPlaintext) {
  if (NULL == pszInputKey || NULL == pszInputPlaintext ||
      NULL == pszInputCiphertext)
    return -1;
  int temp = 0;
  yxyDES2_Initialize();
  yxyDES2_InitializeKey((char *)pszInputKey);
  temp = Cipherlen;
  yxyDES2_DecryptAnyLength((char *)pszInputCiphertext, temp);
  memcpy(pszInputPlaintext, yxyDES2_GetPlaintextAnyLength(), temp);
  return 0;
}


x86 assembly (clang, -O0):
<DESDecryptData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
je     118b <DESDecryptData+0x3b>
xor    %eax,%eax
cmp    -0x28(%rbp),%rax
je     118b <DESDecryptData+0x3b>
xor    %eax,%eax
cmp    -0x18(%rbp),%rax
jne    1197 <DESDecryptData+0x47>
movl   $0xffffffff,-0x4(%rbp)
jmp    11e4 <DESDecryptData+0x94>
movl   $0x0,-0x2c(%rbp)
mov    $0x0,%al
call   1050 <yxyDES2_Initialize@plt>
mov    -0x10(%rbp),%rdi
call   1040 <yxyDES2_InitializeKey@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x2c(%rbp),%esi
call   1070 <yxyDES2_DecryptAnyLength@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    $0x0,%al
call   1030 <yxyDES2_GetPlaintextAnyLength@plt>
mov    -0x38(%rbp),%rdi
mov    %eax,%esi
mov    -0x2c(%rbp),%edx
call   1060 <memcpy@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DESDecryptData>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    $0xffffffff,%r12d
test   %rsi,%rsi
je     11aa <DESDecryptData+0x5a>
mov    %rdi,%rbx
test   %rdi,%rdi
je     11aa <DESDecryptData+0x5a>
mov    %rcx,%r15
test   %rcx,%rcx
je     11aa <DESDecryptData+0x5a>
mov    %edx,%r14d
mov    %rsi,%rbp
xor    %r12d,%r12d
xor    %eax,%eax
call   1050 <yxyDES2_Initialize@plt>
mov    %rbx,%rdi
call   1040 <yxyDES2_InitializeKey@plt>
mov    %rbp,%rdi
mov    %r14d,%esi
call   1070 <yxyDES2_DecryptAnyLength@plt>
xor    %eax,%eax
call   1030 <yxyDES2_GetPlaintextAnyLength@plt>
mov    %r15,%rdi
mov    %eax,%esi
mov    %r14d,%edx
call   1060 <memcpy@plt>
mov    %r12d,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @DESDecryptData(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i8* %3, i8** %9
%11 = load i8*, i8** %6
%12 = icmp eq i8* null, %11
br i1 %12, label %19, label %13
13: ; preds = %4
%14 = load i8*, i8** %9
%15 = icmp eq i8* null, %14
br i1 %15, label %19, label %16
16: ; preds = %13
%17 = load i8*, i8** %7
%18 = icmp eq i8* null, %17
br i1 %18, label %19, label %20
19: ; preds = %16, %13, %4
store i32 -1, i32* %5
br label %32
20: ; preds = %16
store i32 0, i32* %10
%21 = call i32 (...) @yxyDES2_Initialize()
%22 = load i8*, i8** %6
%23 = call i32 @yxyDES2_InitializeKey(i8* %22)
%24 = load i32, i32* %8
store i32 %24, i32* %10
%25 = load i8*, i8** %7
%26 = load i32, i32* %10
%27 = call i32 @yxyDES2_DecryptAnyLength(i8* %25, i32 %26)
%28 = load i8*, i8** %9
%29 = call i32 (...) @yxyDES2_GetPlaintextAnyLength()
%30 = load i32, i32* %10
%31 = call i32 @memcpy(i8* %28, i32 %29, i32 %30)
store i32 0, i32* %5
br label %32
32: ; preds = %20, %19
%33 = load i32, i32* %5
ret i32 %33
}

LLVM IR (-O2):
define i32 @DESDecryptData(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = icmp eq i8* %0, null
%6 = icmp eq i8* %3, null
%7 = or i1 %5, %6
%8 = icmp eq i8* %1, null
%9 = or i1 %8, %7
br i1 %9, label %16, label %10
10: ; preds = %4
%11 = tail call i32 (...) @yxyDES2_Initialize()
%12 = tail call i32 @yxyDES2_InitializeKey(i8* %0)
%13 = tail call i32 @yxyDES2_DecryptAnyLength(i8* %1, i32 %2)
%14 = tail call i32 (...) @yxyDES2_GetPlaintextAnyLength()
%15 = tail call i32 @memcpy(i8* %3, i32 %14, i32 %2)
br label %16
16: ; preds = %4, %10
%17 = phi i32 [ 0, %10 ], [ -1, %4 ]
ret i32 %17
}