#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 *);
scalar_t__ malloc(int);
int /*<<< orphan*/ sprintf(char *, 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_zip[100];
  archive_name = (char *)malloc((strlen(user_name) + 10) * sizeof(char));
  sprintf(archive_name, "%s.zip", user_name);
  aescrypt(0, archive_name, user_name, pass, rand_key);
  sprintf(rm_zip, "rm -f %s", archive_name);
  system(rm_zip);
}


x86 assembly (clang, -O0):
<encrypt_archive>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xe96(%rip),%rax
mov    %rax,-0x1f(%rbp)
mov    0xe94(%rip),%eax
mov    %eax,-0x17(%rbp)
mov    0xe8e(%rip),%ax
mov    %ax,-0x13(%rbp)
mov    0xe86(%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   1060 <malloc@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe58(%rip),%rsi
call   1070 <sprintf@plt>
mov    -0x30(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    -0x1f(%rbp),%r8
xor    %edi,%edi
call   1030 <aescrypt@plt>
lea    -0xa0(%rbp),%rdi
mov    -0x30(%rbp),%rdx
lea    0xe31(%rip),%rsi
call   1070 <sprintf@plt>
lea    -0xa0(%rbp),%rdi
call   1050 <system@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<encrypt_archive>:
push   %r15
push   %r14
push   %rbx
sub    $0x80,%rsp
mov    %rsi,%r14
mov    %rdi,%r15
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   1060 <malloc@plt>
mov    %rax,%rbx
lea    0xe79(%rip),%rsi
mov    %rax,%rdi
mov    %r15,%rdx
call   1070 <sprintf@plt>
mov    %rsp,%r8
xor    %edi,%edi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1030 <aescrypt@plt>
lea    0xe5b(%rip),%rsi
lea    0x10(%rsp),%r14
mov    %r14,%rdi
mov    %rbx,%rdx
call   1070 <sprintf@plt>
mov    %r14,%rdi
call   1050 <system@plt>
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.encrypt_archive.rand_key = [15 x i8] c"123456789ABCDEF"
@.str = [7 x i8] c"%s.zip\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 @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 @sprintf(i8* %18, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %19)
%21 = load i8*, i8** %7
%22 = load i8*, i8** %3
%23 = load i8*, i8** %4
%24 = getelementptr inbounds [15 x i8], [15 x i8]* %5, i64 0, i64 0
%25 = call i32 @aescrypt(i32 0, i8* %21, i8* %22, i8* %23, i8* %24)
%26 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%27 = load i8*, i8** %7
%28 = call i32 @sprintf(i8* %26, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %27)
%29 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%30 = call i32 @system(i8* %29)
ret void
}

LLVM IR (-O2):
@__const.encrypt_archive.rand_key = [15 x i8] c"123456789ABCDEF"
@.str = [7 x i8] c"%s.zip\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 @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 @sprintf(i8* dereferenceable(1) %10, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0)
%12 = call i32 @aescrypt(i32 0, i8* %10, i8* %0, i8* %1, i8* %5)
%13 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%14 = call i32 @system(i8* %6)
ret void
}