#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ wd;
typedef int /*<<< orphan*/ td;
struct stat {
  int /*<<< orphan*/ st_mode;
};
struct dirent {
  unsigned char *d_name;
};
struct archive_file {
  int dummy;
};
typedef int /*<<< orphan*/ fp;
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int PATH_MAX;
int R_OK;
int /*<<< orphan*/ S_ISDIR(int /*<<< orphan*/);
int /*<<< orphan*/ S_ISREG(int /*<<< orphan*/);
int W_OK;
int X_OK;
scalar_t__ access(unsigned char *, int);
scalar_t__ check_file_name(unsigned char *, unsigned char **, unsigned char **);
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
scalar_t__ create_arch_dir(unsigned char *, int, unsigned char const *,
                           unsigned char const *);
int /*<<< orphan*/ error(char *, ...);
int /*<<< orphan*/ free(char *);
scalar_t__ lstat(unsigned char *, struct stat *);
int /*<<< orphan*/ *opendir(unsigned char *);
int /*<<< orphan*/ printf(char *, char *, char *);
scalar_t__ read_text_file(unsigned char *, char *, char **, size_t *);
struct dirent *readdir(int /*<<< orphan*/ *);
int /*<<< orphan*/ remove_directory_recursively(unsigned char *,
                                                int /*<<< orphan*/);
int /*<<< orphan*/ snprintf(unsigned char *, int, char *, unsigned char *,
                            unsigned char *);
scalar_t__ stat(unsigned char *, struct stat *);
scalar_t__ strcmp(unsigned char *, ...);
int make_make_report(
    struct archive_file *arch, const unsigned char *path,
    const unsigned char *work_dir, const unsigned char *prefix,
    const unsigned char *program_dir, const unsigned char *script_name,
    int (*unpack_func)(const unsigned char *path, const unsigned char *dir),
    unsigned char **forbidden_names, unsigned char **forbidden_suffixes) {
  unsigned char wd[PATH_MAX];
  int wd_created = 0;
  unsigned char td[PATH_MAX];
  struct stat stb;
  unsigned char fp[PATH_MAX];
  char *txt = 0;
  size_t len = 0;
  DIR *d = 0;
  struct dirent *dd;
  if (create_arch_dir(wd, sizeof(wd), work_dir, prefix) < 0)
    goto fail;
  wd_created = 1;
  if (unpack_func(path, wd) < 0)
    goto fail;
  if (!(d = opendir(wd))) {
    error("cannot open directory %s", wd);
    goto fail;
  }
  while ((dd = readdir(d))) {
    if (!strcmp(dd->d_name, "."))
      continue;
    if (!strcmp(dd->d_name, ".."))
      continue;
    if (check_file_name(dd->d_name, forbidden_names, forbidden_suffixes) < 0) {
      error("name '%s' is invalid", dd->d_name);
      goto fail;
    }
    if (strcmp(dd->d_name, program_dir) != 0) {
      error("archive contains invalid entries");
      goto fail;
    }
    snprintf(td, sizeof(td), "%s/%s", wd, dd->d_name);
    if (stat(td, &stb) < 0) {
      error("entry %s does not exist", td);
      goto fail;
    }
    if (!S_ISDIR(stb.st_mode)) {
      error("directory %s is not a directory", td);
      goto fail;
    }
    if (access(td, R_OK | W_OK | X_OK) < 0) {
      error("directory %s has invalid permissions", td);
      goto fail;
    }
  }
  closedir(d);
  d = 0;
  if (!(d = opendir(td))) {
    error("cannot open directory %s", td);
    goto fail;
  }
  while ((dd = readdir(d))) {
    if (!strcmp(dd->d_name, "."))
      continue;
    if (!strcmp(dd->d_name, ".."))
      continue;
    if (check_file_name(dd->d_name, forbidden_names, forbidden_suffixes) < 0) {
      error("name '%s' is invalid", dd->d_name);
      goto fail;
    }
    snprintf(fp, sizeof(fp), "%s/%s", td, dd->d_name);
    if (lstat(fp, &stb) < 0) {
      error("entry %s does not exist", fp);
      goto fail;
    }
    if (!S_ISREG(stb.st_mode)) {
      error("entry %s is not a regular file", fp);
      goto fail;
    }
    if (access(td, R_OK | W_OK) < 0) {
      error("entry %s has invalid permissions", fp);
      goto fail;
    }
    if (read_text_file(fp, dd->d_name, &txt, &len) >= 0) {
      printf("=== %s ===\n%s\n", dd->d_name, txt);
      free(txt);
      txt = 0;
      len = 0;
    }
  }
  closedir(d);
  d = 0;
  remove_directory_recursively(wd, 0);
  return 0;
fail:
  if (d)
    closedir(d);
  if (wd_created) {
    remove_directory_recursively(wd, 0);
  }
  return -1;
}


