#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*/ createFullPathFromFileName(char *, char *);
scalar_t__ rename(char *, char *);
bool FileSystem_renameFile(char *oldFilename, char *newFilename) {
  char oldFullPath[sizeof("./vmd-filestore/") + 255];
  char newFullPath[sizeof("./vmd-filestore/") + 255];
  createFullPathFromFileName(oldFullPath, oldFilename);
  createFullPathFromFileName(newFullPath, newFilename);
  if (rename(oldFullPath, newFullPath) == 0)
    return true;
  else
    return false;
}


x86 assembly (clang, -O0):
<FileSystem_renameFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x240,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
lea    -0x130(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <createFullPathFromFileName@plt>
lea    -0x240(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <createFullPathFromFileName@plt>
lea    -0x130(%rbp),%rdi
lea    -0x240(%rbp),%rsi
call   1040 <rename@plt>
cmp    $0x0,%rax
jne    117c <FileSystem_renameFile+0x5c>
movl   $0x1,-0x4(%rbp)
jmp    1183 <FileSystem_renameFile+0x63>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x240,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FileSystem_renameFile>:
push   %r15
push   %r14
push   %rbx
sub    $0x220,%rsp
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0x110(%rsp),%r14
mov    %r14,%rdi
call   1030 <createFullPathFromFileName@plt>
mov    %rsp,%r15
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <createFullPathFromFileName@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <rename@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x220,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @FileSystem_renameFile(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca [272 x i8]
%7 = alloca [272 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = getelementptr inbounds [272 x i8], [272 x i8]* %6, i64 0, i64 0
%9 = load i8*, i8** %4
%10 = call i32 @createFullPathFromFileName(i8* %8, i8* %9)
%11 = getelementptr inbounds [272 x i8], [272 x i8]* %7, i64 0, i64 0
%12 = load i8*, i8** %5
%13 = call i32 @createFullPathFromFileName(i8* %11, i8* %12)
%14 = getelementptr inbounds [272 x i8], [272 x i8]* %6, i64 0, i64 0
%15 = getelementptr inbounds [272 x i8], [272 x i8]* %7, i64 0, i64 0
%16 = call i64 @rename(i8* %14, i8* %15)
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %2
store i32 1, i32* %3
br label %20
19: ; preds = %2
store i32 0, i32* %3
br label %20
20: ; preds = %19, %18
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @FileSystem_renameFile(i8* %0, i8* %1) {
%3 = alloca [272 x i8]
%4 = alloca [272 x i8]
%5 = getelementptr inbounds [272 x i8], [272 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [272 x i8], [272 x i8]* %4, i64 0, i64 0
%7 = call i32 @createFullPathFromFileName(i8* %5, i8* %0)
%8 = call i32 @createFullPathFromFileName(i8* %6, i8* %1)
%9 = call i64 @rename(i8* %5, i8* %6)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}