#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 uid_t;
struct timeval {
  scalar_t__ tv_sec;
  scalar_t__ tv_usec;
};
struct stat {
  int st_mode;
  int st_uid;
  int st_gid;
  scalar_t__ st_mtime;
};
struct passwd {
  int pw_uid;
};
struct group {
  int gr_gid;
};
typedef int /*<<< orphan*/ pid_t;
typedef int mode_t;
typedef int gid_t;

/* Variables and functions */
int BUFSIZ;
int EOF;
int MAXPATHLEN;
int O_CREAT;
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ O_RDWR;
int O_TRUNC;
int O_WRONLY;
int /*<<< orphan*/ S_ISDIR(int);
int /*<<< orphan*/ S_ISREG(int);
scalar_t__ WEXITSTATUS(int);
scalar_t__ WIFEXITED(int);
int chmod(char *, int);
int chown(char *, int, int);
scalar_t__ close(int);
int /*<<< orphan*/ dup2(int, int);
int /*<<< orphan*/ execl(char *, char *, char *, char *, char *, ...);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fork();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
scalar_t__ fsync(int);
struct group *getgrgid(int);
struct group *getgrnam(char *);
int getopt(int, char **, char *);
struct passwd *getpwnam(char *);
struct passwd *getpwuid(int);
int open(char *, int, ...);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, char *, ...);
int read(int, unsigned char *, int);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
int sscanf(char *, char *, int *);
int stat(char *, struct stat *);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
char *strdup(char *);
int /*<<< orphan*/ strlen(char *);
int strtoul(char *, char **, int);
int /*<<< orphan*/ unlink(char *);
int /*<<< orphan*/ usage();
int utimes(char *, struct timeval *);
int waitpid(int /*<<< orphan*/, int *, int /*<<< orphan*/);
int write(int, unsigned char *, int);
int main(int argc, char *argv[]) {
  int c;
  extern int optind;
  extern char *optarg;
  struct passwd *pw;
  struct group *gr;
  struct stat sb_src, sb_dst, sb_dstdir;
  char *src_file = NULL;
  char *dst_dir = NULL;
  char dst_file[MAXPATHLEN];
  mode_t dst_mode = (-3);
  uid_t in_uid, dst_uid = (-3);
  gid_t in_gid, dst_gid = (-3);
  int opt_c = 0, opt_C = 0, opt_f = 0, opt_q = 0;
  int do_copy, do_chmod, do_chown;
  pid_t pid;
  int st, rv;
  char *why, *ptr;
  struct timeval times[2];
  int dst_fd, src_fd, dev_null_fd;
  unsigned char buf[BUFSIZ];
  while ((c = getopt(argc, argv, "s:d:m:o:g:cCfq")) != EOF) {
    switch (c) {
    case 's':
      src_file = strdup(optarg);
      if (stat(src_file, &sb_src) == -1) {
        fprintf(stderr, "%s does not exist\n", src_file);
        exit(1);
      }
      if (!S_ISREG(sb_src.st_mode)) {
        fprintf(stderr, "%s not a plain file\n", src_file);
        exit(1);
      }
      break;
    case 'd':
      dst_dir = strdup(optarg);
      if (stat(dst_dir, &sb_dstdir) == -1) {
        fprintf(stderr, "%s does not exist\n", dst_dir);
        exit(1);
      }
      if (!S_ISDIR(sb_dstdir.st_mode)) {
        fprintf(stderr, "%s not a directory\n", dst_dir);
        exit(1);
      }
      break;
    case 'm':
      if (sscanf(optarg, "%o", &dst_mode) != 1 || dst_mode > 07777) {
        fprintf(stderr, "bad mode: %s\n", optarg);
        exit(1);
      }
      break;
    case 'o':
      pw = getpwnam(optarg);
      if (!pw) {
        in_uid = strtoul(optarg, &ptr, 10);
        if (ptr == (optarg + strlen(optarg)))
          pw = getpwuid(in_uid);
      }
      if (!pw) {
        fprintf(stderr, "bad owner: %s\n", optarg);
        exit(1);
      }
      dst_uid = pw->pw_uid;
      break;
    case 'g':
      gr = getgrnam(optarg);
      if (!gr) {
        in_gid = strtoul(optarg, &ptr, 10);
        if (ptr == (optarg + strlen(optarg)))
          gr = getgrgid(in_gid);
      }
      if (!gr) {
        fprintf(stderr, "bad group: %s\n", optarg);
        exit(1);
      }
      dst_gid = gr->gr_gid;
      break;
    case 'c':
      opt_c = 1;
      break;
    case 'C':
      opt_C = 1;
      break;
    case 'f':
      opt_f = 1;
      break;
    case 'q':
      opt_q = 1;
      break;
    default:
      usage();
    }
  }
  if (!src_file || !dst_dir)
    usage();
  if (dst_mode == (-3))
    dst_mode = sb_src.st_mode & 07777;
  if (dst_uid == (-3))
    dst_uid = sb_src.st_uid;
  if (dst_gid == (-3))
    dst_gid = sb_src.st_gid;
  sprintf(dst_file, "%s/%s", dst_dir, src_file);
  do_copy = 1;
  do_chmod = 1;
  do_chown = 1;
  if (stat(dst_file, &sb_dst) != -1) {
    if (sb_dst.st_mtime == sb_src.st_mtime) {
      if (!opt_f) {
        do_copy = 0;
        why = "source and destination have same mtime";
      }
    } else if (sb_dst.st_mtime > sb_src.st_mtime) {
      if (!opt_f) {
        do_copy = 0;
        why = "destination is newer than source";
      }
    } else if (sb_dst.st_mtime < sb_src.st_mtime) {
      if (opt_c) {
        switch (pid = fork()) {
        case (-1):
          perror("fork");
          exit(1);
        case 0:
          if ((dev_null_fd = open("/dev/null", O_RDWR)) < 0) {
            perror("open");
            exit(1);
          }
          dup2(dev_null_fd, 1);
          dup2(dev_null_fd, 2);
          if (execl("/usr/bin/cmp", "cmp", src_file, dst_file, (char *)0) < 0)
            exit(1);
        default:
          rv = waitpid(pid, &st, 0);
          break;
        }
        if (rv != -1 && WIFEXITED(st) && WEXITSTATUS(st) == 0) {
          do_copy = 0;
          why = "source and destination are identical (cmp)";
        }
      } else if (opt_C) {
        switch (pid = fork()) {
        case (-1):
          perror("fork");
          exit(1);
        case 0:
          if ((dev_null_fd = open("/dev/null", O_RDWR)) < 0) {
            perror("open");
            exit(1);
          }
          dup2(dev_null_fd, 1);
          dup2(dev_null_fd, 2);
          if (execl("/usr/bin/diff", "diff", "-b", src_file, dst_file,
                    (char *)0) < 0)
            exit(1);
        default:
          rv = waitpid(pid, &st, 0);
          break;
        }
        if (rv != -1 && WIFEXITED(st) && WEXITSTATUS(st) == 0) {
          do_copy = 0;
          why = "source and destination are identical (diff -b)";
        }
      }
    }
    if (!do_copy) {
      if (sb_dst.st_uid == dst_uid && sb_dst.st_gid == dst_gid)
        do_chown = 0;
      if ((sb_dst.st_mode & 07777) == dst_mode)
        do_chmod = 0;
    }
  }
  if (!do_copy &&
      !(opt_q && strcmp(why, "destination is newer than source") != 0))
    printf("%s not copied: %s\n", src_file, why);
  if (opt_q && do_copy)
    printf("installing %s\n", dst_file);
  if (do_copy) {
    if ((dst_fd = open(dst_file, O_CREAT | O_TRUNC | O_WRONLY, dst_mode)) ==
        -1) {
      perror(dst_file);
      exit(1);
    }
    if ((src_fd = open(src_file, O_RDONLY)) == -1) {
      perror(src_file);
      exit(1);
    }
    while ((rv = read(src_fd, buf, BUFSIZ)) > 0)
      if (write(dst_fd, buf, rv) == -1) {
        perror(dst_file);
        unlink(dst_file);
        exit(1);
      }
    if (close(src_fd) < 0)
      perror("close");
    if (fsync(dst_fd) < 0) {
      perror("fsync");
      unlink(dst_file);
      exit(1);
    }
    if (close(dst_fd) < 0) {
      perror("close");
      unlink(dst_file);
      exit(1);
    }
    times[0].tv_sec = sb_src.st_mtime;
    times[0].tv_usec = 0;
    times[1] = times[0];
    if (utimes(dst_file, times) == -1)
      perror(dst_file);
  }
  if (do_chown)
    if (chown(dst_file, dst_uid, dst_gid) == -1)
      perror(dst_file);
  if (do_chmod)
    if (chmod(dst_file, dst_mode) == -1)
      perror(dst_file);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x78(%rbp)
movq   $0x0,-0x80(%rbp)
mov    0x2c70(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x88(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x128(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x90(%rbp)
movl   $0xfffffffd,-0x94(%rbp)
ff ff ff
movl   $0xfffffffd,-0x9c(%rbp)
ff ff ff
movl   $0xfffffffd,-0xa4(%rbp)
ff ff ff
movl   $0x0,-0xa8(%rbp)
movl   $0x0,-0xac(%rbp)
movl   $0x0,-0xb0(%rbp)
movl   $0x0,-0xb4(%rbp)
mov    0x2bd5(%rip),%rax
mov    (%rax),%eax
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x120(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x118(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xcc7(%rip),%rdx
call   11d0 <getopt@plt>
mov    %eax,-0x14(%rbp)
mov    0x2bbc(%rip),%rcx
cmp    (%rcx),%eax
je     17c3 <main+0x4a3>
mov    -0x14(%rbp),%eax
add    $0xffffffbd,%eax
mov    %eax,%ecx
mov    %rcx,-0x130(%rbp)
sub    $0x30,%eax
ja     17b7 <main+0x497>
mov    -0x130(%rbp),%rax
lea    0xbc6(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2b66(%rip),%rax
mov    (%rax),%rdi
call   1220 <strdup@plt>
mov    %rax,-0x78(%rbp)
mov    -0x78(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1110 <stat@plt>
cmp    $0xffffffff,%eax
jne    148f <main+0x16f>
mov    0x2b35(%rip),%rax
mov    (%rax),%edi
mov    -0x78(%rbp),%rdx
lea    0xc53(%rip),%rsi
call   1100 <fprintf@plt>
mov    $0x1,%edi
call   1210 <exit@plt>
mov    -0x40(%rbp),%edi
call   1130 <S_ISREG@plt>
cmp    $0x0,%eax
jne    14c3 <main+0x1a3>
mov    0x2b01(%rip),%rax
mov    (%rax),%edi
mov    -0x78(%rbp),%rdx
lea    0xc32(%rip),%rsi
call   1100 <fprintf@plt>
mov    $0x1,%edi
call   1210 <exit@plt>
jmp    17be <main+0x49e>
mov    0x2ae1(%rip),%rax
mov    (%rax),%rdi
call   1220 <strdup@plt>
mov    %rax,-0x80(%rbp)
mov    -0x80(%rbp),%rdi
lea    -0x70(%rbp),%rsi
call   1110 <stat@plt>
cmp    $0xffffffff,%eax
jne    1514 <main+0x1f4>
mov    0x2ab0(%rip),%rax
mov    (%rax),%edi
mov    -0x80(%rbp),%rdx
lea    0xbce(%rip),%rsi
call   1100 <fprintf@plt>
mov    $0x1,%edi
call   1210 <exit@plt>
mov    -0x70(%rbp),%edi
call   1090 <S_ISDIR@plt>
cmp    $0x0,%eax
jne    1548 <main+0x228>
mov    0x2a7c(%rip),%rax
mov    (%rax),%edi
mov    -0x80(%rbp),%rdx
lea    0xbc2(%rip),%rsi
call   1100 <fprintf@plt>
mov    $0x1,%edi
call   1210 <exit@plt>
jmp    17be <main+0x49e>
mov    0x2a5c(%rip),%rax
mov    (%rax),%rdi
lea    0xbb1(%rip),%rsi
lea    -0x94(%rbp),%rdx
call   1140 <sscanf@plt>
cmp    $0x1,%eax
jne    1583 <main+0x263>
cmpl   $0xfff,-0x94(%rbp)
jle    15ac <main+0x28c>
mov    0x2a1e(%rip),%rax
mov    (%rax),%edi
mov    0x2a1d(%rip),%rax
mov    (%rax),%rdx
lea    0xb75(%rip),%rsi
call   1100 <fprintf@plt>
mov    $0x1,%edi
call   1210 <exit@plt>
jmp    17be <main+0x49e>
mov    0x29f8(%rip),%rax
mov    (%rax),%rdi
call   10f0 <getpwnam@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1651 <main+0x331>
mov    0x29da(%rip),%rax
mov    (%rax),%rdi
lea    -0xe0(%rbp),%rsi
mov    $0xa,%edx
call   11e0 <strtoul@plt>
mov    %eax,-0x98(%rbp)
mov    -0xe0(%rbp),%rax
mov    %rax,-0x138(%rbp)
mov    0x29ab(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x140(%rbp)
mov    0x299a(%rip),%rax
mov    (%rax),%rdi
call   1060 <strlen@plt>
mov    -0x140(%rbp),%rcx
mov    %eax,%edx
mov    -0x138(%rbp),%rax
movslq %edx,%rdx
add    %rdx,%rcx
cmp    %rcx,%rax
jne    164c <main+0x32c>
mov    -0x98(%rbp),%edi
call   1050 <getpwuid@plt>
mov    %rax,-0x20(%rbp)
jmp    1651 <main+0x331>
cmpq   $0x0,-0x20(%rbp)
jne    1685 <main+0x365>
mov    0x2945(%rip),%rax
mov    (%rax),%edi
mov    0x2944(%rip),%rax
mov    (%rax),%rdx
lea    0xaaa(%rip),%rsi
call   1100 <fprintf@plt>
mov    $0x1,%edi
call   1210 <exit@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x9c(%rbp)
jmp    17be <main+0x49e>
mov    0x2913(%rip),%rax
mov    (%rax),%rdi
call   1120 <getgrnam@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1736 <main+0x416>
mov    0x28f5(%rip),%rax
mov    (%rax),%rdi
lea    -0xe0(%rbp),%rsi
mov    $0xa,%edx
call   11e0 <strtoul@plt>
mov    %eax,-0xa0(%rbp)
mov    -0xe0(%rbp),%rax
mov    %rax,-0x148(%rbp)
mov    0x28c6(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x150(%rbp)
mov    0x28b5(%rip),%rax
mov    (%rax),%rdi
call   1060 <strlen@plt>
mov    -0x150(%rbp),%rcx
mov    %eax,%edx
mov    -0x148(%rbp),%rax
movslq %edx,%rdx
add    %rdx,%rcx
cmp    %rcx,%rax
jne    1731 <main+0x411>
mov    -0xa0(%rbp),%edi
call   10a0 <getgrgid@plt>
mov    %rax,-0x28(%rbp)
jmp    1736 <main+0x416>
cmpq   $0x0,-0x28(%rbp)
jne    176a <main+0x44a>
mov    0x2860(%rip),%rax
mov    (%rax),%edi
mov    0x285f(%rip),%rax
mov    (%rax),%rdx
lea    0x9d4(%rip),%rsi
call   1100 <fprintf@plt>
mov    $0x1,%edi
call   1210 <exit@plt>
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xa4(%rbp)
jmp    17be <main+0x49e>
movl   $0x1,-0xa8(%rbp)
jmp    17be <main+0x49e>
movl   $0x1,-0xac(%rbp)
jmp    17be <main+0x49e>
movl   $0x1,-0xb0(%rbp)
jmp    17be <main+0x49e>
movl   $0x1,-0xb4(%rbp)
jmp    17be <main+0x49e>
mov    $0x0,%al
call   1160 <usage@plt>
jmp    13ef <main+0xcf>
cmpq   $0x0,-0x78(%rbp)
je     17d9 <main+0x4b9>
cmpq   $0x0,-0x80(%rbp)
jne    17e0 <main+0x4c0>
mov    $0x0,%al
call   1160 <usage@plt>
cmpl   $0xfffffffd,-0x94(%rbp)
jne    17fb <main+0x4db>
mov    -0x40(%rbp),%eax
and    $0xfff,%eax
mov    %eax,-0x94(%rbp)
cmpl   $0xfffffffd,-0x9c(%rbp)
jne    1811 <main+0x4f1>
mov    -0x3c(%rbp),%eax
mov    %eax,-0x9c(%rbp)
cmpl   $0xfffffffd,-0xa4(%rbp)
jne    1827 <main+0x507>
mov    -0x38(%rbp),%eax
mov    %eax,-0xa4(%rbp)
mov    -0x128(%rbp),%rdi
mov    -0x80(%rbp),%rdx
mov    -0x78(%rbp),%rcx
lea    0x901(%rip),%rsi
call   1200 <sprintf@plt>
mov    -0x128(%rbp),%rdi
movl   $0x1,-0xb8(%rbp)
movl   $0x1,-0xbc(%rbp)
movl   $0x1,-0xc0(%rbp)
lea    -0x58(%rbp),%rsi
call   1110 <stat@plt>
cmp    $0xffffffff,%eax
je     1c2f <main+0x90f>
mov    -0x48(%rbp),%rax
cmp    -0x30(%rbp),%rax
jne    18b1 <main+0x591>
cmpl   $0x0,-0xb0(%rbp)
jne    18ac <main+0x58c>
movl   $0x0,-0xb8(%rbp)
lea    0x89f(%rip),%rax
mov    %rax,-0xd8(%rbp)
jmp    1bd2 <main+0x8b2>
mov    -0x48(%rbp),%rax
cmp    -0x30(%rbp),%rax
jle    18e9 <main+0x5c9>
cmpl   $0x0,-0xb0(%rbp)
jne    18e4 <main+0x5c4>
movl   $0x0,-0xb8(%rbp)
lea    0x88e(%rip),%rax
mov    %rax,-0xd8(%rbp)
jmp    1bcd <main+0x8ad>
mov    -0x48(%rbp),%rax
cmp    -0x30(%rbp),%rax
jge    1bc8 <main+0x8a8>
cmpl   $0x0,-0xa8(%rbp)
je     1a57 <main+0x737>
xor    %eax,%eax
call   1240 <fork@plt>
mov    %eax,-0xc4(%rbp)
mov    %eax,%ecx
mov    %ecx,-0x154(%rbp)
sub    $0xffffffff,%eax
je     193a <main+0x61a>
jmp    1927 <main+0x607>
mov    -0x154(%rbp),%eax
test   %eax,%eax
je     1950 <main+0x630>
jmp    19e9 <main+0x6c9>
lea    0x84b(%rip),%rdi
call   11c0 <perror@plt>
mov    $0x1,%edi
call   1210 <exit@plt>
mov    0x2681(%rip),%rax
mov    (%rax),%esi
lea    0x831(%rip),%rdi
mov    $0x0,%al
call   11b0 <open@plt>
mov    %eax,-0x10c(%rbp)
cmp    $0x0,%eax
jge    198c <main+0x66c>
lea    0x81e(%rip),%rdi
call   11c0 <perror@plt>
mov    $0x1,%edi
call   1210 <exit@plt>
mov    -0x10c(%rbp),%edi
mov    $0x1,%esi
call   1070 <dup2@plt>
mov    -0x10c(%rbp),%edi
mov    $0x2,%esi
call   1070 <dup2@plt>
mov    -0x128(%rbp),%rcx
mov    -0x78(%rbp),%rdx
lea    0x7e2(%rip),%rdi
lea    0x7e4(%rip),%rsi
xor    %eax,%eax
mov    %eax,%r8d
mov    $0x0,%al
call   1230 <execl@plt>
cmp    $0x0,%eax
jge    19e4 <main+0x6c4>
mov    $0x1,%edi
call   1210 <exit@plt>
jmp    19e9 <main+0x6c9>
mov    -0xc4(%rbp),%edi
lea    -0xc8(%rbp),%rsi
xor    %edx,%edx
call   11a0 <waitpid@plt>
mov    %eax,-0xcc(%rbp)
cmpl   $0xffffffff,-0xcc(%rbp)
je     1a52 <main+0x732>
mov    -0xc8(%rbp),%edi
call   11f0 <WIFEXITED@plt>
cmp    $0x0,%rax
je     1a52 <main+0x732>
mov    -0xc8(%rbp),%edi
call   1180 <WEXITSTATUS@plt>
cmp    $0x0,%rax
jne    1a52 <main+0x732>
movl   $0x0,-0xb8(%rbp)
lea    0x762(%rip),%rax
mov    %rax,-0xd8(%rbp)
jmp    1bc3 <main+0x8a3>
cmpl   $0x0,-0xac(%rbp)
je     1bbe <main+0x89e>
xor    %eax,%eax
call   1240 <fork@plt>
mov    %eax,-0xc4(%rbp)
mov    %eax,%ecx
mov    %ecx,-0x158(%rbp)
sub    $0xffffffff,%eax
je     1a9a <main+0x77a>
jmp    1a87 <main+0x767>
mov    -0x158(%rbp),%eax
test   %eax,%eax
je     1ab0 <main+0x790>
jmp    1b50 <main+0x830>
lea    0x6eb(%rip),%rdi
call   11c0 <perror@plt>
mov    $0x1,%edi
call   1210 <exit@plt>
mov    0x2521(%rip),%rax
mov    (%rax),%esi
lea    0x6d1(%rip),%rdi
mov    $0x0,%al
call   11b0 <open@plt>
mov    %eax,-0x10c(%rbp)
cmp    $0x0,%eax
jge    1aec <main+0x7cc>
lea    0x6be(%rip),%rdi
call   11c0 <perror@plt>
mov    $0x1,%edi
call   1210 <exit@plt>
mov    -0x10c(%rbp),%edi
mov    $0x1,%esi
call   1070 <dup2@plt>
mov    -0x10c(%rbp),%edi
mov    $0x2,%esi
call   1070 <dup2@plt>
mov    -0x128(%rbp),%r8
mov    -0x78(%rbp),%rcx
lea    0x6ba(%rip),%rdi
lea    0x6bc(%rip),%rsi
lea    0x6ba(%rip),%rdx
xor    %eax,%eax
mov    %eax,%r9d
mov    $0x0,%al
call   1230 <execl@plt>
cmp    $0x0,%eax
jge    1b4b <main+0x82b>
mov    $0x1,%edi
call   1210 <exit@plt>
jmp    1b50 <main+0x830>
mov    -0xc4(%rbp),%edi
lea    -0xc8(%rbp),%rsi
xor    %edx,%edx
call   11a0 <waitpid@plt>
mov    %eax,-0xcc(%rbp)
cmpl   $0xffffffff,-0xcc(%rbp)
je     1bb9 <main+0x899>
mov    -0xc8(%rbp),%edi
call   11f0 <WIFEXITED@plt>
cmp    $0x0,%rax
je     1bb9 <main+0x899>
mov    -0xc8(%rbp),%edi
call   1180 <WEXITSTATUS@plt>
cmp    $0x0,%rax
jne    1bb9 <main+0x899>
movl   $0x0,-0xb8(%rbp)
lea    0x637(%rip),%rax
mov    %rax,-0xd8(%rbp)
jmp    1bbe <main+0x89e>
jmp    1bc3 <main+0x8a3>
jmp    1bc8 <main+0x8a8>
jmp    1bcd <main+0x8ad>
jmp    1bd2 <main+0x8b2>
cmpl   $0x0,-0xb8(%rbp)
jne    1c2a <main+0x90a>
mov    -0x54(%rbp),%eax
cmp    -0x9c(%rbp),%eax
jne    1c07 <main+0x8e7>
mov    -0x50(%rbp),%eax
cmp    -0xa4(%rbp),%eax
jne    1c07 <main+0x8e7>
movl   $0x0,-0xc0(%rbp)
mov    -0x58(%rbp),%eax
and    $0xfff,%eax
cmp    -0x94(%rbp),%eax
jne    1c25 <main+0x905>
movl   $0x0,-0xbc(%rbp)
jmp    1c2a <main+0x90a>
jmp    1c2f <main+0x90f>
cmpl   $0x0,-0xb8(%rbp)
jne    1c7f <main+0x95f>
cmpl   $0x0,-0xb4(%rbp)
je     1c66 <main+0x946>
mov    -0xd8(%rbp),%rdi
lea    0x514(%rip),%rsi
call   10e0 <strcmp@plt>
cmp    $0x0,%rax
jne    1c7f <main+0x95f>
mov    -0x78(%rbp),%rsi
mov    -0xd8(%rbp),%rdx
lea    0x5a0(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
cmpl   $0x0,-0xb4(%rbp)
je     1cae <main+0x98e>
cmpl   $0x0,-0xb8(%rbp)
je     1cae <main+0x98e>
mov    -0x128(%rbp),%rsi
lea    0x584(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
cmpl   $0x0,-0xb8(%rbp)
je     1eaa <main+0xb8a>
mov    -0x128(%rbp),%rdi
mov    0x232f(%rip),%rax
mov    (%rax),%esi
mov    0x231e(%rip),%rax
or     (%rax),%esi
mov    0x22b5(%rip),%rax
or     (%rax),%esi
mov    -0x94(%rbp),%edx
mov    $0x0,%al
call   11b0 <open@plt>
mov    %eax,-0x104(%rbp)
cmp    $0xffffffff,%eax
jne    1d0f <main+0x9ef>
mov    -0x128(%rbp),%rdi
call   11c0 <perror@plt>
mov    $0x1,%edi
call   1210 <exit@plt>
mov    -0x78(%rbp),%rdi
mov    0x22b6(%rip),%rax
mov    (%rax),%esi
mov    $0x0,%al
call   11b0 <open@plt>
mov    %eax,-0x108(%rbp)
cmp    $0xffffffff,%eax
jne    1d45 <main+0xa25>
mov    -0x78(%rbp),%rdi
call   11c0 <perror@plt>
mov    $0x1,%edi
call   1210 <exit@plt>
jmp    1d4a <main+0xa2a>
mov    -0x120(%rbp),%rsi
mov    -0x108(%rbp),%edi
mov    0x2242(%rip),%rax
mov    (%rax),%edx
call   10c0 <read@plt>
mov    %eax,-0xcc(%rbp)
cmp    $0x0,%eax
jle    1dbc <main+0xa9c>
mov    -0x120(%rbp),%rsi
mov    -0x104(%rbp),%edi
mov    -0xcc(%rbp),%edx
call   1040 <write@plt>
cmp    $0xffffffff,%eax
jne    1db7 <main+0xa97>
mov    -0x128(%rbp),%rdi
call   11c0 <perror@plt>
mov    -0x128(%rbp),%rdi
call   1030 <unlink@plt>
mov    $0x1,%edi
call   1210 <exit@plt>
jmp    1d4a <main+0xa2a>
mov    -0x108(%rbp),%edi
call   10b0 <close@plt>
cmp    $0x0,%rax
jge    1ddd <main+0xabd>
lea    0x462(%rip),%rdi
call   11c0 <perror@plt>
mov    -0x104(%rbp),%edi
call   1190 <fsync@plt>
cmp    $0x0,%rax
jge    1e14 <main+0xaf4>
lea    0x447(%rip),%rdi
call   11c0 <perror@plt>
mov    -0x128(%rbp),%rdi
call   1030 <unlink@plt>
mov    $0x1,%edi
call   1210 <exit@plt>
mov    -0x104(%rbp),%edi
call   10b0 <close@plt>
cmp    $0x0,%rax
jge    1e4b <main+0xb2b>
lea    0x40a(%rip),%rdi
call   11c0 <perror@plt>
mov    -0x128(%rbp),%rdi
call   1030 <unlink@plt>
mov    $0x1,%edi
call   1210 <exit@plt>
mov    -0x128(%rbp),%rdi
mov    -0x30(%rbp),%rax
mov    %rax,-0x100(%rbp)
movq   $0x0,-0xf8(%rbp)
mov    -0x100(%rbp),%rax
mov    %rax,-0xf0(%rbp)
mov    -0xf8(%rbp),%rax
mov    %rax,-0xe8(%rbp)
lea    -0x100(%rbp),%rsi
call   10d0 <utimes@plt>
cmp    $0xffffffff,%eax
jne    1ea5 <main+0xb85>
mov    -0x128(%rbp),%rdi
call   11c0 <perror@plt>
jmp    1eaa <main+0xb8a>
cmpl   $0x0,-0xc0(%rbp)
je     1ee9 <main+0xbc9>
mov    -0x128(%rbp),%rdi
mov    -0x9c(%rbp),%esi
mov    -0xa4(%rbp),%edx
call   1150 <chown@plt>
cmp    $0xffffffff,%eax
jne    1ee4 <main+0xbc4>
mov    -0x128(%rbp),%rdi
call   11c0 <perror@plt>
jmp    1ee9 <main+0xbc9>
cmpl   $0x0,-0xbc(%rbp)
je     1f22 <main+0xc02>
mov    -0x128(%rbp),%rdi
mov    -0x94(%rbp),%esi
call   1170 <chmod@plt>
cmp    $0xffffffff,%eax
jne    1f1d <main+0xbfd>
mov    -0x128(%rbp),%rdi
call   11c0 <perror@plt>
jmp    1f22 <main+0xc02>
xor    %edi,%edi
call   1210 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xb8,%rsp
mov    0x2c85(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%r13
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r13
mov    %r13,%rsp
movl   $0xfffffffd,-0x2c(%rbp)
mov    0x2c44(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%r15
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r15
mov    %r15,%rsp
lea    0xd4e(%rip),%rdx
mov    %edi,-0x70(%rbp)
mov    %rsi,%r12
call   11d0 <getopt@plt>
mov    0x2c40(%rip),%rcx
cmp    (%rcx),%eax
mov    %r13,-0x78(%rbp)
mov    $0xfffffffd,%r14d
jne    13cd <main+0xad>
xor    %ecx,%ecx
movl   $0x0,-0x48(%rbp)
movl   $0x0,-0x44(%rbp)
movl   $0x0,-0x4c(%rbp)
xor    %ebx,%ebx
xor    %eax,%eax
mov    %rax,-0x58(%rbp)
mov    $0xfffffffd,%r12d
mov    %rcx,%r13
xor    %eax,%eax
call   1160 <usage@plt>
mov    %r13,%rcx
jmp    1627 <main+0x307>
xor    %ecx,%ecx
mov    %rcx,-0x40(%rbp)
movl   $0x0,-0x48(%rbp)
movl   $0x0,-0x44(%rbp)
movl   $0x0,-0x4c(%rbp)
xor    %ebx,%ebx
xor    %ecx,%ecx
mov    %rcx,-0x58(%rbp)
movl   $0xfffffffd,-0x38(%rbp)
jmp    1424 <main+0x104>
movl   $0x1,-0x48(%rbp)
mov    %r13d,%ebx
mov    -0x70(%rbp),%edi
mov    %r12,%rsi
lea    0xcb4(%rip),%rdx
call   11d0 <getopt@plt>
mov    0x2bac(%rip),%rcx
cmp    (%rcx),%eax
je     160b <main+0x2eb>
mov    %ebx,%r13d
add    $0xffffffbd,%eax
cmp    $0x30,%eax
ja     15ff <main+0x2df>
mov    $0x1,%ebx
lea    0xbc1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4c(%rbp)
jmp    1400 <main+0xe0>
mov    0x2b58(%rip),%rax
mov    (%rax),%rdi
call   1220 <strdup@plt>
mov    %rax,-0x58(%rbp)
mov    %rax,%rdi
lea    -0xe0(%rbp),%rsi
call   1110 <stat@plt>
cmp    $0xffffffff,%eax
je     1a75 <main+0x755>
mov    -0xe0(%rbp),%edi
call   1090 <S_ISDIR@plt>
test   %eax,%eax
jne    1400 <main+0xe0>
jmp    1a8e <main+0x76e>
mov    0x2b15(%rip),%rax
mov    (%rax),%rdi
lea    0xc6a(%rip),%rsi
lea    -0x2c(%rbp),%rdx
call   1140 <sscanf@plt>
cmp    $0x1,%eax
jne    1aa4 <main+0x784>
cmpl   $0x1000,-0x2c(%rbp)
mov    %r13d,%ebx
jl     1403 <main+0xe3>
jmp    1aa4 <main+0x784>
movl   $0x1,-0x44(%rbp)
jmp    1400 <main+0xe0>
mov    0x2ad1(%rip),%rax
mov    (%rax),%rdi
call   1120 <getgrnam@plt>
test   %rax,%rax
jne    1538 <main+0x218>
mov    0x2abd(%rip),%r14
mov    (%r14),%rdi
lea    -0x68(%rbp),%rsi
mov    $0xa,%edx
call   11e0 <strtoul@plt>
mov    %eax,%ebx
mov    -0x68(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    (%r14),%r14
mov    %r14,%rdi
call   1060 <strlen@plt>
cltq
add    %r14,%rax
cmp    %rax,-0x60(%rbp)
jne    1ae8 <main+0x7c8>
mov    %ebx,%edi
call   10a0 <getgrgid@plt>
test   %rax,%rax
je     1ae8 <main+0x7c8>
mov    (%rax),%r14d
jmp    1400 <main+0xe0>
mov    0x2a69(%rip),%rax
mov    (%rax),%rdi
call   10f0 <getpwnam@plt>
test   %rax,%rax
jne    15af <main+0x28f>
mov    0x2a55(%rip),%rax
mov    (%rax),%rdi
lea    -0x68(%rbp),%rsi
mov    $0xa,%edx
call   11e0 <strtoul@plt>
mov    %eax,%ebx
mov    -0x68(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    %r14d,-0x60(%rbp)
mov    0x2a2f(%rip),%rax
mov    (%rax),%r14
mov    %r14,%rdi
call   1060 <strlen@plt>
cltq
add    %r14,%rax
mov    -0x60(%rbp),%r14d
cmp    %rax,-0x38(%rbp)
jne    1b04 <main+0x7e4>
mov    %ebx,%edi
call   1050 <getpwuid@plt>
test   %rax,%rax
je     1b04 <main+0x7e4>
mov    (%rax),%eax
mov    %eax,-0x38(%rbp)
jmp    1400 <main+0xe0>
mov    0x29f0(%rip),%rax
mov    (%rax),%rdi
call   1220 <strdup@plt>
mov    %rax,-0x40(%rbp)
mov    %rax,%rdi
lea    -0x90(%rbp),%rsi
call   1110 <stat@plt>
cmp    $0xffffffff,%eax
je     1ac0 <main+0x7a0>
mov    -0x90(%rbp),%edi
mov    %edi,-0x6c(%rbp)
call   1130 <S_ISREG@plt>
test   %eax,%eax
jne    1400 <main+0xe0>
jmp    1ad2 <main+0x7b2>
xor    %eax,%eax
call   1160 <usage@plt>
jmp    1400 <main+0xe0>
mov    -0x40(%rbp),%rcx
test   %rcx,%rcx
je     18e6 <main+0x5c6>
cmpq   $0x0,-0x58(%rbp)
mov    -0x38(%rbp),%r12d
je     13bb <main+0x9b>
cmpl   $0xfffffffd,-0x2c(%rbp)
jne    1638 <main+0x318>
mov    -0x6c(%rbp),%eax
and    $0xfff,%eax
mov    %eax,-0x2c(%rbp)
mov    %r12d,%r13d
cmp    $0xfffffffd,%r12d
jne    1648 <main+0x328>
mov    -0x8c(%rbp),%r13d
cmp    $0xfffffffd,%r14d
mov    -0x78(%rbp),%r12
jne    1659 <main+0x339>
mov    -0x88(%rbp),%r14d
lea    0xade(%rip),%rsi
mov    %r12,%rdi
mov    -0x58(%rbp),%rdx
mov    %rcx,-0x40(%rbp)
call   1200 <sprintf@plt>
lea    -0xc8(%rbp),%rsi
mov    %r12,%rdi
call   1110 <stat@plt>
cmp    $0xffffffff,%eax
mov    %r13d,-0x38(%rbp)
jne    180f <main+0x4ef>
mov    %r14d,-0x60(%rbp)
cmpl   $0x0,-0x48(%rbp)
je     16a7 <main+0x387>
lea    0xb8e(%rip),%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x294a(%rip),%rax
mov    0x293b(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x28d0(%rip),%rax
or     (%rax),%esi
mov    -0x2c(%rbp),%edx
mov    %r12,%rdi
xor    %eax,%eax
call   11b0 <open@plt>
cmp    $0xffffffff,%eax
je     1b2d <main+0x80d>
mov    %eax,%r14d
mov    0x28ee(%rip),%rax
mov    (%rax),%esi
mov    -0x40(%rbp),%r13
mov    %r13,%rdi
xor    %eax,%eax
call   11b0 <open@plt>
cmp    $0xffffffff,%eax
je     1b32 <main+0x812>
mov    %eax,%ebx
nopl   (%rax)
mov    0x2899(%rip),%rax
mov    (%rax),%edx
mov    %ebx,%edi
mov    %r15,%rsi
call   10c0 <read@plt>
test   %eax,%eax
jle    1743 <main+0x423>
mov    %r14d,%edi
mov    %r15,%rsi
mov    %eax,%edx
call   1040 <write@plt>
cmp    $0xffffffff,%eax
jne    1700 <main+0x3e0>
mov    %r12,%rdi
call   11c0 <perror@plt>
mov    %r12,%rdi
call   1030 <unlink@plt>
mov    $0x1,%edi
call   1210 <exit@plt>
mov    %ebx,%edi
call   10b0 <close@plt>
test   %rax,%rax
jns    175b <main+0x43b>
lea    0xae4(%rip),%rdi
call   11c0 <perror@plt>
mov    %r14d,%edi
call   1190 <fsync@plt>
test   %rax,%rax
js     1b44 <main+0x824>
mov    %r14d,%edi
call   10b0 <close@plt>
test   %rax,%rax
js     1b50 <main+0x830>
mov    -0x80(%rbp),%rax
mov    %rax,-0xb0(%rbp)
movq   $0x0,-0xa8(%rbp)
mov    -0xb0(%rbp),%rax
mov    %rax,-0xa0(%rbp)
mov    -0xa8(%rbp),%rax
mov    %rax,-0x98(%rbp)
lea    -0xb0(%rbp),%rsi
mov    %r12,%rdi
call   10d0 <utimes@plt>
cmp    $0xffffffff,%eax
mov    -0x60(%rbp),%ebx
jne    17ce <main+0x4ae>
mov    %r12,%rdi
call   11c0 <perror@plt>
xor    %r13d,%r13d
mov    %r12,%rdi
mov    -0x38(%rbp),%esi
mov    %ebx,%edx
call   1150 <chown@plt>
cmp    $0xffffffff,%eax
jne    17eb <main+0x4cb>
mov    %r12,%rdi
call   11c0 <perror@plt>
test   %r13b,%r13b
jne    1808 <main+0x4e8>
mov    -0x2c(%rbp),%esi
mov    %r12,%rdi
call   1170 <chmod@plt>
cmp    $0xffffffff,%eax
jne    1808 <main+0x4e8>
mov    %r12,%rdi
call   11c0 <perror@plt>
xor    %edi,%edi
call   1210 <exit@plt>
mov    -0xb8(%rbp),%rax
mov    -0x80(%rbp),%rcx
cmp    %rcx,%rax
jne    1835 <main+0x515>
cmpl   $0x0,-0x44(%rbp)
jne    168c <main+0x36c>
mov    %r14d,%ebx
lea    0x911(%rip),%r14
jmp    184b <main+0x52b>
jle    18b1 <main+0x591>
cmpl   $0x0,-0x44(%rbp)
jne    168c <main+0x36c>
mov    %r14d,%ebx
lea    0x920(%rip),%r14
mov    -0xc4(%rbp),%eax
xor    %r13d,%eax
mov    -0xc0(%rbp),%ecx
xor    %ebx,%ecx
or     %eax,%ecx
sete   %r15b
mov    $0xfff,%eax
and    -0xc8(%rbp),%eax
cmp    -0x2c(%rbp),%eax
sete   %r13b
cmpl   $0x0,-0x48(%rbp)
je     188e <main+0x56e>
lea    0x8ea(%rip),%rsi
mov    %r14,%rdi
call   10e0 <strcmp@plt>
test   %rax,%rax
jne    18a3 <main+0x583>
lea    0x983(%rip),%rdi
mov    -0x40(%rbp),%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1080 <printf@plt>
test   %r15b,%r15b
je     17d1 <main+0x4b1>
jmp    17eb <main+0x4cb>
jge    168c <main+0x36c>
test   %ebx,%ebx
jne    18ef <main+0x5cf>
cmpl   $0x0,-0x4c(%rbp)
je     168c <main+0x36c>
mov    %r14d,%ebx
xor    %eax,%eax
call   1240 <fork@plt>
mov    %eax,%r14d
test   %eax,%eax
je     19c0 <main+0x6a0>
cmp    $0xffffffff,%r14d
jne    1a2d <main+0x70d>
jmp    1906 <main+0x5e6>
mov    -0x38(%rbp),%r12d
jmp    13bb <main+0x9b>
mov    %r14d,%ebx
xor    %eax,%eax
call   1240 <fork@plt>
mov    %eax,%r14d
test   %eax,%eax
je     1912 <main+0x5f2>
cmp    $0xffffffff,%r14d
jne    1978 <main+0x658>
lea    0x87f(%rip),%rdi
jmp    1b35 <main+0x815>
mov    0x26bf(%rip),%rax
mov    (%rax),%esi
lea    0x86f(%rip),%rdi
xor    %eax,%eax
call   11b0 <open@plt>
test   %eax,%eax
js     1b5c <main+0x83c>
mov    %eax,%r13d
mov    %eax,%edi
mov    $0x1,%esi
call   1070 <dup2@plt>
mov    %r13d,%edi
mov    $0x2,%esi
call   1070 <dup2@plt>
lea    0x84c(%rip),%rdi
lea    0x84e(%rip),%rsi
mov    -0x40(%rbp),%rdx
mov    %r12,%rcx
xor    %r8d,%r8d
xor    %eax,%eax
call   1230 <execl@plt>
test   %eax,%eax
mov    -0x38(%rbp),%r13d
js     1b65 <main+0x845>
lea    -0x30(%rbp),%rsi
mov    %r14d,%edi
xor    %edx,%edx
call   11a0 <waitpid@plt>
cmp    $0xffffffff,%eax
mov    %ebx,%r14d
je     168c <main+0x36c>
mov    -0x30(%rbp),%edi
call   11f0 <WIFEXITED@plt>
test   %rax,%rax
je     168c <main+0x36c>
mov    -0x30(%rbp),%edi
call   1180 <WEXITSTATUS@plt>
test   %rax,%rax
jne    168c <main+0x36c>
lea    0x7f2(%rip),%r14
jmp    184b <main+0x52b>
mov    0x2611(%rip),%rax
mov    (%rax),%esi
lea    0x7c1(%rip),%rdi
xor    %eax,%eax
call   11b0 <open@plt>
test   %eax,%eax
js     1b5c <main+0x83c>
mov    %eax,%r13d
mov    %eax,%edi
mov    $0x1,%esi
call   1070 <dup2@plt>
mov    %r13d,%edi
mov    $0x2,%esi
call   1070 <dup2@plt>
lea    0x7d6(%rip),%rdi
lea    0x7d8(%rip),%rsi
lea    0x7d6(%rip),%rdx
mov    -0x40(%rbp),%rcx
mov    %r12,%r8
xor    %r9d,%r9d
xor    %eax,%eax
call   1230 <execl@plt>
test   %eax,%eax
mov    -0x38(%rbp),%r13d
js     1b65 <main+0x845>
lea    -0x30(%rbp),%rsi
mov    %r14d,%edi
xor    %edx,%edx
call   11a0 <waitpid@plt>
cmp    $0xffffffff,%eax
mov    %ebx,%r14d
je     168c <main+0x36c>
mov    -0x30(%rbp),%edi
call   11f0 <WIFEXITED@plt>
test   %rax,%rax
je     168c <main+0x36c>
mov    -0x30(%rbp),%edi
call   1180 <WEXITSTATUS@plt>
test   %rax,%rax
jne    168c <main+0x36c>
lea    0x779(%rip),%r14
jmp    184b <main+0x52b>
mov    0x252c(%rip),%rax
mov    (%rax),%edi
lea    0x64e(%rip),%rsi
mov    -0x58(%rbp),%rdx
jmp    1b1e <main+0x7fe>
mov    0x2513(%rip),%rax
mov    (%rax),%edi
lea    0x65d(%rip),%rsi
mov    -0x58(%rbp),%rdx
jmp    1b1e <main+0x7fe>
mov    0x24fd(%rip),%rax
mov    (%rax),%edi
mov    0x24fc(%rip),%rax
mov    (%rax),%rdx
lea    0x654(%rip),%rsi
jmp    1b1e <main+0x7fe>
mov    0x24e1(%rip),%rax
mov    (%rax),%edi
lea    0x603(%rip),%rsi
jmp    1ae2 <main+0x7c2>
mov    0x24cf(%rip),%rax
mov    (%rax),%edi
lea    0x604(%rip),%rsi
mov    -0x40(%rbp),%rdx
jmp    1b1e <main+0x7fe>
mov    0x24b9(%rip),%rax
mov    (%rax),%edi
mov    0x24b8(%rip),%rax
mov    (%rax),%rdx
lea    0x62d(%rip),%rsi
jmp    1b1e <main+0x7fe>
mov    0x249d(%rip),%rax
mov    (%rax),%edi
mov    0x249c(%rip),%rax
mov    (%rax),%rdx
lea    0x602(%rip),%rsi
call   1100 <fprintf@plt>
mov    $0x1,%edi
call   1210 <exit@plt>
mov    %r12,%rdi
jmp    1b35 <main+0x815>
mov    %r13,%rdi
call   11c0 <perror@plt>
mov    $0x1,%edi
call   1210 <exit@plt>
lea    0x6f5(%rip),%rdi
jmp    172c <main+0x40c>
lea    0x6e3(%rip),%rdi
jmp    172c <main+0x40c>
lea    0x638(%rip),%rdi
jmp    1b35 <main+0x815>
mov    $0x1,%edi
call   1210 <exit@plt>

LLVM IR (-O0):
%struct.passwd = type { i32 }
%struct.group = type { i32 }
%struct.stat = type { i32, i32, i32, i64 }
%struct.timeval = type { i64, i64 }
@MAXPATHLEN = global i32 0
@BUFSIZ = global i32 0
@.str = [15 x i8] c"s:d:m:o:g:cCfq\00"
@EOF = global i32 0
@optarg = external global i8*
@stderr = global i32 0
@.str.1 = [19 x i8] c"%s does not exist\0A\00"
@.str.2 = [21 x i8] c"%s not a plain file\0A\00"
@.str.3 = [20 x i8] c"%s not a directory\0A\00"
@.str.4 = [3 x i8] c"%o\00"
@.str.5 = [14 x i8] c"bad mode: %s\0A\00"
@.str.6 = [15 x i8] c"bad owner: %s\0A\00"
@.str.7 = [15 x i8] c"bad group: %s\0A\00"
@.str.8 = [6 x i8] c"%s/%s\00"
@.str.9 = [39 x i8] c"source and destination have same mtime\00"
@.str.10 = [33 x i8] c"destination is newer than source\00"
@.str.11 = [5 x i8] c"fork\00"
@.str.12 = [10 x i8] c"/dev/null\00"
@O_RDWR = global i32 0
@.str.13 = [5 x i8] c"open\00"
@.str.14 = [13 x i8] c"/usr/bin/cmp\00"
@.str.15 = [4 x i8] c"cmp\00"
@.str.16 = [43 x i8] c"source and destination are identical (cmp)\00"
@.str.17 = [14 x i8] c"/usr/bin/diff\00"
@.str.18 = [5 x i8] c"diff\00"
@.str.19 = [3 x i8] c"-b\00"
@.str.20 = [47 x i8] c"source and destination are identical (diff -b)\00"
@.str.21 = [19 x i8] c"%s not copied: %s\0A\00"
@.str.22 = [15 x i8] c"installing %s\0A\00"
@O_CREAT = global i32 0
@O_TRUNC = global i32 0
@O_WRONLY = global i32 0
@O_RDONLY = global i32 0
@.str.23 = [6 x i8] c"close\00"
@.str.24 = [6 x i8] c"fsync\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca %struct.passwd*
%8 = alloca %struct.group*
%9 = alloca %struct.stat
%10 = alloca %struct.stat
%11 = alloca %struct.stat
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i64
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32
%27 = alloca i32
%28 = alloca i32
%29 = alloca i32
%30 = alloca i32
%31 = alloca i8*
%32 = alloca i8*
%33 = alloca [2 x %struct.timeval]
%34 = alloca i32
%35 = alloca i32
%36 = alloca i32
%37 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %12
store i8* null, i8** %13
%38 = load i32, i32* @MAXPATHLEN
%39 = zext i32 %38 to i64
%40 = call i8* @llvm.stacksave()
store i8* %40, i8** %14
%41 = alloca i8, i64 %39
store i64 %39, i64* %15
store i32 -3, i32* %16
store i32 -3, i32* %18
store i32 -3, i32* %20
store i32 0, i32* %21
store i32 0, i32* %22
store i32 0, i32* %23
store i32 0, i32* %24
%42 = load i32, i32* @BUFSIZ
%43 = zext i32 %42 to i64
%44 = alloca i8, i64 %43
store i64 %43, i64* %37
br label %45
45: ; preds = %178, %2
%46 = load i32, i32* %4
%47 = load i8**, i8*** %5
%48 = call i32 @getopt(i32 %46, i8** %47, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store i32 %48, i32* %6
%49 = load i32, i32* @EOF
%50 = icmp ne i32 %48, %49
br i1 %50, label %51, label %179
51: ; preds = %45
%52 = load i32, i32* %6
switch i32 %52, label %176 [
i32 115, label %53
i32 100, label %75
i32 109, label %97
i32 111, label %110
i32 103, label %141
i32 99, label %172
i32 67, label %173
i32 102, label %174
i32 113, label %175
]
53: ; preds = %51
%54 = load i8*, i8** @optarg
%55 = call i8* @strdup(i8* %54)
store i8* %55, i8** %12
%56 = load i8*, i8** %12
%57 = call i32 @stat(i8* %56, %struct.stat* %9)
%58 = icmp eq i32 %57, -1
br i1 %58, label %59, label %64
59: ; preds = %53
%60 = load i32, i32* @stderr
%61 = load i8*, i8** %12
%62 = call i32 @fprintf(i32 %60, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %61)
%63 = call i32 @exit(i32 1)
unreachable
64: ; preds = %53
%65 = getelementptr inbounds %struct.stat, %struct.stat* %9, i32 0, i32 0
%66 = load i32, i32* %65
%67 = call i32 @S_ISREG(i32 %66)
%68 = icmp ne i32 %67, 0
br i1 %68, label %74, label %69
69: ; preds = %64
%70 = load i32, i32* @stderr
%71 = load i8*, i8** %12
%72 = call i32 @fprintf(i32 %70, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i8* %71)
%73 = call i32 @exit(i32 1)
unreachable
74: ; preds = %64
br label %178
75: ; preds = %51
%76 = load i8*, i8** @optarg
%77 = call i8* @strdup(i8* %76)
store i8* %77, i8** %13
%78 = load i8*, i8** %13
%79 = call i32 @stat(i8* %78, %struct.stat* %11)
%80 = icmp eq i32 %79, -1
br i1 %80, label %81, label %86
81: ; preds = %75
%82 = load i32, i32* @stderr
%83 = load i8*, i8** %13
%84 = call i32 @fprintf(i32 %82, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %83)
%85 = call i32 @exit(i32 1)
unreachable
86: ; preds = %75
%87 = getelementptr inbounds %struct.stat, %struct.stat* %11, i32 0, i32 0
%88 = load i32, i32* %87
%89 = call i32 @S_ISDIR(i32 %88)
%90 = icmp ne i32 %89, 0
br i1 %90, label %96, label %91
91: ; preds = %86
%92 = load i32, i32* @stderr
%93 = load i8*, i8** %13
%94 = call i32 @fprintf(i32 %92, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8* %93)
%95 = call i32 @exit(i32 1)
unreachable
96: ; preds = %86
br label %178
97: ; preds = %51
%98 = load i8*, i8** @optarg
%99 = call i32 @sscanf(i8* %98, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %16)
%100 = icmp ne i32 %99, 1
br i1 %100, label %104, label %101
101: ; preds = %97
%102 = load i32, i32* %16
%103 = icmp sgt i32 %102, 4095
br i1 %103, label %104, label %109
104: ; preds = %101, %97
%105 = load i32, i32* @stderr
%106 = load i8*, i8** @optarg
%107 = call i32 @fprintf(i32 %105, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i8* %106)
%108 = call i32 @exit(i32 1)
unreachable
109: ; preds = %101
br label %178
110: ; preds = %51
%111 = load i8*, i8** @optarg
%112 = call %struct.passwd* @getpwnam(i8* %111)
store %struct.passwd* %112, %struct.passwd** %7
%113 = load %struct.passwd*, %struct.passwd** %7
%114 = icmp ne %struct.passwd* %113, null
br i1 %114, label %129, label %115
115: ; preds = %110
%116 = load i8*, i8** @optarg
%117 = call i32 @strtoul(i8* %116, i8** %32, i32 10)
store i32 %117, i32* %17
%118 = load i8*, i8** %32
%119 = load i8*, i8** @optarg
%120 = load i8*, i8** @optarg
%121 = call i32 @strlen(i8* %120)
%122 = sext i32 %121 to i64
%123 = getelementptr inbounds i8, i8* %119, i64 %122
%124 = icmp eq i8* %118, %123
br i1 %124, label %125, label %128
125: ; preds = %115
%126 = load i32, i32* %17
%127 = call %struct.passwd* @getpwuid(i32 %126)
store %struct.passwd* %127, %struct.passwd** %7
br label %128
128: ; preds = %125, %115
br label %129
129: ; preds = %128, %110
%130 = load %struct.passwd*, %struct.passwd** %7
%131 = icmp ne %struct.passwd* %130, null
br i1 %131, label %137, label %132
132: ; preds = %129
%133 = load i32, i32* @stderr
%134 = load i8*, i8** @optarg
%135 = call i32 @fprintf(i32 %133, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), i8* %134)
%136 = call i32 @exit(i32 1)
unreachable
137: ; preds = %129
%138 = load %struct.passwd*, %struct.passwd** %7
%139 = getelementptr inbounds %struct.passwd, %struct.passwd* %138, i32 0, i32 0
%140 = load i32, i32* %139
store i32 %140, i32* %18
br label %178
141: ; preds = %51
%142 = load i8*, i8** @optarg
%143 = call %struct.group* @getgrnam(i8* %142)
store %struct.group* %143, %struct.group** %8
%144 = load %struct.group*, %struct.group** %8
%145 = icmp ne %struct.group* %144, null
br i1 %145, label %160, label %146
146: ; preds = %141
%147 = load i8*, i8** @optarg
%148 = call i32 @strtoul(i8* %147, i8** %32, i32 10)
store i32 %148, i32* %19
%149 = load i8*, i8** %32
%150 = load i8*, i8** @optarg
%151 = load i8*, i8** @optarg
%152 = call i32 @strlen(i8* %151)
%153 = sext i32 %152 to i64
%154 = getelementptr inbounds i8, i8* %150, i64 %153
%155 = icmp eq i8* %149, %154
br i1 %155, label %156, label %159
156: ; preds = %146
%157 = load i32, i32* %19
%158 = call %struct.group* @getgrgid(i32 %157)
store %struct.group* %158, %struct.group** %8
br label %159
159: ; preds = %156, %146
br label %160
160: ; preds = %159, %141
%161 = load %struct.group*, %struct.group** %8
%162 = icmp ne %struct.group* %161, null
br i1 %162, label %168, label %163
163: ; preds = %160
%164 = load i32, i32* @stderr
%165 = load i8*, i8** @optarg
%166 = call i32 @fprintf(i32 %164, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0), i8* %165)
%167 = call i32 @exit(i32 1)
unreachable
168: ; preds = %160
%169 = load %struct.group*, %struct.group** %8
%170 = getelementptr inbounds %struct.group, %struct.group* %169, i32 0, i32 0
%171 = load i32, i32* %170
store i32 %171, i32* %20
br label %178
172: ; preds = %51
store i32 1, i32* %21
br label %178
173: ; preds = %51
store i32 1, i32* %22
br label %178
174: ; preds = %51
store i32 1, i32* %23
br label %178
175: ; preds = %51
store i32 1, i32* %24
br label %178
176: ; preds = %51
%177 = call i32 (...) @usage()
br label %178
178: ; preds = %176, %175, %174, %173, %172, %168, %137, %109, %96, %74
br label %45
179: ; preds = %45
%180 = load i8*, i8** %12
%181 = icmp ne i8* %180, null
br i1 %181, label %182, label %185
182: ; preds = %179
%183 = load i8*, i8** %13
%184 = icmp ne i8* %183, null
br i1 %184, label %187, label %185
185: ; preds = %182, %179
%186 = call i32 (...) @usage()
br label %187
187: ; preds = %185, %182
%188 = load i32, i32* %16
%189 = icmp eq i32 %188, -3
br i1 %189, label %190, label %194
190: ; preds = %187
%191 = getelementptr inbounds %struct.stat, %struct.stat* %9, i32 0, i32 0
%192 = load i32, i32* %191
%193 = and i32 %192, 4095
store i32 %193, i32* %16
br label %194
194: ; preds = %190, %187
%195 = load i32, i32* %18
%196 = icmp eq i32 %195, -3
br i1 %196, label %197, label %200
197: ; preds = %194
%198 = getelementptr inbounds %struct.stat, %struct.stat* %9, i32 0, i32 1
%199 = load i32, i32* %198
store i32 %199, i32* %18
br label %200
200: ; preds = %197, %194
%201 = load i32, i32* %20
%202 = icmp eq i32 %201, -3
br i1 %202, label %203, label %206
203: ; preds = %200
%204 = getelementptr inbounds %struct.stat, %struct.stat* %9, i32 0, i32 2
%205 = load i32, i32* %204
store i32 %205, i32* %20
br label %206
206: ; preds = %203, %200
%207 = load i8*, i8** %13
%208 = load i8*, i8** %12
%209 = call i32 @sprintf(i8* %41, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i8* %207, i8* %208)
store i32 1, i32* %25
store i32 1, i32* %26
store i32 1, i32* %27
%210 = call i32 @stat(i8* %41, %struct.stat* %10)
%211 = icmp ne i32 %210, -1
br i1 %211, label %212, label %351
212: ; preds = %206
%213 = getelementptr inbounds %struct.stat, %struct.stat* %10, i32 0, i32 3
%214 = load i64, i64* %213
%215 = getelementptr inbounds %struct.stat, %struct.stat* %9, i32 0, i32 3
%216 = load i64, i64* %215
%217 = icmp eq i64 %214, %216
br i1 %217, label %218, label %223
218: ; preds = %212
%219 = load i32, i32* %23
%220 = icmp ne i32 %219, 0
br i1 %220, label %222, label %221
221: ; preds = %218
store i32 0, i32* %25
store i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.9, i64 0, i64 0), i8** %31
br label %222
222: ; preds = %221, %218
br label %328
223: ; preds = %212
%224 = getelementptr inbounds %struct.stat, %struct.stat* %10, i32 0, i32 3
%225 = load i64, i64* %224
%226 = getelementptr inbounds %struct.stat, %struct.stat* %9, i32 0, i32 3
%227 = load i64, i64* %226
%228 = icmp sgt i64 %225, %227
br i1 %228, label %229, label %234
229: ; preds = %223
%230 = load i32, i32* %23
%231 = icmp ne i32 %230, 0
br i1 %231, label %233, label %232
232: ; preds = %229
store i32 0, i32* %25
store i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.10, i64 0, i64 0), i8** %31
br label %233
233: ; preds = %232, %229
br label %327
234: ; preds = %223
%235 = getelementptr inbounds %struct.stat, %struct.stat* %10, i32 0, i32 3
%236 = load i64, i64* %235
%237 = getelementptr inbounds %struct.stat, %struct.stat* %9, i32 0, i32 3
%238 = load i64, i64* %237
%239 = icmp slt i64 %236, %238
br i1 %239, label %240, label %326
240: ; preds = %234
%241 = load i32, i32* %21
%242 = icmp ne i32 %241, 0
br i1 %242, label %243, label %282
243: ; preds = %240
%244 = call i32 (...) @fork()
store i32 %244, i32* %28
switch i32 %244, label %266 [
i32 -1, label %245
i32 0, label %248
]
245: ; preds = %243
%246 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
%247 = call i32 @exit(i32 1)
unreachable
248: ; preds = %243
%249 = load i32, i32* @O_RDWR
%250 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0), i32 %249)
store i32 %250, i32* %36
%251 = icmp slt i32 %250, 0
br i1 %251, label %252, label %255
252: ; preds = %248
%253 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0))
%254 = call i32 @exit(i32 1)
unreachable
255: ; preds = %248
%256 = load i32, i32* %36
%257 = call i32 @dup2(i32 %256, i32 1)
%258 = load i32, i32* %36
%259 = call i32 @dup2(i32 %258, i32 2)
%260 = load i8*, i8** %12
%261 = call i32 (i8*, i8*, i8*, i8*, i8*, ...) @execl(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i8* %260, i8* %41, i8* null)
%262 = icmp slt i32 %261, 0
br i1 %262, label %263, label %265
263: ; preds = %255
%264 = call i32 @exit(i32 1)
unreachable
265: ; preds = %255
br label %266
266: ; preds = %243, %265
%267 = load i32, i32* %28
%268 = call i32 @waitpid(i32 %267, i32* %29, i32 0)
store i32 %268, i32* %30
br label %269
269: ; preds = %266
%270 = load i32, i32* %30
%271 = icmp ne i32 %270, -1
br i1 %271, label %272, label %281
272: ; preds = %269
%273 = load i32, i32* %29
%274 = call i64 @WIFEXITED(i32 %273)
%275 = icmp ne i64 %274, 0
br i1 %275, label %276, label %281
276: ; preds = %272
%277 = load i32, i32* %29
%278 = call i64 @WEXITSTATUS(i32 %277)
%279 = icmp eq i64 %278, 0
br i1 %279, label %280, label %281
280: ; preds = %276
store i32 0, i32* %25
store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.16, i64 0, i64 0), i8** %31
br label %281
281: ; preds = %280, %276, %272, %269
br label %325
282: ; preds = %240
%283 = load i32, i32* %22
%284 = icmp ne i32 %283, 0
br i1 %284, label %285, label %324
285: ; preds = %282
%286 = call i32 (...) @fork()
store i32 %286, i32* %28
switch i32 %286, label %308 [
i32 -1, label %287
i32 0, label %290
]
287: ; preds = %285
%288 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
%289 = call i32 @exit(i32 1)
unreachable
290: ; preds = %285
%291 = load i32, i32* @O_RDWR
%292 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0), i32 %291)
store i32 %292, i32* %36
%293 = icmp slt i32 %292, 0
br i1 %293, label %294, label %297
294: ; preds = %290
%295 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0))
%296 = call i32 @exit(i32 1)
unreachable
297: ; preds = %290
%298 = load i32, i32* %36
%299 = call i32 @dup2(i32 %298, i32 1)
%300 = load i32, i32* %36
%301 = call i32 @dup2(i32 %300, i32 2)
%302 = load i8*, i8** %12
%303 = call i32 (i8*, i8*, i8*, i8*, i8*, ...) @execl(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.19, i64 0, i64 0), i8* %302, i8* %41, i8* null)
%304 = icmp slt i32 %303, 0
br i1 %304, label %305, label %307
305: ; preds = %297
%306 = call i32 @exit(i32 1)
unreachable
307: ; preds = %297
br label %308
308: ; preds = %285, %307
%309 = load i32, i32* %28
%310 = call i32 @waitpid(i32 %309, i32* %29, i32 0)
store i32 %310, i32* %30
br label %311
311: ; preds = %308
%312 = load i32, i32* %30
%313 = icmp ne i32 %312, -1
br i1 %313, label %314, label %323
314: ; preds = %311
%315 = load i32, i32* %29
%316 = call i64 @WIFEXITED(i32 %315)
%317 = icmp ne i64 %316, 0
br i1 %317, label %318, label %323
318: ; preds = %314
%319 = load i32, i32* %29
%320 = call i64 @WEXITSTATUS(i32 %319)
%321 = icmp eq i64 %320, 0
br i1 %321, label %322, label %323
322: ; preds = %318
store i32 0, i32* %25
store i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.20, i64 0, i64 0), i8** %31
br label %323
323: ; preds = %322, %318, %314, %311
br label %324
324: ; preds = %323, %282
br label %325
325: ; preds = %324, %281
br label %326
326: ; preds = %325, %234
br label %327
327: ; preds = %326, %233
br label %328
328: ; preds = %327, %222
%329 = load i32, i32* %25
%330 = icmp ne i32 %329, 0
br i1 %330, label %350, label %331
331: ; preds = %328
%332 = getelementptr inbounds %struct.stat, %struct.stat* %10, i32 0, i32 1
%333 = load i32, i32* %332
%334 = load i32, i32* %18
%335 = icmp eq i32 %333, %334
br i1 %335, label %336, label %342
336: ; preds = %331
%337 = getelementptr inbounds %struct.stat, %struct.stat* %10, i32 0, i32 2
%338 = load i32, i32* %337
%339 = load i32, i32* %20
%340 = icmp eq i32 %338, %339
br i1 %340, label %341, label %342
341: ; preds = %336
store i32 0, i32* %27
br label %342
342: ; preds = %341, %336, %331
%343 = getelementptr inbounds %struct.stat, %struct.stat* %10, i32 0, i32 0
%344 = load i32, i32* %343
%345 = and i32 %344, 4095
%346 = load i32, i32* %16
%347 = icmp eq i32 %345, %346
br i1 %347, label %348, label %349
348: ; preds = %342
store i32 0, i32* %26
br label %349
349: ; preds = %348, %342
br label %350
350: ; preds = %349, %328
br label %351
351: ; preds = %350, %206
%352 = load i32, i32* %25
%353 = icmp ne i32 %352, 0
br i1 %353, label %365, label %354
354: ; preds = %351
%355 = load i32, i32* %24
%356 = icmp ne i32 %355, 0
br i1 %356, label %357, label %361
357: ; preds = %354
%358 = load i8*, i8** %31
%359 = call i64 @strcmp(i8* %358, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.10, i64 0, i64 0))
%360 = icmp ne i64 %359, 0
br i1 %360, label %365, label %361
361: ; preds = %357, %354
%362 = load i8*, i8** %12
%363 = load i8*, i8** %31
%364 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.21, i64 0, i64 0), i8* %362, i8* %363)
br label %365
365: ; preds = %361, %357, %351
%366 = load i32, i32* %24
%367 = icmp ne i32 %366, 0
br i1 %367, label %368, label %373
368: ; preds = %365
%369 = load i32, i32* %25
%370 = icmp ne i32 %369, 0
br i1 %370, label %371, label %373
371: ; preds = %368
%372 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.22, i64 0, i64 0), i8* %41)
br label %373
373: ; preds = %371, %368, %365
%374 = load i32, i32* %25
%375 = icmp ne i32 %374, 0
br i1 %375, label %376, label %452
376: ; preds = %373
%377 = load i32, i32* @O_CREAT
%378 = load i32, i32* @O_TRUNC
%379 = or i32 %377, %378
%380 = load i32, i32* @O_WRONLY
%381 = or i32 %379, %380
%382 = load i32, i32* %16
%383 = call i32 (i8*, i32, ...) @open(i8* %41, i32 %381, i32 %382)
store i32 %383, i32* %34
%384 = icmp eq i32 %383, -1
br i1 %384, label %385, label %388
385: ; preds = %376
%386 = call i32 @perror(i8* %41)
%387 = call i32 @exit(i32 1)
unreachable
388: ; preds = %376
%389 = load i8*, i8** %12
%390 = load i32, i32* @O_RDONLY
%391 = call i32 (i8*, i32, ...) @open(i8* %389, i32 %390)
store i32 %391, i32* %35
%392 = icmp eq i32 %391, -1
br i1 %392, label %393, label %397
393: ; preds = %388
%394 = load i8*, i8** %12
%395 = call i32 @perror(i8* %394)
%396 = call i32 @exit(i32 1)
unreachable
397: ; preds = %388
br label %398
398: ; preds = %412, %397
%399 = load i32, i32* %35
%400 = load i32, i32* @BUFSIZ
%401 = call i32 @read(i32 %399, i8* %44, i32 %400)
store i32 %401, i32* %30
%402 = icmp sgt i32 %401, 0
br i1 %402, label %403, label %413
403: ; preds = %398
%404 = load i32, i32* %34
%405 = load i32, i32* %30
%406 = call i32 @write(i32 %404, i8* %44, i32 %405)
%407 = icmp eq i32 %406, -1
br i1 %407, label %408, label %412
408: ; preds = %403
%409 = call i32 @perror(i8* %41)
%410 = call i32 @unlink(i8* %41)
%411 = call i32 @exit(i32 1)
unreachable
412: ; preds = %403
br label %398
413: ; preds = %398
%414 = load i32, i32* %35
%415 = call i64 @close(i32 %414)
%416 = icmp slt i64 %415, 0
br i1 %416, label %417, label %419
417: ; preds = %413
%418 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.23, i64 0, i64 0))
br label %419
419: ; preds = %417, %413
%420 = load i32, i32* %34
%421 = call i64 @fsync(i32 %420)
%422 = icmp slt i64 %421, 0
br i1 %422, label %423, label %427
423: ; preds = %419
%424 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.24, i64 0, i64 0))
%425 = call i32 @unlink(i8* %41)
%426 = call i32 @exit(i32 1)
unreachable
427: ; preds = %419
%428 = load i32, i32* %34
%429 = call i64 @close(i32 %428)
%430 = icmp slt i64 %429, 0
br i1 %430, label %431, label %435
431: ; preds = %427
%432 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.23, i64 0, i64 0))
%433 = call i32 @unlink(i8* %41)
%434 = call i32 @exit(i32 1)
unreachable
435: ; preds = %427
%436 = getelementptr inbounds %struct.stat, %struct.stat* %9, i32 0, i32 3
%437 = load i64, i64* %436
%438 = getelementptr inbounds [2 x %struct.timeval], [2 x %struct.timeval]* %33, i64 0, i64 0
%439 = getelementptr inbounds %struct.timeval, %struct.timeval* %438, i32 0, i32 0
store i64 %437, i64* %439
%440 = getelementptr inbounds [2 x %struct.timeval], [2 x %struct.timeval]* %33, i64 0, i64 0
%441 = getelementptr inbounds %struct.timeval, %struct.timeval* %440, i32 0, i32 1
store i64 0, i64* %441
%442 = getelementptr inbounds [2 x %struct.timeval], [2 x %struct.timeval]* %33, i64 0, i64 1
%443 = getelementptr inbounds [2 x %struct.timeval], [2 x %struct.timeval]* %33, i64 0, i64 0
%444 = bitcast %struct.timeval* %442 to i8*
%445 = bitcast %struct.timeval* %443 to i8*
%446 = getelementptr inbounds [2 x %struct.timeval], [2 x %struct.timeval]* %33, i64 0, i64 0
%447 = call i32 @utimes(i8* %41, %struct.timeval* %446)
%448 = icmp eq i32 %447, -1
br i1 %448, label %449, label %451
449: ; preds = %435
%450 = call i32 @perror(i8* %41)
br label %451
451: ; preds = %449, %435
br label %452
452: ; preds = %451, %373
%453 = load i32, i32* %27
%454 = icmp ne i32 %453, 0
br i1 %454, label %455, label %463
455: ; preds = %452
%456 = load i32, i32* %18
%457 = load i32, i32* %20
%458 = call i32 @chown(i8* %41, i32 %456, i32 %457)
%459 = icmp eq i32 %458, -1
br i1 %459, label %460, label %462
460: ; preds = %455
%461 = call i32 @perror(i8* %41)
br label %462
462: ; preds = %460, %455
br label %463
463: ; preds = %462, %452
%464 = load i32, i32* %26
%465 = icmp ne i32 %464, 0
br i1 %465, label %466, label %473
466: ; preds = %463
%467 = load i32, i32* %16
%468 = call i32 @chmod(i8* %41, i32 %467)
%469 = icmp eq i32 %468, -1
br i1 %469, label %470, label %472
470: ; preds = %466
%471 = call i32 @perror(i8* %41)
br label %472
472: ; preds = %470, %466
br label %473
473: ; preds = %472, %463
%474 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
%struct.stat = type { i32, i32, i32, i64 }
%struct.timeval = type { i64, i64 }
%struct.passwd = type { i32 }
%struct.group = type { i32 }
@MAXPATHLEN = global i32 0
@BUFSIZ = global i32 0
@.str = [15 x i8] c"s:d:m:o:g:cCfq\00"
@EOF = global i32 0
@optarg = external global i8*
@stderr = global i32 0
@.str.1 = [19 x i8] c"%s does not exist\0A\00"
@.str.2 = [21 x i8] c"%s not a plain file\0A\00"
@.str.3 = [20 x i8] c"%s not a directory\0A\00"
@.str.4 = [3 x i8] c"%o\00"
@.str.5 = [14 x i8] c"bad mode: %s\0A\00"
@.str.6 = [15 x i8] c"bad owner: %s\0A\00"
@.str.7 = [15 x i8] c"bad group: %s\0A\00"
@.str.8 = [6 x i8] c"%s/%s\00"
@.str.9 = [39 x i8] c"source and destination have same mtime\00"
@.str.10 = [33 x i8] c"destination is newer than source\00"
@.str.11 = [5 x i8] c"fork\00"
@.str.12 = [10 x i8] c"/dev/null\00"
@O_RDWR = global i32 0
@.str.13 = [5 x i8] c"open\00"
@.str.14 = [13 x i8] c"/usr/bin/cmp\00"
@.str.15 = [4 x i8] c"cmp\00"
@.str.16 = [43 x i8] c"source and destination are identical (cmp)\00"
@.str.17 = [14 x i8] c"/usr/bin/diff\00"
@.str.18 = [5 x i8] c"diff\00"
@.str.19 = [3 x i8] c"-b\00"
@.str.20 = [47 x i8] c"source and destination are identical (diff -b)\00"
@.str.21 = [19 x i8] c"%s not copied: %s\0A\00"
@.str.22 = [15 x i8] c"installing %s\0A\00"
@O_CREAT = global i32 0
@O_TRUNC = global i32 0
@O_WRONLY = global i32 0
@O_RDONLY = global i32 0
@.str.23 = [6 x i8] c"close\00"
@.str.24 = [6 x i8] c"fsync\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca %struct.stat
%4 = alloca %struct.stat
%5 = alloca %struct.stat
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca [2 x %struct.timeval]
%10 = bitcast %struct.stat* %3 to i8*
%11 = bitcast %struct.stat* %4 to i8*
%12 = bitcast %struct.stat* %5 to i8*
%13 = load i32, i32* @MAXPATHLEN
%14 = zext i32 %13 to i64
%15 = alloca i8, i64 %14
%16 = bitcast i32* %6 to i8*
store i32 -3, i32* %6
%17 = bitcast i32* %7 to i8*
%18 = bitcast i8** %8 to i8*
%19 = bitcast [2 x %struct.timeval]* %9 to i8*
%20 = load i32, i32* @BUFSIZ
%21 = zext i32 %20 to i64
%22 = alloca i8, i64 %21
%23 = call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%24 = load i32, i32* @EOF
%25 = icmp eq i32 %23, %24
br i1 %25, label %158, label %26
26: ; preds = %2
%27 = getelementptr inbounds %struct.stat, %struct.stat* %5, i64 0, i32 0
%28 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0
br label %29
29: ; preds = %26, %141
%30 = phi i32 [ undef, %26 ], [ %142, %141 ]
%31 = phi i32 [ %23, %26 ], [ %151, %141 ]
%32 = phi i8* [ null, %26 ], [ %150, %141 ]
%33 = phi i32 [ 0, %26 ], [ %149, %141 ]
%34 = phi i32 [ 0, %26 ], [ %148, %141 ]
%35 = phi i32 [ 0, %26 ], [ %147, %141 ]
%36 = phi i32 [ 0, %26 ], [ %146, %141 ]
%37 = phi i32 [ -3, %26 ], [ %145, %141 ]
%38 = phi i8* [ null, %26 ], [ %144, %141 ]
%39 = phi i32 [ -3, %26 ], [ %143, %141 ]
switch i32 %31, label %139 [
i32 115, label %40
i32 100, label %57
i32 109, label %74
i32 111, label %86
i32 103, label %111
i32 99, label %141
i32 67, label %136
i32 102, label %137
i32 113, label %138
]
40: ; preds = %29
%41 = load i8*, i8** @optarg
%42 = call i8* @strdup(i8* %41)
%43 = call i32 @stat(i8* %42, %struct.stat* %3)
%44 = icmp eq i32 %43, -1
br i1 %44, label %45, label %49
45: ; preds = %40
%46 = load i32, i32* @stderr
%47 = call i32 @fprintf(i32 %46, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %42)
%48 = call i32 @exit(i32 1)
unreachable
49: ; preds = %40
%50 = load i32, i32* %28
%51 = call i32 @S_ISREG(i32 %50)
%52 = icmp eq i32 %51, 0
br i1 %52, label %53, label %141
53: ; preds = %49
%54 = load i32, i32* @stderr
%55 = call i32 @fprintf(i32 %54, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i8* %42)
%56 = call i32 @exit(i32 1)
unreachable
57: ; preds = %29
%58 = load i8*, i8** @optarg
%59 = call i8* @strdup(i8* %58)
%60 = call i32 @stat(i8* %59, %struct.stat* %5)
%61 = icmp eq i32 %60, -1
br i1 %61, label %62, label %66
62: ; preds = %57
%63 = load i32, i32* @stderr
%64 = call i32 @fprintf(i32 %63, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %59)
%65 = call i32 @exit(i32 1)
unreachable
66: ; preds = %57
%67 = load i32, i32* %27
%68 = call i32 @S_ISDIR(i32 %67)
%69 = icmp eq i32 %68, 0
br i1 %69, label %70, label %141
70: ; preds = %66
%71 = load i32, i32* @stderr
%72 = call i32 @fprintf(i32 %71, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8* %59)
%73 = call i32 @exit(i32 1)
unreachable
74: ; preds = %29
%75 = load i8*, i8** @optarg
%76 = call i32 @sscanf(i8* %75, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %6)
%77 = icmp ne i32 %76, 1
%78 = load i32, i32* %6
%79 = icmp sgt i32 %78, 4095
%80 = select i1 %77, i1 true, i1 %79
br i1 %80, label %81, label %141
81: ; preds = %74
%82 = load i32, i32* @stderr
%83 = load i8*, i8** @optarg
%84 = call i32 @fprintf(i32 %82, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i8* %83)
%85 = call i32 @exit(i32 1)
unreachable
86: ; preds = %29
%87 = load i8*, i8** @optarg
%88 = call %struct.passwd* @getpwnam(i8* %87)
%89 = icmp eq %struct.passwd* %88, null
br i1 %89, label %90, label %107
90: ; preds = %86
%91 = load i8*, i8** @optarg
%92 = call i32 @strtoul(i8* %91, i8** %8, i32 10)
%93 = load i8*, i8** %8
%94 = load i8*, i8** @optarg
%95 = call i32 @strlen(i8* %94)
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds i8, i8* %94, i64 %96
%98 = icmp eq i8* %93, %97
br i1 %98, label %99, label %102
99: ; preds = %90
%100 = call %struct.passwd* @getpwuid(i32 %92)
%101 = icmp eq %struct.passwd* %100, null
br i1 %101, label %102, label %107
102: ; preds = %90, %99
%103 = load i32, i32* @stderr
%104 = load i8*, i8** @optarg
%105 = call i32 @fprintf(i32 %103, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), i8* %104)
%106 = call i32 @exit(i32 1)
unreachable
107: ; preds = %86, %99
%108 = phi %struct.passwd* [ %100, %99 ], [ %88, %86 ]
%109 = getelementptr inbounds %struct.passwd, %struct.passwd* %108, i64 0, i32 0
%110 = load i32, i32* %109
br label %141
111: ; preds = %29
%112 = load i8*, i8** @optarg
%113 = call %struct.group* @getgrnam(i8* %112)
%114 = icmp eq %struct.group* %113, null
br i1 %114, label %115, label %132
115: ; preds = %111
%116 = load i8*, i8** @optarg
%117 = call i32 @strtoul(i8* %116, i8** %8, i32 10)
%118 = load i8*, i8** %8
%119 = load i8*, i8** @optarg
%120 = call i32 @strlen(i8* %119)
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds i8, i8* %119, i64 %121
%123 = icmp eq i8* %118, %122
br i1 %123, label %124, label %127
124: ; preds = %115
%125 = call %struct.group* @getgrgid(i32 %117)
%126 = icmp eq %struct.group* %125, null
br i1 %126, label %127, label %132
127: ; preds = %115, %124
%128 = load i32, i32* @stderr
%129 = load i8*, i8** @optarg
%130 = call i32 @fprintf(i32 %128, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0), i8* %129)
%131 = call i32 @exit(i32 1)
unreachable
132: ; preds = %111, %124
%133 = phi %struct.group* [ %125, %124 ], [ %113, %111 ]
%134 = getelementptr inbounds %struct.group, %struct.group* %133, i64 0, i32 0
%135 = load i32, i32* %134
br label %141
136: ; preds = %29
br label %141
137: ; preds = %29
br label %141
138: ; preds = %29
br label %141
139: ; preds = %29
%140 = call i32 (...) @usage()
br label %141
141: ; preds = %29, %74, %66, %49, %139, %138, %137, %136, %132, %107
%142 = phi i32 [ %30, %139 ], [ %30, %138 ], [ %30, %137 ], [ %30, %136 ], [ %30, %132 ], [ %30, %107 ], [ %30, %74 ], [ %30, %66 ], [ %50, %49 ], [ %30, %29 ]
%143 = phi i32 [ %39, %139 ], [ %39, %138 ], [ %39, %137 ], [ %39, %136 ], [ %39, %132 ], [ %110, %107 ], [ %39, %74 ], [ %39, %66 ], [ %39, %49 ], [ %39, %29 ]
%144 = phi i8* [ %38, %139 ], [ %38, %138 ], [ %38, %137 ], [ %38, %136 ], [ %38, %132 ], [ %38, %107 ], [ %38, %74 ], [ %59, %66 ], [ %38, %49 ], [ %38, %29 ]
%145 = phi i32 [ %37, %139 ], [ %37, %138 ], [ %37, %137 ], [ %37, %136 ], [ %135, %132 ], [ %37, %107 ], [ %37, %74 ], [ %37, %66 ], [ %37, %49 ], [ %37, %29 ]
%146 = phi i32 [ %36, %139 ], [ %36, %138 ], [ %36, %137 ], [ %36, %136 ], [ %36, %132 ], [ %36, %107 ], [ %36, %74 ], [ %36, %66 ], [ %36, %49 ], [ 1, %29 ]
%147 = phi i32 [ %35, %139 ], [ %35, %138 ], [ %35, %137 ], [ 1, %136 ], [ %35, %132 ], [ %35, %107 ], [ %35, %74 ], [ %35, %66 ], [ %35, %49 ], [ %35, %29 ]
%148 = phi i32 [ %34, %139 ], [ %34, %138 ], [ 1, %137 ], [ %34, %136 ], [ %34, %132 ], [ %34, %107 ], [ %34, %74 ], [ %34, %66 ], [ %34, %49 ], [ %34, %29 ]
%149 = phi i32 [ %33, %139 ], [ 1, %138 ], [ %33, %137 ], [ %33, %136 ], [ %33, %132 ], [ %33, %107 ], [ %33, %74 ], [ %33, %66 ], [ %33, %49 ], [ %33, %29 ]
%150 = phi i8* [ %32, %139 ], [ %32, %138 ], [ %32, %137 ], [ %32, %136 ], [ %32, %132 ], [ %32, %107 ], [ %32, %74 ], [ %32, %66 ], [ %42, %49 ], [ %32, %29 ]
%151 = call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%152 = load i32, i32* @EOF
%153 = icmp eq i32 %151, %152
br i1 %153, label %154, label %29
154: ; preds = %141
%155 = icmp ne i8* %150, null
%156 = icmp ne i8* %144, null
%157 = select i1 %155, i1 %156, i1 false
br i1 %157, label %169, label %158
158: ; preds = %2, %154
%159 = phi i8* [ %150, %154 ], [ null, %2 ]
%160 = phi i32 [ %149, %154 ], [ 0, %2 ]
%161 = phi i32 [ %148, %154 ], [ 0, %2 ]
%162 = phi i32 [ %147, %154 ], [ 0, %2 ]
%163 = phi i32 [ %146, %154 ], [ 0, %2 ]
%164 = phi i32 [ %145, %154 ], [ -3, %2 ]
%165 = phi i8* [ %144, %154 ], [ null, %2 ]
%166 = phi i32 [ %143, %154 ], [ -3, %2 ]
%167 = phi i32 [ %142, %154 ], [ undef, %2 ]
%168 = call i32 (...) @usage()
br label %169
169: ; preds = %154, %158
%170 = phi i8* [ %150, %154 ], [ %159, %158 ]
%171 = phi i32 [ %149, %154 ], [ %160, %158 ]
%172 = phi i32 [ %148, %154 ], [ %161, %158 ]
%173 = phi i32 [ %147, %154 ], [ %162, %158 ]
%174 = phi i32 [ %146, %154 ], [ %163, %158 ]
%175 = phi i32 [ %145, %154 ], [ %164, %158 ]
%176 = phi i8* [ %144, %154 ], [ %165, %158 ]
%177 = phi i32 [ %143, %154 ], [ %166, %158 ]
%178 = phi i32 [ %142, %154 ], [ %167, %158 ]
%179 = load i32, i32* %6
%180 = icmp eq i32 %179, -3
br i1 %180, label %181, label %183
181: ; preds = %169
%182 = and i32 %178, 4095
store i32 %182, i32* %6
br label %183
183: ; preds = %181, %169
%184 = icmp eq i32 %177, -3
%185 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 1
%186 = load i32, i32* %185
%187 = select i1 %184, i32 %186, i32 %177
%188 = icmp eq i32 %175, -3
%189 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 2
%190 = load i32, i32* %189
%191 = select i1 %188, i32 %190, i32 %175
%192 = call i32 @sprintf(i8* %15, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i8* %176, i8* %170)
%193 = call i32 @stat(i8* %15, %struct.stat* %4)
%194 = icmp eq i32 %193, -1
br i1 %194, label %293, label %195
195: ; preds = %183
%196 = getelementptr inbounds %struct.stat, %struct.stat* %4, i64 0, i32 3
%197 = load i64, i64* %196
%198 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 3
%199 = load i64, i64* %198
%200 = icmp eq i64 %197, %199
br i1 %200, label %201, label %203
201: ; preds = %195
%202 = icmp eq i32 %172, 0
br i1 %202, label %273, label %293
203: ; preds = %195
%204 = icmp sgt i64 %197, %199
br i1 %204, label %205, label %207
205: ; preds = %203
%206 = icmp eq i32 %172, 0
br i1 %206, label %273, label %293
207: ; preds = %203
%208 = icmp slt i64 %197, %199
br i1 %208, label %209, label %293
209: ; preds = %207
%210 = icmp eq i32 %174, 0
br i1 %210, label %241, label %211
211: ; preds = %209
%212 = call i32 (...) @fork()
switch i32 %212, label %230 [
i32 -1, label %213
i32 0, label %216
]
213: ; preds = %211
%214 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
%215 = call i32 @exit(i32 1)
unreachable
216: ; preds = %211
%217 = load i32, i32* @O_RDWR
%218 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0), i32 %217)
%219 = icmp slt i32 %218, 0
br i1 %219, label %220, label %223
220: ; preds = %216
%221 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0))
%222 = call i32 @exit(i32 1)
unreachable
223: ; preds = %216
%224 = call i32 @dup2(i32 %218, i32 1)
%225 = call i32 @dup2(i32 %218, i32 2)
%226 = call i32 (i8*, i8*, i8*, i8*, i8*, ...) @execl(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i8* %170, i8* %15, i8* null)
%227 = icmp slt i32 %226, 0
br i1 %227, label %228, label %230
228: ; preds = %223
%229 = call i32 @exit(i32 1)
unreachable
230: ; preds = %223, %211
%231 = call i32 @waitpid(i32 %212, i32* %7, i32 0)
%232 = icmp eq i32 %231, -1
br i1 %232, label %293, label %233
233: ; preds = %230
%234 = load i32, i32* %7
%235 = call i64 @WIFEXITED(i32 %234)
%236 = icmp eq i64 %235, 0
br i1 %236, label %293, label %237
237: ; preds = %233
%238 = load i32, i32* %7
%239 = call i64 @WEXITSTATUS(i32 %238)
%240 = icmp eq i64 %239, 0
br i1 %240, label %273, label %293
241: ; preds = %209
%242 = icmp eq i32 %173, 0
br i1 %242, label %293, label %243
243: ; preds = %241
%244 = call i32 (...) @fork()
switch i32 %244, label %262 [
i32 -1, label %245
i32 0, label %248
]
245: ; preds = %243
%246 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
%247 = call i32 @exit(i32 1)
unreachable
248: ; preds = %243
%249 = load i32, i32* @O_RDWR
%250 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0), i32 %249)
%251 = icmp slt i32 %250, 0
br i1 %251, label %252, label %255
252: ; preds = %248
%253 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0))
%254 = call i32 @exit(i32 1)
unreachable
255: ; preds = %248
%256 = call i32 @dup2(i32 %250, i32 1)
%257 = call i32 @dup2(i32 %250, i32 2)
%258 = call i32 (i8*, i8*, i8*, i8*, i8*, ...) @execl(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.19, i64 0, i64 0), i8* %170, i8* %15, i8* null)
%259 = icmp slt i32 %258, 0
br i1 %259, label %260, label %262
260: ; preds = %255
%261 = call i32 @exit(i32 1)
unreachable
262: ; preds = %255, %243
%263 = call i32 @waitpid(i32 %244, i32* %7, i32 0)
%264 = icmp eq i32 %263, -1
br i1 %264, label %293, label %265
265: ; preds = %262
%266 = load i32, i32* %7
%267 = call i64 @WIFEXITED(i32 %266)
%268 = icmp eq i64 %267, 0
br i1 %268, label %293, label %269
269: ; preds = %265
%270 = load i32, i32* %7
%271 = call i64 @WEXITSTATUS(i32 %270)
%272 = icmp eq i64 %271, 0
br i1 %272, label %273, label %293
273: ; preds = %237, %205, %201, %269
%274 = phi i8* [ getelementptr inbounds ([39 x i8], [39 x i8]* @.str.9, i64 0, i64 0), %201 ], [ getelementptr inbounds ([47 x i8], [47 x i8]* @.str.20, i64 0, i64 0), %269 ], [ getelementptr inbounds ([33 x i8], [33 x i8]* @.str.10, i64 0, i64 0), %205 ], [ getelementptr inbounds ([43 x i8], [43 x i8]* @.str.16, i64 0, i64 0), %237 ]
%275 = getelementptr inbounds %struct.stat, %struct.stat* %4, i64 0, i32 1
%276 = load i32, i32* %275
%277 = icmp eq i32 %276, %187
%278 = getelementptr inbounds %struct.stat, %struct.stat* %4, i64 0, i32 2
%279 = load i32, i32* %278
%280 = icmp eq i32 %279, %191
%281 = select i1 %277, i1 %280, i1 false
%282 = getelementptr inbounds %struct.stat, %struct.stat* %4, i64 0, i32 0
%283 = load i32, i32* %282
%284 = and i32 %283, 4095
%285 = load i32, i32* %6
%286 = icmp eq i32 %284, %285
%287 = icmp eq i32 %171, 0
br i1 %287, label %291, label %288
288: ; preds = %273
%289 = call i64 @strcmp(i8* %274, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.10, i64 0, i64 0))
%290 = icmp eq i64 %289, 0
br i1 %290, label %291, label %358
291: ; preds = %288, %273
%292 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.21, i64 0, i64 0), i8* %170, i8* %274)
br label %358
293: ; preds = %207, %241, %265, %262, %230, %233, %269, %183, %201, %205, %237
%294 = icmp eq i32 %171, 0
br i1 %294, label %297, label %295
295: ; preds = %293
%296 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.22, i64 0, i64 0), i8* %15)
br label %297
297: ; preds = %295, %293
%298 = load i32, i32* @O_CREAT
%299 = load i32, i32* @O_TRUNC
%300 = or i32 %299, %298
%301 = load i32, i32* @O_WRONLY
%302 = or i32 %300, %301
%303 = load i32, i32* %6
%304 = call i32 (i8*, i32, ...) @open(i8* %15, i32 %302, i32 %303)
%305 = icmp eq i32 %304, -1
br i1 %305, label %306, label %309
306: ; preds = %297
%307 = call i32 @perror(i8* %15)
%308 = call i32 @exit(i32 1)
unreachable
309: ; preds = %297
%310 = load i32, i32* @O_RDONLY
%311 = call i32 (i8*, i32, ...) @open(i8* %170, i32 %310)
%312 = icmp eq i32 %311, -1
br i1 %312, label %313, label %316
313: ; preds = %309
%314 = call i32 @perror(i8* %170)
%315 = call i32 @exit(i32 1)
unreachable
316: ; preds = %309, %320
%317 = load i32, i32* @BUFSIZ
%318 = call i32 @read(i32 %311, i8* %22, i32 %317)
%319 = icmp sgt i32 %318, 0
br i1 %319, label %320, label %327
320: ; preds = %316
%321 = call i32 @write(i32 %304, i8* %22, i32 %318)
%322 = icmp eq i32 %321, -1
br i1 %322, label %323, label %316
323: ; preds = %320
%324 = call i32 @perror(i8* %15)
%325 = call i32 @unlink(i8* %15)
%326 = call i32 @exit(i32 1)
unreachable
327: ; preds = %316
%328 = call i64 @close(i32 %311)
%329 = icmp slt i64 %328, 0
br i1 %329, label %330, label %332
330: ; preds = %327
%331 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.23, i64 0, i64 0))
br label %332
332: ; preds = %330, %327
%333 = call i64 @fsync(i32 %304)
%334 = icmp slt i64 %333, 0
br i1 %334, label %335, label %339
335: ; preds = %332
%336 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.24, i64 0, i64 0))
%337 = call i32 @unlink(i8* %15)
%338 = call i32 @exit(i32 1)
unreachable
339: ; preds = %332
%340 = call i64 @close(i32 %304)
%341 = icmp slt i64 %340, 0
br i1 %341, label %342, label %346
342: ; preds = %339
%343 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.23, i64 0, i64 0))
%344 = call i32 @unlink(i8* %15)
%345 = call i32 @exit(i32 1)
unreachable
346: ; preds = %339
%347 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 3
%348 = load i64, i64* %347
%349 = getelementptr inbounds [2 x %struct.timeval], [2 x %struct.timeval]* %9, i64 0, i64 0
%350 = getelementptr inbounds [2 x %struct.timeval], [2 x %struct.timeval]* %9, i64 0, i64 0, i32 0
store i64 %348, i64* %350
%351 = getelementptr inbounds [2 x %struct.timeval], [2 x %struct.timeval]* %9, i64 0, i64 0, i32 1
store i64 0, i64* %351
%352 = getelementptr inbounds [2 x %struct.timeval], [2 x %struct.timeval]* %9, i64 0, i64 1
%353 = bitcast %struct.timeval* %352 to i8*
%354 = call i32 @utimes(i8* %15, %struct.timeval* %349)
%355 = icmp eq i32 %354, -1
br i1 %355, label %356, label %359
356: ; preds = %346
%357 = call i32 @perror(i8* %15)
br label %359
358: ; preds = %288, %291
br i1 %281, label %365, label %359
359: ; preds = %356, %346, %358
%360 = phi i1 [ %286, %358 ], [ false, %346 ], [ false, %356 ]
%361 = call i32 @chown(i8* %15, i32 %187, i32 %191)
%362 = icmp eq i32 %361, -1
br i1 %362, label %363, label %365
363: ; preds = %359
%364 = call i32 @perror(i8* %15)
br i1 %360, label %373, label %367
365: ; preds = %359, %358
%366 = phi i1 [ %360, %359 ], [ %286, %358 ]
br i1 %366, label %373, label %367
367: ; preds = %363, %365
%368 = load i32, i32* %6
%369 = call i32 @chmod(i8* %15, i32 %368)
%370 = icmp eq i32 %369, -1
br i1 %370, label %371, label %373
371: ; preds = %367
%372 = call i32 @perror(i8* %15)
br label %373
373: ; preds = %363, %367, %371, %365
%374 = call i32 @exit(i32 0)
unreachable
}