x86 assembly (clang, -O0):
<make_make_report>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
mov    0x2daa(%rip),%rcx
mov    (%rcx),%eax
mov    %rsp,%rdx
mov    %rdx,-0x40(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rdi
sub    %rdx,%rdi
mov    %rdi,-0xb8(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x48(%rbp)
movl   $0x0,-0x4c(%rbp)
mov    (%rcx),%edx
mov    %rdx,-0xb0(%rbp)
mov    %rdx,%r8
add    $0xf,%r8
and    $0xfffffffffffffff0,%r8
mov    %rsp,%rsi
sub    %r8,%rsi
mov    %rsi,-0xa8(%rbp)
mov    %rsi,%rsp
mov    %rdx,-0x58(%rbp)
mov    (%rcx),%ecx
mov    %rcx,-0xa0(%rbp)
mov    %rcx,%rsi
add    $0xf,%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0x98(%rbp)
mov    %rdx,%rsp
mov    %rcx,-0x68(%rbp)
movq   $0x0,-0x70(%rbp)
movq   $0x0,-0x78(%rbp)
movq   $0x0,-0x80(%rbp)
mov    %eax,%esi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   1040 <create_arch_dir@plt>
cmp    $0x0,%rax
jge    12fb <make_make_report+0xeb>
jmp    1761 <make_make_report+0x551>
mov    -0xb8(%rbp),%rsi
movl   $0x1,-0x4c(%rbp)
mov    0x10(%rbp),%rax
mov    -0x18(%rbp),%rdi
call   *%rax
cmp    $0x0,%eax
jge    1321 <make_make_report+0x111>
jmp    1761 <make_make_report+0x551>
mov    -0xb8(%rbp),%rdi
call   1050 <opendir@plt>
mov    %rax,-0x80(%rbp)
cmp    $0x0,%rax
jne    1355 <make_make_report+0x145>
mov    -0xb8(%rbp),%rsi
lea    0xcb7(%rip),%rdi
mov    $0x0,%al
call   1120 <error@plt>
jmp    1761 <make_make_report+0x551>
jmp    135a <make_make_report+0x14a>
mov    -0x80(%rbp),%rdi
call   10f0 <readdir@plt>
mov    %rax,-0x88(%rbp)
cmp    $0x0,%rax
je     150e <make_make_report+0x2fe>
mov    -0x88(%rbp),%rax
mov    (%rax),%rdi
lea    0xc95(%rip),%rsi
xor    %eax,%eax
call   10c0 <strcmp@plt>
cmp    $0x0,%rax
jne    139b <make_make_report+0x18b>
jmp    135a <make_make_report+0x14a>
mov    -0x88(%rbp),%rax
mov    (%rax),%rdi
lea    0xc6d(%rip),%rsi
xor    %eax,%eax
call   10c0 <strcmp@plt>
cmp    $0x0,%rax
jne    13c2 <make_make_report+0x1b2>
jmp    135a <make_make_report+0x14a>
mov    -0x88(%rbp),%rax
mov    (%rax),%rdi
mov    0x18(%rbp),%rsi
mov    0x20(%rbp),%rdx
call   1110 <check_file_name@plt>
cmp    $0x0,%rax
jge    1400 <make_make_report+0x1f0>
mov    -0x88(%rbp),%rax
mov    (%rax),%rsi
lea    0xc28(%rip),%rdi
mov    $0x0,%al
call   1120 <error@plt>
jmp    1761 <make_make_report+0x551>
mov    -0x88(%rbp),%rax
mov    (%rax),%rdi
mov    -0x30(%rbp),%rsi
xor    %eax,%eax
call   10c0 <strcmp@plt>
cmp    $0x0,%rax
je     1432 <make_make_report+0x222>
lea    0xc0b(%rip),%rdi
mov    $0x0,%al
call   1120 <error@plt>
jmp    1761 <make_make_report+0x551>
mov    -0xa8(%rbp),%rdi
mov    -0xb8(%rbp),%rcx
mov    -0xb0(%rbp),%rax
mov    %eax,%esi
mov    -0x88(%rbp),%rax
mov    (%rax),%r8
lea    0xbf8(%rip),%rdx
call   1080 <snprintf@plt>
mov    -0xa8(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   10d0 <stat@plt>
cmp    $0x0,%rax
jge    1493 <make_make_report+0x283>
mov    -0xa8(%rbp),%rsi
lea    0xbd1(%rip),%rdi
mov    $0x0,%al
call   1120 <error@plt>
jmp    1761 <make_make_report+0x551>
mov    -0x60(%rbp),%edi
call   1070 <S_ISDIR@plt>
cmp    $0x0,%eax
jne    14be <make_make_report+0x2ae>
mov    -0xa8(%rbp),%rsi
lea    0xbbe(%rip),%rdi
mov    $0x0,%al
call   1120 <error@plt>
jmp    1761 <make_make_report+0x551>
mov    -0xa8(%rbp),%rdi
mov    0x2afc(%rip),%rax
mov    (%rax),%esi
mov    0x2b0b(%rip),%rax
or     (%rax),%esi
mov    0x2afa(%rip),%rax
or     (%rax),%esi
call   1130 <access@plt>
cmp    $0x0,%rax
jge    1509 <make_make_report+0x2f9>
mov    -0xa8(%rbp),%rsi
lea    0xb93(%rip),%rdi
mov    $0x0,%al
call   1120 <error@plt>
jmp    1761 <make_make_report+0x551>
jmp    135a <make_make_report+0x14a>
mov    -0x80(%rbp),%rdi
call   10a0 <closedir@plt>
mov    -0xa8(%rbp),%rdi
movq   $0x0,-0x80(%rbp)
call   1050 <opendir@plt>
mov    %rax,-0x80(%rbp)
cmp    $0x0,%rax
jne    1553 <make_make_report+0x343>
mov    -0xa8(%rbp),%rsi
lea    0xab9(%rip),%rdi
mov    $0x0,%al
call   1120 <error@plt>
jmp    1761 <make_make_report+0x551>
jmp    1558 <make_make_report+0x348>
mov    -0x80(%rbp),%rdi
call   10f0 <readdir@plt>
mov    %rax,-0x88(%rbp)
cmp    $0x0,%rax
je     172c <make_make_report+0x51c>
mov    -0x88(%rbp),%rax
mov    (%rax),%rdi
lea    0xa97(%rip),%rsi
xor    %eax,%eax
call   10c0 <strcmp@plt>
cmp    $0x0,%rax
jne    1599 <make_make_report+0x389>
jmp    1558 <make_make_report+0x348>
mov    -0x88(%rbp),%rax
mov    (%rax),%rdi
lea    0xa6f(%rip),%rsi
xor    %eax,%eax
call   10c0 <strcmp@plt>
cmp    $0x0,%rax
jne    15c0 <make_make_report+0x3b0>
jmp    1558 <make_make_report+0x348>
mov    -0x88(%rbp),%rax
mov    (%rax),%rdi
mov    0x18(%rbp),%rsi
mov    0x20(%rbp),%rdx
call   1110 <check_file_name@plt>
cmp    $0x0,%rax
jge    15fe <make_make_report+0x3ee>
mov    -0x88(%rbp),%rax
mov    (%rax),%rsi
lea    0xa2a(%rip),%rdi
mov    $0x0,%al
call   1120 <error@plt>
jmp    1761 <make_make_report+0x551>
mov    -0x98(%rbp),%rdi
mov    -0xa8(%rbp),%rcx
mov    -0xa0(%rbp),%rax
mov    %eax,%esi
mov    -0x88(%rbp),%rax
mov    (%rax),%r8
lea    0xa2c(%rip),%rdx
call   1080 <snprintf@plt>
mov    -0x98(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   10b0 <lstat@plt>
cmp    $0x0,%rax
jge    165f <make_make_report+0x44f>
mov    -0x98(%rbp),%rsi
lea    0xa05(%rip),%rdi
mov    $0x0,%al
call   1120 <error@plt>
jmp    1761 <make_make_report+0x551>
mov    -0x60(%rbp),%edi
call   10e0 <S_ISREG@plt>
cmp    $0x0,%eax
jne    168a <make_make_report+0x47a>
mov    -0x98(%rbp),%rsi
lea    0xa37(%rip),%rdi
mov    $0x0,%al
call   1120 <error@plt>
jmp    1761 <make_make_report+0x551>
mov    -0xa8(%rbp),%rdi
mov    0x2930(%rip),%rax
mov    (%rax),%esi
mov    0x293f(%rip),%rax
or     (%rax),%esi
call   1130 <access@plt>
cmp    $0x0,%rax
jge    16cc <make_make_report+0x4bc>
mov    -0x98(%rbp),%rsi
lea    0xa14(%rip),%rdi
mov    $0x0,%al
call   1120 <error@plt>
jmp    1761 <make_make_report+0x551>
mov    -0x98(%rbp),%rdi
mov    -0x88(%rbp),%rax
mov    (%rax),%rsi
lea    -0x70(%rbp),%rdx
lea    -0x78(%rbp),%rcx
call   1090 <read_text_file@plt>
cmp    $0x0,%rax
jl     1727 <make_make_report+0x517>
mov    -0x88(%rbp),%rax
mov    (%rax),%rsi
mov    -0x70(%rbp),%rdx
lea    0x9ec(%rip),%rdi
call   1060 <printf@plt>
mov    -0x70(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x70(%rbp)
movq   $0x0,-0x78(%rbp)
jmp    1558 <make_make_report+0x348>
mov    -0x80(%rbp),%rdi
call   10a0 <closedir@plt>
mov    -0xb8(%rbp),%rdi
movq   $0x0,-0x80(%rbp)
xor    %esi,%esi
call   1100 <remove_directory_recursively@plt>
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8c(%rbp)
jmp    179e <make_make_report+0x58e>
cmpq   $0x0,-0x80(%rbp)
je     1775 <make_make_report+0x565>
mov    -0x80(%rbp),%rdi
call   10a0 <closedir@plt>
cmpl   $0x0,-0x4c(%rbp)
je     178d <make_make_report+0x57d>
mov    -0xb8(%rbp),%rdi
xor    %esi,%esi
call   1100 <remove_directory_recursively@plt>
movl   $0xffffffff,-0x4(%rbp)
movl   $0x1,-0x8c(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_make_report>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r8,%r15
mov    %rsi,%rbx
mov    0x2dc2(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%r12
mov    %rsi,%rax
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r12
mov    %r12,%rsp
mov    %rsp,%r13
sub    %rax,%r13
mov    %r13,%rsp
mov    %rsp,%r14
sub    %rax,%r14
mov    %r14,%rsp
movq   $0x0,-0x40(%rbp)
movq   $0x0,-0x50(%rbp)
mov    %r12,%rdi
mov    %rsi,-0x48(%rbp)
call   1040 <create_arch_dir@plt>
test   %rax,%rax
js     13ac <make_make_report+0x19c>
mov    %rbx,%rdi
mov    %r12,%rsi
call   *0x10(%rbp)
mov    $0xffffffff,%ebx
test   %eax,%eax
js     15a7 <make_make_report+0x397>
mov    %r12,%rdi
call   1050 <opendir@plt>
test   %rax,%rax
je     13b6 <make_make_report+0x1a6>
mov    %r15,%rbx
mov    %rax,-0x30(%rbp)
mov    %rax,%rdi
call   10f0 <readdir@plt>
test   %rax,%rax
je     13cc <make_make_report+0x1bc>
mov    %rax,%r15
jmp    12d5 <make_make_report+0xc5>
nop
mov    -0x30(%rbp),%rdi
call   10f0 <readdir@plt>
mov    %rax,%r15
test   %rax,%rax
je     13cc <make_make_report+0x1bc>
mov    (%r15),%rdi
lea    0xd3b(%rip),%rsi
xor    %eax,%eax
call   10c0 <strcmp@plt>
test   %rax,%rax
je     12c0 <make_make_report+0xb0>
mov    (%r15),%rdi
lea    0xd24(%rip),%rsi
xor    %eax,%eax
call   10c0 <strcmp@plt>
test   %rax,%rax
je     12c0 <make_make_report+0xb0>
mov    (%r15),%rdi
mov    0x18(%rbp),%rsi
mov    0x20(%rbp),%rdx
call   1110 <check_file_name@plt>
mov    (%r15),%rsi
test   %rax,%rax
js     1539 <make_make_report+0x329>
mov    %rsi,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   10c0 <strcmp@plt>
test   %rax,%rax
jne    1542 <make_make_report+0x332>
mov    (%r15),%r8
mov    %r13,%rdi
mov    -0x48(%rbp),%rsi
lea    0xd0e(%rip),%rdx
mov    %r12,%rcx
call   1080 <snprintf@plt>
mov    %r13,%rdi
lea    -0x38(%rbp),%rsi
call   10d0 <stat@plt>
test   %rax,%rax
js     1552 <make_make_report+0x342>
mov    -0x38(%rbp),%edi
call   1070 <S_ISDIR@plt>
test   %eax,%eax
je     155e <make_make_report+0x34e>
mov    0x2c68(%rip),%rax
mov    (%rax),%esi
mov    0x2c47(%rip),%rax
or     (%rax),%esi
mov    0x2c4e(%rip),%rax
or     (%rax),%esi
mov    %r13,%rdi
call   1130 <access@plt>
test   %rax,%rax
jns    12c0 <make_make_report+0xb0>
lea    0xcec(%rip),%rdi
mov    %r13,%rsi
jmp    1592 <make_make_report+0x382>
mov    $0xffffffff,%ebx
jmp    15b1 <make_make_report+0x3a1>
lea    0xc43(%rip),%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1120 <error@plt>
jmp    15a7 <make_make_report+0x397>
mov    -0x30(%rbp),%rdi
call   10a0 <closedir@plt>
mov    %r13,%rdi
call   1050 <opendir@plt>
test   %rax,%rax
je     1521 <make_make_report+0x311>
mov    %rax,-0x30(%rbp)
mov    %rax,%rdi
call   10f0 <readdir@plt>
test   %rax,%rax
je     1511 <make_make_report+0x301>
mov    %rax,%r15
mov    0x2bdb(%rip),%rbx
jmp    1425 <make_make_report+0x215>
nopw   0x0(%rax,%rax,1)
mov    -0x30(%rbp),%rdi
call   10f0 <readdir@plt>
mov    %rax,%r15
test   %rax,%rax
je     1511 <make_make_report+0x301>
mov    (%r15),%rdi
lea    0xbeb(%rip),%rsi
xor    %eax,%eax
call   10c0 <strcmp@plt>
test   %rax,%rax
je     1410 <make_make_report+0x200>
mov    (%r15),%rdi
lea    0xbd4(%rip),%rsi
xor    %eax,%eax
call   10c0 <strcmp@plt>
test   %rax,%rax
je     1410 <make_make_report+0x200>
mov    (%r15),%rdi
mov    0x18(%rbp),%rsi
mov    0x20(%rbp),%rdx
call   1110 <check_file_name@plt>
mov    (%r15),%r8
test   %rax,%rax
js     156a <make_make_report+0x35a>
mov    %r14,%rdi
mov    -0x48(%rbp),%rsi
lea    0xbd7(%rip),%rdx
mov    %r13,%rcx
call   1080 <snprintf@plt>
mov    %r14,%rdi
lea    -0x38(%rbp),%rsi
call   10b0 <lstat@plt>
test   %rax,%rax
js     1576 <make_make_report+0x366>
mov    -0x38(%rbp),%edi
call   10e0 <S_ISREG@plt>
test   %eax,%eax
je     157f <make_make_report+0x36f>
mov    (%rbx),%esi
mov    0x2b17(%rip),%rax
or     (%rax),%esi
mov    %r13,%rdi
call   1130 <access@plt>
test   %rax,%rax
js     1588 <make_make_report+0x378>
mov    (%r15),%rsi
mov    %r14,%rdi
lea    -0x40(%rbp),%rdx
lea    -0x50(%rbp),%rcx
call   1090 <read_text_file@plt>
test   %rax,%rax
js     1410 <make_make_report+0x200>
mov    (%r15),%rsi
mov    -0x40(%rbp),%rdx
lea    0xc07(%rip),%rdi
call   1060 <printf@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x40(%rbp)
movq   $0x0,-0x50(%rbp)
jmp    1410 <make_make_report+0x200>
mov    -0x30(%rbp),%rdi
call   10a0 <closedir@plt>
xor    %ebx,%ebx
jmp    15a7 <make_make_report+0x397>
lea    0xad8(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1120 <error@plt>
mov    $0xffffffff,%ebx
jmp    15a7 <make_make_report+0x397>
lea    0xadc(%rip),%rdi
jmp    1592 <make_make_report+0x382>
lea    0xae8(%rip),%rdi
xor    %eax,%eax
call   1120 <error@plt>
jmp    1599 <make_make_report+0x389>
lea    0xaff(%rip),%rdi
mov    %r13,%rsi
jmp    1592 <make_make_report+0x382>
lea    0xb0b(%rip),%rdi
mov    %r13,%rsi
jmp    1592 <make_make_report+0x382>
lea    0xaab(%rip),%rdi
mov    %r8,%rsi
jmp    1592 <make_make_report+0x382>
lea    0xadb(%rip),%rdi
jmp    158f <make_make_report+0x37f>
lea    0xb2f(%rip),%rdi
jmp    158f <make_make_report+0x37f>
lea    0xb45(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1120 <error@plt>
mov    $0xffffffff,%ebx
mov    -0x30(%rbp),%rdi
call   10a0 <closedir@plt>
mov    %r12,%rdi
xor    %esi,%esi
call   1100 <remove_directory_recursively@plt>
mov    %ebx,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.archive_file = type { i32 }
%struct.stat = type { i32 }
%struct.dirent = type { i8* }
@PATH_MAX = global i32 0
@.str = [25 x i8] c"cannot open directory %s\00"
@.str.1 = [2 x i8] c".\00"
@.str.2 = [3 x i8] c"..\00"
@.str.3 = [21 x i8] c"name '%s' is invalid\00"
@.str.4 = [33 x i8] c"archive contains invalid entries\00"
@.str.5 = [6 x i8] c"%s/%s\00"
@.str.6 = [24 x i8] c"entry %s does not exist\00"
@.str.7 = [32 x i8] c"directory %s is not a directory\00"
@R_OK = global i32 0
@W_OK = global i32 0
@X_OK = global i32 0
@.str.8 = [37 x i8] c"directory %s has invalid permissions\00"
@.str.9 = [31 x i8] c"entry %s is not a regular file\00"
@.str.10 = [33 x i8] c"entry %s has invalid permissions\00"
@.str.11 = [15 x i8] c"=== %s ===\0A%s\0A\00"
define i32 @make_make_report(%struct.archive_file* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5, i32 (i8*, i8*)* %6, i8** %7, i8** %8) {
%10 = alloca i32
%11 = alloca %struct.archive_file*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i8*
%17 = alloca i32 (i8*, i8*)*
%18 = alloca i8**
%19 = alloca i8**
%20 = alloca i8*
%21 = alloca i64
%22 = alloca i32
%23 = alloca i64
%24 = alloca %struct.stat
%25 = alloca i64
%26 = alloca i8*
%27 = alloca i64
%28 = alloca i32*
%29 = alloca %struct.dirent*
%30 = alloca i32
store %struct.archive_file* %0, %struct.archive_file** %11
store i8* %1, i8** %12
store i8* %2, i8** %13
store i8* %3, i8** %14
store i8* %4, i8** %15
store i8* %5, i8** %16
store i32 (i8*, i8*)* %6, i32 (i8*, i8*)** %17
store i8** %7, i8*** %18
store i8** %8, i8*** %19
%31 = load i32, i32* @PATH_MAX
%32 = zext i32 %31 to i64
%33 = call i8* @llvm.stacksave()
store i8* %33, i8** %20
%34 = alloca i8, i64 %32
store i64 %32, i64* %21
store i32 0, i32* %22
%35 = load i32, i32* @PATH_MAX
%36 = zext i32 %35 to i64
%37 = alloca i8, i64 %36
store i64 %36, i64* %23
%38 = load i32, i32* @PATH_MAX
%39 = zext i32 %38 to i64
%40 = alloca i8, i64 %39
store i64 %39, i64* %25
store i8* null, i8** %26
store i64 0, i64* %27
store i32* null, i32** %28
%41 = trunc i64 %32 to i32
%42 = load i8*, i8** %13
%43 = load i8*, i8** %14
%44 = call i64 @create_arch_dir(i8* %34, i32 %41, i8* %42, i8* %43)
%45 = icmp slt i64 %44, 0
br i1 %45, label %46, label %47
46: ; preds = %9
br label %210
47: ; preds = %9
store i32 1, i32* %22
%48 = load i32 (i8*, i8*)*, i32 (i8*, i8*)** %17
%49 = load i8*, i8** %12
%50 = call i32 %48(i8* %49, i8* %34)
%51 = icmp slt i32 %50, 0
br i1 %51, label %52, label %53
52: ; preds = %47
br label %210
53: ; preds = %47
%54 = call i32* @opendir(i8* %34)
store i32* %54, i32** %28
%55 = icmp ne i32* %54, null
br i1 %55, label %58, label %56
56: ; preds = %53
%57 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %34)
br label %210
58: ; preds = %53
br label %59
59: ; preds = %126, %76, %69, %58
%60 = load i32*, i32** %28
%61 = call %struct.dirent* @readdir(i32* %60)
store %struct.dirent* %61, %struct.dirent** %29
%62 = icmp ne %struct.dirent* %61, null
br i1 %62, label %63, label %127
63: ; preds = %59
%64 = load %struct.dirent*, %struct.dirent** %29
%65 = getelementptr inbounds %struct.dirent, %struct.dirent* %64, i32 0, i32 0
%66 = load i8*, i8** %65
%67 = call i64 (i8*, ...) @strcmp(i8* %66, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%68 = icmp ne i64 %67, 0
br i1 %68, label %70, label %69
69: ; preds = %63
br label %59
70: ; preds = %63
%71 = load %struct.dirent*, %struct.dirent** %29
%72 = getelementptr inbounds %struct.dirent, %struct.dirent* %71, i32 0, i32 0
%73 = load i8*, i8** %72
%74 = call i64 (i8*, ...) @strcmp(i8* %73, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%75 = icmp ne i64 %74, 0
br i1 %75, label %77, label %76
76: ; preds = %70
br label %59
77: ; preds = %70
%78 = load %struct.dirent*, %struct.dirent** %29
%79 = getelementptr inbounds %struct.dirent, %struct.dirent* %78, i32 0, i32 0
%80 = load i8*, i8** %79
%81 = load i8**, i8*** %18
%82 = load i8**, i8*** %19
%83 = call i64 @check_file_name(i8* %80, i8** %81, i8** %82)
%84 = icmp slt i64 %83, 0
br i1 %84, label %85, label %90
85: ; preds = %77
%86 = load %struct.dirent*, %struct.dirent** %29
%87 = getelementptr inbounds %struct.dirent, %struct.dirent* %86, i32 0, i32 0
%88 = load i8*, i8** %87
%89 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* %88)
br label %210
90: ; preds = %77
%91 = load %struct.dirent*, %struct.dirent** %29
%92 = getelementptr inbounds %struct.dirent, %struct.dirent* %91, i32 0, i32 0
%93 = load i8*, i8** %92
%94 = load i8*, i8** %15
%95 = call i64 (i8*, ...) @strcmp(i8* %93, i8* %94)
%96 = icmp ne i64 %95, 0
br i1 %96, label %97, label %99
97: ; preds = %90
%98 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0))
br label %210
99: ; preds = %90
%100 = trunc i64 %36 to i32
%101 = load %struct.dirent*, %struct.dirent** %29
%102 = getelementptr inbounds %struct.dirent, %struct.dirent* %101, i32 0, i32 0
%103 = load i8*, i8** %102
%104 = call i32 @snprintf(i8* %37, i32 %100, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* %34, i8* %103)
%105 = call i64 @stat(i8* %37, %struct.stat* %24)
%106 = icmp slt i64 %105, 0
br i1 %106, label %107, label %109
107: ; preds = %99
%108 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), i8* %37)
br label %210
109: ; preds = %99
%110 = getelementptr inbounds %struct.stat, %struct.stat* %24, i32 0, i32 0
%111 = load i32, i32* %110
%112 = call i32 @S_ISDIR(i32 %111)
%113 = icmp ne i32 %112, 0
br i1 %113, label %116, label %114
114: ; preds = %109
%115 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.7, i64 0, i64 0), i8* %37)
br label %210
116: ; preds = %109
%117 = load i32, i32* @R_OK
%118 = load i32, i32* @W_OK
%119 = or i32 %117, %118
%120 = load i32, i32* @X_OK
%121 = or i32 %119, %120
%122 = call i64 @access(i8* %37, i32 %121)
%123 = icmp slt i64 %122, 0
br i1 %123, label %124, label %126
124: ; preds = %116
%125 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.8, i64 0, i64 0), i8* %37)
br label %210
126: ; preds = %116
br label %59
127: ; preds = %59
%128 = load i32*, i32** %28
%129 = call i32 @closedir(i32* %128)
store i32* null, i32** %28
%130 = call i32* @opendir(i8* %37)
store i32* %130, i32** %28
%131 = icmp ne i32* %130, null
br i1 %131, label %134, label %132
132: ; preds = %127
%133 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %37)
br label %210
134: ; preds = %127
br label %135
135: ; preds = %205, %152, %145, %134
%136 = load i32*, i32** %28
%137 = call %struct.dirent* @readdir(i32* %136)
store %struct.dirent* %137, %struct.dirent** %29
%138 = icmp ne %struct.dirent* %137, null
br i1 %138, label %139, label %206
139: ; preds = %135
%140 = load %struct.dirent*, %struct.dirent** %29
%141 = getelementptr inbounds %struct.dirent, %struct.dirent* %140, i32 0, i32 0
%142 = load i8*, i8** %141
%143 = call i64 (i8*, ...) @strcmp(i8* %142, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%144 = icmp ne i64 %143, 0
br i1 %144, label %146, label %145
145: ; preds = %139
br label %135
146: ; preds = %139
%147 = load %struct.dirent*, %struct.dirent** %29
%148 = getelementptr inbounds %struct.dirent, %struct.dirent* %147, i32 0, i32 0
%149 = load i8*, i8** %148
%150 = call i64 (i8*, ...) @strcmp(i8* %149, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%151 = icmp ne i64 %150, 0
br i1 %151, label %153, label %152
152: ; preds = %146
br label %135
153: ; preds = %146
%154 = load %struct.dirent*, %struct.dirent** %29
%155 = getelementptr inbounds %struct.dirent, %struct.dirent* %154, i32 0, i32 0
%156 = load i8*, i8** %155
%157 = load i8**, i8*** %18
%158 = load i8**, i8*** %19
%159 = call i64 @check_file_name(i8* %156, i8** %157, i8** %158)
%160 = icmp slt i64 %159, 0
br i1 %160, label %161, label %166
161: ; preds = %153
%162 = load %struct.dirent*, %struct.dirent** %29
%163 = getelementptr inbounds %struct.dirent, %struct.dirent* %162, i32 0, i32 0
%164 = load i8*, i8** %163
%165 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* %164)
br label %210
166: ; preds = %153
%167 = trunc i64 %39 to i32
%168 = load %struct.dirent*, %struct.dirent** %29
%169 = getelementptr inbounds %struct.dirent, %struct.dirent* %168, i32 0, i32 0
%170 = load i8*, i8** %169
%171 = call i32 @snprintf(i8* %40, i32 %167, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* %37, i8* %170)
%172 = call i64 @lstat(i8* %40, %struct.stat* %24)
%173 = icmp slt i64 %172, 0
br i1 %173, label %174, label %176
174: ; preds = %166
%175 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), i8* %40)
br label %210
176: ; preds = %166
%177 = getelementptr inbounds %struct.stat, %struct.stat* %24, i32 0, i32 0
%178 = load i32, i32* %177
%179 = call i32 @S_ISREG(i32 %178)
%180 = icmp ne i32 %179, 0
br i1 %180, label %183, label %181
181: ; preds = %176
%182 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.9, i64 0, i64 0), i8* %40)
br label %210
183: ; preds = %176
%184 = load i32, i32* @R_OK
%185 = load i32, i32* @W_OK
%186 = or i32 %184, %185
%187 = call i64 @access(i8* %37, i32 %186)
%188 = icmp slt i64 %187, 0
br i1 %188, label %189, label %191
189: ; preds = %183
%190 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.10, i64 0, i64 0), i8* %40)
br label %210
191: ; preds = %183
%192 = load %struct.dirent*, %struct.dirent** %29
%193 = getelementptr inbounds %struct.dirent, %struct.dirent* %192, i32 0, i32 0
%194 = load i8*, i8** %193
%195 = call i64 @read_text_file(i8* %40, i8* %194, i8** %26, i64* %27)
%196 = icmp sge i64 %195, 0
br i1 %196, label %197, label %205
197: ; preds = %191
%198 = load %struct.dirent*, %struct.dirent** %29
%199 = getelementptr inbounds %struct.dirent, %struct.dirent* %198, i32 0, i32 0
%200 = load i8*, i8** %199
%201 = load i8*, i8** %26
%202 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.11, i64 0, i64 0), i8* %200, i8* %201)
%203 = load i8*, i8** %26
%204 = call i32 @free(i8* %203)
store i8* null, i8** %26
store i64 0, i64* %27
br label %205
205: ; preds = %197, %191
br label %135
206: ; preds = %135
%207 = load i32*, i32** %28
%208 = call i32 @closedir(i32* %207)
store i32* null, i32** %28
%209 = call i32 @remove_directory_recursively(i8* %34, i32 0)
store i32 0, i32* %10
store i32 1, i32* %30
br label %222
210: ; preds = %189, %181, %174, %161, %132, %124, %114, %107, %97, %85, %56, %52, %46
%211 = load i32*, i32** %28
%212 = icmp ne i32* %211, null
br i1 %212, label %213, label %216
213: ; preds = %210
%214 = load i32*, i32** %28
%215 = call i32 @closedir(i32* %214)
br label %216
216: ; preds = %213, %210
%217 = load i32, i32* %22
%218 = icmp ne i32 %217, 0
br i1 %218, label %219, label %221
219: ; preds = %216
%220 = call i32 @remove_directory_recursively(i8* %34, i32 0)
br label %221
221: ; preds = %219, %216
store i32 -1, i32* %10
store i32 1, i32* %30
br label %222
222: ; preds = %221, %206
%223 = load i8*, i8** %20
%224 = load i32, i32* %10
ret i32 %224
}

