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


x86 assembly (clang, -O0):
<encrypt_archive>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xe76(%rip),%rax
mov    %rax,-0x1f(%rbp)
mov    0xe74(%rip),%eax
mov    %eax,-0x17(%rbp)
mov    0xe6e(%rip),%ax
mov    %ax,-0x13(%rbp)
mov    0xe66(%rip),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rdi
call   1080 <make_plain_archive@plt>
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    0xe2f(%rip),%rsi
call   1090 <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    -0x30(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0x28(%rbp),%rcx
lea    -0x1f(%rbp),%r8
xor    %edi,%edi
call   1030 <aescrypt@plt>
lea    -0xa0(%rbp),%rdi
mov    -0x30(%rbp),%rdx
lea    0xdde(%rip),%rsi
call   1090 <sprintf@plt>
lea    -0xa0(%rbp),%rdi
call   1060 <system@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<encrypt_archive>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %rsi,%r14
mov    %rdi,%r12
movabs $0x4645444342413938,%rax
44 45 46
mov    %rax,0x7(%rsp)
movabs $0x3837363534333231,%rax
36 37 38
mov    %rax,(%rsp)
call   1080 <make_plain_archive@plt>
mov    %r12,%rdi
call   1050 <strlen@plt>
lea    0xa(%rax),%edi
call   1070 <malloc@plt>
mov    %rax,%r15
lea    0xe52(%rip),%rsi
mov    %rax,%rdi
mov    %r12,%rdx
call   1090 <sprintf@plt>
mov    %r14,%rdi
call   1050 <strlen@plt>
lea    0x1(%rax),%edi
call   1070 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1040 <strcpy@plt>
mov    %rsp,%r8
xor    %edi,%edi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %rbx,%rcx
call   1030 <aescrypt@plt>
lea    0xe16(%rip),%rsi
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    %r15,%rdx
call   1090 <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.encrypt_archive.rand_key = [15 x i8] c"123456789ABCDEF"
@.str = [7 x i8] c"%s.tar\00"
@.str.1 = [9 x i8] c"rm -f %s\00"
define void @encrypt_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 @make_plain_archive(i8* %10)
%12 = load i8*, i8** %3
%13 = call i32 @strlen(i8* %12)
%14 = add nsw i32 %13, 10
%15 = sext i32 %14 to i64
%16 = mul i64 %15, 1
%17 = trunc i64 %16 to i32
%18 = call i64 @malloc(i32 %17)
%19 = inttoptr i64 %18 to i8*
store i8* %19, i8** %7
%20 = load i8*, i8** %7
%21 = load i8*, i8** %3
%22 = call i32 @sprintf(i8* %20, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %21)
%23 = load i8*, i8** %4
%24 = call i32 @strlen(i8* %23)
%25 = add nsw i32 %24, 1
%26 = sext i32 %25 to i64
%27 = mul i64 %26, 1
%28 = trunc i64 %27 to i32
%29 = call i64 @malloc(i32 %28)
%30 = inttoptr i64 %29 to i8*
store i8* %30, i8** %6
%31 = load i8*, i8** %6
%32 = load i8*, i8** %4
%33 = call i32 @strcpy(i8* %31, i8* %32)
%34 = load i8*, i8** %7
%35 = load i8*, i8** %3
%36 = load i8*, i8** %6
%37 = getelementptr inbounds [15 x i8], [15 x i8]* %5, i64 0, i64 0
%38 = call i32 @aescrypt(i32 0, i8* %34, i8* %35, i8* %36, i8* %37)
%39 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%40 = load i8*, i8** %7
%41 = call i32 @sprintf(i8* %39, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %40)
%42 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%43 = call i32 @system(i8* %42)
ret void
}

LLVM IR (-O2):
@__const.encrypt_archive.rand_key = [15 x i8] c"123456789ABCDEF"
@.str = [7 x i8] c"%s.tar\00"
@.str.1 = [9 x i8] c"rm -f %s\00"
define void @encrypt_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 @make_plain_archive(i8* %0)
%8 = tail call i32 @strlen(i8* %0)
%9 = add nsw i32 %8, 10
%10 = tail call i64 @malloc(i32 %9)
%11 = inttoptr i64 %10 to i8*
%12 = tail call i32 @sprintf(i8* dereferenceable(1) %11, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0)
%13 = tail call i32 @strlen(i8* %1)
%14 = add nsw i32 %13, 1
%15 = tail call i64 @malloc(i32 %14)
%16 = inttoptr i64 %15 to i8*
%17 = tail call i32 @strcpy(i8* %16, i8* %1)
%18 = call i32 @aescrypt(i32 0, i8* %11, i8* %0, i8* %16, i8* %5)
%19 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %11)
%20 = call i32 @system(i8* %6)
ret void
}