#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*/ eprintf(char *);
int /*<<< orphan*/ r_sandbox_enable(int /*<<< orphan*/);
int /*<<< orphan*/ r_sys_cmdf(char *, char const *);
int strlen(char const *);
int cmd_mv(void *data, const char *input) {
  if (strlen(input) < 3) {
    eprintf("Usage: mv src dst\n");
    return 0;
  }
  input = input + 2;
  if (!r_sandbox_enable(0)) {
    r_sys_cmdf("mv %s", input);
  }
  return 0;
}


x86 assembly (clang, -O0):
<cmd_mv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x3,%eax
jge    117a <cmd_mv+0x3a>
lea    0xe97(%rip),%rdi
call   1040 <eprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    11ad <cmd_mv+0x6d>
mov    -0x18(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x18(%rbp)
xor    %edi,%edi
call   1060 <r_sandbox_enable@plt>
cmp    $0x0,%eax
jne    11a6 <cmd_mv+0x66>
mov    -0x18(%rbp),%rsi
lea    0xe72(%rip),%rdi
call   1050 <r_sys_cmdf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_mv>:
push   %rbx
mov    %rsi,%rbx
mov    %rsi,%rdi
call   1030 <strlen@plt>
cmp    $0x2,%eax
jg     115f <cmd_mv+0x1f>
lea    0xea8(%rip),%rdi
call   1040 <eprintf@plt>
jmp    117d <cmd_mv+0x3d>
xor    %edi,%edi
call   1060 <r_sandbox_enable@plt>
test   %eax,%eax
jne    117d <cmd_mv+0x3d>
add    $0x2,%rbx
lea    0xe9e(%rip),%rdi
mov    %rbx,%rsi
call   1050 <r_sys_cmdf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Usage: mv src dst\0A\00"
@.str.1 = [6 x i8] c"mv %s\00"
define i32 @cmd_mv(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %5
%7 = call i32 @strlen(i8* %6)
%8 = icmp slt i32 %7, 3
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @eprintf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %20
11: ; preds = %2
%12 = load i8*, i8** %5
%13 = getelementptr inbounds i8, i8* %12, i64 2
store i8* %13, i8** %5
%14 = call i32 @r_sandbox_enable(i32 0)
%15 = icmp ne i32 %14, 0
br i1 %15, label %19, label %16
16: ; preds = %11
%17 = load i8*, i8** %5
%18 = call i32 @r_sys_cmdf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %17)
br label %19
19: ; preds = %16, %11
store i32 0, i32* %3
br label %20
20: ; preds = %19, %9
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
@.str = [19 x i8] c"Usage: mv src dst\0A\00"
@.str.1 = [6 x i8] c"mv %s\00"
define i32 @cmd_mv(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = icmp slt i32 %3, 3
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @eprintf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %13
7: ; preds = %2
%8 = tail call i32 @r_sandbox_enable(i32 0)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = getelementptr inbounds i8, i8* %1, i64 2
%12 = tail call i32 @r_sys_cmdf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %11)
br label %13
13: ; preds = %7, %10, %5
ret i32 0
}