#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*/ printf(char *, char *);
int rename(char *, char *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int MoveFile(char *entry, char *sourceDirectory, char *destDirectory) {
  int status = 0;
  char fullSourceName[256];
  char fullDestName[256];
  strcpy(fullSourceName, sourceDirectory);
  strcat(fullSourceName, entry);
  strcpy(fullDestName, destDirectory);
  strcat(fullDestName, entry);
  status = rename(fullSourceName, fullDestName);
  if (status != 0)
    printf("Error: unable to move the following file: %s\n", fullSourceName);
  return status;
}


x86 assembly (clang, -O0):
<MoveFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
lea    -0x120(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x120(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1060 <strcat@plt>
lea    -0x220(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x220(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1060 <strcat@plt>
lea    -0x120(%rbp),%rdi
lea    -0x220(%rbp),%rsi
call   1050 <rename@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     11d1 <MoveFile+0x91>
lea    -0x120(%rbp),%rsi
lea    0xe34(%rip),%rdi
call   1040 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MoveFile>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x208,%rsp
mov    %rdx,%r14
mov    %rdi,%rbx
mov    %rsp,%r15
mov    %r15,%rdi
call   1030 <strcpy@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1060 <strcat@plt>
lea    0x100(%rsp),%r12
mov    %r12,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1060 <strcat@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1050 <rename@plt>
mov    %eax,%ebx
test   %eax,%eax
je     11a8 <MoveFile+0x68>
lea    0xe60(%rip),%rdi
mov    %rsp,%rsi
call   1040 <printf@plt>
mov    %ebx,%eax
add    $0x208,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [46 x i8] c"Error: unable to move the following file: %s\0A\00"
define i32 @MoveFile(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca [256 x i8]
%9 = alloca [256 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
store i32 0, i32* %7
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%11 = load i8*, i8** %5
%12 = call i32 @strcpy(i8* %10, i8* %11)
%13 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%14 = load i8*, i8** %4
%15 = call i32 @strcat(i8* %13, i8* %14)
%16 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%17 = load i8*, i8** %6
%18 = call i32 @strcpy(i8* %16, i8* %17)
%19 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%20 = load i8*, i8** %4
%21 = call i32 @strcat(i8* %19, i8* %20)
%22 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%23 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%24 = call i32 @rename(i8* %22, i8* %23)
store i32 %24, i32* %7
%25 = load i32, i32* %7
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %30
27: ; preds = %3
%28 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%29 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %28)
br label %30
30: ; preds = %27, %3
%31 = load i32, i32* %7
ret i32 %31
}

LLVM IR (-O2):
@.str = [46 x i8] c"Error: unable to move the following file: %s\0A\00"
define i32 @MoveFile(i8* %0, i8* %1, i8* %2) {
%4 = alloca [256 x i8]
%5 = alloca [256 x i8]
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%8 = call i32 @strcpy(i8* %6, i8* %1)
%9 = call i32 @strcat(i8* %6, i8* %0)
%10 = call i32 @strcpy(i8* %7, i8* %2)
%11 = call i32 @strcat(i8* %7, i8* %0)
%12 = call i32 @rename(i8* %6, i8* %7)
%13 = icmp eq i32 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %3
%15 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %16
16: ; preds = %14, %3
ret i32 %12
}