#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 */
char *appendExt(char const *, char *);
int /*<<< orphan*/ fileRename(char *, char *);
int /*<<< orphan*/ free(char *);
void renameImgAndMeta(const char *src, const char *dst) {
  char *src_meta_file = appendExt(src, ".meta");
  char *src_img_file = appendExt(src, ".img");
  char *dst_meta_file = appendExt(dst, ".meta");
  char *dst_img_file = appendExt(dst, ".img");
  fileRename(src_meta_file, dst_meta_file);
  fileRename(src_img_file, dst_img_file);
  free(src_meta_file);
  free(src_img_file);
  free(dst_meta_file);
  free(dst_img_file);
}


x86 assembly (clang, -O0):
<renameImgAndMeta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1050 <appendExt@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea7(%rip),%rsi
call   1050 <appendExt@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe8d(%rip),%rsi
call   1050 <appendExt@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe7f(%rip),%rsi
call   1050 <appendExt@plt>
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <fileRename@plt>
mov    -0x20(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1030 <fileRename@plt>
mov    -0x18(%rbp),%rdi
call   1040 <free@plt>
mov    -0x20(%rbp),%rdi
call   1040 <free@plt>
mov    -0x28(%rbp),%rdi
call   1040 <free@plt>
mov    -0x30(%rbp),%rdi
call   1040 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<renameImgAndMeta>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0xeb8(%rip),%rbp
mov    %rbp,%rsi
call   1050 <appendExt@plt>
mov    %rax,%r14
lea    0xeac(%rip),%r13
mov    %rbx,%rdi
mov    %r13,%rsi
call   1050 <appendExt@plt>
mov    %rax,%r12
mov    %r15,%rdi
mov    %rbp,%rsi
call   1050 <appendExt@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %r13,%rsi
call   1050 <appendExt@plt>
mov    %rax,%rbp
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <fileRename@plt>
mov    %r12,%rdi
mov    %rbp,%rsi
call   1030 <fileRename@plt>
mov    %r14,%rdi
call   1040 <free@plt>
mov    %r12,%rdi
call   1040 <free@plt>
mov    %rbx,%rdi
call   1040 <free@plt>
mov    %rbp,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <free@plt>

LLVM IR (-O0):
@.str = [6 x i8] c".meta\00"
@.str.1 = [5 x i8] c".img\00"
define void @renameImgAndMeta(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%9 = load i8*, i8** %3
%10 = call i8* @appendExt(i8* %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i8* %10, i8** %5
%11 = load i8*, i8** %3
%12 = call i8* @appendExt(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
store i8* %12, i8** %6
%13 = load i8*, i8** %4
%14 = call i8* @appendExt(i8* %13, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i8* %14, i8** %7
%15 = load i8*, i8** %4
%16 = call i8* @appendExt(i8* %15, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
store i8* %16, i8** %8
%17 = load i8*, i8** %5
%18 = load i8*, i8** %7
%19 = call i32 @fileRename(i8* %17, i8* %18)
%20 = load i8*, i8** %6
%21 = load i8*, i8** %8
%22 = call i32 @fileRename(i8* %20, i8* %21)
%23 = load i8*, i8** %5
%24 = call i32 @free(i8* %23)
%25 = load i8*, i8** %6
%26 = call i32 @free(i8* %25)
%27 = load i8*, i8** %7
%28 = call i32 @free(i8* %27)
%29 = load i8*, i8** %8
%30 = call i32 @free(i8* %29)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c".meta\00"
@.str.1 = [5 x i8] c".img\00"
define void @renameImgAndMeta(i8* %0, i8* %1) {
%3 = tail call i8* @appendExt(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = tail call i8* @appendExt(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i8* @appendExt(i8* %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = tail call i8* @appendExt(i8* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @fileRename(i8* %3, i8* %5)
%8 = tail call i32 @fileRename(i8* %4, i8* %6)
%9 = tail call i32 @free(i8* %3)
%10 = tail call i32 @free(i8* %4)
%11 = tail call i32 @free(i8* %5)
%12 = tail call i32 @free(i8* %6)
ret void
}