#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 */
scalar_t__ exists(char const *);
int /*<<< orphan*/ run(char const *const *);
void backup(const char *file, const char *dest) {
  const char *const cmd[] = {"cp", "-dp", file, dest, NULL};
  if (exists(file))
    run(cmd);
}


x86 assembly (clang, -O0):
<backup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rax
mov    %rax,-0x40(%rbp)
lea    0xec1(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <exists@plt>
cmp    $0x0,%rax
je     117a <backup+0x5a>
lea    -0x40(%rbp),%rdi
call   1030 <run@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<backup>:
sub    $0x28,%rsp
lea    0xed5(%rip),%rax
mov    %rax,(%rsp)
lea    0xecd(%rip),%rax
mov    %rax,0x8(%rsp)
mov    %rdi,0x10(%rsp)
mov    %rsi,0x18(%rsp)
movq   $0x0,0x20(%rsp)
call   1040 <exists@plt>
test   %rax,%rax
je     1160 <backup+0x40>
mov    %rsp,%rdi
call   1030 <run@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"cp\00"
@.str.1 = [4 x i8] c"-dp\00"
define void @backup(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [5 x i8*]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [5 x i8*], [5 x i8*]* %5, i64 0, i64 0
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %6
%7 = getelementptr inbounds i8*, i8** %6, i64 1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %7
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %3
store i8* %9, i8** %8
%10 = getelementptr inbounds i8*, i8** %8, i64 1
%11 = load i8*, i8** %4
store i8* %11, i8** %10
%12 = getelementptr inbounds i8*, i8** %10, i64 1
store i8* null, i8** %12
%13 = load i8*, i8** %3
%14 = call i64 @exists(i8* %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %2
%17 = getelementptr inbounds [5 x i8*], [5 x i8*]* %5, i64 0, i64 0
%18 = call i32 @run(i8** %17)
br label %19
19: ; preds = %16, %2
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"cp\00"
@.str.1 = [4 x i8] c"-dp\00"
define void @backup(i8* %0, i8* %1) {
%3 = alloca [5 x i8*]
%4 = bitcast [5 x i8*]* %3 to i8*
%5 = getelementptr inbounds [5 x i8*], [5 x i8*]* %3, i64 0, i64 0
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %5
%6 = getelementptr inbounds [5 x i8*], [5 x i8*]* %3, i64 0, i64 1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %6
%7 = getelementptr inbounds [5 x i8*], [5 x i8*]* %3, i64 0, i64 2
store i8* %0, i8** %7
%8 = getelementptr inbounds [5 x i8*], [5 x i8*]* %3, i64 0, i64 3
store i8* %1, i8** %8
%9 = getelementptr inbounds [5 x i8*], [5 x i8*]* %3, i64 0, i64 4
store i8* null, i8** %9
%10 = tail call i64 @exists(i8* %0)
%11 = icmp eq i64 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %2
%13 = call i32 @run(i8** %5)
br label %14
14: ; preds = %12, %2
ret void
}