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


x86 assembly (clang, -O0):
<decrypt_archive>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xea6(%rip),%rax
mov    %rax,-0x1f(%rbp)
mov    0xea4(%rip),%eax
mov    %eax,-0x17(%rbp)
mov    0xe9e(%rip),%ax
mov    %ax,-0x13(%rbp)
mov    0xe96(%rip),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0xa,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe68(%rip),%rsi
mov    $0x0,%al
call   1060 <sprintf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0xa,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe3c(%rip),%rsi
mov    $0x0,%al
call   1060 <sprintf@plt>
mov    -0x8(%rbp),%rsi
mov    -0x28(%rbp),%rdx
lea    -0x1f(%rbp),%rcx
mov    $0x1,%edi
call   1030 <aescrypt@plt>
lea    -0xa0(%rbp),%rdi
mov    -0x28(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    -0x30(%rbp),%r9
lea    0xe08(%rip),%rsi
mov    $0x0,%al
call   1060 <sprintf@plt>
add    $0xa0,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.decrypt_archive.rand_key = [15 x i8] c"123456789ABCDEF"
@.str = [7 x i8] c"%s.zip\00"
@.str.1 = [7 x i8] c"%s.tar\00"
@.str.2 = [41 x i8] c"unzip %s; rm -f %s; 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** %6
%18 = load i8*, i8** %6
%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** %3
%22 = call i32 @strlen(i8* %21)
%23 = add nsw i32 %22, 10
%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** %7
%29 = load i8*, i8** %6
%30 = load i8*, i8** %3
%31 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %29, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %30)
%32 = load i8*, i8** %3
%33 = load i8*, i8** %6
%34 = getelementptr inbounds [15 x i8], [15 x i8]* %5, i64 0, i64 0
%35 = call i32 @aescrypt(i32 1, i8* %32, i8* %33, i8* %34)
%36 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%37 = load i8*, i8** %6
%38 = load i8*, i8** %6
%39 = load i8*, i8** %7
%40 = load i8*, i8** %7
%41 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %36, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0), i8* %37, i8* %38, i8* %39, i8* %40)
ret void
}

LLVM IR (-O2):
@__const.decrypt_archive.rand_key = [15 x i8] c"123456789ABCDEF"
@.str = [7 x i8] c"%s.zip\00"
@.str.1 = [7 x i8] c"%s.tar\00"
@.str.2 = [41 x i8] c"unzip %s; rm -f %s; tar xvf %s; rm -f %s\00"
define void @decrypt_archive(i8* %0, i8* nocapture readnone %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* %0)
%13 = add nsw i32 %12, 10
%14 = tail call i64 @malloc(i32 %13)
%15 = inttoptr i64 %14 to i8*
%16 = tail call i32 (i8*, i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %10, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%17 = call i32 @aescrypt(i32 1, i8* %0, i8* %10, i8* %5)
%18 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0), i8* %10, i8* %10, i8* %15, i8* %15)
ret void
}