#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*/ extractName(char *, char *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void createPath(char *fullName, char *prefix, char *suffix, char *fileName) {
  char buffer[100] = {0};
  char nameOnly[100];
  extractName(fullName, nameOnly);
  strcpy(buffer, prefix);
  strcat(buffer, nameOnly);
  strcat(buffer, suffix);
  strcpy(fileName, buffer);
}


x86 assembly (clang, -O0):
<createPath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1040 <memset@plt>
mov    -0x8(%rbp),%rdi
lea    -0x100(%rbp),%rsi
call   1050 <extractName@plt>
lea    -0x90(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x90(%rbp),%rdi
lea    -0x100(%rbp),%rsi
call   1060 <strcat@plt>
lea    -0x90(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x20(%rbp),%rdi
lea    -0x90(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createPath>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xe0,%rsp
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r13
xorps  %xmm0,%xmm0
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movl   $0x0,0x60(%rsp)
lea    0x70(%rsp),%r12
mov    %r12,%rsi
call   1040 <extractName@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %r13,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1050 <strcat@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <strcat@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
add    $0xe0,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @createPath(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca [100 x i8]
%10 = alloca [100 x i8]
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%11 = bitcast [100 x i8]* %9 to i8*
%12 = load i8*, i8** %5
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%14 = call i32 @extractName(i8* %12, i8* %13)
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%16 = load i8*, i8** %6
%17 = call i32 @strcpy(i8* %15, i8* %16)
%18 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%19 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%20 = call i32 @strcat(i8* %18, i8* %19)
%21 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%22 = load i8*, i8** %7
%23 = call i32 @strcat(i8* %21, i8* %22)
%24 = load i8*, i8** %8
%25 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%26 = call i32 @strcpy(i8* %24, i8* %25)
ret void
}

LLVM IR (-O2):
define void @createPath(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca [100 x i8]
%6 = alloca [100 x i8]
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%9 = call i32 @extractName(i8* %0, i8* %8)
%10 = call i32 @strcpy(i8* %7, i8* %1)
%11 = call i32 @strcat(i8* %7, i8* %8)
%12 = call i32 @strcat(i8* %7, i8* %2)
%13 = call i32 @strcpy(i8* %3, i8* %7)
ret void
}