#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 */
typedef struct TYPE_7__ TYPE_2__;
typedef struct TYPE_6__ TYPE_1__;

/* Type definitions */
typedef int mode_t;
struct TYPE_7__ {
  int fts_info;
  char *fts_path;
  TYPE_1__ *fts_statp;
  int /*<<< orphan*/ fts_accpath;
  int /*<<< orphan*/ fts_errno;
};
struct TYPE_6__ {
  int st_mode;
};
typedef TYPE_2__ FTSENT;
typedef int /*<<< orphan*/ FTS;

/* Variables and functions */
int ALLPERMS;
int FTS_COMFOLLOW;
#define FTS_D 133
#define FTS_DNR 132
#define FTS_ERR 131
int FTS_LOGICAL;
#define FTS_NS 130
int FTS_PHYSICAL;
int /*<<< orphan*/ FTS_SKIP;
#define FTS_SL 129
#define FTS_SLNONE 128
int S_IFMT;
int chmod(int /*<<< orphan*/, int);
int /*<<< orphan*/ err(int, char *);
scalar_t__ errno;
int /*<<< orphan*/ errx(int, char *, ...);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fts_open(char **, int, int /*<<< orphan*/);
TYPE_2__ *fts_read(int /*<<< orphan*/ *);
int /*<<< orphan*/ fts_set(int /*<<< orphan*/ *, TYPE_2__ *,
                           int /*<<< orphan*/);
