#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*/ aescrypt(int, char *, char *, char *, char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, char *, ...);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int /*<<< orphan*/ system(char *);
void decrypt_archive(char *user_name, char *pass) {
  char rand_key[15] = "123456789ABCDEF";
  char *password, *tar_name, extract[100];
  tar_name = (char *)malloc((strlen(user_name) + 10) * sizeof(char));
  sprintf(tar_name, "%s.tar", user_name);
  password = (char *)malloc((strlen(pass) + 1) * sizeof(char));
  strcpy(password, pass);
  aescrypt(1, user_name, tar_name, password, rand_key);
  sprintf(extract, "tar xvf %s; rm -f %s", tar_name, tar_name);
  system(extract);
}


x86 assembly (clang, -O0):
<decrypt_archive>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xe86(%rip),%rax
mov    %rax,-0x1f(%rbp)
mov    0xe84(%rip),%eax
mov    %eax,-0x17(%rbp)
mov    0xe7e(%rip),%ax
mov    %ax,-0x13(%rbp)
mov    0xe76(%rip),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
add    $0xa,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe48(%rip),%rsi
mov    $0x0,%al
call   1080 <sprintf@plt>
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x8(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rcx
lea    -0x1f(%rbp),%r8
mov    $0x1,%edi
call   1030 <aescrypt@plt>
lea    -0xa0(%rbp),%rdi
mov    -0x30(%rbp),%rdx
mov    -0x30(%rbp),%rcx
lea    0xdee(%rip),%rsi
mov    $0x0,%al
call   1080 <sprintf@plt>
lea    -0xa0(%rbp),%rdi
call   1060 <system@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decrypt_archive>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %rsi,%r15
mov    %rdi,%r14
movabs $0x4645444342413938,%rax
44 45 46
mov    %rax,0x7(%rsp)
movabs $0x3837363534333231,%rax
36 37 38
mov    %rax,(%rsp)
call   1050 <strlen@plt>
lea    0xa(%rax),%edi
call   1070 <malloc@plt>
mov    %rax,%r12
lea    0xe6a(%rip),%rsi
mov    %rax,%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   1080 <sprintf@plt>
mov    %r15,%rdi
call   1050 <strlen@plt>
lea    0x1(%rax),%edi
call   1070 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
call   1040 <strcpy@plt>
mov    %rsp,%r8
mov    $0x1,%edi
mov    %r14,%rsi
mov    %r12,%rdx
mov    %rbx,%rcx
call   1030 <aescrypt@plt>
lea    0xe29(%rip),%rsi
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    %r12,%rdx
mov    %r12,%rcx
xor    %eax,%eax
call   1080 <sprintf@plt>
mov    %rbx,%rdi
call   1060 <system@plt>
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.decrypt_archive.rand_key = [15 x i8] c"123456789ABCDEF"
@.str = [7 x i8] c"%s.tar\00"
@.str.1 = [21 x i8] c"tar xvf %s; rm -f %s\00"
define void @decrypt_archive(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [15 x i8]
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca [100 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%9 = bitcast [15 x i8]* %5 to i8*
%10 = load i8*, i8** %3
%11 = call i32 @strlen(i8* %10)
%12 = add nsw i32 %11, 10
%13 = sext i32 %12 to i64
%14 = mul i64 %13, 1
%15 = trunc i64 %14 to i32
%16 = call i64 @malloc(i32 %15)
%17 = inttoptr i64 %16 to i8*
store i8* %17, i8** %7
%18 = load i8*, i8** %7
%19 = load i8*, i8** %3
%20 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %18, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %19)
%21 = load i8*, i8** %4
%22 = call i32 @strlen(i8* %21)
%23 = add nsw i32 %22, 1
%24 = sext i32 %23 to i64
%25 = mul i64 %24, 1
%26 = trunc i64 %25 to i32
%27 = call i64 @malloc(i32 %26)
%28 = inttoptr i64 %27 to i8*
store i8* %28, i8** %6
%29 = load i8*, i8** %6
%30 = load i8*, i8** %4
%31 = call i32 @strcpy(i8* %29, i8* %30)
%32 = load i8*, i8** %3
%33 = load i8*, i8** %7
%34 = load i8*, i8** %6
%35 = getelementptr inbounds [15 x i8], [15 x i8]* %5, i64 0, i64 0
%36 = call i32 @aescrypt(i32 1, i8* %32, i8* %33, i8* %34, i8* %35)
%37 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%38 = load i8*, i8** %7
%39 = load i8*, i8** %7
%40 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %37, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %38, i8* %39)
%41 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%42 = call i32 @system(i8* %41)
ret void
}

LLVM IR (-O2):
@__const.decrypt_archive.rand_key = [15 x i8] c"123456789ABCDEF"
@.str = [7 x i8] c"%s.tar\00"
@.str.1 = [21 x i8] c"tar xvf %s; rm -f %s\00"
define void @decrypt_archive(i8* %0, i8* %1) {
%3 = alloca [15 x i8]
%4 = alloca [100 x i8]
%5 = getelementptr inbounds [15 x i8], [15 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%7 = tail call i32 @strlen(i8* %0)
%8 = add nsw i32 %7, 10
%9 = tail call i64 @malloc(i32 %8)
%10 = inttoptr i64 %9 to i8*
%11 = tail call i32 (i8*, i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %10, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0)
%12 = tail call i32 @strlen(i8* %1)
%13 = add nsw i32 %12, 1
%14 = tail call i64 @malloc(i32 %13)
%15 = inttoptr i64 %14 to i8*
%16 = tail call i32 @strcpy(i8* %15, i8* %1)
%17 = call i32 @aescrypt(i32 1, i8* %0, i8* %10, i8* %15, i8* %5)
%18 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %10, i8* %10)
%19 = call i32 @system(i8* %6)
ret void
}