#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*/ _archive_dir(char *, char *, int /*<<< orphan*/,
                                int /*<<< orphan*/);
int /*<<< orphan*/ strcpy(char *, char const *);
int /*<<< orphan*/ strlen(char *);
void archive(const char *start, const char *prefix) {
  char in[8192];
  char out[8192];
  strcpy(in, start);
  strcpy(out, prefix);
  _archive_dir(in, out, strlen(in), strlen(out));
}


x86 assembly (clang, -O0):
<archive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4030,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x2010(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x4010(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x2010(%rbp),%rax
mov    %rax,-0x4028(%rbp)
lea    -0x4010(%rbp),%rax
mov    %rax,-0x4020(%rbp)
lea    -0x2010(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x4014(%rbp)
lea    -0x4010(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x4028(%rbp),%rdi
mov    -0x4020(%rbp),%rsi
mov    -0x4014(%rbp),%edx
mov    %eax,%ecx
call   1050 <_archive_dir@plt>
add    $0x4030,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<archive>:
push   %r15
push   %r14
push   %rbx
sub    $0x4000,%rsp
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0x2000(%rsp),%r14
mov    %r14,%rdi
call   1030 <strcpy@plt>
mov    %rsp,%r15
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %eax,%ebx
mov    %r15,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %ebx,%edx
mov    %eax,%ecx
call   1050 <_archive_dir@plt>
add    $0x4000,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @archive(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [8192 x i8]
%6 = alloca [8192 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = getelementptr inbounds [8192 x i8], [8192 x i8]* %5, i64 0, i64 0
%8 = load i8*, i8** %3
%9 = call i32 @strcpy(i8* %7, i8* %8)
%10 = getelementptr inbounds [8192 x i8], [8192 x i8]* %6, i64 0, i64 0
%11 = load i8*, i8** %4
%12 = call i32 @strcpy(i8* %10, i8* %11)
%13 = getelementptr inbounds [8192 x i8], [8192 x i8]* %5, i64 0, i64 0
%14 = getelementptr inbounds [8192 x i8], [8192 x i8]* %6, i64 0, i64 0
%15 = getelementptr inbounds [8192 x i8], [8192 x i8]* %5, i64 0, i64 0
%16 = call i32 @strlen(i8* %15)
%17 = getelementptr inbounds [8192 x i8], [8192 x i8]* %6, i64 0, i64 0
%18 = call i32 @strlen(i8* %17)
%19 = call i32 @_archive_dir(i8* %13, i8* %14, i32 %16, i32 %18)
ret void
}

LLVM IR (-O2):
define void @archive(i8* %0, i8* %1) {
%3 = alloca [8192 x i8]
%4 = alloca [8192 x i8]
%5 = getelementptr inbounds [8192 x i8], [8192 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [8192 x i8], [8192 x i8]* %4, i64 0, i64 0
%7 = call i32 @strcpy(i8* %5, i8* %0)
%8 = call i32 @strcpy(i8* %6, i8* %1)
%9 = call i32 @strlen(i8* %5)
%10 = call i32 @strlen(i8* %6)
%11 = call i32 @_archive_dir(i8* %5, i8* %6, i32 %9, i32 %10)
ret void
}