#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*/ log_entry(char *, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *, char *);
int system(char *);
void move_file(char *source_file, char *destination_file) {
  char command[200];
  snprintf(command, 200, "mv %s %s", source_file, destination_file);
  if (system(command) == -1) {
    log_entry("/var/log/web_interface/web_interface.log", "Error moving file");
  }
}


x86 assembly (clang, -O0):
<move_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0xe0(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    $0xc8,%esi
lea    0xea2(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0xe0(%rbp),%rdi
call   1030 <system@plt>
cmp    $0xffffffff,%eax
jne    118b <move_file+0x5b>
lea    0xe8a(%rip),%rdi
lea    0xeac(%rip),%rsi
call   1050 <log_entry@plt>
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<move_file>:
push   %rbx
sub    $0xd0,%rsp
mov    %rsi,%r8
mov    %rdi,%rcx
lea    0xebb(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xc8,%esi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
cmp    $0xffffffff,%eax
jne    1175 <move_file+0x45>
lea    0xea0(%rip),%rdi
lea    0xec2(%rip),%rsi
call   1050 <log_entry@plt>
add    $0xd0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"mv %s %s\00"
@.str.1 = [41 x i8] c"/var/log/web_interface/web_interface.log\00"
@.str.2 = [18 x i8] c"Error moving file\00"
define void @move_file(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [200 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [200 x i8], [200 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @snprintf(i8* %6, i32 200, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8)
%10 = getelementptr inbounds [200 x i8], [200 x i8]* %5, i64 0, i64 0
%11 = call i32 @system(i8* %10)
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = call i32 @log_entry(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
br label %15
15: ; preds = %13, %2
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"mv %s %s\00"
@.str.1 = [41 x i8] c"/var/log/web_interface/web_interface.log\00"
@.str.2 = [18 x i8] c"Error moving file\00"
define void @move_file(i8* %0, i8* %1) {
%3 = alloca [200 x i8]
%4 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 200, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%6 = call i32 @system(i8* %4)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @log_entry(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
ret void
}