#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 */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
int /*<<< orphan*/ copyNew(char *, int /*<<< orphan*/, char *,
                           int /*<<< orphan*/, int);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ *opendir(char *);
int /*<<< orphan*/ printHelp();
int /*<<< orphan*/ printUsage(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ removeMissing(char *, int /*<<< orphan*/, char *,
                                 int /*<<< orphan*/, int);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
char *strerror(int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int main(int argc, char **argv) {
  int srcArg = 0, destArg = 0;
  int testMode = 0, remove = 1;
  for (int i = 1; i < argc; i++) {
    if (strcmp(argv[i], "--help") == 0) {
      printHelp();
      exit(0);
    } else if (strcmp(argv[i], "--test") == 0) {
      testMode = 1;
      printf("***Operating in test mode.***\n");
    } else if (strcmp(argv[i], "--noremove") == 0) {
      remove = 0;
    } else if (srcArg == 0) {
      srcArg = i;
    } else {
      destArg = i;
    }
  }
  if (srcArg == 0 || destArg == 0) {
    printUsage(stderr);
    fprintf(stderr, "Run 'backly --help' for more information.\n");
    exit(1);
  }
  int srcLen = 0, destLen = 0;
  while (argv[srcArg][srcLen])
    srcLen++;
  while (argv[destArg][destLen])
    destLen++;
  char srcDir[srcLen + 2], destDir[destLen + 2];
  if (argv[srcArg][srcLen - 1] == '/')
    sprintf(srcDir, "%s", argv[srcArg]);
  else
    sprintf(srcDir, "%s/", argv[srcArg]);
  if (argv[destArg][destLen - 1] == '/')
    sprintf(destDir, "%s", argv[destArg]);
  else
    sprintf(destDir, "%s/", argv[destArg]);
  DIR *dir = opendir(srcDir);
  if (dir == NULL) {
    fprintf(stderr, "Could not open source: %s\n", strerror(errno));
    exit(1);
  }
  closedir(dir);
  dir = opendir(destDir);
  if (dir == NULL) {
    fprintf(stderr, "Could not open destination: %s\n", strerror(errno));
    exit(1);
  }
  closedir(dir);
  if (remove)
    removeMissing(srcDir, strlen(srcDir), destDir, strlen(destDir), testMode);
  copyNew(srcDir, strlen(srcDir), destDir, strlen(destDir), testMode);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x1,-0x20(%rbp)
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    12ea <main+0x11a>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xdd8(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    1245 <main+0x75>
mov    $0x0,%al
call   1030 <printHelp@plt>
xor    %edi,%edi
call   10d0 <exit@plt>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xdaf(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    127f <main+0xaf>
movl   $0x1,-0x1c(%rbp)
lea    0xd99(%rip),%rdi
call   1060 <printf@plt>
jmp    12d2 <main+0x102>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd9b(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    12ad <main+0xdd>
movl   $0x0,-0x20(%rbp)
jmp    12cd <main+0xfd>
cmpl   $0x0,-0x14(%rbp)
jne    12c2 <main+0xf2>
mov    -0x24(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    12c8 <main+0xf8>
mov    -0x24(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    12cd <main+0xfd>
jmp    12d2 <main+0x102>
jmp    12d7 <main+0x107>
jmp    12dc <main+0x10c>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1209 <main+0x39>
cmpl   $0x0,-0x14(%rbp)
je     12fe <main+0x12e>
cmpl   $0x0,-0x18(%rbp)
jne    132d <main+0x15d>
mov    0x2cdb(%rip),%rax
mov    (%rax),%edi
call   10b0 <printUsage@plt>
mov    0x2ccd(%rip),%rax
mov    (%rax),%edi
lea    0xd1c(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1363 <main+0x193>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    133b <main+0x16b>
jmp    1368 <main+0x198>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x2c(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1390 <main+0x1c0>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1368 <main+0x198>
mov    -0x28(%rbp),%eax
add    $0x2,%eax
mov    %rsp,%rcx
mov    %rcx,-0x38(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x60(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x40(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x2,%eax
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x58(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x48(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x28(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
jne    141e <main+0x24e>
mov    -0x60(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xc4f(%rip),%rsi
call   10c0 <sprintf@plt>
jmp    143a <main+0x26a>
mov    -0x60(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xc31(%rip),%rsi
call   10c0 <sprintf@plt>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x2c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
jne    147d <main+0x2ad>
mov    -0x58(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xbf0(%rip),%rsi
call   10c0 <sprintf@plt>
jmp    1499 <main+0x2c9>
mov    -0x58(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xbd2(%rip),%rsi
call   10c0 <sprintf@plt>
mov    -0x60(%rbp),%rdi
call   1040 <opendir@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
jne    14e9 <main+0x319>
mov    0x2b28(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x64(%rbp)
mov    0x2b14(%rip),%rax
mov    (%rax),%edi
call   10f0 <strerror@plt>
mov    -0x64(%rbp),%edi
mov    %rax,%rdx
lea    0xb92(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    -0x50(%rbp),%rdi
call   1070 <closedir@plt>
mov    -0x58(%rbp),%rdi
call   1040 <opendir@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
jne    1542 <main+0x372>
mov    0x2acf(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x68(%rbp)
mov    0x2abb(%rip),%rax
mov    (%rax),%edi
call   10f0 <strerror@plt>
mov    -0x68(%rbp),%edi
mov    %rax,%rdx
lea    0xb54(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
mov    -0x50(%rbp),%rdi
call   1070 <closedir@plt>
cmpl   $0x0,-0x20(%rbp)
je     1580 <main+0x3b0>
mov    -0x60(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x58(%rbp),%rdi
mov    %eax,-0x6c(%rbp)
call   1050 <strlen@plt>
mov    -0x60(%rbp),%rdi
mov    -0x6c(%rbp),%esi
mov    -0x58(%rbp),%rdx
mov    %eax,%ecx
mov    -0x1c(%rbp),%r8d
call   10a0 <removeMissing@plt>
mov    -0x60(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x58(%rbp),%rdi
mov    %eax,-0x70(%rbp)
call   1050 <strlen@plt>
mov    -0x60(%rbp),%rdi
mov    -0x70(%rbp),%esi
mov    -0x58(%rbp),%rdx
mov    %eax,%ecx
mov    -0x1c(%rbp),%r8d
call   10e0 <copyNew@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     141f <main+0x23f>
mov    %rsi,%rbx
mov    %edi,%r15d
movl   $0x1,-0x2c(%rbp)
xor    %r14d,%r14d
mov    $0x1,%r12d
xor    %r13d,%r13d
movl   $0x0,-0x30(%rbp)
jmp    123c <main+0x5c>
nopl   0x0(%rax)
lea    0xe5c(%rip),%rdi
call   1050 <puts@plt>
movl   $0x1,-0x30(%rbp)
add    $0x1,%r12
cmp    %r12,%r15
je     1299 <main+0xb9>
mov    (%rbx,%r12,8),%rdi
lea    0xdb9(%rip),%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
je     1411 <main+0x231>
mov    (%rbx,%r12,8),%rdi
lea    0xda7(%rip),%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
je     1220 <main+0x40>
mov    (%rbx,%r12,8),%rdi
lea    0xd99(%rip),%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
je     1290 <main+0xb0>
test   %r14d,%r14d
cmovne %r12d,%r13d
cmove  %r12d,%r14d
jmp    1233 <main+0x53>
nopl   0x0(%rax)
movl   $0x0,-0x2c(%rbp)
jmp    1233 <main+0x53>
test   %r14d,%r14d
je     141f <main+0x23f>
test   %r13d,%r13d
je     141f <main+0x23f>
movabs $0xfffffffe00000000,%r15
ff ff ff
movabs $0x100000000,%rcx
movslq %r14d,%rax
mov    (%rbx,%rax,8),%rdx
mov    $0x1,%esi
mov    %r15,%rax
xchg   %ax,%ax
add    %rcx,%rax
cmpb   $0x0,-0x1(%rdx,%rsi,1)
lea    0x1(%rsi),%rsi
jne    12d0 <main+0xf0>
movslq %r13d,%r8
mov    (%rbx,%r8,8),%r14
mov    $0x1,%edi
nopw   0x0(%rax,%rax,1)
add    %rcx,%r15
cmpb   $0x0,-0x1(%r14,%rdi,1)
lea    0x1(%rdi),%rdi
jne    12f0 <main+0x110>
mov    %esi,%ecx
mov    %rsp,%r13
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
sub    %rcx,%r13
mov    %r13,%rsp
mov    %edi,%ecx
mov    %rsp,%r12
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
sub    %rcx,%r12
mov    %r12,%rsp
sar    $0x20,%rax
cmpb   $0x2f,(%rdx,%rax,1)
jne    133c <main+0x15c>
mov    %r13,%rdi
mov    %rdx,%rsi
call   1040 <strcpy@plt>
jmp    1352 <main+0x172>
lea    0xd01(%rip),%rsi
mov    %r13,%rdi
mov    %r8,%r14
call   10d0 <sprintf@plt>
mov    (%rbx,%r14,8),%r14
sar    $0x20,%r15
cmpb   $0x2f,(%r14,%r15,1)
jne    136a <main+0x18a>
mov    %r12,%rdi
mov    %r14,%rsi
call   1040 <strcpy@plt>
jmp    137c <main+0x19c>
lea    0xcd3(%rip),%rsi
mov    %r12,%rdi
mov    %r14,%rdx
call   10d0 <sprintf@plt>
mov    %r13,%rdi
call   1060 <opendir@plt>
test   %rax,%rax
mov    -0x30(%rbp),%r14d
je     1447 <main+0x267>
mov    %rax,%rdi
call   1080 <closedir@plt>
mov    %r12,%rdi
call   1060 <opendir@plt>
test   %rax,%rax
je     1467 <main+0x287>
mov    %rax,%rdi
call   1080 <closedir@plt>
cmpl   $0x0,-0x2c(%rbp)
je     13dc <main+0x1fc>
mov    %r13,%rdi
call   1070 <strlen@plt>
mov    %eax,%ebx
mov    %r12,%rdi
call   1070 <strlen@plt>
mov    %r13,%rdi
mov    %ebx,%esi
mov    %r12,%rdx
mov    %eax,%ecx
mov    %r14d,%r8d
call   10b0 <removeMissing@plt>
mov    %r13,%rdi
call   1070 <strlen@plt>
mov    %eax,%ebx
mov    %r12,%rdi
call   1070 <strlen@plt>
mov    %r13,%rdi
mov    %ebx,%esi
mov    %r12,%rdx
mov    %eax,%ecx
mov    %r14d,%r8d
call   10f0 <copyNew@plt>
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %eax,%eax
call   1030 <printHelp@plt>
xor    %edi,%edi
call   10e0 <exit@plt>
mov    0x2bba(%rip),%rbx
mov    (%rbx),%edi
call   10c0 <printUsage@plt>
mov    (%rbx),%edi
lea    0xbe3(%rip),%rsi
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    0x2b92(%rip),%rax
mov    (%rax),%ebx
mov    0x2b81(%rip),%rax
mov    (%rax),%edi
call   1100 <strerror@plt>
lea    0xbe3(%rip),%rsi
jmp    1485 <main+0x2a5>
mov    0x2b72(%rip),%rax
mov    (%rax),%ebx
mov    0x2b61(%rip),%rax
mov    (%rax),%edi
call   1100 <strerror@plt>
lea    0xbde(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"--help\00"
@.str.1 = [7 x i8] c"--test\00"
@.str.2 = [31 x i8] c"***Operating in test mode.***\0A\00"
@.str.3 = [11 x i8] c"--noremove\00"
@stderr = global i32 0
@.str.4 = [43 x i8] c"Run 'backly --help' for more information.\0A\00"
@.str.5 = [3 x i8] c"%s\00"
@.str.6 = [4 x i8] c"%s/\00"
@.str.7 = [27 x i8] c"Could not open source: %s\0A\00"
@errno = global i32 0
@.str.8 = [32 x i8] c"Could not open destination: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i64
%15 = alloca i64
%16 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 1, i32* %9
store i32 1, i32* %10
br label %17
17: ; preds = %62, %2
%18 = load i32, i32* %10
%19 = load i32, i32* %4
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %65
21: ; preds = %17
%22 = load i8**, i8*** %5
%23 = load i32, i32* %10
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8*, i8** %22, i64 %24
%26 = load i8*, i8** %25
%27 = call i64 @strcmp(i8* %26, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%28 = icmp eq i64 %27, 0
br i1 %28, label %29, label %32
29: ; preds = %21
%30 = call i32 (...) @printHelp()
%31 = call i32 @exit(i32 0)
unreachable
32: ; preds = %21
%33 = load i8**, i8*** %5
%34 = load i32, i32* %10
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i8*, i8** %33, i64 %35
%37 = load i8*, i8** %36
%38 = call i64 @strcmp(i8* %37, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%39 = icmp eq i64 %38, 0
br i1 %39, label %40, label %42
40: ; preds = %32
store i32 1, i32* %8
%41 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
br label %60
42: ; preds = %32
%43 = load i8**, i8*** %5
%44 = load i32, i32* %10
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds i8*, i8** %43, i64 %45
%47 = load i8*, i8** %46
%48 = call i64 @strcmp(i8* %47, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%49 = icmp eq i64 %48, 0
br i1 %49, label %50, label %51
50: ; preds = %42
store i32 0, i32* %9
br label %59
51: ; preds = %42
%52 = load i32, i32* %6
%53 = icmp eq i32 %52, 0
br i1 %53, label %54, label %56
54: ; preds = %51
%55 = load i32, i32* %10
store i32 %55, i32* %6
br label %58
56: ; preds = %51
%57 = load i32, i32* %10
store i32 %57, i32* %7
br label %58
58: ; preds = %56, %54
br label %59
59: ; preds = %58, %50
br label %60
60: ; preds = %59, %40
br label %61
61: ; preds = %60
br label %62
62: ; preds = %61
%63 = load i32, i32* %10
%64 = add nsw i32 %63, 1
store i32 %64, i32* %10
br label %17
65: ; preds = %17
%66 = load i32, i32* %6
%67 = icmp eq i32 %66, 0
br i1 %67, label %71, label %68
68: ; preds = %65
%69 = load i32, i32* %7
%70 = icmp eq i32 %69, 0
br i1 %70, label %71, label %77
71: ; preds = %68, %65
%72 = load i32, i32* @stderr
%73 = call i32 @printUsage(i32 %72)
%74 = load i32, i32* @stderr
%75 = call i32 (i32, i8*, ...) @fprintf(i32 %74, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.4, i64 0, i64 0))
%76 = call i32 @exit(i32 1)
unreachable
77: ; preds = %68
store i32 0, i32* %11
store i32 0, i32* %12
br label %78
78: ; preds = %89, %77
%79 = load i8**, i8*** %5
%80 = load i32, i32* %6
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds i8*, i8** %79, i64 %81
%83 = load i8*, i8** %82
%84 = load i32, i32* %11
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds i8, i8* %83, i64 %85
%87 = load i8, i8* %86
%88 = icmp ne i8 %87, 0
br i1 %88, label %89, label %92
89: ; preds = %78
%90 = load i32, i32* %11
%91 = add nsw i32 %90, 1
store i32 %91, i32* %11
br label %78
92: ; preds = %78
br label %93
93: ; preds = %104, %92
%94 = load i8**, i8*** %5
%95 = load i32, i32* %7
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds i8*, i8** %94, i64 %96
%98 = load i8*, i8** %97
%99 = load i32, i32* %12
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds i8, i8* %98, i64 %100
%102 = load i8, i8* %101
%103 = icmp ne i8 %102, 0
br i1 %103, label %104, label %107
104: ; preds = %93
%105 = load i32, i32* %12
%106 = add nsw i32 %105, 1
store i32 %106, i32* %12
br label %93
107: ; preds = %93
%108 = load i32, i32* %11
%109 = add nsw i32 %108, 2
%110 = zext i32 %109 to i64
%111 = call i8* @llvm.stacksave()
store i8* %111, i8** %13
%112 = alloca i8, i64 %110
store i64 %110, i64* %14
%113 = load i32, i32* %12
%114 = add nsw i32 %113, 2
%115 = zext i32 %114 to i64
%116 = alloca i8, i64 %115
store i64 %115, i64* %15
%117 = load i8**, i8*** %5
%118 = load i32, i32* %6
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds i8*, i8** %117, i64 %119
%121 = load i8*, i8** %120
%122 = load i32, i32* %11
%123 = sub nsw i32 %122, 1
%124 = sext i32 %123 to i64
%125 = getelementptr inbounds i8, i8* %121, i64 %124
%126 = load i8, i8* %125
%127 = sext i8 %126 to i32
%128 = icmp eq i32 %127, 47
br i1 %128, label %129, label %136
129: ; preds = %107
%130 = load i8**, i8*** %5
%131 = load i32, i32* %6
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds i8*, i8** %130, i64 %132
%134 = load i8*, i8** %133
%135 = call i32 @sprintf(i8* %112, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %134)
br label %143
136: ; preds = %107
%137 = load i8**, i8*** %5
%138 = load i32, i32* %6
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds i8*, i8** %137, i64 %139
%141 = load i8*, i8** %140
%142 = call i32 @sprintf(i8* %112, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* %141)
br label %143
143: ; preds = %136, %129
%144 = load i8**, i8*** %5
%145 = load i32, i32* %7
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds i8*, i8** %144, i64 %146
%148 = load i8*, i8** %147
%149 = load i32, i32* %12
%150 = sub nsw i32 %149, 1
%151 = sext i32 %150 to i64
%152 = getelementptr inbounds i8, i8* %148, i64 %151
%153 = load i8, i8* %152
%154 = sext i8 %153 to i32
%155 = icmp eq i32 %154, 47
br i1 %155, label %156, label %163
156: ; preds = %143
%157 = load i8**, i8*** %5
%158 = load i32, i32* %7
%159 = sext i32 %158 to i64
%160 = getelementptr inbounds i8*, i8** %157, i64 %159
%161 = load i8*, i8** %160
%162 = call i32 @sprintf(i8* %116, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %161)
br label %170
163: ; preds = %143
%164 = load i8**, i8*** %5
%165 = load i32, i32* %7
%166 = sext i32 %165 to i64
%167 = getelementptr inbounds i8*, i8** %164, i64 %166
%168 = load i8*, i8** %167
%169 = call i32 @sprintf(i8* %116, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* %168)
br label %170
170: ; preds = %163, %156
%171 = call i32* @opendir(i8* %112)
store i32* %171, i32** %16
%172 = load i32*, i32** %16
%173 = icmp eq i32* %172, null
br i1 %173, label %174, label %180
174: ; preds = %170
%175 = load i32, i32* @stderr
%176 = load i32, i32* @errno
%177 = call i8* @strerror(i32 %176)
%178 = call i32 (i32, i8*, ...) @fprintf(i32 %175, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0), i8* %177)
%179 = call i32 @exit(i32 1)
unreachable
180: ; preds = %170
%181 = load i32*, i32** %16
%182 = call i32 @closedir(i32* %181)
%183 = call i32* @opendir(i8* %116)
store i32* %183, i32** %16
%184 = load i32*, i32** %16
%185 = icmp eq i32* %184, null
br i1 %185, label %186, label %192
186: ; preds = %180
%187 = load i32, i32* @stderr
%188 = load i32, i32* @errno
%189 = call i8* @strerror(i32 %188)
%190 = call i32 (i32, i8*, ...) @fprintf(i32 %187, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.8, i64 0, i64 0), i8* %189)
%191 = call i32 @exit(i32 1)
unreachable
192: ; preds = %180
%193 = load i32*, i32** %16
%194 = call i32 @closedir(i32* %193)
%195 = load i32, i32* %9
%196 = icmp ne i32 %195, 0
br i1 %196, label %197, label %202
197: ; preds = %192
%198 = call i32 @strlen(i8* %112)
%199 = call i32 @strlen(i8* %116)
%200 = load i32, i32* %8
%201 = call i32 @removeMissing(i8* %112, i32 %198, i8* %116, i32 %199, i32 %200)
br label %202
202: ; preds = %197, %192
%203 = call i32 @strlen(i8* %112)
%204 = call i32 @strlen(i8* %116)
%205 = load i32, i32* %8
%206 = call i32 @copyNew(i8* %112, i32 %203, i8* %116, i32 %204, i32 %205)
store i32 0, i32* %3
%207 = load i8*, i8** %13
%208 = load i32, i32* %3
ret i32 %208
}

LLVM IR (-O2):
@.str = [7 x i8] c"--help\00"
@.str.1 = [7 x i8] c"--test\00"
@.str.3 = [11 x i8] c"--noremove\00"
@stderr = global i32 0
@.str.4 = [43 x i8] c"Run 'backly --help' for more information.\0A\00"
@.str.6 = [4 x i8] c"%s/\00"
@.str.7 = [27 x i8] c"Could not open source: %s\0A\00"
@errno = global i32 0
@.str.8 = [32 x i8] c"Could not open destination: %s\0A\00"
@str = [30 x i8] c"***Operating in test mode.***\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %49
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %14
6: ; preds = %42
%7 = icmp eq i32 %46, 0
%8 = icmp eq i32 %45, 0
%9 = select i1 %7, i1 true, i1 %8
br i1 %9, label %49, label %10
10: ; preds = %6
%11 = sext i32 %46 to i64
%12 = getelementptr inbounds i8*, i8** %1, i64 %11
%13 = load i8*, i8** %12
br label %55
14: ; preds = %4, %42
%15 = phi i64 [ 1, %4 ], [ %47, %42 ]
%16 = phi i32 [ 0, %4 ], [ %46, %42 ]
%17 = phi i32 [ 0, %4 ], [ %45, %42 ]
%18 = phi i32 [ 1, %4 ], [ %44, %42 ]
%19 = phi i32 [ 0, %4 ], [ %43, %42 ]
%20 = getelementptr inbounds i8*, i8** %1, i64 %15
%21 = load i8*, i8** %20
%22 = tail call i64 @strcmp(i8* %21, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %27
24: ; preds = %14
%25 = tail call i32 (...) @printHelp()
%26 = tail call i32 @exit(i32 0)
unreachable
27: ; preds = %14
%28 = load i8*, i8** %20
%29 = tail call i64 @strcmp(i8* %28, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %27
%32 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
br label %42
33: ; preds = %27
%34 = load i8*, i8** %20
%35 = tail call i64 @strcmp(i8* %34, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%36 = icmp eq i64 %35, 0
br i1 %36, label %42, label %37
37: ; preds = %33
%38 = icmp eq i32 %16, 0
%39 = trunc i64 %15 to i32
%40 = select i1 %38, i32 %17, i32 %39
%41 = select i1 %38, i32 %39, i32 %16
br label %42
42: ; preds = %37, %33, %31
%43 = phi i32 [ 1, %31 ], [ %19, %33 ], [ %19, %37 ]
%44 = phi i32 [ %18, %31 ], [ 0, %33 ], [ %18, %37 ]
%45 = phi i32 [ %17, %31 ], [ %17, %33 ], [ %40, %37 ]
%46 = phi i32 [ %16, %31 ], [ %16, %33 ], [ %41, %37 ]
%47 = add nuw nsw i64 %15, 1
%48 = icmp eq i64 %47, %5
br i1 %48, label %6, label %14
49: ; preds = %2, %6
%50 = load i32, i32* @stderr
%51 = tail call i32 @printUsage(i32 %50)
%52 = load i32, i32* @stderr
%53 = tail call i32 (i32, i8*, ...) @fprintf(i32 %52, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.4, i64 0, i64 0))
%54 = tail call i32 @exit(i32 1)
unreachable
55: ; preds = %55, %10
%56 = phi i64 [ %60, %55 ], [ 0, %10 ]
%57 = getelementptr inbounds i8, i8* %13, i64 %56
%58 = load i8, i8* %57
%59 = icmp eq i8 %58, 0
%60 = add nuw i64 %56, 1
br i1 %59, label %61, label %55
61: ; preds = %55
%62 = sext i32 %45 to i64
%63 = getelementptr inbounds i8*, i8** %1, i64 %62
%64 = load i8*, i8** %63
br label %65
65: ; preds = %65, %61
%66 = phi i64 [ %70, %65 ], [ 0, %61 ]
%67 = getelementptr inbounds i8, i8* %64, i64 %66
%68 = load i8, i8* %67
%69 = icmp eq i8 %68, 0
%70 = add nuw i64 %66, 1
br i1 %69, label %71, label %65
71: ; preds = %65
%72 = add i64 %56, 2
%73 = and i64 %72, 4294967295
%74 = alloca i8, i64 %73
%75 = add i64 %66, 2
%76 = and i64 %75, 4294967295
%77 = alloca i8, i64 %76
%78 = shl i64 %56, 32
%79 = add i64 %78, -4294967296
%80 = ashr exact i64 %79, 32
%81 = getelementptr inbounds i8, i8* %13, i64 %80
%82 = load i8, i8* %81
%83 = icmp eq i8 %82, 47
br i1 %83, label %84, label %86
84: ; preds = %71
%85 = call i8* @strcpy(i8* %74, i8* dereferenceable(1) %13)
br label %89
86: ; preds = %71
%87 = call i32 @sprintf(i8* %74, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* %13)
%88 = load i8*, i8** %63
br label %89
89: ; preds = %86, %84
%90 = phi i8* [ %88, %86 ], [ %64, %84 ]
%91 = shl i64 %66, 32
%92 = add i64 %91, -4294967296
%93 = ashr exact i64 %92, 32
%94 = getelementptr inbounds i8, i8* %90, i64 %93
%95 = load i8, i8* %94
%96 = icmp eq i8 %95, 47
br i1 %96, label %97, label %99
97: ; preds = %89
%98 = call i8* @strcpy(i8* %77, i8* dereferenceable(1) %90)
br label %101
99: ; preds = %89
%100 = call i32 @sprintf(i8* %77, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* %90)
br label %101
101: ; preds = %99, %97
%102 = call i32* @opendir(i8* %74)
%103 = icmp eq i32* %102, null
br i1 %103, label %104, label %110
104: ; preds = %101
%105 = load i32, i32* @stderr
%106 = load i32, i32* @errno
%107 = call i8* @strerror(i32 %106)
%108 = call i32 (i32, i8*, ...) @fprintf(i32 %105, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0), i8* %107)
%109 = call i32 @exit(i32 1)
unreachable
110: ; preds = %101
%111 = call i32 @closedir(i32* %102)
%112 = call i32* @opendir(i8* %77)
%113 = icmp eq i32* %112, null
br i1 %113, label %114, label %120
114: ; preds = %110
%115 = load i32, i32* @stderr
%116 = load i32, i32* @errno
%117 = call i8* @strerror(i32 %116)
%118 = call i32 (i32, i8*, ...) @fprintf(i32 %115, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.8, i64 0, i64 0), i8* %117)
%119 = call i32 @exit(i32 1)
unreachable
120: ; preds = %110
%121 = call i32 @closedir(i32* %112)
%122 = icmp eq i32 %44, 0
br i1 %122, label %127, label %123
123: ; preds = %120
%124 = call i32 @strlen(i8* %74)
%125 = call i32 @strlen(i8* %77)
%126 = call i32 @removeMissing(i8* %74, i32 %124, i8* %77, i32 %125, i32 %43)
br label %127
127: ; preds = %123, %120
%128 = call i32 @strlen(i8* %74)
%129 = call i32 @strlen(i8* %77)
%130 = call i32 @copyNew(i8* %74, i32 %128, i8* %77, i32 %129, i32 %43)
ret i32 0
}