LLVM IR (-O2):
%struct.archive_file = type { i32 }
%struct.stat = type { i32 }
%struct.dirent = type { i8* }
@PATH_MAX = global i32 0
@.str = [25 x i8] c"cannot open directory %s\00"
@.str.1 = [2 x i8] c".\00"
@.str.2 = [3 x i8] c"..\00"
@.str.3 = [21 x i8] c"name '%s' is invalid\00"
@.str.4 = [33 x i8] c"archive contains invalid entries\00"
@.str.5 = [6 x i8] c"%s/%s\00"
@.str.6 = [24 x i8] c"entry %s does not exist\00"
@.str.7 = [32 x i8] c"directory %s is not a directory\00"
@R_OK = global i32 0
@W_OK = global i32 0
@X_OK = global i32 0
@.str.8 = [37 x i8] c"directory %s has invalid permissions\00"
@.str.9 = [31 x i8] c"entry %s is not a regular file\00"
@.str.10 = [33 x i8] c"entry %s has invalid permissions\00"
@.str.11 = [15 x i8] c"=== %s ===\0A%s\0A\00"
define i32 @make_make_report(%struct.archive_file* nocapture readnone %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* nocapture readnone %5, i32 (i8*, i8*)* nocapture %6, i8** %7, i8** %8) {
%10 = alloca %struct.stat
%11 = alloca i8*
%12 = alloca i64
%13 = load i32, i32* @PATH_MAX
%14 = zext i32 %13 to i64
%15 = alloca i8, i64 %14
%16 = alloca i8, i64 %14
%17 = bitcast %struct.stat* %10 to i8*
%18 = alloca i8, i64 %14
%19 = bitcast i8** %11 to i8*
store i8* null, i8** %11
%20 = bitcast i64* %12 to i8*
store i64 0, i64* %12
%21 = call i64 @create_arch_dir(i8* %15, i32 %13, i8* %2, i8* %3)
%22 = icmp slt i64 %21, 0
br i1 %22, label %153, label %23
23: ; preds = %9
%24 = call i32 %6(i8* %1, i8* %15)
%25 = icmp slt i32 %24, 0
br i1 %25, label %150, label %26
26: ; preds = %23
%27 = call i32* @opendir(i8* %15)
%28 = icmp eq i32* %27, null
br i1 %28, label %34, label %29
29: ; preds = %26
%30 = call %struct.dirent* @readdir(i32* %27)
%31 = icmp eq %struct.dirent* %30, null
br i1 %31, label %84, label %32
32: ; preds = %29
%33 = getelementptr inbounds %struct.stat, %struct.stat* %10, i64 0, i32 0
br label %36
34: ; preds = %26
%35 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %15)
br label %150
36: ; preds = %32, %42
%37 = phi %struct.dirent* [ %30, %32 ], [ %43, %42 ]
%38 = getelementptr inbounds %struct.dirent, %struct.dirent* %37, i64 0, i32 0
%39 = load i8*, i8** %38
%40 = call i64 (i8*, ...) @strcmp(i8* %39, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%41 = icmp eq i64 %40, 0
br i1 %41, label %42, label %45
42: ; preds = %36, %45, %74
%43 = call %struct.dirent* @readdir(i32* %27)
%44 = icmp eq %struct.dirent* %43, null
br i1 %44, label %84, label %36
45: ; preds = %36
%46 = load i8*, i8** %38
%47 = call i64 (i8*, ...) @strcmp(i8* %46, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%48 = icmp eq i64 %47, 0
br i1 %48, label %42, label %49
49: ; preds = %45
%50 = load i8*, i8** %38
%51 = call i64 @check_file_name(i8* %50, i8** %7, i8** %8)
%52 = icmp slt i64 %51, 0
%53 = load i8*, i8** %38
br i1 %52, label %54, label %56
54: ; preds = %49
%55 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* %53)
br label %147
56: ; preds = %49
%57 = call i64 (i8*, ...) @strcmp(i8* %53, i8* %4)
%58 = icmp eq i64 %57, 0
br i1 %58, label %61, label %59
59: ; preds = %56
%60 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0))
br label %147
61: ; preds = %56
%62 = load i8*, i8** %38
%63 = call i32 @snprintf(i8* %16, i32 %13, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* %15, i8* %62)
%64 = call i64 @stat(i8* %16, %struct.stat* %10)
%65 = icmp slt i64 %64, 0
br i1 %65, label %66, label %68
66: ; preds = %61
%67 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), i8* %16)
br label %147
68: ; preds = %61
%69 = load i32, i32* %33
%70 = call i32 @S_ISDIR(i32 %69)
%71 = icmp eq i32 %70, 0
br i1 %71, label %72, label %74
72: ; preds = %68
%73 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.7, i64 0, i64 0), i8* %16)
br label %147
74: ; preds = %68
%75 = load i32, i32* @R_OK
%76 = load i32, i32* @W_OK
%77 = or i32 %76, %75
%78 = load i32, i32* @X_OK
%79 = or i32 %77, %78
%80 = call i64 @access(i8* %16, i32 %79)
%81 = icmp slt i64 %80, 0
br i1 %81, label %82, label %42
82: ; preds = %74
%83 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.8, i64 0, i64 0), i8* %16)
br label %147
84: ; preds = %42, %29
%85 = call i32 @closedir(i32* %27)
%86 = call i32* @opendir(i8* %16)
%87 = icmp eq i32* %86, null
br i1 %87, label %93, label %88
88: ; preds = %84
%89 = call %struct.dirent* @readdir(i32* %86)
%90 = icmp eq %struct.dirent* %89, null
br i1 %90, label %145, label %91
91: ; preds = %88
%92 = getelementptr inbounds %struct.stat, %struct.stat* %10, i64 0, i32 0
br label %95
93: ; preds = %84
%94 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %16)
br label %150
95: ; preds = %91, %142
%96 = phi %struct.dirent* [ %89, %91 ], [ %143, %142 ]
%97 = getelementptr inbounds %struct.dirent, %struct.dirent* %96, i64 0, i32 0
%98 = load i8*, i8** %97
%99 = call i64 (i8*, ...) @strcmp(i8* %98, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%100 = icmp eq i64 %99, 0
br i1 %100, label %142, label %101
101: ; preds = %95
%102 = load i8*, i8** %97
%103 = call i64 (i8*, ...) @strcmp(i8* %102, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%104 = icmp eq i64 %103, 0
br i1 %104, label %142, label %105
105: ; preds = %101
%106 = load i8*, i8** %97
%107 = call i64 @check_file_name(i8* %106, i8** %7, i8** %8)
%108 = icmp slt i64 %107, 0
%109 = load i8*, i8** %97
br i1 %108, label %110, label %112
110: ; preds = %105
%111 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* %109)
br label %147
112: ; preds = %105
%113 = call i32 @snprintf(i8* %18, i32 %13, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* %16, i8* %109)
%114 = call i64 @lstat(i8* %18, %struct.stat* %10)
%115 = icmp slt i64 %114, 0
br i1 %115, label %116, label %118
116: ; preds = %112
%117 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), i8* %18)
br label %147
118: ; preds = %112
%119 = load i32, i32* %92
%120 = call i32 @S_ISREG(i32 %119)
%121 = icmp eq i32 %120, 0
br i1 %121, label %122, label %124
122: ; preds = %118
%123 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.9, i64 0, i64 0), i8* %18)
br label %147
124: ; preds = %118
%125 = load i32, i32* @R_OK
%126 = load i32, i32* @W_OK
%127 = or i32 %126, %125
%128 = call i64 @access(i8* %16, i32 %127)
%129 = icmp slt i64 %128, 0
br i1 %129, label %130, label %132
130: ; preds = %124
%131 = call i32 (i8*, ...) @error(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.10, i64 0, i64 0), i8* %18)
br label %147
132: ; preds = %124
%133 = load i8*, i8** %97
%134 = call i64 @read_text_file(i8* %18, i8* %133, i8** %11, i64* %12)
%135 = icmp sgt i64 %134, -1
br i1 %135, label %136, label %142
136: ; preds = %132
%137 = load i8*, i8** %97
%138 = load i8*, i8** %11
%139 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.11, i64 0, i64 0), i8* %137, i8* %138)
%140 = load i8*, i8** %11
%141 = call i32 @free(i8* %140)
store i8* null, i8** %11
store i64 0, i64* %12
br label %142
142: ; preds = %132, %136, %95, %101
%143 = call %struct.dirent* @readdir(i32* %86)
%144 = icmp eq %struct.dirent* %143, null
br i1 %144, label %145, label %95
145: ; preds = %142, %88
%146 = call i32 @closedir(i32* %86)
br label %150
147: ; preds = %54, %59, %66, %72, %82, %110, %116, %122, %130
%148 = phi i32* [ %86, %130 ], [ %86, %122 ], [ %86, %116 ], [ %86, %110 ], [ %27, %82 ], [ %27, %72 ], [ %27, %66 ], [ %27, %59 ], [ %27, %54 ]
%149 = call i32 @closedir(i32* %148)
br label %150
150: ; preds = %147, %34, %93, %23, %145
%151 = phi i32 [ 0, %145 ], [ -1, %23 ], [ -1, %93 ], [ -1, %34 ], [ -1, %147 ]
%152 = call i32 @remove_directory_recursively(i8* %15, i32 0)
br label %153
153: ; preds = %150, %9
%154 = phi i32 [ -1, %9 ], [ %151, %150 ]
ret i32 %154
}