#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*/ AES_KeyExpansion(int, int, unsigned char *, unsigned char *);
int /*<<< orphan*/ InvCipher(int, unsigned char *, unsigned char *,
                             unsigned char **, unsigned char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
void AES_decrypt(unsigned char *in, unsigned char *out, char *password) {
  int Nr = 10;
  int Nk = 4;
  unsigned char Key[16] = {0};
  unsigned char state[4][4];
  unsigned char RoundKey[240];
  strncpy((char *)Key, password, 16);
  AES_KeyExpansion(Nk, Nr, RoundKey, Key);
  InvCipher(Nr, in, out, state, RoundKey);
  return;
}


x86 assembly (clang, -O0):
<AES_decrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0xa,-0x1c(%rbp)
movl   $0x4,-0x20(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <memset@plt>
lea    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x10,%edx
call   1030 <strncpy@plt>
mov    -0x20(%rbp),%edi
mov    -0x1c(%rbp),%esi
lea    -0x130(%rbp),%rdx
lea    -0x30(%rbp),%rcx
call   1060 <AES_KeyExpansion@plt>
mov    -0x1c(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    -0x40(%rbp),%rcx
lea    -0x130(%rbp),%r8
call   1050 <InvCipher@plt>
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AES_decrypt>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x118,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%r15
mov    %r15,%rdi
mov    %rdx,%rsi
mov    $0x10,%edx
call   1030 <strncpy@plt>
lea    0x20(%rsp),%r12
mov    $0x4,%edi
mov    $0xa,%esi
mov    %r12,%rdx
mov    %r15,%rcx
call   1050 <AES_KeyExpansion@plt>
lea    0x10(%rsp),%rcx
mov    $0xa,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %r12,%r8
call   1040 <InvCipher@plt>
add    $0x118,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @AES_decrypt(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca [16 x i8]
%10 = alloca [4 x [4 x i8]]
%11 = alloca [240 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
store i32 10, i32* %7
store i32 4, i32* %8
%12 = bitcast [16 x i8]* %9 to i8*
%13 = getelementptr inbounds [16 x i8], [16 x i8]* %9, i64 0, i64 0
%14 = load i8*, i8** %6
%15 = call i32 @strncpy(i8* %13, i8* %14, i32 16)
%16 = load i32, i32* %8
%17 = load i32, i32* %7
%18 = getelementptr inbounds [240 x i8], [240 x i8]* %11, i64 0, i64 0
%19 = getelementptr inbounds [16 x i8], [16 x i8]* %9, i64 0, i64 0
%20 = call i32 @AES_KeyExpansion(i32 %16, i32 %17, i8* %18, i8* %19)
%21 = load i32, i32* %7
%22 = load i8*, i8** %4
%23 = load i8*, i8** %5
%24 = getelementptr inbounds [4 x [4 x i8]], [4 x [4 x i8]]* %10, i64 0, i64 0
%25 = bitcast [4 x i8]* %24 to i8**
%26 = getelementptr inbounds [240 x i8], [240 x i8]* %11, i64 0, i64 0
%27 = call i32 @InvCipher(i32 %21, i8* %22, i8* %23, i8** %25, i8* %26)
ret void
}

LLVM IR (-O2):
define void @AES_decrypt(i8* %0, i8* %1, i8* %2) {
%4 = alloca [16 x i8]
%5 = alloca [4 x [4 x i8]]
%6 = alloca [240 x i8]
%7 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%8 = getelementptr inbounds [4 x [4 x i8]], [4 x [4 x i8]]* %5, i64 0, i64 0, i64 0
%9 = getelementptr inbounds [240 x i8], [240 x i8]* %6, i64 0, i64 0
%10 = call i32 @strncpy(i8* %7, i8* %2, i32 16)
%11 = call i32 @AES_KeyExpansion(i32 4, i32 10, i8* %9, i8* %7)
%12 = bitcast [4 x [4 x i8]]* %5 to i8**
%13 = call i32 @InvCipher(i32 10, i8* %0, i8* %1, i8** %12, i8* %9)
ret void
}