int getmode(int *, int);
int getopt(int, char **, char *);
int lchmod(int /*<<< orphan*/, int);
scalar_t__ may_have_nfs4acl(TYPE_2__ *, int);
size_t optind;
int /*<<< orphan*/ printf(char *, ...);
int *setmode(char *);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
int /*<<< orphan*/ strmode(int, char *);
int /*<<< orphan*/ usage();
int /*<<< orphan*/ warn(char *, char *);
int /*<<< orphan*/ warnx(char *, char *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  FTS *ftsp;
  FTSENT *p;
  mode_t *set;
  int Hflag, Lflag, Rflag, ch, error, fflag, fts_options, hflag, rval;
  int vflag;
  char *mode;
  mode_t newmode;
  set = NULL;
  Hflag = Lflag = Rflag = fflag = hflag = vflag = 0;
  while ((ch = getopt(argc, argv, "HLPRXfghorstuvwx")) != -1)
    switch (ch) {
    case 'H':
      Hflag = 1;
      Lflag = 0;
      break;
    case 'L':
      Lflag = 1;
      Hflag = 0;
      break;
    case 'P':
      Hflag = Lflag = 0;
      break;
    case 'R':
      Rflag = 1;
      break;
    case 'f':
      fflag = 1;
      break;
    case 'h':
      hflag = 1;
      break;
    case 'g':
    case 'o':
    case 'r':
    case 's':
    case 't':
    case 'u':
    case 'w':
    case 'X':
    case 'x':
      if (argv[optind - 1][0] == '-' && argv[optind - 1][1] == ch &&
          argv[optind - 1][2] == '\0')
        --optind;
      goto done;
    case 'v':
      vflag++;
      break;
    case '?':
    default:
      usage();
    }
done:
  argv += optind;
  argc -= optind;
  if (argc < 2)
    usage();
  if (Rflag) {
    fts_options = FTS_PHYSICAL;
    if (hflag)
      errx(1, "the -R and -h options may not be specified together.");
    if (Hflag)
      fts_options |= FTS_COMFOLLOW;
    if (Lflag) {
      fts_options &= ~FTS_PHYSICAL;
      fts_options |= FTS_LOGICAL;
    }
  } else
    fts_options = hflag ? FTS_PHYSICAL : FTS_LOGICAL;
  mode = *argv;
  if ((set = setmode(mode)) == NULL)
    errx(1, "invalid file mode: %s", mode);
  if ((ftsp = fts_open(++argv, fts_options, 0)) == NULL)
    err(1, "fts_open");
  for (rval = 0; (p = fts_read(ftsp)) != NULL;) {
    switch (p->fts_info) {
    case FTS_D:
      if (!Rflag)
        fts_set(ftsp, p, FTS_SKIP);
      continue;
    case FTS_DNR:
      warnx("%s: %s", p->fts_path, strerror(p->fts_errno));
      rval = 1;
      break;
    case FTS_ERR:
    case FTS_NS:
      warnx("%s: %s", p->fts_path, strerror(p->fts_errno));
      rval = 1;
      continue;
    case FTS_SL:
    case FTS_SLNONE:
      if (!hflag)
        continue;
    default:
      break;
    }
    newmode = getmode(set, p->fts_statp->st_mode);
    if (may_have_nfs4acl(p, hflag) == 0 &&
        (newmode & ALLPERMS) == (p->fts_statp->st_mode & ALLPERMS))
      continue;
    if (hflag)
      error = lchmod(p->fts_accpath, newmode);
    else
      error = chmod(p->fts_accpath, newmode);
    if (error) {
      if (!fflag) {
        warn("%s", p->fts_path);
        rval = 1;
      }
    } else {
      if (vflag) {
        (void)printf("%s", p->fts_path);
        if (vflag > 1) {
          char m1[12], m2[12];
          strmode(p->fts_statp->st_mode, m1);
          strmode((p->fts_statp->st_mode & S_IFMT) | newmode, m2);
          (void)printf(": 0%o [%s] -> 0%o [%s]", p->fts_statp->st_mode, m1,
                       (p->fts_statp->st_mode & S_IFMT) | newmode, m2);
        }
        (void)printf("\n");
      }
    }
  }
  if (errno)
    err(1, "fts_read");
  exit(rval);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x28(%rbp)
movl   $0x0,-0x50(%rbp)
movl   $0x0,-0x48(%rbp)
movl   $0x0,-0x40(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe87(%rip),%rdx
call   1120 <getopt@plt>
mov    %eax,-0x38(%rbp)
cmp    $0xffffffff,%eax
je     13b4 <main+0x194>
mov    -0x38(%rbp),%eax
add    $0xffffffc1,%eax
mov    %eax,%ecx
mov    %rcx,-0x80(%rbp)
sub    $0x39,%eax
ja     13a8 <main+0x188>
mov    -0x80(%rbp),%rax
lea    0xd56(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
jmp    13af <main+0x18f>
movl   $0x1,-0x30(%rbp)
movl   $0x0,-0x2c(%rbp)
jmp    13af <main+0x18f>
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x2c(%rbp)
jmp    13af <main+0x18f>
movl   $0x1,-0x34(%rbp)
jmp    13af <main+0x18f>
movl   $0x1,-0x40(%rbp)
jmp    13af <main+0x18f>
movl   $0x1,-0x48(%rbp)
jmp    13af <main+0x18f>
mov    -0x10(%rbp),%rax
mov    0x2cad(%rip),%rcx
mov    (%rcx),%rcx
sub    $0x1,%rcx
mov    (%rax,%rcx,8),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1390 <main+0x170>
mov    -0x10(%rbp),%rax
mov    0x2c8b(%rip),%rcx
mov    (%rcx),%rcx
sub    $0x1,%rcx
mov    (%rax,%rcx,8),%rax
movsbl 0x1(%rax),%eax
cmp    -0x38(%rbp),%eax
jne    1390 <main+0x170>
mov    -0x10(%rbp),%rax
mov    0x2c68(%rip),%rcx
mov    (%rcx),%rcx
sub    $0x1,%rcx
mov    (%rax,%rcx,8),%rax
movsbl 0x2(%rax),%eax
cmp    $0x0,%eax
jne    1390 <main+0x170>
mov    0x2c49(%rip),%rax
mov    (%rax),%rcx
add    $0xffffffffffffffff,%rcx
mov    0x2c3b(%rip),%rax
mov    %rcx,(%rax)
jmp    13b9 <main+0x199>
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    13af <main+0x18f>
jmp    13a8 <main+0x188>
mov    $0x0,%al
call   10e0 <usage@plt>
jmp    126b <main+0x4b>
jmp    13b9 <main+0x199>
mov    0x2c08(%rip),%rax
mov    (%rax),%rax
shl    $0x3,%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2bf2(%rip),%rax
mov    (%rax),%rcx
movslq -0x8(%rbp),%rax
sub    %rcx,%rax
mov    %eax,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    13f4 <main+0x1d4>
mov    $0x0,%al
call   10e0 <usage@plt>
cmpl   $0x0,-0x34(%rbp)
je     1470 <main+0x250>
mov    0x2be3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x44(%rbp)
cmpl   $0x0,-0x48(%rbp)
je     1427 <main+0x207>
mov    $0x1,%edi
lea    0xcf1(%rip),%rsi
mov    $0x0,%al
call   1060 <errx@plt>
cmpl   $0x0,-0x2c(%rbp)
je     1440 <main+0x220>
mov    0x2b98(%rip),%rax
mov    (%rax),%eax
or     -0x44(%rbp),%eax
mov    %eax,-0x44(%rbp)
cmpl   $0x0,-0x30(%rbp)
je     146b <main+0x24b>
mov    0x2b97(%rip),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    -0x44(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    0x2b8d(%rip),%rax
mov    (%rax),%eax
or     -0x44(%rbp),%eax
mov    %eax,-0x44(%rbp)
jmp    14a6 <main+0x286>
cmpl   $0x0,-0x48(%rbp)
je     148e <main+0x26e>
mov    0x2b67(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x84(%rbp)
jmp    149d <main+0x27d>
mov    0x2b5b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x84(%rbp)
mov    -0x84(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rdi
call   10c0 <setmode@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
jne    14df <main+0x2bf>
mov    -0x58(%rbp),%rdx
mov    $0x1,%edi
lea    0xc6e(%rip),%rsi
mov    $0x0,%al
call   1060 <errx@plt>
mov    -0x10(%rbp),%rdi
add    $0x8,%rdi
mov    %rdi,-0x10(%rbp)
mov    -0x44(%rbp),%esi
xor    %edx,%edx
call   10a0 <fts_open@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1514 <main+0x2f4>
mov    $0x1,%edi
lea    0xc4d(%rip),%rsi
call   10d0 <err@plt>
movl   $0x0,-0x4c(%rbp)
mov    -0x18(%rbp),%rdi
call   1090 <fts_read@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     1783 <main+0x563>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
add    $0xffffff80,%eax
mov    %eax,%ecx
mov    %rcx,-0x90(%rbp)
sub    $0x5,%eax
ja     1615 <main+0x3f5>
mov    -0x90(%rbp),%rax
lea    0xb8d(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
cmpl   $0x0,-0x34(%rbp)
jne    1584 <main+0x364>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    0x2a5b(%rip),%rax
mov    (%rax),%edx
call   1050 <fts_set@plt>
jmp    151b <main+0x2fb>
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x98(%rbp)
mov    -0x20(%rbp),%rax
mov    0x1c(%rax),%edi
call   1140 <strerror@plt>
mov    -0x98(%rbp),%rsi
mov    %eax,%edx
lea    0xbb1(%rip),%rdi
call   1080 <warnx@plt>
movl   $0x1,-0x4c(%rbp)
jmp    161a <main+0x3fa>
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0xa0(%rbp)
mov    -0x20(%rbp),%rax
mov    0x1c(%rax),%edi
call   1140 <strerror@plt>
mov    -0xa0(%rbp),%rsi
mov    %eax,%edx
lea    0xb75(%rip),%rdi
call   1080 <warnx@plt>
movl   $0x1,-0x4c(%rbp)
jmp    151b <main+0x2fb>
cmpl   $0x0,-0x48(%rbp)
jne    1610 <main+0x3f0>
jmp    151b <main+0x2fb>
jmp    1615 <main+0x3f5>
jmp    161a <main+0x3fa>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rax
mov    0x10(%rax),%rax
mov    (%rax),%esi
call   1110 <getmode@plt>
mov    %eax,-0x5c(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x48(%rbp),%esi
call   10b0 <may_have_nfs4acl@plt>
cmp    $0x0,%rax
jne    1672 <main+0x452>
mov    -0x5c(%rbp),%eax
mov    0x2960(%rip),%rcx
and    (%rcx),%eax
mov    -0x20(%rbp),%rcx
mov    0x10(%rcx),%rcx
mov    (%rcx),%ecx
mov    0x294d(%rip),%rdx
and    (%rdx),%ecx
cmp    %ecx,%eax
jne    1672 <main+0x452>
jmp    151b <main+0x2fb>
cmpl   $0x0,-0x48(%rbp)
je     1693 <main+0x473>
mov    -0x20(%rbp),%rax
mov    0x18(%rax),%edi
mov    -0x5c(%rbp),%esi
call   1040 <lchmod@plt>
mov    %eax,-0x3c(%rbp)
jmp    16a5 <main+0x485>
mov    -0x20(%rbp),%rax
mov    0x18(%rax),%edi
mov    -0x5c(%rbp),%esi
call   10f0 <chmod@plt>
mov    %eax,-0x3c(%rbp)
cmpl   $0x0,-0x3c(%rbp)
je     16d9 <main+0x4b9>
cmpl   $0x0,-0x40(%rbp)
jne    16d4 <main+0x4b4>
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xa91(%rip),%rdi
call   1030 <warn@plt>
movl   $0x1,-0x4c(%rbp)
jmp    177e <main+0x55e>
cmpl   $0x0,-0x50(%rbp)
je     1779 <main+0x559>
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xa67(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
cmpl   $0x1,-0x50(%rbp)
jle    176b <main+0x54b>
mov    -0x20(%rbp),%rax
mov    0x10(%rax),%rax
mov    (%rax),%edi
lea    -0x68(%rbp),%rsi
call   1100 <strmode@plt>
mov    -0x20(%rbp),%rax
mov    0x10(%rax),%rax
mov    (%rax),%edi
mov    0x2891(%rip),%rax
and    (%rax),%edi
or     -0x5c(%rbp),%edi
lea    -0x74(%rbp),%rsi
call   1100 <strmode@plt>
mov    -0x20(%rbp),%rax
mov    0x10(%rax),%rax
mov    (%rax),%esi
lea    -0x68(%rbp),%rdx
mov    -0x20(%rbp),%rax
mov    0x10(%rax),%rax
mov    (%rax),%ecx
mov    0x2864(%rip),%rax
and    (%rax),%ecx
or     -0x5c(%rbp),%ecx
lea    -0x74(%rbp),%r8
lea    0xa08(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xa11(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    177e <main+0x55e>
jmp    151b <main+0x2fb>
mov    0x281e(%rip),%rax
cmpq   $0x0,(%rax)
je     17a5 <main+0x585>
mov    $0x1,%edi
lea    0x9e5(%rip),%rsi
call   10d0 <err@plt>
mov    -0x4c(%rbp),%edi
call   1130 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rsi,%r14
mov    %edi,%ebp
lea    0xfb6(%rip),%r15
lea    0xdaf(%rip),%r13
xor    %ecx,%ecx
xor    %edx,%edx
movl   $0x0,0x4(%rsp)
movl   $0x0,0x14(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0x10(%rsp)
jmp    1285 <main+0x55>
movl   $0x1,0x4(%rsp)
nop
mov    %ebx,%ecx
mov    %r12d,%edx
mov    %edx,%r12d
mov    %ecx,%ebx
mov    %ebp,%edi
mov    %r14,%rsi
mov    %r15,%rdx
call   1130 <getopt@plt>
lea    0x1(%rax),%edx
cmp    $0x79,%edx
ja     12b9 <main+0x89>
mov    $0x1,%ecx
movslq 0x0(%r13,%rdx,4),%rsi
add    %r13,%rsi
xor    %edx,%edx
jmp    *%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
jmp    1285 <main+0x55>
xor    %eax,%eax
call   10f0 <usage@plt>
jmp    1280 <main+0x50>
xor    %ecx,%ecx
xor    %edx,%edx
jmp    1285 <main+0x55>
movl   $0x1,0x14(%rsp)
jmp    1280 <main+0x50>
movl   $0x1,0x8(%rsp)
jmp    1280 <main+0x50>
addl   $0x1,0x10(%rsp)
jmp    1280 <main+0x50>
mov    0x2cde(%rip),%rcx
mov    (%rcx),%r15
mov    -0x8(%r14,%r15,8),%rdx
cmpb   $0x2d,(%rdx)
jne    131d <main+0xed>
movsbl 0x1(%rdx),%esi
cmp    %esi,%eax
mov    0x4(%rsp),%r13d
jne    1322 <main+0xf2>
cmpb   $0x0,0x2(%rdx)
jne    1322 <main+0xf2>
add    $0xffffffffffffffff,%r15
mov    %r15,(%rcx)
jmp    1322 <main+0xf2>
mov    0x2cae(%rip),%rax
mov    (%rax),%r15
mov    0x4(%rsp),%r13d
sub    %r15d,%ebp
cmp    $0x1,%ebp
jg     1331 <main+0x101>
xor    %eax,%eax
call   10f0 <usage@plt>
lea    (%r14,%r15,8),%r14
test   %r13d,%r13d
jne    134b <main+0x11b>
mov    0x8(%rsp),%ebp
test   %ebp,%ebp
jne    1399 <main+0x169>
mov    0x2ca7(%rip),%rax
jmp    13a0 <main+0x170>
mov    0x2c96(%rip),%r15
mov    (%r15),%ebp
cmpl   $0x0,0x8(%rsp)
je     136f <main+0x13f>
lea    0xeae(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   1070 <errx@plt>
test   %ebx,%ebx
je     137c <main+0x14c>
mov    0x2c56(%rip),%rax
mov    (%rax),%ebx
or     %ebp,%ebx
test   %r12d,%r12d
je     1393 <main+0x163>
mov    (%r15),%eax
not    %eax
and    %eax,%ebx
mov    0x2c5f(%rip),%rax
or     (%rax),%ebx
mov    0x8(%rsp),%ebp
jmp    13a2 <main+0x172>
mov    0x2c48(%rip),%rax
mov    (%rax),%ebx
mov    (%r14),%r15
mov    %r15,%rdi
call   10d0 <setmode@plt>
mov    %rax,0x18(%rsp)
test   %rax,%rax
jne    13cd <main+0x19d>
lea    0xe88(%rip),%rsi
mov    $0x1,%edi
mov    %r15,%rdx
xor    %eax,%eax
call   1070 <errx@plt>
add    $0x8,%r14
movl   $0x0,0xc(%rsp)
mov    %r14,%rdi
mov    %ebx,%esi
xor    %edx,%edx
call   10b0 <fts_open@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    13fe <main+0x1ce>
lea    0xe68(%rip),%rsi
mov    $0x1,%edi
call   10e0 <err@plt>
mov    %rbx,%rdi
call   10a0 <fts_read@plt>
test   %rax,%rax
jne    1432 <main+0x202>
mov    0x2b96(%rip),%rax
cmpq   $0x0,(%rax)
je     1429 <main+0x1f9>
lea    0xe64(%rip),%rsi
mov    $0x1,%edi
call   10e0 <err@plt>
mov    0xc(%rsp),%edi
call   1140 <exit@plt>
mov    %rax,%r12
lea    0xdac(%rip),%r14
movl   $0x0,0xc(%rsp)
mov    %r13d,0x4(%rsp)
jmp    1468 <main+0x238>
nopl   0x0(%rax,%rax,1)
test   %ebp,%ebp
jne    14ea <main+0x2ba>
mov    %rbx,%rdi
call   10a0 <fts_read@plt>
mov    %rax,%r12
test   %rax,%rax
je     140b <main+0x1db>
mov    (%r12),%eax
add    $0xffffff80,%eax
cmp    $0x5,%eax
ja     14ea <main+0x2ba>
movslq (%r14,%rax,4),%rax
add    %r14,%rax
jmp    *%rax
test   %r13d,%r13d
jne    1458 <main+0x228>
mov    0x2b4f(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    %r12,%rsi
call   1060 <fts_set@plt>
jmp    1458 <main+0x228>
mov    0x8(%r12),%r15
mov    0x1c(%r12),%edi
call   1150 <strerror@plt>
lea    0xdb7(%rip),%rdi
mov    %r15,%rsi
mov    %eax,%edx
call   1090 <warnx@plt>
movl   $0x1,0xc(%rsp)
jmp    1458 <main+0x228>
mov    0x8(%r12),%r15
mov    0x1c(%r12),%edi
call   1150 <strerror@plt>
lea    0xd8d(%rip),%rdi
mov    %r15,%rsi
mov    %eax,%edx
call   1090 <warnx@plt>
movl   $0x1,0xc(%rsp)
mov    0x10(%r12),%rax
mov    (%rax),%esi
mov    0x18(%rsp),%rdi
call   1120 <getmode@plt>
mov    %eax,%r13d
mov    %r12,%rdi
mov    %ebp,%esi
call   10c0 <may_have_nfs4acl@plt>
test   %rax,%rax
jne    1526 <main+0x2f6>
mov    0x10(%r12),%rax
mov    (%rax),%eax
xor    %r13d,%eax
mov    0x2a92(%rip),%rcx
test   %eax,(%rcx)
je     15fc <main+0x3cc>
mov    0x18(%r12),%edi
mov    %r13d,%esi
test   %ebp,%ebp
je     1539 <main+0x309>
call   1050 <lchmod@plt>
jmp    153e <main+0x30e>
call   1100 <chmod@plt>
mov    0x10(%rsp),%r15d
test   %eax,%eax
je     1579 <main+0x349>
cmpl   $0x0,0x14(%rsp)
mov    0x8(%rsp),%ebp
mov    0x4(%rsp),%r13d
jne    1458 <main+0x228>
mov    0x8(%r12),%rsi
lea    0xcf2(%rip),%rdi
call   1040 <warn@plt>
movl   $0x1,0xc(%rsp)
jmp    1458 <main+0x228>
test   %r15d,%r15d
je     15f8 <main+0x3c8>
mov    0x8(%r12),%rsi
lea    0xccf(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
cmp    $0x2,%r15d
jl     15ee <main+0x3be>
mov    0x10(%r12),%rax
mov    (%rax),%edi
lea    0x20(%rsp),%rsi
call   1110 <strmode@plt>
mov    0x10(%r12),%rax
mov    0x2a04(%rip),%rbp
mov    0x0(%rbp),%edi
and    (%rax),%edi
or     %r13d,%edi
lea    0x2c(%rsp),%r15
mov    %r15,%rsi
call   1110 <strmode@plt>
mov    0x10(%r12),%rax
mov    (%rax),%esi
mov    0x0(%rbp),%ecx
and    %esi,%ecx
or     %r13d,%ecx
lea    0xc8d(%rip),%rdi
lea    0x20(%rsp),%rdx
mov    %r15,%r8
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x8(%rsp),%ebp
mov    0x4(%rsp),%r13d
jmp    1458 <main+0x228>

LLVM IR (-O0):
%struct.TYPE_7__ = type { i32, i8*, %struct.TYPE_6__*, i32, i32 }
%struct.TYPE_6__ = type { i32 }
@.str = [17 x i8] c"HLPRXfghorstuvwx\00"
@optind = global i64 0
@FTS_PHYSICAL = global i32 0
@.str.1 = [53 x i8] c"the -R and -h options may not be specified together.\00"
@FTS_COMFOLLOW = global i32 0
@FTS_LOGICAL = global i32 0
@.str.2 = [22 x i8] c"invalid file mode: %s\00"
@.str.3 = [9 x i8] c"fts_open\00"
@FTS_SKIP = global i32 0
@.str.4 = [7 x i8] c"%s: %s\00"
@ALLPERMS = global i32 0
@.str.5 = [3 x i8] c"%s\00"
@S_IFMT = global i32 0
@.str.6 = [23 x i8] c": 0%o [%s] -> 0%o [%s]\00"
@.str.7 = [2 x i8] c"\0A\00"
@errno = global i64 0
@.str.8 = [9 x i8] c"fts_read\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca %struct.TYPE_7__*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i8*
%20 = alloca i32
%21 = alloca [12 x i8]
%22 = alloca [12 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32* null, i32** %8
store i32 0, i32* %18
store i32 0, i32* %16
store i32 0, i32* %14
store i32 0, i32* %11
store i32 0, i32* %10
store i32 0, i32* %9
br label %23
23: ; preds = %77, %2
%24 = load i32, i32* %4
%25 = load i8**, i8*** %5
%26 = call i32 @getopt(i32 %24, i8** %25, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
store i32 %26, i32* %12
%27 = icmp ne i32 %26, -1
br i1 %27, label %28, label %78
28: ; preds = %23
%29 = load i32, i32* %12
switch i32 %29, label %75 [
i32 72, label %30
i32 76, label %31
i32 80, label %32
i32 82, label %33
i32 102, label %34
i32 104, label %35
i32 103, label %36
i32 111, label %36
i32 114, label %36
i32 115, label %36
i32 116, label %36
i32 117, label %36
i32 119, label %36
i32 88, label %36
i32 120, label %36
i32 118, label %71
i32 63, label %74
]
30: ; preds = %28
store i32 1, i32* %9
store i32 0, i32* %10
br label %77
31: ; preds = %28
store i32 1, i32* %10
store i32 0, i32* %9
br label %77
32: ; preds = %28
store i32 0, i32* %10
store i32 0, i32* %9
br label %77
33: ; preds = %28
store i32 1, i32* %11
br label %77
34: ; preds = %28
store i32 1, i32* %14
br label %77
35: ; preds = %28
store i32 1, i32* %16
br label %77
36: ; preds = %28, %28, %28, %28, %28, %28, %28, %28, %28
%37 = load i8**, i8*** %5
%38 = load i64, i64* @optind
%39 = sub i64 %38, 1
%40 = getelementptr inbounds i8*, i8** %37, i64 %39
%41 = load i8*, i8** %40
%42 = getelementptr inbounds i8, i8* %41, i64 0
%43 = load i8, i8* %42
%44 = sext i8 %43 to i32
%45 = icmp eq i32 %44, 45
br i1 %45, label %46, label %70
46: ; preds = %36
%47 = load i8**, i8*** %5
%48 = load i64, i64* @optind
%49 = sub i64 %48, 1
%50 = getelementptr inbounds i8*, i8** %47, i64 %49
%51 = load i8*, i8** %50
%52 = getelementptr inbounds i8, i8* %51, i64 1
%53 = load i8, i8* %52
%54 = sext i8 %53 to i32
%55 = load i32, i32* %12
%56 = icmp eq i32 %54, %55
br i1 %56, label %57, label %70
57: ; preds = %46
%58 = load i8**, i8*** %5
%59 = load i64, i64* @optind
%60 = sub i64 %59, 1
%61 = getelementptr inbounds i8*, i8** %58, i64 %60
%62 = load i8*, i8** %61
%63 = getelementptr inbounds i8, i8* %62, i64 2
%64 = load i8, i8* %63
%65 = sext i8 %64 to i32
%66 = icmp eq i32 %65, 0
br i1 %66, label %67, label %70
67: ; preds = %57
%68 = load i64, i64* @optind
%69 = add i64 %68, -1
store i64 %69, i64* @optind
br label %70
70: ; preds = %67, %57, %46, %36
br label %79
71: ; preds = %28
%72 = load i32, i32* %18
%73 = add nsw i32 %72, 1
store i32 %73, i32* %18
br label %77
74: ; preds = %28
br label %75
75: ; preds = %28, %74
%76 = call i32 (...) @usage()
br label %77
77: ; preds = %75, %71, %35, %34, %33, %32, %31, %30
br label %23
78: ; preds = %23
br label %79
79: ; preds = %78, %70
%80 = load i64, i64* @optind
%81 = load i8**, i8*** %5
%82 = getelementptr inbounds i8*, i8** %81, i64 %80
store i8** %82, i8*** %5
%83 = load i64, i64* @optind
%84 = load i32, i32* %4
%85 = sext i32 %84 to i64
%86 = sub i64 %85, %83
%87 = trunc i64 %86 to i32
store i32 %87, i32* %4
%88 = load i32, i32* %4
%89 = icmp slt i32 %88, 2
br i1 %89, label %90, label %92
90: ; preds = %79
%91 = call i32 (...) @usage()
br label %92
92: ; preds = %90, %79
%93 = load i32, i32* %11
%94 = icmp ne i32 %93, 0
br i1 %94, label %95, label %120
95: ; preds = %92
%96 = load i32, i32* @FTS_PHYSICAL
store i32 %96, i32* %15
%97 = load i32, i32* %16
%98 = icmp ne i32 %97, 0
br i1 %98, label %99, label %101
99: ; preds = %95
%100 = call i32 (i32, i8*, ...) @errx(i32 1, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0))
br label %101
101: ; preds = %99, %95
%102 = load i32, i32* %9
%103 = icmp ne i32 %102, 0
br i1 %103, label %104, label %108
104: ; preds = %101
%105 = load i32, i32* @FTS_COMFOLLOW
%106 = load i32, i32* %15
%107 = or i32 %106, %105
store i32 %107, i32* %15
br label %108
108: ; preds = %104, %101
%109 = load i32, i32* %10
%110 = icmp ne i32 %109, 0
br i1 %110, label %111, label %119
111: ; preds = %108
%112 = load i32, i32* @FTS_PHYSICAL
%113 = xor i32 %112, -1
%114 = load i32, i32* %15
%115 = and i32 %114, %113
store i32 %115, i32* %15
%116 = load i32, i32* @FTS_LOGICAL
%117 = load i32, i32* %15
%118 = or i32 %117, %116
store i32 %118, i32* %15
br label %119
119: ; preds = %111, %108
br label %129
120: ; preds = %92
%121 = load i32, i32* %16
%122 = icmp ne i32 %121, 0
br i1 %122, label %123, label %125
123: ; preds = %120
%124 = load i32, i32* @FTS_PHYSICAL
br label %127
125: ; preds = %120
%126 = load i32, i32* @FTS_LOGICAL
br label %127
127: ; preds = %125, %123
%128 = phi i32 [ %124, %123 ], [ %126, %125 ]
store i32 %128, i32* %15
br label %129
129: ; preds = %127, %119
%130 = load i8**, i8*** %5
%131 = load i8*, i8** %130
store i8* %131, i8** %19
%132 = load i8*, i8** %19
%133 = call i32* @setmode(i8* %132)
store i32* %133, i32** %8
%134 = icmp eq i32* %133, null
br i1 %134, label %135, label %138
135: ; preds = %129
%136 = load i8*, i8** %19
%137 = call i32 (i32, i8*, ...) @errx(i32 1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i8* %136)
br label %138
138: ; preds = %135, %129
%139 = load i8**, i8*** %5
%140 = getelementptr inbounds i8*, i8** %139, i32 1
store i8** %140, i8*** %5
%141 = load i32, i32* %15
%142 = call i32* @fts_open(i8** %140, i32 %141, i32 0)
store i32* %142, i32** %6
%143 = icmp eq i32* %142, null
br i1 %143, label %144, label %146
144: ; preds = %138
%145 = call i32 @err(i32 1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
br label %146
146: ; preds = %144, %138
store i32 0, i32* %17
br label %147
147: ; preds = %289, %212, %185, %173, %163, %146
%148 = load i32*, i32** %6
%149 = call %struct.TYPE_7__* @fts_read(i32* %148)
store %struct.TYPE_7__* %149, %struct.TYPE_7__** %7
%150 = icmp ne %struct.TYPE_7__* %149, null
br i1 %150, label %151, label %290
151: ; preds = %147
%152 = load %struct.TYPE_7__*, %struct.TYPE_7__** %7
%153 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %152, i32 0, i32 0
%154 = load i32, i32* %153
switch i32 %154, label %187 [
i32 133, label %155
i32 132, label %164
i32 131, label %173
i32 130, label %173
i32 129, label %182
i32 128, label %182
]
155: ; preds = %151
%156 = load i32, i32* %11
%157 = icmp ne i32 %156, 0
br i1 %157, label %163, label %158
158: ; preds = %155
%159 = load i32*, i32** %6
%160 = load %struct.TYPE_7__*, %struct.TYPE_7__** %7
%161 = load i32, i32* @FTS_SKIP
%162 = call i32 @fts_set(i32* %159, %struct.TYPE_7__* %160, i32 %161)
br label %163
163: ; preds = %158, %155
br label %147
164: ; preds = %151
%165 = load %struct.TYPE_7__*, %struct.TYPE_7__** %7
%166 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %165, i32 0, i32 1
%167 = load i8*, i8** %166
%168 = load %struct.TYPE_7__*, %struct.TYPE_7__** %7
%169 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %168, i32 0, i32 4
%170 = load i32, i32* %169
%171 = call i32 @strerror(i32 %170)
%172 = call i32 @warnx(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %167, i32 %171)
store i32 1, i32* %17
br label %188
173: ; preds = %151, %151
%174 = load %struct.TYPE_7__*, %struct.TYPE_7__** %7
%175 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %174, i32 0, i32 1
%176 = load i8*, i8** %175
%177 = load %struct.TYPE_7__*, %struct.TYPE_7__** %7
%178 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %177, i32 0, i32 4
%179 = load i32, i32* %178
%180 = call i32 @strerror(i32 %179)
%181 = call i32 @warnx(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %176, i32 %180)
store i32 1, i32* %17
br label %147
182: ; preds = %151, %151
%183 = load i32, i32* %16
%184 = icmp ne i32 %183, 0
br i1 %184, label %186, label %185
185: ; preds = %182
br label %147
186: ; preds = %182
br label %187
187: ; preds = %151, %186
br label %188
188: ; preds = %187, %164
%189 = load i32*, i32** %8
%190 = load %struct.TYPE_7__*, %struct.TYPE_7__** %7
%191 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %190, i32 0, i32 2
%192 = load %struct.TYPE_6__*, %struct.TYPE_6__** %191
%193 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %192, i32 0, i32 0
%194 = load i32, i32* %193
%195 = call i32 @getmode(i32* %189, i32 %194)
store i32 %195, i32* %20
%196 = load %struct.TYPE_7__*, %struct.TYPE_7__** %7
%197 = load i32, i32* %16
%198 = call i64 @may_have_nfs4acl(%struct.TYPE_7__* %196, i32 %197)
%199 = icmp eq i64 %198, 0
br i1 %199, label %200, label %213
200: ; preds = %188
%201 = load i32, i32* %20
%202 = load i32, i32* @ALLPERMS
%203 = and i32 %201, %202
%204 = load %struct.TYPE_7__*, %struct.TYPE_7__** %7
%205 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %204, i32 0, i32 2
%206 = load %struct.TYPE_6__*, %struct.TYPE_6__** %205
%207 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %206, i32 0, i32 0
%208 = load i32, i32* %207
%209 = load i32, i32* @ALLPERMS
%210 = and i32 %208, %209
%211 = icmp eq i32 %203, %210
br i1 %211, label %212, label %213
212: ; preds = %200
br label %147
213: ; preds = %200, %188
%214 = load i32, i32* %16
%215 = icmp ne i32 %214, 0
br i1 %215, label %216, label %222
216: ; preds = %213
%217 = load %struct.TYPE_7__*, %struct.TYPE_7__** %7
%218 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %217, i32 0, i32 3
%219 = load i32, i32* %218
%220 = load i32, i32* %20
%221 = call i32 @lchmod(i32 %219, i32 %220)
store i32 %221, i32* %13
br label %228
222: ; preds = %213
%223 = load %struct.TYPE_7__*, %struct.TYPE_7__** %7
%224 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %223, i32 0, i32 3
%225 = load i32, i32* %224
%226 = load i32, i32* %20
%227 = call i32 @chmod(i32 %225, i32 %226)
store i32 %227, i32* %13
br label %228
228: ; preds = %222, %216
%229 = load i32, i32* %13
%230 = icmp ne i32 %229, 0
br i1 %230, label %231, label %240
231: ; preds = %228
%232 = load i32, i32* %14
%233 = icmp ne i32 %232, 0
br i1 %233, label %239, label %234
234: ; preds = %231
%235 = load %struct.TYPE_7__*, %struct.TYPE_7__** %7
%236 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %235, i32 0, i32 1
%237 = load i8*, i8** %236
%238 = call i32 @warn(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %237)
store i32 1, i32* %17
br label %239
239: ; preds = %234, %231
br label %289
240: ; preds = %228
%241 = load i32, i32* %18
%242 = icmp ne i32 %241, 0
br i1 %242, label %243, label %288
243: ; preds = %240
%244 = load %struct.TYPE_7__*, %struct.TYPE_7__** %7
%245 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %244, i32 0, i32 1
%246 = load i8*, i8** %245
%247 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %246)
%248 = load i32, i32* %18
%249 = icmp sgt i32 %248, 1
br i1 %249, label %250, label %286
250: ; preds = %243
%251 = load %struct.TYPE_7__*, %struct.TYPE_7__** %7
%252 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %251, i32 0, i32 2
%253 = load %struct.TYPE_6__*, %struct.TYPE_6__** %252
%254 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %253, i32 0, i32 0
%255 = load i32, i32* %254
%256 = getelementptr inbounds [12 x i8], [12 x i8]* %21, i64 0, i64 0
%257 = call i32 @strmode(i32 %255, i8* %256)
%258 = load %struct.TYPE_7__*, %struct.TYPE_7__** %7
%259 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %258, i32 0, i32 2
%260 = load %struct.TYPE_6__*, %struct.TYPE_6__** %259
%261 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %260, i32 0, i32 0
%262 = load i32, i32* %261
%263 = load i32, i32* @S_IFMT
%264 = and i32 %262, %263
%265 = load i32, i32* %20
%266 = or i32 %264, %265
%267 = getelementptr inbounds [12 x i8], [12 x i8]* %22, i64 0, i64 0
%268 = call i32 @strmode(i32 %266, i8* %267)
%269 = load %struct.TYPE_7__*, %struct.TYPE_7__** %7
%270 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %269, i32 0, i32 2
%271 = load %struct.TYPE_6__*, %struct.TYPE_6__** %270
%272 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %271, i32 0, i32 0
%273 = load i32, i32* %272
%274 = getelementptr inbounds [12 x i8], [12 x i8]* %21, i64 0, i64 0
%275 = load %struct.TYPE_7__*, %struct.TYPE_7__** %7
%276 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %275, i32 0, i32 2
%277 = load %struct.TYPE_6__*, %struct.TYPE_6__** %276
%278 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %277, i32 0, i32 0
%279 = load i32, i32* %278
%280 = load i32, i32* @S_IFMT
%281 = and i32 %279, %280
%282 = load i32, i32* %20
%283 = or i32 %281, %282
%284 = getelementptr inbounds [12 x i8], [12 x i8]* %22, i64 0, i64 0
%285 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), i32 %273, i8* %274, i32 %283, i8* %284)
br label %286
286: ; preds = %250, %243
%287 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
br label %288
288: ; preds = %286, %240
br label %289
289: ; preds = %288, %239
br label %147
290: ; preds = %147
%291 = load i64, i64* @errno
%292 = icmp ne i64 %291, 0
br i1 %292, label %293, label %295
293: ; preds = %290
%294 = call i32 @err(i32 1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
br label %295
295: ; preds = %293, %290
%296 = load i32, i32* %17
%297 = call i32 @exit(i32 %296)
unreachable
}

LLVM IR (-O2):
%struct.TYPE_7__ = type { i32, i8*, %struct.TYPE_6__*, i32, i32 }
%struct.TYPE_6__ = type { i32 }
@.str = [17 x i8] c"HLPRXfghorstuvwx\00"
@optind = global i64 0
@FTS_PHYSICAL = global i32 0
@.str.1 = [53 x i8] c"the -R and -h options may not be specified together.\00"
@FTS_COMFOLLOW = global i32 0
@FTS_LOGICAL = global i32 0
@.str.2 = [22 x i8] c"invalid file mode: %s\00"
@.str.3 = [9 x i8] c"fts_open\00"
@FTS_SKIP = global i32 0
@.str.4 = [7 x i8] c"%s: %s\00"
@ALLPERMS = global i32 0
@.str.5 = [3 x i8] c"%s\00"
@S_IFMT = global i32 0
@.str.6 = [23 x i8] c": 0%o [%s] -> 0%o [%s]\00"
@errno = global i64 0
@.str.8 = [9 x i8] c"fts_read\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca [12 x i8]
%4 = alloca [12 x i8]
br label %5
5: ; preds = %13, %2
%6 = phi i32 [ 0, %2 ], [ %14, %13 ]
%7 = phi i32 [ 0, %2 ], [ %15, %13 ]
%8 = phi i32 [ 0, %2 ], [ %16, %13 ]
%9 = phi i32 [ 0, %2 ], [ %17, %13 ]
%10 = phi i32 [ 0, %2 ], [ %18, %13 ]
%11 = phi i32 [ 0, %2 ], [ %19, %13 ]
%12 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
switch i32 %12, label %44 [
i32 -1, label %46
i32 72, label %13
i32 76, label %20
i32 80, label %21
i32 82, label %22
i32 102, label %23
i32 104, label %24
i32 103, label %25
i32 111, label %25
i32 114, label %25
i32 115, label %25
i32 116, label %25
i32 117, label %25
i32 119, label %25
i32 88, label %25
i32 120, label %25
i32 118, label %42
]
13: ; preds = %5, %44, %42, %24, %23, %22, %21, %20
%14 = phi i32 [ %6, %44 ], [ %6, %42 ], [ %6, %24 ], [ %6, %23 ], [ %6, %22 ], [ 0, %21 ], [ 0, %20 ], [ 1, %5 ]
%15 = phi i32 [ %7, %44 ], [ %7, %42 ], [ %7, %24 ], [ %7, %23 ], [ %7, %22 ], [ 0, %21 ], [ 1, %20 ], [ 0, %5 ]
%16 = phi i32 [ %8, %44 ], [ %8, %42 ], [ %8, %24 ], [ %8, %23 ], [ 1, %22 ], [ %8, %21 ], [ %8, %20 ], [ %8, %5 ]
%17 = phi i32 [ %9, %44 ], [ %9, %42 ], [ %9, %24 ], [ 1, %23 ], [ %9, %22 ], [ %9, %21 ], [ %9, %20 ], [ %9, %5 ]
%18 = phi i32 [ %10, %44 ], [ %10, %42 ], [ 1, %24 ], [ %10, %23 ], [ %10, %22 ], [ %10, %21 ], [ %10, %20 ], [ %10, %5 ]
%19 = phi i32 [ %11, %44 ], [ %43, %42 ], [ %11, %24 ], [ %11, %23 ], [ %11, %22 ], [ %11, %21 ], [ %11, %20 ], [ %11, %5 ]
br label %5
20: ; preds = %5
br label %13
21: ; preds = %5
br label %13
22: ; preds = %5
br label %13
23: ; preds = %5
br label %13
24: ; preds = %5
br label %13
25: ; preds = %5, %5, %5, %5, %5, %5, %5, %5, %5
%26 = load i64, i64* @optind
%27 = add i64 %26, -1
%28 = getelementptr inbounds i8*, i8** %1, i64 %27
%29 = load i8*, i8** %28
%30 = load i8, i8* %29
%31 = icmp eq i8 %30, 45
br i1 %31, label %32, label %48
32: ; preds = %25
%33 = getelementptr inbounds i8, i8* %29, i64 1
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = icmp eq i32 %12, %35
br i1 %36, label %37, label %48
37: ; preds = %32
%38 = getelementptr inbounds i8, i8* %29, i64 2
%39 = load i8, i8* %38
%40 = icmp eq i8 %39, 0
br i1 %40, label %41, label %48
41: ; preds = %37
store i64 %27, i64* @optind
br label %48
42: ; preds = %5
%43 = add nsw i32 %11, 1
br label %13
44: ; preds = %5
%45 = tail call i32 (...) @usage()
br label %13
46: ; preds = %5
%47 = load i64, i64* @optind
br label %48
48: ; preds = %46, %25, %32, %37, %41
%49 = phi i64 [ %47, %46 ], [ %26, %25 ], [ %26, %32 ], [ %26, %37 ], [ %27, %41 ]
%50 = getelementptr inbounds i8*, i8** %1, i64 %49
%51 = trunc i64 %49 to i32
%52 = sub i32 %0, %51
%53 = icmp slt i32 %52, 2
br i1 %53, label %54, label %56
54: ; preds = %48
%55 = tail call i32 (...) @usage()
br label %56
56: ; preds = %54, %48
%57 = icmp eq i32 %8, 0
br i1 %57, label %75, label %58
58: ; preds = %56
%59 = load i32, i32* @FTS_PHYSICAL
%60 = icmp eq i32 %10, 0
br i1 %60, label %63, label %61
61: ; preds = %58
%62 = tail call i32 (i32, i8*, ...) @errx(i32 1, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0))
br label %63
63: ; preds = %61, %58
%64 = icmp eq i32 %6, 0
%65 = load i32, i32* @FTS_COMFOLLOW
%66 = select i1 %64, i32 0, i32 %65
%67 = or i32 %66, %59
%68 = icmp eq i32 %7, 0
br i1 %68, label %80, label %69
69: ; preds = %63
%70 = load i32, i32* @FTS_PHYSICAL
%71 = xor i32 %70, -1
%72 = and i32 %67, %71
%73 = load i32, i32* @FTS_LOGICAL
%74 = or i32 %72, %73
br label %80
75: ; preds = %56
%76 = icmp eq i32 %10, 0
%77 = load i32, i32* @FTS_PHYSICAL
%78 = load i32, i32* @FTS_LOGICAL
%79 = select i1 %76, i32 %78, i32 %77
br label %80
80: ; preds = %63, %69, %75
%81 = phi i32 [ %74, %69 ], [ %67, %63 ], [ %79, %75 ]
%82 = load i8*, i8** %50
%83 = tail call i32* @setmode(i8* %82)
%84 = icmp eq i32* %83, null
br i1 %84, label %85, label %87
85: ; preds = %80
%86 = tail call i32 (i32, i8*, ...) @errx(i32 1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i8* %82)
br label %87
87: ; preds = %85, %80
%88 = getelementptr inbounds i8*, i8** %50, i64 1
%89 = tail call i32* @fts_open(i8** %88, i32 %81, i32 0)
%90 = icmp eq i32* %89, null
br i1 %90, label %91, label %93
91: ; preds = %87
%92 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
br label %93
93: ; preds = %91, %87
%94 = call %struct.TYPE_7__* @fts_read(i32* %89)
%95 = icmp eq %struct.TYPE_7__* %94, null
br i1 %95, label %194, label %96
96: ; preds = %93
%97 = icmp eq i32 %10, 0
%98 = icmp eq i32 %9, 0
%99 = icmp eq i32 %11, 0
%100 = icmp sgt i32 %11, 1
%101 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%102 = getelementptr inbounds [12 x i8], [12 x i8]* %4, i64 0, i64 0
br label %103
103: ; preds = %96, %149
%104 = phi %struct.TYPE_7__* [ %94, %96 ], [ %151, %149 ]
%105 = phi i32 [ 0, %96 ], [ %150, %149 ]
br label %106
106: ; preds = %103, %114
%107 = phi %struct.TYPE_7__* [ %104, %103 ], [ %115, %114 ]
%108 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %107, i64 0, i32 0
%109 = load i32, i32* %108
switch i32 %109, label %132 [
i32 133, label %110
i32 132, label %117
i32 131, label %124
i32 130, label %124
i32 129, label %131
i32 128, label %131
]
110: ; preds = %106
br i1 %57, label %111, label %114
111: ; preds = %110
%112 = load i32, i32* @FTS_SKIP
%113 = call i32 @fts_set(i32* %89, %struct.TYPE_7__* %107, i32 %112)
br label %114
114: ; preds = %110, %111, %131
%115 = call %struct.TYPE_7__* @fts_read(i32* %89)
%116 = icmp eq %struct.TYPE_7__* %115, null
br i1 %116, label %194, label %106
117: ; preds = %106
%118 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %107, i64 0, i32 1
%119 = load i8*, i8** %118
%120 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %107, i64 0, i32 4
%121 = load i32, i32* %120
%122 = call i32 @strerror(i32 %121)
%123 = call i32 @warnx(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %119, i32 %122)
br label %132
124: ; preds = %106, %106
%125 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %107, i64 0, i32 1
%126 = load i8*, i8** %125
%127 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %107, i64 0, i32 4
%128 = load i32, i32* %127
%129 = call i32 @strerror(i32 %128)
%130 = call i32 @warnx(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %126, i32 %129)
br label %149
131: ; preds = %106, %106
br i1 %97, label %114, label %132
132: ; preds = %106, %131, %117
%133 = phi i32 [ 1, %117 ], [ %105, %131 ], [ %105, %106 ]
%134 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %107, i64 0, i32 2
%135 = load %struct.TYPE_6__*, %struct.TYPE_6__** %134
%136 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %135, i64 0, i32 0
%137 = load i32, i32* %136
%138 = call i32 @getmode(i32* %83, i32 %137)
%139 = call i64 @may_have_nfs4acl(%struct.TYPE_7__* %107, i32 %10)
%140 = icmp eq i64 %139, 0
br i1 %140, label %141, label %153
141: ; preds = %132
%142 = load i32, i32* @ALLPERMS
%143 = load %struct.TYPE_6__*, %struct.TYPE_6__** %134
%144 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %143, i64 0, i32 0
%145 = load i32, i32* %144
%146 = xor i32 %145, %138
%147 = and i32 %146, %142
%148 = icmp eq i32 %147, 0
br i1 %148, label %149, label %153
149: ; preds = %164, %163, %192, %168, %141, %124
%150 = phi i32 [ 1, %124 ], [ %133, %141 ], [ %133, %163 ], [ 1, %164 ], [ %133, %192 ], [ %133, %168 ]
%151 = call %struct.TYPE_7__* @fts_read(i32* %89)
%152 = icmp eq %struct.TYPE_7__* %151, null
br i1 %152, label %194, label %103
153: ; preds = %141, %132
%154 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %107, i64 0, i32 3
%155 = load i32, i32* %154
br i1 %97, label %158, label %156
156: ; preds = %153
%157 = call i32 @lchmod(i32 %155, i32 %138)
br label %160
158: ; preds = %153
%159 = call i32 @chmod(i32 %155, i32 %138)
br label %160
160: ; preds = %158, %156
%161 = phi i32 [ %157, %156 ], [ %159, %158 ]
%162 = icmp eq i32 %161, 0
br i1 %162, label %168, label %163
163: ; preds = %160
br i1 %98, label %164, label %149
164: ; preds = %163
%165 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %107, i64 0, i32 1
%166 = load i8*, i8** %165
%167 = call i32 @warn(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %166)
br label %149
168: ; preds = %160
br i1 %99, label %149, label %169
169: ; preds = %168
%170 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %107, i64 0, i32 1
%171 = load i8*, i8** %170
%172 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %171)
br i1 %100, label %173, label %192
173: ; preds = %169
%174 = load %struct.TYPE_6__*, %struct.TYPE_6__** %134
%175 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %174, i64 0, i32 0
%176 = load i32, i32* %175
%177 = call i32 @strmode(i32 %176, i8* %101)
%178 = load %struct.TYPE_6__*, %struct.TYPE_6__** %134
%179 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %178, i64 0, i32 0
%180 = load i32, i32* %179
%181 = load i32, i32* @S_IFMT
%182 = and i32 %181, %180
%183 = or i32 %182, %138
%184 = call i32 @strmode(i32 %183, i8* %102)
%185 = load %struct.TYPE_6__*, %struct.TYPE_6__** %134
%186 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %185, i64 0, i32 0
%187 = load i32, i32* %186
%188 = load i32, i32* @S_IFMT
%189 = and i32 %188, %187
%190 = or i32 %189, %138
%191 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), i32 %187, i8* %101, i32 %190, i8* %102)
br label %192
192: ; preds = %173, %169
%193 = call i32 @putchar(i32 10)
br label %149
194: ; preds = %149, %114, %93
%195 = phi i32 [ 0, %93 ], [ %105, %114 ], [ %150, %149 ]
%196 = load i64, i64* @errno
%197 = icmp eq i64 %196, 0
br i1 %197, label %200, label %198
198: ; preds = %194
%199 = call i32 @err(i32 1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
br label %200
200: ; preds = %198, %194
%201 = call i32 @exit(i32 %195)
unreachable
}