#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 */
struct stat {
  int st_mode;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ EOF;
int S_IFDIR;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
scalar_t__ fscanf(int /*<<< orphan*/ *, char *, char *, ...);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ remove(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *, char *, ...);
int stat(char *, struct stat *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ system(char *);
int /*<<< orphan*/ usage(char *);
int main(int argc, char *argv[]) {
  FILE *bufferFile;
  char dest_path[100], final_command[300];
  char ch;
  char command[5], com_opt[100], src_file[100];
  int is_com_opt, is_move = 0;
  char operation[5];
  struct stat file_info;
  if (argc == 2) {
    if ((strcmp(argv[1], "--help") == 0) || (strcmp(argv[1], "-h") == 0))
      usage(argv[0]);
    strcpy(dest_path, argv[1]);
    if (stat(dest_path, &file_info) == -1) {
      printf("provide valid destination directory to paste\n");
      exit(0);
    } else if (!(file_info.st_mode & S_IFDIR)) {
      printf("destination directory is required not destination file\n");
      exit(0);
    }
  } else if (argc > 2) {
    usage(argv[0]);
  } else {
    strcpy(dest_path, ".");
  }
  bufferFile = fopen("/tmp/ocopy_queue.que", "r");
  if (bufferFile == NULL) {
    printf("Nothing to paste\no-copy or o-cut first to paste throug o-paste\n");
    return 1;
  }
  do {
    if (fscanf(bufferFile, "%s %s", command, com_opt) == EOF) {
      break;
    }
    if (strcmp(command, "mv") == 0)
      is_move = 1;
    if (com_opt[0] != '-') {
      strcpy(src_file, com_opt);
      is_com_opt = 0;
    } else {
      fscanf(bufferFile, "%s", src_file);
      is_com_opt = 1;
    }
    if (is_com_opt) {
      sprintf(final_command, "%s %s %s %s", command, com_opt, src_file,
              dest_path);
      printf("%s\n", final_command);
      system(final_command);
    } else {
      sprintf(final_command, "%s %s %s", command, src_file, dest_path);
      printf("%s\n", final_command);
      system(final_command);
    }
  } while (1);
  fclose(bufferFile);
  if (is_move) {
    remove("/tmp/ocopy_queue.que");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2b0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x298(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    12ab <main+0xeb>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe04(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
je     1229 <main+0x69>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xded(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    1235 <main+0x75>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   10b0 <usage@plt>
lea    -0x80(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1040 <strcpy@plt>
lea    -0x80(%rbp),%rdi
lea    -0x2a8(%rbp),%rsi
call   10a0 <stat@plt>
cmp    $0xffffffff,%eax
jne    1274 <main+0xb4>
lea    0xda4(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
xor    %edi,%edi
call   10e0 <exit@plt>
mov    -0x2a8(%rbp),%eax
mov    0x2d4f(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
jne    12a1 <main+0xe1>
lea    0xda5(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
xor    %edi,%edi
call   10e0 <exit@plt>
jmp    12a6 <main+0xe6>
jmp    12db <main+0x11b>
cmpl   $0x2,-0x8(%rbp)
jle    12c6 <main+0x106>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   10b0 <usage@plt>
jmp    12d6 <main+0x116>
lea    -0x80(%rbp),%rdi
lea    0xd9f(%rip),%rsi
call   1040 <strcpy@plt>
jmp    12db <main+0x11b>
lea    0xd90(%rip),%rdi
lea    0xd9e(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1317 <main+0x157>
lea    0xd85(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    14b3 <main+0x2f3>
jmp    131c <main+0x15c>
mov    -0x18(%rbp),%rdi
lea    -0x1b6(%rbp),%rdx
lea    -0x220(%rbp),%rcx
lea    0xd9d(%rip),%rsi
mov    $0x0,%al
call   1080 <fscanf@plt>
mov    0x2ca5(%rip),%rcx
cmp    (%rcx),%rax
jne    1351 <main+0x191>
jmp    148a <main+0x2ca>
lea    -0x1b6(%rbp),%rdi
lea    0xd6a(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    1378 <main+0x1b8>
movl   $0x1,-0x298(%rbp)
movsbl -0x220(%rbp),%eax
cmp    $0x2d,%eax
je     13aa <main+0x1ea>
lea    -0x290(%rbp),%rdi
lea    -0x220(%rbp),%rsi
call   1040 <strcpy@plt>
movl   $0x0,-0x294(%rbp)
jmp    13cd <main+0x20d>
mov    -0x18(%rbp),%rdi
lea    -0x290(%rbp),%rdx
lea    0xd19(%rip),%rsi
mov    $0x0,%al
call   1080 <fscanf@plt>
movl   $0x1,-0x294(%rbp)
cmpl   $0x0,-0x294(%rbp)
je     142e <main+0x26e>
lea    -0x1b0(%rbp),%rdi
lea    -0x1b6(%rbp),%rdx
lea    -0x220(%rbp),%rcx
lea    -0x290(%rbp),%r8
lea    -0x80(%rbp),%r9
lea    0xccb(%rip),%rsi
mov    $0x0,%al
call   10d0 <sprintf@plt>
lea    -0x1b0(%rbp),%rsi
lea    0xcc2(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x1b0(%rbp),%rdi
call   1060 <system@plt>
jmp    1476 <main+0x2b6>
lea    -0x1b0(%rbp),%rdi
lea    -0x1b6(%rbp),%rdx
lea    -0x290(%rbp),%rcx
lea    -0x80(%rbp),%r8
lea    0xc81(%rip),%rsi
mov    $0x0,%al
call   10d0 <sprintf@plt>
lea    -0x1b0(%rbp),%rsi
lea    0xc75(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x1b0(%rbp),%rdi
call   1060 <system@plt>
jmp    147b <main+0x2bb>
mov    $0x1,%al
test   $0x1,%al
jne    131c <main+0x15c>
jmp    148a <main+0x2ca>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
cmpl   $0x0,-0x298(%rbp)
je     14ac <main+0x2ec>
lea    0xbcb(%rip),%rdi
call   1030 <remove@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x298,%rsp
mov    %rsi,%rbx
cmp    $0x2,%edi
jne    124a <main+0x8a>
mov    0x8(%rbx),%rdi
lea    0xe1c(%rip),%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
je     1203 <main+0x43>
mov    0x8(%rbx),%rdi
lea    0xe0e(%rip),%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
jne    120b <main+0x4b>
mov    (%rbx),%rdi
call   10b0 <usage@plt>
mov    0x8(%rbx),%rsi
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <strcpy@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   10a0 <stat@plt>
cmp    $0xffffffff,%eax
je     13e6 <main+0x226>
mov    0x2d99(%rip),%rax
mov    (%rax),%eax
test   %eax,(%rsp)
jne    1267 <main+0xa7>
lea    0xe2c(%rip),%rdi
jmp    13ed <main+0x22d>
jle    1256 <main+0x96>
mov    (%rbx),%rdi
call   10b0 <usage@plt>
jmp    1267 <main+0xa7>
lea    0xdad(%rip),%rsi
lea    0x10(%rsp),%rdi
call   1040 <strcpy@plt>
lea    0xd9e(%rip),%rdi
lea    0xdac(%rip),%rsi
call   10c0 <fopen@plt>
test   %rax,%rax
je     12bb <main+0xfb>
mov    %rax,%r15
lea    0xda3(%rip),%rsi
lea    0xb(%rsp),%rdx
lea    0x80(%rsp),%rcx
mov    %rax,%rdi
xor    %eax,%eax
call   1080 <fscanf@plt>
mov    0x2d41(%rip),%rcx
cmp    (%rcx),%rax
jne    12d1 <main+0x111>
mov    %r15,%rdi
call   1060 <fclose@plt>
xor    %ebx,%ebx
jmp    13d2 <main+0x212>
lea    0xd70(%rip),%rdi
call   1050 <puts@plt>
mov    $0x1,%ebx
jmp    13d2 <main+0x212>
lea    0xb(%rsp),%rbx
lea    0xf0(%rsp),%r13
lea    0x160(%rsp),%r12
lea    0x80(%rsp),%rbp
xor    %r14d,%r14d
jmp    135a <main+0x19a>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r13,%rdi
mov    %rbp,%rsi
call   1040 <strcpy@plt>
mov    %r12,%rdi
lea    0xd14(%rip),%rsi
mov    %rbx,%rdx
mov    %r13,%rcx
lea    0x10(%rsp),%r8
xor    %eax,%eax
call   10d0 <sprintf@plt>
mov    %r12,%rdi
call   1050 <puts@plt>
mov    %r12,%rdi
call   1070 <system@plt>
mov    %r15,%rdi
lea    0xceb(%rip),%rsi
mov    %rbx,%rdx
mov    %rbp,%rcx
xor    %eax,%eax
call   1080 <fscanf@plt>
mov    0x2c93(%rip),%rcx
cmp    (%rcx),%rax
je     13b7 <main+0x1f7>
mov    %rbx,%rdi
lea    0xcbf(%rip),%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
mov    $0x1,%eax
cmove  %eax,%r14d
cmpb   $0x2d,0x80(%rsp)
2d
jne    1300 <main+0x140>
mov    %r15,%rdi
lea    0xca6(%rip),%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1080 <fscanf@plt>
mov    %r12,%rdi
lea    0xc89(%rip),%rsi
mov    %rbx,%rdx
mov    %rbp,%rcx
mov    %r13,%r8
lea    0x10(%rsp),%r9
xor    %eax,%eax
call   10d0 <sprintf@plt>
jmp    1327 <main+0x167>
mov    %r15,%rdi
call   1060 <fclose@plt>
xor    %ebx,%ebx
test   %r14d,%r14d
je     13d2 <main+0x212>
lea    0xc3f(%rip),%rdi
call   1030 <remove@plt>
mov    %ebx,%eax
add    $0x298,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xcbb(%rip),%rdi
call   1050 <puts@plt>
xor    %edi,%edi
call   10e0 <exit@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [7 x i8] c"--help\00"
@.str.1 = [3 x i8] c"-h\00"
@.str.2 = [46 x i8] c"provide valid destination directory to paste\0A\00"
@S_IFDIR = global i32 0
@.str.3 = [56 x i8] c"destination directory is required not destination file\0A\00"
@.str.4 = [2 x i8] c".\00"
@.str.5 = [21 x i8] c"/tmp/ocopy_queue.que\00"
@.str.6 = [2 x i8] c"r\00"
@.str.7 = [64 x i8] c"Nothing to paste\0Ao-copy or o-cut first to paste throug o-paste\0A\00"
@.str.8 = [6 x i8] c"%s %s\00"
@EOF = global i64 0
@.str.9 = [3 x i8] c"mv\00"
@.str.10 = [3 x i8] c"%s\00"
@.str.11 = [12 x i8] c"%s %s %s %s\00"
@.str.12 = [4 x i8] c"%s\0A\00"
@.str.13 = [9 x i8] c"%s %s %s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca [100 x i8]
%8 = alloca [300 x i8]
%9 = alloca i8
%10 = alloca [5 x i8]
%11 = alloca [100 x i8]
%12 = alloca [100 x i8]
%13 = alloca i32
%14 = alloca i32
%15 = alloca [5 x i8]
%16 = alloca %struct.stat
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %14
%17 = load i32, i32* %4
%18 = icmp eq i32 %17, 2
br i1 %18, label %19, label %59
19: ; preds = %2
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
%23 = call i64 @strcmp(i8* %22, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %31, label %25
25: ; preds = %19
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 1
%28 = load i8*, i8** %27
%29 = call i64 @strcmp(i8* %28, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %36
31: ; preds = %25, %19
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 0
%34 = load i8*, i8** %33
%35 = call i32 @usage(i8* %34)
br label %36
36: ; preds = %31, %25
%37 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%38 = load i8**, i8*** %5
%39 = getelementptr inbounds i8*, i8** %38, i64 1
%40 = load i8*, i8** %39
%41 = call i32 @strcpy(i8* %37, i8* %40)
%42 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%43 = call i32 @stat(i8* %42, %struct.stat* %16)
%44 = icmp eq i32 %43, -1
br i1 %44, label %45, label %48
45: ; preds = %36
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0))
%47 = call i32 @exit(i32 0)
unreachable
48: ; preds = %36
%49 = getelementptr inbounds %struct.stat, %struct.stat* %16, i32 0, i32 0
%50 = load i32, i32* %49
%51 = load i32, i32* @S_IFDIR
%52 = and i32 %50, %51
%53 = icmp ne i32 %52, 0
br i1 %53, label %57, label %54
54: ; preds = %48
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.3, i64 0, i64 0))
%56 = call i32 @exit(i32 0)
unreachable
57: ; preds = %48
br label %58
58: ; preds = %57
br label %71
59: ; preds = %2
%60 = load i32, i32* %4
%61 = icmp sgt i32 %60, 2
br i1 %61, label %62, label %67
62: ; preds = %59
%63 = load i8**, i8*** %5
%64 = getelementptr inbounds i8*, i8** %63, i64 0
%65 = load i8*, i8** %64
%66 = call i32 @usage(i8* %65)
br label %70
67: ; preds = %59
%68 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%69 = call i32 @strcpy(i8* %68, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %70
70: ; preds = %67, %62
br label %71
71: ; preds = %70, %58
%72 = call i32* @fopen(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
store i32* %72, i32** %6
%73 = load i32*, i32** %6
%74 = icmp eq i32* %73, null
br i1 %74, label %75, label %77
75: ; preds = %71
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.7, i64 0, i64 0))
store i32 1, i32* %3
br label %138
77: ; preds = %71
br label %78
78: ; preds = %129, %77
%79 = load i32*, i32** %6
%80 = getelementptr inbounds [5 x i8], [5 x i8]* %10, i64 0, i64 0
%81 = getelementptr inbounds [100 x i8], [100 x i8]* %11, i64 0, i64 0
%82 = call i64 (i32*, i8*, i8*, ...) @fscanf(i32* %79, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i8* %80, i8* %81)
%83 = load i64, i64* @EOF
%84 = icmp eq i64 %82, %83
br i1 %84, label %85, label %86
85: ; preds = %78
br label %130
86: ; preds = %78
%87 = getelementptr inbounds [5 x i8], [5 x i8]* %10, i64 0, i64 0
%88 = call i64 @strcmp(i8* %87, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%89 = icmp eq i64 %88, 0
br i1 %89, label %90, label %91
90: ; preds = %86
store i32 1, i32* %14
br label %91
91: ; preds = %90, %86
%92 = getelementptr inbounds [100 x i8], [100 x i8]* %11, i64 0, i64 0
%93 = load i8, i8* %92
%94 = sext i8 %93 to i32
%95 = icmp ne i32 %94, 45
br i1 %95, label %96, label %100
96: ; preds = %91
%97 = getelementptr inbounds [100 x i8], [100 x i8]* %12, i64 0, i64 0
%98 = getelementptr inbounds [100 x i8], [100 x i8]* %11, i64 0, i64 0
%99 = call i32 @strcpy(i8* %97, i8* %98)
store i32 0, i32* %13
br label %104
100: ; preds = %91
%101 = load i32*, i32** %6
%102 = getelementptr inbounds [100 x i8], [100 x i8]* %12, i64 0, i64 0
%103 = call i64 (i32*, i8*, i8*, ...) @fscanf(i32* %101, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i8* %102)
store i32 1, i32* %13
br label %104
104: ; preds = %100, %96
%105 = load i32, i32* %13
%106 = icmp ne i32 %105, 0
br i1 %106, label %107, label %118
107: ; preds = %104
%108 = getelementptr inbounds [300 x i8], [300 x i8]* %8, i64 0, i64 0
%109 = getelementptr inbounds [5 x i8], [5 x i8]* %10, i64 0, i64 0
%110 = getelementptr inbounds [100 x i8], [100 x i8]* %11, i64 0, i64 0
%111 = getelementptr inbounds [100 x i8], [100 x i8]* %12, i64 0, i64 0
%112 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%113 = call i32 (i8*, i8*, i8*, i8*, i8*, ...) @sprintf(i8* %108, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0), i8* %109, i8* %110, i8* %111, i8* %112)
%114 = getelementptr inbounds [300 x i8], [300 x i8]* %8, i64 0, i64 0
%115 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i8* %114)
%116 = getelementptr inbounds [300 x i8], [300 x i8]* %8, i64 0, i64 0
%117 = call i32 @system(i8* %116)
br label %128
118: ; preds = %104
%119 = getelementptr inbounds [300 x i8], [300 x i8]* %8, i64 0, i64 0
%120 = getelementptr inbounds [5 x i8], [5 x i8]* %10, i64 0, i64 0
%121 = getelementptr inbounds [100 x i8], [100 x i8]* %12, i64 0, i64 0
%122 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%123 = call i32 (i8*, i8*, i8*, i8*, i8*, ...) @sprintf(i8* %119, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0), i8* %120, i8* %121, i8* %122)
%124 = getelementptr inbounds [300 x i8], [300 x i8]* %8, i64 0, i64 0
%125 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i8* %124)
%126 = getelementptr inbounds [300 x i8], [300 x i8]* %8, i64 0, i64 0
%127 = call i32 @system(i8* %126)
br label %128
128: ; preds = %118, %107
br label %129
129: ; preds = %128
br i1 true, label %78, label %130
130: ; preds = %129, %85
%131 = load i32*, i32** %6
%132 = call i32 @fclose(i32* %131)
%133 = load i32, i32* %14
%134 = icmp ne i32 %133, 0
br i1 %134, label %135, label %137
135: ; preds = %130
%136 = call i32 @remove(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0))
br label %137
137: ; preds = %135, %130
store i32 0, i32* %3
br label %138
138: ; preds = %137, %75
%139 = load i32, i32* %3
ret i32 %139
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [7 x i8] c"--help\00"
@.str.1 = [3 x i8] c"-h\00"
@S_IFDIR = global i32 0
@.str.4 = [2 x i8] c".\00"
@.str.5 = [21 x i8] c"/tmp/ocopy_queue.que\00"
@.str.6 = [2 x i8] c"r\00"
@.str.8 = [6 x i8] c"%s %s\00"
@EOF = global i64 0
@.str.9 = [3 x i8] c"mv\00"
@.str.10 = [3 x i8] c"%s\00"
@.str.11 = [12 x i8] c"%s %s %s %s\00"
@.str.13 = [9 x i8] c"%s %s %s\00"
@str = [63 x i8] c"Nothing to paste\0Ao-copy or o-cut first to paste throug o-paste\00"
@str.14 = [55 x i8] c"destination directory is required not destination file\00"
@str.15 = [45 x i8] c"provide valid destination directory to paste\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [100 x i8]
%4 = alloca [300 x i8]
%5 = alloca [5 x i8]
%6 = alloca [100 x i8]
%7 = alloca [100 x i8]
%8 = alloca %struct.stat
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%10 = getelementptr inbounds [300 x i8], [300 x i8]* %4, i64 0, i64 0
%11 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 0
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%14 = bitcast %struct.stat* %8 to i8*
%15 = icmp eq i32 %0, 2
br i1 %15, label %16, label %45
16: ; preds = %2
%17 = getelementptr inbounds i8*, i8** %1, i64 1
%18 = load i8*, i8** %17
%19 = tail call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %25, label %21
21: ; preds = %16
%22 = load i8*, i8** %17
%23 = tail call i64 @strcmp(i8* %22, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %28
25: ; preds = %21, %16
%26 = load i8*, i8** %1
%27 = tail call i32 @usage(i8* %26)
br label %28
28: ; preds = %25, %21
%29 = load i8*, i8** %17
%30 = call i32 @strcpy(i8* %9, i8* %29)
%31 = call i32 @stat(i8* %9, %struct.stat* %8)
%32 = icmp eq i32 %31, -1
br i1 %32, label %33, label %36
33: ; preds = %28
%34 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.15, i64 0, i64 0))
%35 = call i32 @exit(i32 0)
unreachable
36: ; preds = %28
%37 = getelementptr inbounds %struct.stat, %struct.stat* %8, i64 0, i32 0
%38 = load i32, i32* %37
%39 = load i32, i32* @S_IFDIR
%40 = and i32 %39, %38
%41 = icmp eq i32 %40, 0
br i1 %41, label %42, label %52
42: ; preds = %36
%43 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.14, i64 0, i64 0))
%44 = call i32 @exit(i32 0)
unreachable
45: ; preds = %2
%46 = icmp sgt i32 %0, 2
br i1 %46, label %47, label %50
47: ; preds = %45
%48 = load i8*, i8** %1
%49 = tail call i32 @usage(i8* %48)
br label %52
50: ; preds = %45
%51 = call i32 @strcpy(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %52
52: ; preds = %47, %50, %36
%53 = call i32* @fopen(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%54 = icmp eq i32* %53, null
br i1 %54, label %61, label %55
55: ; preds = %52
%56 = call i64 (i32*, i8*, i8*, ...) @fscanf(i32* %53, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i8* %11, i8* %12)
%57 = load i64, i64* @EOF
%58 = icmp eq i64 %56, %57
br i1 %58, label %59, label %63
59: ; preds = %55
%60 = call i32 @fclose(i32* %53)
br label %87
61: ; preds = %52
%62 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str, i64 0, i64 0))
br label %87
63: ; preds = %55, %76
%64 = phi i32 [ %67, %76 ], [ 0, %55 ]
%65 = call i64 @strcmp(i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%66 = icmp eq i64 %65, 0
%67 = select i1 %66, i32 1, i32 %64
%68 = load i8, i8* %12
%69 = icmp eq i8 %68, 45
br i1 %69, label %70, label %73
70: ; preds = %63
%71 = call i64 (i32*, i8*, i8*, ...) @fscanf(i32* %53, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i8* %13)
%72 = call i32 (i8*, i8*, i8*, i8*, i8*, ...) @sprintf(i8* %10, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0), i8* %11, i8* %12, i8* %13, i8* %9)
br label %76
73: ; preds = %63
%74 = call i32 @strcpy(i8* %13, i8* %12)
%75 = call i32 (i8*, i8*, i8*, i8*, i8*, ...) @sprintf(i8* %10, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0), i8* %11, i8* %13, i8* %9)
br label %76
76: ; preds = %70, %73
%77 = call i32 @puts(i8* %10)
%78 = call i32 @system(i8* %10)
%79 = call i64 (i32*, i8*, i8*, ...) @fscanf(i32* %53, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i8* %11, i8* %12)
%80 = load i64, i64* @EOF
%81 = icmp eq i64 %79, %80
br i1 %81, label %82, label %63
82: ; preds = %76
%83 = icmp eq i32 %67, 0
%84 = call i32 @fclose(i32* %53)
br i1 %83, label %87, label %85
85: ; preds = %82
%86 = call i32 @remove(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0))
br label %87
87: ; preds = %59, %82, %85, %61
%88 = phi i32 [ 1, %61 ], [ 0, %85 ], [ 0, %82 ], [ 0, %59 ]
ret i32 %88
}