#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*/ funcReverseLSX(unsigned char *, unsigned char *,
                                  unsigned char *);
int /*<<< orphan*/ funcX(unsigned char *, unsigned char *, unsigned char *);
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char const *, int);
void Decrypt_14(const unsigned char *chipherText, unsigned char *plainText,
                unsigned int lenPlainText, unsigned char *keys) {
  unsigned char xTemp[16] = {0};
  unsigned char yTemp[16] = {0};
  int i;
  memcpy(xTemp, chipherText, 16);
  for (i = 0; i < 9; ++i) {
    funcReverseLSX(xTemp, keys + (9 - i) * 16, yTemp);
    memcpy(xTemp, yTemp, 16);
  }
  funcX(yTemp, keys, plainText);
}


x86 assembly (clang, -O0):
<Decrypt_14>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x10,%edx
call   1040 <memcpy@plt>
movl   $0x0,-0x44(%rbp)
cmpl   $0x9,-0x44(%rbp)
jge    11db <Decrypt_14+0x9b>
lea    -0x30(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    $0x9,%eax
sub    -0x44(%rbp),%eax
shl    $0x4,%eax
cltq
add    %rax,%rsi
lea    -0x40(%rbp),%rdx
call   1060 <funcReverseLSX@plt>
lea    -0x30(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    $0x10,%edx
call   1040 <memcpy@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1190 <Decrypt_14+0x50>
lea    -0x40(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1050 <funcX@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Decrypt_14>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rcx,%r12
mov    %rsi,%r14
mov    %rdi,%rsi
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
lea    0x10(%rsp),%r15
mov    %r15,%rdi
mov    $0x10,%edx
call   1030 <memcpy@plt>
lea    0x90(%r12),%rsi
mov    %rsp,%rbx
mov    %r15,%rdi
mov    %rbx,%rdx
call   1050 <funcReverseLSX@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    $0x10,%edx
call   1030 <memcpy@plt>
lea    0x80(%r12),%rsi
mov    %r15,%rdi
mov    %rbx,%rdx
call   1050 <funcReverseLSX@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    $0x10,%edx
call   1030 <memcpy@plt>
lea    0x70(%r12),%rsi
mov    %r15,%rdi
mov    %rbx,%rdx
call   1050 <funcReverseLSX@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    $0x10,%edx
call   1030 <memcpy@plt>
lea    0x60(%r12),%rsi
mov    %r15,%rdi
mov    %rbx,%rdx
call   1050 <funcReverseLSX@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    $0x10,%edx
call   1030 <memcpy@plt>
lea    0x50(%r12),%rsi
mov    %r15,%rdi
mov    %rbx,%rdx
call   1050 <funcReverseLSX@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    $0x10,%edx
call   1030 <memcpy@plt>
lea    0x40(%r12),%rsi
mov    %r15,%rdi
mov    %rbx,%rdx
call   1050 <funcReverseLSX@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    $0x10,%edx
call   1030 <memcpy@plt>
lea    0x30(%r12),%rsi
mov    %r15,%rdi
mov    %rbx,%rdx
call   1050 <funcReverseLSX@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    $0x10,%edx
call   1030 <memcpy@plt>
lea    0x20(%r12),%rsi
mov    %r15,%rdi
mov    %rbx,%rdx
call   1050 <funcReverseLSX@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    $0x10,%edx
call   1030 <memcpy@plt>
lea    0x10(%r12),%rsi
mov    %r15,%rdi
mov    %rbx,%rdx
call   1050 <funcReverseLSX@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    $0x10,%edx
call   1030 <memcpy@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r14,%rdx
call   1040 <funcX@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @Decrypt_14(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca [16 x i8]
%10 = alloca [16 x i8]
%11 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%12 = bitcast [16 x i8]* %9 to i8*
%13 = bitcast [16 x i8]* %10 to i8*
%14 = getelementptr inbounds [16 x i8], [16 x i8]* %9, i64 0, i64 0
%15 = load i8*, i8** %5
%16 = call i32 @memcpy(i8* %14, i8* %15, i32 16)
store i32 0, i32* %11
br label %17
17: ; preds = %33, %4
%18 = load i32, i32* %11
%19 = icmp slt i32 %18, 9
br i1 %19, label %20, label %36
20: ; preds = %17
%21 = getelementptr inbounds [16 x i8], [16 x i8]* %9, i64 0, i64 0
%22 = load i8*, i8** %8
%23 = load i32, i32* %11
%24 = sub nsw i32 9, %23
%25 = mul nsw i32 %24, 16
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8, i8* %22, i64 %26
%28 = getelementptr inbounds [16 x i8], [16 x i8]* %10, i64 0, i64 0
%29 = call i32 @funcReverseLSX(i8* %21, i8* %27, i8* %28)
%30 = getelementptr inbounds [16 x i8], [16 x i8]* %9, i64 0, i64 0
%31 = getelementptr inbounds [16 x i8], [16 x i8]* %10, i64 0, i64 0
%32 = call i32 @memcpy(i8* %30, i8* %31, i32 16)
br label %33
33: ; preds = %20
%34 = load i32, i32* %11
%35 = add nsw i32 %34, 1
store i32 %35, i32* %11
br label %17
36: ; preds = %17
%37 = getelementptr inbounds [16 x i8], [16 x i8]* %10, i64 0, i64 0
%38 = load i8*, i8** %8
%39 = load i8*, i8** %6
%40 = call i32 @funcX(i8* %37, i8* %38, i8* %39)
ret void
}

LLVM IR (-O2):
define void @Decrypt_14(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca [16 x i8]
%6 = alloca [16 x i8]
%7 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%8 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%9 = call i32 @memcpy(i8* %7, i8* %0, i32 16)
%10 = getelementptr inbounds i8, i8* %3, i64 144
%11 = call i32 @funcReverseLSX(i8* %7, i8* %10, i8* %8)
%12 = call i32 @memcpy(i8* %7, i8* %8, i32 16)
%13 = getelementptr inbounds i8, i8* %3, i64 128
%14 = call i32 @funcReverseLSX(i8* %7, i8* %13, i8* %8)
%15 = call i32 @memcpy(i8* %7, i8* %8, i32 16)
%16 = getelementptr inbounds i8, i8* %3, i64 112
%17 = call i32 @funcReverseLSX(i8* %7, i8* %16, i8* %8)
%18 = call i32 @memcpy(i8* %7, i8* %8, i32 16)
%19 = getelementptr inbounds i8, i8* %3, i64 96
%20 = call i32 @funcReverseLSX(i8* %7, i8* %19, i8* %8)
%21 = call i32 @memcpy(i8* %7, i8* %8, i32 16)
%22 = getelementptr inbounds i8, i8* %3, i64 80
%23 = call i32 @funcReverseLSX(i8* %7, i8* %22, i8* %8)
%24 = call i32 @memcpy(i8* %7, i8* %8, i32 16)
%25 = getelementptr inbounds i8, i8* %3, i64 64
%26 = call i32 @funcReverseLSX(i8* %7, i8* %25, i8* %8)
%27 = call i32 @memcpy(i8* %7, i8* %8, i32 16)
%28 = getelementptr inbounds i8, i8* %3, i64 48
%29 = call i32 @funcReverseLSX(i8* %7, i8* %28, i8* %8)
%30 = call i32 @memcpy(i8* %7, i8* %8, i32 16)
%31 = getelementptr inbounds i8, i8* %3, i64 32
%32 = call i32 @funcReverseLSX(i8* %7, i8* %31, i8* %8)
%33 = call i32 @memcpy(i8* %7, i8* %8, i32 16)
%34 = getelementptr inbounds i8, i8* %3, i64 16
%35 = call i32 @funcReverseLSX(i8* %7, i8* %34, i8* %8)
%36 = call i32 @memcpy(i8* %7, i8* %8, i32 16)
%37 = call i32 @funcX(i8* %8, i8* %3, i8* %1)
ret void
}