#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 uint8_t;
struct utimbuf {
  int actime;
  int modtime;
};
struct stat {
  int st_size;
  int st_mode;
  int st_atime;
  int st_mtime;
};
struct iovec {
  int *iov_base;
  int iov_len;
};
struct dirent {
  int /*<<< orphan*/ d_name;
};
typedef int /*<<< orphan*/ cur_dir;
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int O_CREAT;
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ O_RDWR;
int O_TRUNC;
int O_WRONLY;
int /*<<< orphan*/ R_OK;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ S_ISDIR(int);
int /*<<< orphan*/ S_ISLNK(int);
int /*<<< orphan*/ S_ISREG(int);
int __chk_error(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ access(char *, int /*<<< orphan*/);
int /*<<< orphan*/ chdir(char *);
int /*<<< orphan*/ chmod(char *, int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
int /*<<< orphan*/ error1(char *, int, char *);
int /*<<< orphan*/ fstat(int, struct stat *);
int /*<<< orphan*/ ftruncate(int, int);
int /*<<< orphan*/ *getcwd(char *, int);
int /*<<< orphan*/ lseek(int, int, int /*<<< orphan*/);
int /*<<< orphan*/ lstat(char *, struct stat *);
scalar_t__ memcmp(int *, int *, int);
int /*<<< orphan*/ mkdir(char *, int);
int /*<<< orphan*/ open(char *, int, ...);
int /*<<< orphan*/ *opendir(char *);
int /*<<< orphan*/ read(int, int *, int);
struct dirent *readdir(int /*<<< orphan*/ *);
int /*<<< orphan*/ readv(int, struct iovec *, int);
int /*<<< orphan*/ rename(char *, char *);
int /*<<< orphan*/ rmdir(char *);
int /*<<< orphan*/ stat(char *, struct stat *);
scalar_t__ strcmp(int /*<<< orphan*/, char *);
int /*<<< orphan*/ symlink(char *, char *);
int /*<<< orphan*/ truncate(char *, int);
int /*<<< orphan*/ unlink(char *);
int /*<<< orphan*/ utime(char *, struct utimbuf *);
int /*<<< orphan*/ write(int, int *, int);
int /*<<< orphan*/ writev(int, struct iovec *, int);
void test_file(void) {
  int fd, i, len, ret;
  uint8_t buf[300];
  uint8_t buf2[300];
  uint8_t buf3[300];
  char cur_dir[1024];
  struct stat st;
  struct utimbuf tbuf;
  struct iovec vecs[2];
  DIR *dir;
  struct dirent *de;
  unlink("/tmp/linux-test.tmp"
         "/file1");
  unlink("/tmp/linux-test.tmp"
         "/file2");
  unlink("/tmp/linux-test.tmp"
         "/file3");
  rmdir("/tmp/linux-test.tmp");
  if (getcwd(cur_dir, sizeof(cur_dir)) == NULL)
    error1("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/jvesely/qemu-neo1973/refs/heads/master/"
           "tests/linux-test.c",
           95, "getcwd");
  __chk_error("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/jvesely/qemu-neo1973/refs/heads/"
              "master/tests/linux-test.c",
              97, (mkdir("/tmp/linux-test.tmp", 0755)));
  __chk_error("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/jvesely/qemu-neo1973/refs/heads/"
              "master/tests/linux-test.c",
              99, (chdir("/tmp/linux-test.tmp")));
  fd = __chk_error("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                   "outputs/2022-01-22/02-19-57/repos/jvesely/qemu-neo1973/"
                   "refs/heads/master/tests/linux-test.c",
                   103, (open("file1", O_WRONLY | O_TRUNC | O_CREAT, 0644)));
  for (i = 0; i < 300; i++)
    buf[i] = i;
  len = __chk_error("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/jvesely/qemu-neo1973/"
                    "refs/heads/master/tests/linux-test.c",
                    106, (write(fd, buf, 300 / 2)));
  if (len != (300 / 2))
    error1("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/jvesely/qemu-neo1973/refs/heads/master/"
           "tests/linux-test.c",
           108, "write");
  vecs[0].iov_base = buf + (300 / 2);
  vecs[0].iov_len = 16;
  vecs[1].iov_base = buf + (300 / 2) + 16;
  vecs[1].iov_len = (300 / 2) - 16;
  len = __chk_error("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/jvesely/qemu-neo1973/"
                    "refs/heads/master/tests/linux-test.c",
                    113, (writev(fd, vecs, 2)));
  if (len != (300 / 2))
    error1("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/jvesely/qemu-neo1973/refs/heads/master/"
           "tests/linux-test.c",
           115, "writev");
  __chk_error("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/jvesely/qemu-neo1973/refs/heads/"
              "master/tests/linux-test.c",
              116, (close(fd)));
  __chk_error("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/jvesely/qemu-neo1973/refs/heads/"
              "master/tests/linux-test.c",
              118, (rename("file1", "file2")));
  fd = __chk_error("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                   "outputs/2022-01-22/02-19-57/repos/jvesely/qemu-neo1973/"
                   "refs/heads/master/tests/linux-test.c",
                   120, (open("file2", O_RDONLY)));
  len = __chk_error("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/jvesely/qemu-neo1973/"
                    "refs/heads/master/tests/linux-test.c",
                    122, (read(fd, buf2, 300)));
  if (len != 300)
    error1("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/jvesely/qemu-neo1973/refs/heads/master/"
           "tests/linux-test.c",
           124, "read");
  if (memcmp(buf, buf2, 300) != 0)
    error1("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/jvesely/qemu-neo1973/refs/heads/master/"
           "tests/linux-test.c",
           126, "memcmp");
  ret = __chk_error("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/jvesely/qemu-neo1973/"
                    "refs/heads/master/tests/linux-test.c",
                    129, (lseek(fd, 16, SEEK_SET)));
  if (ret != 16)
    error1("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/jvesely/qemu-neo1973/refs/heads/master/"
           "tests/linux-test.c",
           131, "lseek");
  vecs[0].iov_base = buf3;
  vecs[0].iov_len = 32;
  vecs[1].iov_base = buf3 + 32;
  vecs[1].iov_len = 300 - 16 - 32;
  len = __chk_error("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/jvesely/qemu-neo1973/"
                    "refs/heads/master/tests/linux-test.c",
                    136, (readv(fd, vecs, 2)));
  if (len != 300 - 16)
    error1("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/jvesely/qemu-neo1973/refs/heads/master/"
           "tests/linux-test.c",
           138, "readv");
  if (memcmp(buf + 16, buf3, 300 - 16) != 0)
    error1("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/jvesely/qemu-neo1973/refs/heads/master/"
           "tests/linux-test.c",
           140, "memcmp");
  __chk_error("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/jvesely/qemu-neo1973/refs/heads/"
              "master/tests/linux-test.c",
              142, (close(fd)));
  __chk_error("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/jvesely/qemu-neo1973/refs/heads/"
              "master/tests/linux-test.c",
              145, (access("file2", R_OK)));
  __chk_error("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/jvesely/qemu-neo1973/refs/heads/"
              "master/tests/linux-test.c",
              149, (chmod("file2", 0600)));
  tbuf.actime = 1001;
  tbuf.modtime = 1000;
  __chk_error("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/jvesely/qemu-neo1973/refs/heads/"
              "master/tests/linux-test.c",
              152, (truncate("file2", 100)));
  __chk_error("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/jvesely/qemu-neo1973/refs/heads/"
              "master/tests/linux-test.c",
              153, (utime("file2", &tbuf)));
  __chk_error("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/jvesely/qemu-neo1973/refs/heads/"
              "master/tests/linux-test.c",
              154, (stat("file2", &st)));
  if (st.st_size != 100)
    error1("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/jvesely/qemu-neo1973/refs/heads/master/"
           "tests/linux-test.c",
           156, "stat size");
  if (!S_ISREG(st.st_mode))
    error1("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/jvesely/qemu-neo1973/refs/heads/master/"
           "tests/linux-test.c",
           158, "stat mode");
  if ((st.st_mode & 0777) != 0600)
    error1("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/jvesely/qemu-neo1973/refs/heads/master/"
           "tests/linux-test.c",
           160, "stat mode2");
  if (st.st_atime != 1001 || st.st_mtime != 1000)
    error1("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/jvesely/qemu-neo1973/refs/heads/master/"
           "tests/linux-test.c",
           163, "stat time");
  __chk_error("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/jvesely/qemu-neo1973/refs/heads/"
              "master/tests/linux-test.c",
              165, (stat("/tmp/linux-test.tmp", &st)));
  if (!S_ISDIR(st.st_mode))
    error1("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/jvesely/qemu-neo1973/refs/heads/master/"
           "tests/linux-test.c",
           167, "stat mode");
  fd = __chk_error("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                   "outputs/2022-01-22/02-19-57/repos/jvesely/qemu-neo1973/"
                   "refs/heads/master/tests/linux-test.c",
                   170, (open("file2", O_RDWR)));
  __chk_error("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/jvesely/qemu-neo1973/refs/heads/"
              "master/tests/linux-test.c",
              171, (ftruncate(fd, 50)));
  __chk_error("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/jvesely/qemu-neo1973/refs/heads/"
              "master/tests/linux-test.c",
              172, (fstat(fd, &st)));
  __chk_error("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/jvesely/qemu-neo1973/refs/heads/"
              "master/tests/linux-test.c",
              173, (close(fd)));
  if (st.st_size != 50)
    error1("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/jvesely/qemu-neo1973/refs/heads/master/"
           "tests/linux-test.c",
           176, "stat size");
  if (!S_ISREG(st.st_mode))
    error1("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/jvesely/qemu-neo1973/refs/heads/master/"
           "tests/linux-test.c",
           178, "stat mode");
  __chk_error("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/jvesely/qemu-neo1973/refs/heads/"
              "master/tests/linux-test.c",
              181, (symlink("file2", "file3")));
  __chk_error("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/jvesely/qemu-neo1973/refs/heads/"
              "master/tests/linux-test.c",
              182, (lstat("file3", &st)));
  if (!S_ISLNK(st.st_mode))
    error1("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/jvesely/qemu-neo1973/refs/heads/master/"
           "tests/linux-test.c",
           184, "stat mode");
  dir = opendir("/tmp/linux-test.tmp");
  if (!dir)
    error1("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/jvesely/qemu-neo1973/refs/heads/master/"
           "tests/linux-test.c",
           189, "opendir");
  len = 0;
  for (;;) {
    de = readdir(dir);
    if (!de)
      break;
    if (strcmp(de->d_name, ".") != 0 && strcmp(de->d_name, "..") != 0 &&
        strcmp(de->d_name, "file2") != 0 && strcmp(de->d_name, "file3") != 0)
      error1("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/jvesely/qemu-neo1973/refs/heads/master/"
             "tests/linux-test.c",
             199, "readdir");
    len++;
  }
  closedir(dir);
  if (len != 4)
    error1("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/jvesely/qemu-neo1973/refs/heads/master/"
           "tests/linux-test.c",
           204, "readdir");
  __chk_error("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/jvesely/qemu-neo1973/refs/heads/"
              "master/tests/linux-test.c",
              206, (unlink("file3")));
  __chk_error("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/jvesely/qemu-neo1973/refs/heads/"
              "master/tests/linux-test.c",
              207, (unlink("file2")));
  __chk_error("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/jvesely/qemu-neo1973/refs/heads/"
              "master/tests/linux-test.c",
              208, (chdir(cur_dir)));
  __chk_error("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/jvesely/qemu-neo1973/refs/heads/"
              "master/tests/linux-test.c",
              209, (rmdir("/tmp/linux-test.tmp")));
}


x86 assembly (clang, -O0):
<test_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1270,%rsp
lea    0xcee(%rip),%rdi
call   1040 <unlink@plt>
lea    0xcfc(%rip),%rdi
call   1040 <unlink@plt>
lea    0xd0a(%rip),%rdi
call   1040 <unlink@plt>
lea    0xd18(%rip),%rdi
call   10b0 <rmdir@plt>
lea    -0x1220(%rbp),%rdi
mov    $0x400,%esi
call   1110 <getcwd@plt>
cmp    $0x0,%rax
jne    136e <test_file+0x6e>
lea    0xd05(%rip),%rdi
mov    $0x5f,%esi
lea    0xd8d(%rip),%rdx
call   1210 <error1@plt>
lea    0xcd9(%rip),%rdi
mov    $0x1ed,%esi
call   1060 <mkdir@plt>
mov    %eax,%edx
lea    0xcda(%rip),%rdi
mov    $0x61,%esi
call   1090 <__chk_error@plt>
lea    0xcb5(%rip),%rdi
call   10c0 <chdir@plt>
mov    %eax,%edx
lea    0xcbb(%rip),%rdi
mov    $0x63,%esi
call   1090 <__chk_error@plt>
mov    0x2bf0(%rip),%rax
mov    (%rax),%esi
mov    0x2c2f(%rip),%rax
or     (%rax),%esi
mov    0x2c2e(%rip),%rax
or     (%rax),%esi
lea    0xc41(%rip),%rdi
mov    $0x1a4,%edx
mov    $0x0,%al
call   11e0 <open@plt>
mov    %eax,%edx
lea    0xc7a(%rip),%rdi
mov    $0x67,%esi
call   1090 <__chk_error@plt>
mov    %eax,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x12c,-0x8(%rbp)
jge    1425 <test_file+0x125>
mov    -0x8(%rbp),%ecx
movslq -0x8(%rbp),%rax
mov    %ecx,-0x4c0(%rbp,%rax,4)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    13fc <test_file+0xfc>
mov    -0x4(%rbp),%edi
lea    -0x4c0(%rbp),%rsi
mov    $0x96,%edx
call   1080 <write@plt>
mov    %eax,%edx
lea    0xc20(%rip),%rdi
mov    $0x6a,%esi
call   1090 <__chk_error@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x96,-0xc(%rbp)
je     1474 <test_file+0x174>
lea    0xbff(%rip),%rdi
mov    $0x6c,%esi
lea    0xc8e(%rip),%rdx
call   1210 <error1@plt>
lea    -0x4c0(%rbp),%rax
add    $0x258,%rax
mov    %rax,-0x1260(%rbp)
movl   $0x10,-0x1258(%rbp)
lea    -0x4c0(%rbp),%rax
add    $0x258,%rax
add    $0x40,%rax
mov    %rax,-0x1250(%rbp)
movl   $0x86,-0x1248(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x1260(%rbp),%rsi
mov    $0x2,%edx
call   1070 <writev@plt>
mov    %eax,%edx
lea    0xb91(%rip),%rdi
mov    $0x71,%esi
call   1090 <__chk_error@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x96,-0xc(%rbp)
je     1503 <test_file+0x203>
lea    0xb70(%rip),%rdi
mov    $0x73,%esi
lea    0xc05(%rip),%rdx
call   1210 <error1@plt>
mov    -0x4(%rbp),%edi
call   1120 <close@plt>
mov    %eax,%edx
lea    0xb4e(%rip),%rdi
mov    $0x74,%esi
call   1090 <__chk_error@plt>
lea    0xaef(%rip),%rdi
lea    0xb02(%rip),%rsi
call   1200 <rename@plt>
mov    %eax,%edx
lea    0xb28(%rip),%rdi
mov    $0x76,%esi
call   1090 <__chk_error@plt>
mov    0x2a85(%rip),%rax
mov    (%rax),%esi
lea    0xada(%rip),%rdi
mov    $0x0,%al
call   11e0 <open@plt>
mov    %eax,%edx
lea    0xafe(%rip),%rdi
mov    $0x78,%esi
call   1090 <__chk_error@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x970(%rbp),%rsi
mov    $0x12c,%edx
call   1140 <read@plt>
mov    %eax,%edx
lea    0xad4(%rip),%rdi
mov    $0x7a,%esi
call   1090 <__chk_error@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x12c,-0xc(%rbp)
je     15c0 <test_file+0x2c0>
lea    0xab3(%rip),%rdi
mov    $0x7c,%esi
lea    0xb4f(%rip),%rdx
call   1210 <error1@plt>
lea    -0x4c0(%rbp),%rdi
lea    -0x970(%rbp),%rsi
mov    $0x12c,%edx
call   1160 <memcmp@plt>
cmp    $0x0,%rax
je     15fa <test_file+0x2fa>
lea    0xa79(%rip),%rdi
mov    $0x7e,%esi
lea    0xb1a(%rip),%rdx
call   1210 <error1@plt>
mov    -0x4(%rbp),%edi
mov    0x29bc(%rip),%rax
mov    (%rax),%edx
mov    $0x10,%esi
call   1100 <lseek@plt>
mov    %eax,%edx
lea    0xa49(%rip),%rdi
mov    $0x81,%esi
call   1090 <__chk_error@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x10,-0x10(%rbp)
je     1648 <test_file+0x348>
lea    0xa2b(%rip),%rdi
mov    $0x83,%esi
lea    0xad3(%rip),%rdx
call   1210 <error1@plt>
lea    -0xe20(%rbp),%rax
mov    %rax,-0x1260(%rbp)
movl   $0x20,-0x1258(%rbp)
lea    -0xe20(%rbp),%rax
add    $0x80,%rax
mov    %rax,-0x1250(%rbp)
movl   $0xfc,-0x1248(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x1260(%rbp),%rsi
mov    $0x2,%edx
call   11d0 <readv@plt>
mov    %eax,%edx
lea    0x9c7(%rip),%rdi
mov    $0x88,%esi
call   1090 <__chk_error@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x11c,-0xc(%rbp)
je     16cd <test_file+0x3cd>
lea    0x9a6(%rip),%rdi
mov    $0x8a,%esi
lea    0xa54(%rip),%rdx
call   1210 <error1@plt>
lea    -0x4c0(%rbp),%rdi
add    $0x40,%rdi
lea    -0xe20(%rbp),%rsi
mov    $0x11c,%edx
call   1160 <memcmp@plt>
cmp    $0x0,%rax
je     170b <test_file+0x40b>
lea    0x968(%rip),%rdi
mov    $0x8c,%esi
lea    0xa09(%rip),%rdx
call   1210 <error1@plt>
mov    -0x4(%rbp),%edi
call   1120 <close@plt>
mov    %eax,%edx
lea    0x946(%rip),%rdi
mov    $0x8e,%esi
call   1090 <__chk_error@plt>
mov    0x288b(%rip),%rax
mov    (%rax),%esi
lea    0x8f8(%rip),%rdi
call   11f0 <access@plt>
mov    %eax,%edx
lea    0x91e(%rip),%rdi
mov    $0x91,%esi
call   1090 <__chk_error@plt>
lea    0x8d9(%rip),%rdi
mov    $0x180,%esi
call   11c0 <chmod@plt>
mov    %eax,%edx
lea    0x8fa(%rip),%rdi
mov    $0x95,%esi
call   1090 <__chk_error@plt>
movl   $0x3e9,-0x1238(%rbp)
movl   $0x3e8,-0x1234(%rbp)
lea    0x8a1(%rip),%rdi
mov    $0x64,%esi
call   1190 <truncate@plt>
mov    %eax,%edx
lea    0x8c2(%rip),%rdi
mov    $0x98,%esi
call   1090 <__chk_error@plt>
lea    0x87d(%rip),%rdi
lea    -0x1238(%rbp),%rsi
call   1030 <utime@plt>
mov    %eax,%edx
lea    0x89c(%rip),%rdi
mov    $0x99,%esi
call   1090 <__chk_error@plt>
lea    0x857(%rip),%rdi
lea    -0x1230(%rbp),%rsi
call   1180 <stat@plt>
mov    %eax,%edx
lea    0x876(%rip),%rdi
mov    $0x9a,%esi
call   1090 <__chk_error@plt>
cmpl   $0x64,-0x1230(%rbp)
je     181b <test_file+0x51b>
lea    0x858(%rip),%rdi
mov    $0x9c,%esi
lea    0x90c(%rip),%rdx
call   1210 <error1@plt>
mov    -0x122c(%rbp),%edi
call   11a0 <S_ISREG@plt>
cmp    $0x0,%eax
jne    1847 <test_file+0x547>
lea    0x82c(%rip),%rdi
mov    $0x9e,%esi
lea    0x8ea(%rip),%rdx
call   1210 <error1@plt>
mov    -0x122c(%rbp),%eax
and    $0x1ff,%eax
cmp    $0x180,%eax
je     1875 <test_file+0x575>
lea    0x7fe(%rip),%rdi
mov    $0xa0,%esi
lea    0x8c6(%rip),%rdx
call   1210 <error1@plt>
cmpl   $0x3e9,-0x1228(%rbp)
jne    1895 <test_file+0x595>
cmpl   $0x3e8,-0x1224(%rbp)
je     18ad <test_file+0x5ad>
lea    0x7c6(%rip),%rdi
mov    $0xa3,%esi
lea    0x899(%rip),%rdx
call   1210 <error1@plt>
lea    0x79a(%rip),%rdi
lea    -0x1230(%rbp),%rsi
call   1180 <stat@plt>
mov    %eax,%edx
lea    0x799(%rip),%rdi
mov    $0xa5,%esi
call   1090 <__chk_error@plt>
mov    -0x122c(%rbp),%edi
call   10d0 <S_ISDIR@plt>
cmp    $0x0,%eax
jne    18ff <test_file+0x5ff>
lea    0x774(%rip),%rdi
mov    $0xa7,%esi
lea    0x832(%rip),%rdx
call   1210 <error1@plt>
mov    0x26d2(%rip),%rax
mov    (%rax),%esi
lea    0x71f(%rip),%rdi
mov    $0x0,%al
call   11e0 <open@plt>
mov    %eax,%edx
lea    0x743(%rip),%rdi
mov    $0xaa,%esi
call   1090 <__chk_error@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x32,%esi
call   10f0 <ftruncate@plt>
mov    %eax,%edx
lea    0x720(%rip),%rdi
mov    $0xab,%esi
call   1090 <__chk_error@plt>
mov    -0x4(%rbp),%edi
lea    -0x1230(%rbp),%rsi
call   1220 <fstat@plt>
mov    %eax,%edx
lea    0x6fe(%rip),%rdi
mov    $0xac,%esi
call   1090 <__chk_error@plt>
mov    -0x4(%rbp),%edi
call   1120 <close@plt>
mov    %eax,%edx
lea    0x6e3(%rip),%rdi
mov    $0xad,%esi
call   1090 <__chk_error@plt>
cmpl   $0x32,-0x1230(%rbp)
je     19ae <test_file+0x6ae>
lea    0x6c5(%rip),%rdi
mov    $0xb0,%esi
lea    0x779(%rip),%rdx
call   1210 <error1@plt>
mov    -0x122c(%rbp),%edi
call   11a0 <S_ISREG@plt>
cmp    $0x0,%eax
jne    19da <test_file+0x6da>
lea    0x699(%rip),%rdi
mov    $0xb2,%esi
lea    0x757(%rip),%rdx
call   1210 <error1@plt>
lea    0x64d(%rip),%rdi
lea    0x660(%rip),%rsi
call   10e0 <symlink@plt>
mov    %eax,%edx
lea    0x66c(%rip),%rdi
mov    $0xb5,%esi
call   1090 <__chk_error@plt>
lea    0x641(%rip),%rdi
lea    -0x1230(%rbp),%rsi
call   1150 <lstat@plt>
mov    %eax,%edx
lea    0x646(%rip),%rdi
mov    $0xb6,%esi
call   1090 <__chk_error@plt>
mov    -0x122c(%rbp),%edi
call   1050 <S_ISLNK@plt>
cmp    $0x0,%eax
jne    1a52 <test_file+0x752>
lea    0x621(%rip),%rdi
mov    $0xb8,%esi
lea    0x6df(%rip),%rdx
call   1210 <error1@plt>
lea    0x5f5(%rip),%rdi
call   10a0 <opendir@plt>
mov    %rax,-0x1268(%rbp)
cmpq   $0x0,-0x1268(%rbp)
jne    1a8b <test_file+0x78b>
lea    0x5e8(%rip),%rdi
mov    $0xbd,%esi
lea    0x6c5(%rip),%rdx
call   1210 <error1@plt>
movl   $0x0,-0xc(%rbp)
mov    -0x1268(%rbp),%rdi
call   11b0 <readdir@plt>
mov    %rax,-0x1270(%rbp)
cmpq   $0x0,-0x1270(%rbp)
jne    1ab8 <test_file+0x7b8>
jmp    1b5a <test_file+0x85a>
mov    -0x1270(%rbp),%rax
mov    (%rax),%edi
lea    0x68c(%rip),%rsi
call   1170 <strcmp@plt>
cmp    $0x0,%rax
je     1b4c <test_file+0x84c>
mov    -0x1270(%rbp),%rax
mov    (%rax),%edi
lea    0x66c(%rip),%rsi
call   1170 <strcmp@plt>
cmp    $0x0,%rax
je     1b4c <test_file+0x84c>
mov    -0x1270(%rbp),%rax
mov    (%rax),%edi
lea    0x528(%rip),%rsi
call   1170 <strcmp@plt>
cmp    $0x0,%rax
je     1b4c <test_file+0x84c>
mov    -0x1270(%rbp),%rax
mov    (%rax),%edi
lea    0x523(%rip),%rsi
call   1170 <strcmp@plt>
cmp    $0x0,%rax
je     1b4c <test_file+0x84c>
lea    0x527(%rip),%rdi
mov    $0xc7,%esi
lea    0x60f(%rip),%rdx
call   1210 <error1@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1a92 <test_file+0x792>
mov    -0x1268(%rbp),%rdi
call   1130 <closedir@plt>
cmpl   $0x4,-0xc(%rbp)
je     1b88 <test_file+0x888>
lea    0x4eb(%rip),%rdi
mov    $0xcc,%esi
lea    0x5d3(%rip),%rdx
call   1210 <error1@plt>
lea    0x4b9(%rip),%rdi
call   1040 <unlink@plt>
mov    %eax,%edx
lea    0x4c5(%rip),%rdi
mov    $0xce,%esi
call   1090 <__chk_error@plt>
lea    0x480(%rip),%rdi
call   1040 <unlink@plt>
mov    %eax,%edx
lea    0x4a6(%rip),%rdi
mov    $0xcf,%esi
call   1090 <__chk_error@plt>
lea    -0x1220(%rbp),%rdi
call   10c0 <chdir@plt>
mov    %eax,%edx
lea    0x487(%rip),%rdi
mov    $0xd0,%esi
call   1090 <__chk_error@plt>
lea    0x462(%rip),%rdi
call   10b0 <rmdir@plt>
mov    %eax,%edx
lea    0x468(%rip),%rdi
mov    $0xd1,%esi
call   1090 <__chk_error@plt>
add    $0x1270,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_file>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1258,%rsp
lea    0xd88(%rip),%rdi
call   1040 <unlink@plt>
lea    0xd96(%rip),%rdi
call   1040 <unlink@plt>
lea    0xda4(%rip),%rdi
call   1040 <unlink@plt>
lea    0xdb2(%rip),%rdi
call   10b0 <rmdir@plt>
lea    0x9a0(%rsp),%rdi
mov    $0x400,%esi
call   1110 <getcwd@plt>
test   %rax,%rax
jne    1370 <test_file+0x70>
lea    0xda3(%rip),%rdi
lea    0xe30(%rip),%rdx
mov    $0x5f,%esi
call   1210 <error1@plt>
lea    0xd77(%rip),%rbp
mov    %rbp,%rdi
mov    $0x1ed,%esi
call   1060 <mkdir@plt>
lea    0xd77(%rip),%rbx
mov    %rbx,%rdi
mov    $0x61,%esi
mov    %eax,%edx
call   1090 <__chk_error@plt>
mov    %rbp,%rdi
call   10c0 <chdir@plt>
mov    %rbx,%rdi
mov    $0x63,%esi
mov    %eax,%edx
call   1090 <__chk_error@plt>
mov    0x2bf0(%rip),%rax
mov    0x2c31(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2c2e(%rip),%rax
or     (%rax),%esi
lea    0xce1(%rip),%rdi
mov    $0x1a4,%edx
xor    %eax,%eax
call   11e0 <open@plt>
mov    %rbx,%rdi
mov    $0x67,%esi
mov    %eax,%edx
call   1090 <__chk_error@plt>
mov    %eax,%ebx
movdqa 0xc08(%rip),%xmm1
mov    $0x1c,%eax
movdqa 0xc0a(%rip),%xmm10
movdqa 0xc11(%rip),%xmm8
movdqa 0xc18(%rip),%xmm9
movdqa 0xc20(%rip),%xmm4
movdqa 0xc28(%rip),%xmm5
movdqa 0xc30(%rip),%xmm6
movdqa 0xc38(%rip),%xmm7
movdqa 0xc40(%rip),%xmm2
movdqa %xmm1,%xmm0
paddd  %xmm10,%xmm0
movdqa %xmm1,-0x30(%rsp,%rax,4)
movdqa %xmm0,-0x20(%rsp,%rax,4)
cmp    $0x13c,%rax
je     14bc <test_file+0x1bc>
movdqa %xmm1,%xmm0
paddd  %xmm8,%xmm0
movdqa %xmm1,%xmm3
paddd  %xmm9,%xmm3
movdqa %xmm0,-0x10(%rsp,%rax,4)
movdqa %xmm3,(%rsp,%rax,4)
movdqa %xmm1,%xmm0
paddd  %xmm4,%xmm0
movdqa %xmm1,%xmm3
paddd  %xmm5,%xmm3
movdqa %xmm0,0x10(%rsp,%rax,4)
movdqa %xmm3,0x20(%rsp,%rax,4)
movdqa %xmm1,%xmm0
paddd  %xmm6,%xmm0
movdqa %xmm1,%xmm3
paddd  %xmm7,%xmm3
movdqa %xmm0,0x30(%rsp,%rax,4)
movdqa %xmm3,0x40(%rsp,%rax,4)
paddd  %xmm2,%xmm1
add    $0x20,%rax
jmp    1440 <test_file+0x140>
movaps 0xbcd(%rip),%xmm0
movaps %xmm0,0x4e0(%rsp)
lea    0x40(%rsp),%rsi
mov    %ebx,%edi
mov    $0x96,%edx
call   1080 <write@plt>
lea    0xc1f(%rip),%rdi
mov    $0x6a,%esi
mov    %eax,%edx
call   1090 <__chk_error@plt>
cmp    $0x96,%eax
je     150e <test_file+0x20e>
lea    0xc05(%rip),%rdi
lea    0xc99(%rip),%rdx
mov    $0x6c,%esi
call   1210 <error1@plt>
lea    0x298(%rsp),%rax
mov    %rax,0x10(%rsp)
movl   $0x10,0x18(%rsp)
lea    0x2d8(%rsp),%rax
mov    %rax,0x20(%rsp)
movl   $0x86,0x28(%rsp)
lea    0x10(%rsp),%rsi
mov    %ebx,%edi
mov    $0x2,%edx
call   1070 <writev@plt>
lea    0xbb2(%rip),%rdi
mov    $0x71,%esi
mov    %eax,%edx
call   1090 <__chk_error@plt>
cmp    $0x96,%eax
je     157b <test_file+0x27b>
lea    0xb98(%rip),%rdi
lea    0xc32(%rip),%rdx
mov    $0x73,%esi
call   1210 <error1@plt>
mov    %ebx,%edi
call   1120 <close@plt>
lea    0xb79(%rip),%rbp
mov    %rbp,%rdi
mov    $0x74,%esi
mov    %eax,%edx
call   1090 <__chk_error@plt>
lea    0xb15(%rip),%rdi
lea    0xb28(%rip),%rbx
mov    %rbx,%rsi
call   1200 <rename@plt>
mov    %rbp,%rdi
mov    $0x76,%esi
mov    %eax,%edx
call   1090 <__chk_error@plt>
mov    0x2a0c(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   11e0 <open@plt>
mov    %rbp,%rdi
mov    $0x78,%esi
mov    %eax,%edx
call   1090 <__chk_error@plt>
mov    %eax,%ebx
lea    0xda0(%rsp),%rsi
mov    %eax,%edi
mov    $0x12c,%edx
call   1140 <read@plt>
mov    %rbp,%rdi
mov    $0x7a,%esi
mov    %eax,%edx
call   1090 <__chk_error@plt>
cmp    $0x12c,%eax
je     1623 <test_file+0x323>
lea    0xaf0(%rip),%rdi
lea    0xb91(%rip),%rdx
mov    $0x7c,%esi
call   1210 <error1@plt>
lea    0x40(%rsp),%rdi
lea    0xda0(%rsp),%rsi
mov    $0x12c,%edx
call   1160 <memcmp@plt>
test   %rax,%rax
je     1657 <test_file+0x357>
lea    0xabc(%rip),%rdi
lea    0xb62(%rip),%rdx
mov    $0x7e,%esi
call   1210 <error1@plt>
mov    0x2962(%rip),%rax
mov    (%rax),%edx
mov    %ebx,%edi
mov    $0x10,%esi
call   1100 <lseek@plt>
lea    0xa8f(%rip),%rdi
mov    $0x81,%esi
mov    %eax,%edx
call   1090 <__chk_error@plt>
cmp    $0x10,%eax
je     169c <test_file+0x39c>
lea    0xa77(%rip),%rdi
lea    0xb24(%rip),%rdx
mov    $0x83,%esi
call   1210 <error1@plt>
lea    0x4f0(%rsp),%rax
mov    %rax,0x10(%rsp)
movl   $0x20,0x18(%rsp)
lea    0x570(%rsp),%rax
mov    %rax,0x20(%rsp)
movl   $0xfc,0x28(%rsp)
lea    0x10(%rsp),%rsi
mov    %ebx,%edi
mov    $0x2,%edx
call   11d0 <readv@plt>
lea    0xa24(%rip),%rdi
mov    $0x88,%esi
mov    %eax,%edx
call   1090 <__chk_error@plt>
cmp    $0x11c,%eax
je     1709 <test_file+0x409>
lea    0xa0a(%rip),%rdi
lea    0xabd(%rip),%rdx
mov    $0x8a,%esi
call   1210 <error1@plt>
lea    0x80(%rsp),%rdi
lea    0x4f0(%rsp),%rsi
mov    $0x11c,%edx
call   1160 <memcmp@plt>
test   %rax,%rax
je     1740 <test_file+0x440>
lea    0x9d3(%rip),%rdi
lea    0xa79(%rip),%rdx
mov    $0x8c,%esi
call   1210 <error1@plt>
mov    %ebx,%edi
call   1120 <close@plt>
lea    0x9b4(%rip),%rbx
mov    %rbx,%rdi
mov    $0x8e,%esi
mov    %eax,%edx
call   1090 <__chk_error@plt>
mov    0x2854(%rip),%rax
mov    (%rax),%esi
lea    0x961(%rip),%rbp
mov    %rbp,%rdi
call   11f0 <access@plt>
mov    %rbx,%rdi
mov    $0x91,%esi
mov    %eax,%edx
call   1090 <__chk_error@plt>
mov    %rbp,%rdi
mov    $0x180,%esi
call   11c0 <chmod@plt>
mov    %rbx,%rdi
mov    $0x95,%esi
mov    %eax,%edx
call   1090 <__chk_error@plt>
movabs $0x3e8000003e9,%rax
mov    %rax,0x38(%rsp)
mov    %rbp,%rdi
mov    $0x64,%esi
call   1190 <truncate@plt>
mov    %rbx,%rdi
mov    $0x98,%esi
mov    %eax,%edx
call   1090 <__chk_error@plt>
lea    0x38(%rsp),%rsi
mov    %rbp,%rdi
call   1030 <utime@plt>
mov    %rbx,%rdi
mov    $0x99,%esi
mov    %eax,%edx
call   1090 <__chk_error@plt>
mov    %rsp,%rsi
mov    %rbp,%rdi
call   1180 <stat@plt>
mov    %rbx,%rdi
mov    $0x9a,%esi
mov    %eax,%edx
call   1090 <__chk_error@plt>
cmpl   $0x64,(%rsp)
je     181f <test_file+0x51f>
lea    0x8f4(%rip),%rdi
lea    0x9ad(%rip),%rdx
mov    $0x9c,%esi
call   1210 <error1@plt>
mov    0x4(%rsp),%ebx
mov    %ebx,%edi
call   11a0 <S_ISREG@plt>
test   %eax,%eax
jne    1846 <test_file+0x546>
lea    0x8cd(%rip),%rdi
lea    0x990(%rip),%rdx
mov    $0x9e,%esi
call   1210 <error1@plt>
and    $0x1ff,%ebx
cmp    $0x180,%ebx
je     186c <test_file+0x56c>
lea    0x8a7(%rip),%rdi
lea    0x974(%rip),%rdx
mov    $0xa0,%esi
call   1210 <error1@plt>
cmpl   $0x3e9,0x8(%rsp)
jne    1880 <test_file+0x580>
cmpl   $0x3e8,0xc(%rsp)
je     1898 <test_file+0x598>
lea    0x87b(%rip),%rdi
lea    0x953(%rip),%rdx
mov    $0xa3,%esi
call   1210 <error1@plt>
lea    0x84f(%rip),%rdi
mov    %rsp,%rsi
call   1180 <stat@plt>
lea    0x854(%rip),%rdi
mov    $0xa5,%esi
mov    %eax,%edx
call   1090 <__chk_error@plt>
mov    0x4(%rsp),%edi
call   10d0 <S_ISDIR@plt>
test   %eax,%eax
jne    18df <test_file+0x5df>
lea    0x834(%rip),%rdi
lea    0x8f7(%rip),%rdx
mov    $0xa7,%esi
call   1210 <error1@plt>
mov    0x26f2(%rip),%rax
mov    (%rax),%esi
lea    0x7df(%rip),%rdi
xor    %eax,%eax
call   11e0 <open@plt>
lea    0x805(%rip),%rbx
mov    %rbx,%rdi
mov    $0xaa,%esi
mov    %eax,%edx
call   1090 <__chk_error@plt>
mov    %eax,%ebp
mov    %eax,%edi
mov    $0x32,%esi
call   10f0 <ftruncate@plt>
mov    %rbx,%rdi
mov    $0xab,%esi
mov    %eax,%edx
call   1090 <__chk_error@plt>
mov    %rsp,%rsi
mov    %ebp,%edi
call   1220 <fstat@plt>
mov    %rbx,%rdi
mov    $0xac,%esi
mov    %eax,%edx
call   1090 <__chk_error@plt>
mov    %ebp,%edi
call   1120 <close@plt>
mov    %rbx,%rdi
mov    $0xad,%esi
mov    %eax,%edx
call   1090 <__chk_error@plt>
cmpl   $0x32,(%rsp)
je     1976 <test_file+0x676>
lea    0x79d(%rip),%rdi
lea    0x856(%rip),%rdx
mov    $0xb0,%esi
call   1210 <error1@plt>
mov    0x4(%rsp),%edi
call   11a0 <S_ISREG@plt>
test   %eax,%eax
jne    199b <test_file+0x69b>
lea    0x778(%rip),%rdi
lea    0x83b(%rip),%rdx
mov    $0xb2,%esi
call   1210 <error1@plt>
lea    0x72c(%rip),%rdi
lea    0x73f(%rip),%rbx
mov    %rbx,%rsi
call   10e0 <symlink@plt>
lea    0x74a(%rip),%rbp
mov    %rbp,%rdi
mov    $0xb5,%esi
mov    %eax,%edx
call   1090 <__chk_error@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1150 <lstat@plt>
mov    %rbp,%rdi
mov    $0xb6,%esi
mov    %eax,%edx
call   1090 <__chk_error@plt>
mov    0x4(%rsp),%edi
call   1050 <S_ISLNK@plt>
test   %eax,%eax
jne    1a06 <test_file+0x706>
lea    0x70d(%rip),%rdi
lea    0x7d0(%rip),%rdx
mov    $0xb8,%esi
call   1210 <error1@plt>
lea    0x6e1(%rip),%rdi
call   10a0 <opendir@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1a32 <test_file+0x732>
lea    0x6e1(%rip),%rdi
lea    0x7c3(%rip),%rdx
mov    $0xbd,%esi
call   1210 <error1@plt>
mov    %rbx,%rdi
call   11b0 <readdir@plt>
test   %rax,%rax
je     1af1 <test_file+0x7f1>
mov    %rax,%rbp
mov    $0x4,%r13d
lea    0x7a1(%rip),%r14
lea    0x799(%rip),%r15
lea    0x66d(%rip),%r12
jmp    1a84 <test_file+0x784>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
call   11b0 <readdir@plt>
mov    %rax,%rbp
add    $0xffffffff,%r13d
test   %rax,%rax
je     1ae2 <test_file+0x7e2>
mov    0x0(%rbp),%edi
mov    %r14,%rsi
call   1170 <strcmp@plt>
test   %rax,%rax
je     1a70 <test_file+0x770>
mov    0x0(%rbp),%edi
mov    %r15,%rsi
call   1170 <strcmp@plt>
test   %rax,%rax
je     1a70 <test_file+0x770>
mov    0x0(%rbp),%edi
mov    %r12,%rsi
call   1170 <strcmp@plt>
test   %rax,%rax
je     1a70 <test_file+0x770>
mov    0x0(%rbp),%edi
lea    0x62a(%rip),%rsi
call   1170 <strcmp@plt>
test   %rax,%rax
je     1a70 <test_file+0x770>
lea    0x633(%rip),%rdi
mov    $0xc7,%esi
lea    0x71b(%rip),%rdx
call   1210 <error1@plt>
jmp    1a70 <test_file+0x770>
mov    %rbx,%rdi
call   1130 <closedir@plt>
test   %r13d,%r13d
jne    1af9 <test_file+0x7f9>
jmp    1b11 <test_file+0x811>
mov    %rbx,%rdi
call   1130 <closedir@plt>
lea    0x602(%rip),%rdi
lea    0x6ef(%rip),%rdx
mov    $0xcc,%esi
call   1210 <error1@plt>
lea    0x5d0(%rip),%rdi
call   1040 <unlink@plt>
lea    0x5de(%rip),%rbx
mov    %rbx,%rdi
mov    $0xce,%esi
mov    %eax,%edx
call   1090 <__chk_error@plt>
lea    0x594(%rip),%rdi
call   1040 <unlink@plt>
mov    %rbx,%rdi
mov    $0xcf,%esi
mov    %eax,%edx
call   1090 <__chk_error@plt>
lea    0x9a0(%rsp),%rdi
call   10c0 <chdir@plt>
mov    %rbx,%rdi
mov    $0xd0,%esi
mov    %eax,%edx
call   1090 <__chk_error@plt>
lea    0x57d(%rip),%rdi
call   10b0 <rmdir@plt>
mov    %rbx,%rdi
mov    $0xd1,%esi
mov    %eax,%edx
call   1090 <__chk_error@plt>
add    $0x1258,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.stat = type { i32, i32, i32, i32 }
%struct.utimbuf = type { i32, i32 }
%struct.iovec = type { i32*, i32 }
%struct.dirent = type { i32 }
@.str = [26 x i8] c"/tmp/linux-test.tmp/file1\00"
@.str.1 = [26 x i8] c"/tmp/linux-test.tmp/file2\00"
@.str.2 = [26 x i8] c"/tmp/linux-test.tmp/file3\00"
@.str.3 = [20 x i8] c"/tmp/linux-test.tmp\00"
@.str.4 = [148 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/jvesely/qemu-neo1973/refs/heads/master/tests/linux-test.c\00"
@.str.5 = [7 x i8] c"getcwd\00"
@.str.6 = [6 x i8] c"file1\00"
@O_WRONLY = global i32 0
@O_TRUNC = global i32 0
@O_CREAT = global i32 0
@.str.7 = [6 x i8] c"write\00"
@.str.8 = [7 x i8] c"writev\00"
@.str.9 = [6 x i8] c"file2\00"
@O_RDONLY = global i32 0
@.str.10 = [5 x i8] c"read\00"
@.str.11 = [7 x i8] c"memcmp\00"
@SEEK_SET = global i32 0
@.str.12 = [6 x i8] c"lseek\00"
@.str.13 = [6 x i8] c"readv\00"
@R_OK = global i32 0
@.str.14 = [10 x i8] c"stat size\00"
@.str.15 = [10 x i8] c"stat mode\00"
@.str.16 = [11 x i8] c"stat mode2\00"
@.str.17 = [10 x i8] c"stat time\00"
@O_RDWR = global i32 0
@.str.18 = [6 x i8] c"file3\00"
@.str.19 = [8 x i8] c"opendir\00"
@.str.20 = [2 x i8] c".\00"
@.str.21 = [3 x i8] c"..\00"
@.str.22 = [8 x i8] c"readdir\00"
define void @test_file() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [300 x i32]
%6 = alloca [300 x i32]
%7 = alloca [300 x i32]
%8 = alloca [1024 x i8]
%9 = alloca %struct.stat
%10 = alloca %struct.utimbuf
%11 = alloca [2 x %struct.iovec]
%12 = alloca i32*
%13 = alloca %struct.dirent*
%14 = call i32 @unlink(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @unlink(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%16 = call i32 @unlink(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%17 = call i32 @rmdir(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%18 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%19 = call i32* @getcwd(i8* %18, i32 1024)
%20 = icmp eq i32* %19, null
br i1 %20, label %21, label %23
21: ; preds = %0
%22 = call i32 @error1(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 95, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
br label %23
23: ; preds = %21, %0
%24 = call i32 @mkdir(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 493)
%25 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 97, i32 %24)
%26 = call i32 @chdir(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%27 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 99, i32 %26)
%28 = load i32, i32* @O_WRONLY
%29 = load i32, i32* @O_TRUNC
%30 = or i32 %28, %29
%31 = load i32, i32* @O_CREAT
%32 = or i32 %30, %31
%33 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i32 %32, i32 420)
%34 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 103, i32 %33)
store i32 %34, i32* %1
store i32 0, i32* %2
br label %35
35: ; preds = %43, %23
%36 = load i32, i32* %2
%37 = icmp slt i32 %36, 300
br i1 %37, label %38, label %46
38: ; preds = %35
%39 = load i32, i32* %2
%40 = load i32, i32* %2
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [300 x i32], [300 x i32]* %5, i64 0, i64 %41
store i32 %39, i32* %42
br label %43
43: ; preds = %38
%44 = load i32, i32* %2
%45 = add nsw i32 %44, 1
store i32 %45, i32* %2
br label %35
46: ; preds = %35
%47 = load i32, i32* %1
%48 = getelementptr inbounds [300 x i32], [300 x i32]* %5, i64 0, i64 0
%49 = call i32 @write(i32 %47, i32* %48, i32 150)
%50 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 106, i32 %49)
store i32 %50, i32* %3
%51 = load i32, i32* %3
%52 = icmp ne i32 %51, 150
br i1 %52, label %53, label %55
53: ; preds = %46
%54 = call i32 @error1(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 108, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
br label %55
55: ; preds = %53, %46
%56 = getelementptr inbounds [300 x i32], [300 x i32]* %5, i64 0, i64 0
%57 = getelementptr inbounds i32, i32* %56, i64 150
%58 = getelementptr inbounds [2 x %struct.iovec], [2 x %struct.iovec]* %11, i64 0, i64 0
%59 = getelementptr inbounds %struct.iovec, %struct.iovec* %58, i32 0, i32 0
store i32* %57, i32** %59
%60 = getelementptr inbounds [2 x %struct.iovec], [2 x %struct.iovec]* %11, i64 0, i64 0
%61 = getelementptr inbounds %struct.iovec, %struct.iovec* %60, i32 0, i32 1
store i32 16, i32* %61
%62 = getelementptr inbounds [300 x i32], [300 x i32]* %5, i64 0, i64 0
%63 = getelementptr inbounds i32, i32* %62, i64 150
%64 = getelementptr inbounds i32, i32* %63, i64 16
%65 = getelementptr inbounds [2 x %struct.iovec], [2 x %struct.iovec]* %11, i64 0, i64 1
%66 = getelementptr inbounds %struct.iovec, %struct.iovec* %65, i32 0, i32 0
store i32* %64, i32** %66
%67 = getelementptr inbounds [2 x %struct.iovec], [2 x %struct.iovec]* %11, i64 0, i64 1
%68 = getelementptr inbounds %struct.iovec, %struct.iovec* %67, i32 0, i32 1
store i32 134, i32* %68
%69 = load i32, i32* %1
%70 = getelementptr inbounds [2 x %struct.iovec], [2 x %struct.iovec]* %11, i64 0, i64 0
%71 = call i32 @writev(i32 %69, %struct.iovec* %70, i32 2)
%72 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 113, i32 %71)
store i32 %72, i32* %3
%73 = load i32, i32* %3
%74 = icmp ne i32 %73, 150
br i1 %74, label %75, label %77
75: ; preds = %55
%76 = call i32 @error1(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 115, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
br label %77
77: ; preds = %75, %55
%78 = load i32, i32* %1
%79 = call i32 @close(i32 %78)
%80 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 116, i32 %79)
%81 = call i32 @rename(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%82 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 118, i32 %81)
%83 = load i32, i32* @O_RDONLY
%84 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i32 %83)
%85 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 120, i32 %84)
store i32 %85, i32* %1
%86 = load i32, i32* %1
%87 = getelementptr inbounds [300 x i32], [300 x i32]* %6, i64 0, i64 0
%88 = call i32 @read(i32 %86, i32* %87, i32 300)
%89 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 122, i32 %88)
store i32 %89, i32* %3
%90 = load i32, i32* %3
%91 = icmp ne i32 %90, 300
br i1 %91, label %92, label %94
92: ; preds = %77
%93 = call i32 @error1(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 124, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0))
br label %94
94: ; preds = %92, %77
%95 = getelementptr inbounds [300 x i32], [300 x i32]* %5, i64 0, i64 0
%96 = getelementptr inbounds [300 x i32], [300 x i32]* %6, i64 0, i64 0
%97 = call i64 @memcmp(i32* %95, i32* %96, i32 300)
%98 = icmp ne i64 %97, 0
br i1 %98, label %99, label %101
99: ; preds = %94
%100 = call i32 @error1(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 126, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0))
br label %101
101: ; preds = %99, %94
%102 = load i32, i32* %1
%103 = load i32, i32* @SEEK_SET
%104 = call i32 @lseek(i32 %102, i32 16, i32 %103)
%105 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 129, i32 %104)
store i32 %105, i32* %4
%106 = load i32, i32* %4
%107 = icmp ne i32 %106, 16
br i1 %107, label %108, label %110
108: ; preds = %101
%109 = call i32 @error1(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 131, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0))
br label %110
110: ; preds = %108, %101
%111 = getelementptr inbounds [300 x i32], [300 x i32]* %7, i64 0, i64 0
%112 = getelementptr inbounds [2 x %struct.iovec], [2 x %struct.iovec]* %11, i64 0, i64 0
%113 = getelementptr inbounds %struct.iovec, %struct.iovec* %112, i32 0, i32 0
store i32* %111, i32** %113
%114 = getelementptr inbounds [2 x %struct.iovec], [2 x %struct.iovec]* %11, i64 0, i64 0
%115 = getelementptr inbounds %struct.iovec, %struct.iovec* %114, i32 0, i32 1
store i32 32, i32* %115
%116 = getelementptr inbounds [300 x i32], [300 x i32]* %7, i64 0, i64 0
%117 = getelementptr inbounds i32, i32* %116, i64 32
%118 = getelementptr inbounds [2 x %struct.iovec], [2 x %struct.iovec]* %11, i64 0, i64 1
%119 = getelementptr inbounds %struct.iovec, %struct.iovec* %118, i32 0, i32 0
store i32* %117, i32** %119
%120 = getelementptr inbounds [2 x %struct.iovec], [2 x %struct.iovec]* %11, i64 0, i64 1
%121 = getelementptr inbounds %struct.iovec, %struct.iovec* %120, i32 0, i32 1
store i32 252, i32* %121
%122 = load i32, i32* %1
%123 = getelementptr inbounds [2 x %struct.iovec], [2 x %struct.iovec]* %11, i64 0, i64 0
%124 = call i32 @readv(i32 %122, %struct.iovec* %123, i32 2)
%125 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 136, i32 %124)
store i32 %125, i32* %3
%126 = load i32, i32* %3
%127 = icmp ne i32 %126, 284
br i1 %127, label %128, label %130
128: ; preds = %110
%129 = call i32 @error1(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 138, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0))
br label %130
130: ; preds = %128, %110
%131 = getelementptr inbounds [300 x i32], [300 x i32]* %5, i64 0, i64 0
%132 = getelementptr inbounds i32, i32* %131, i64 16
%133 = getelementptr inbounds [300 x i32], [300 x i32]* %7, i64 0, i64 0
%134 = call i64 @memcmp(i32* %132, i32* %133, i32 284)
%135 = icmp ne i64 %134, 0
br i1 %135, label %136, label %138
136: ; preds = %130
%137 = call i32 @error1(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 140, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0))
br label %138
138: ; preds = %136, %130
%139 = load i32, i32* %1
%140 = call i32 @close(i32 %139)
%141 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 142, i32 %140)
%142 = load i32, i32* @R_OK
%143 = call i32 @access(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i32 %142)
%144 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 145, i32 %143)
%145 = call i32 @chmod(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i32 384)
%146 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 149, i32 %145)
%147 = getelementptr inbounds %struct.utimbuf, %struct.utimbuf* %10, i32 0, i32 0
store i32 1001, i32* %147
%148 = getelementptr inbounds %struct.utimbuf, %struct.utimbuf* %10, i32 0, i32 1
store i32 1000, i32* %148
%149 = call i32 @truncate(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i32 100)
%150 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 152, i32 %149)
%151 = call i32 @utime(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), %struct.utimbuf* %10)
%152 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 153, i32 %151)
%153 = call i32 @stat(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), %struct.stat* %9)
%154 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 154, i32 %153)
%155 = getelementptr inbounds %struct.stat, %struct.stat* %9, i32 0, i32 0
%156 = load i32, i32* %155
%157 = icmp ne i32 %156, 100
br i1 %157, label %158, label %160
158: ; preds = %138
%159 = call i32 @error1(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 156, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i64 0, i64 0))
br label %160
160: ; preds = %158, %138
%161 = getelementptr inbounds %struct.stat, %struct.stat* %9, i32 0, i32 1
%162 = load i32, i32* %161
%163 = call i32 @S_ISREG(i32 %162)
%164 = icmp ne i32 %163, 0
br i1 %164, label %167, label %165
165: ; preds = %160
%166 = call i32 @error1(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 158, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.15, i64 0, i64 0))
br label %167
167: ; preds = %165, %160
%168 = getelementptr inbounds %struct.stat, %struct.stat* %9, i32 0, i32 1
%169 = load i32, i32* %168
%170 = and i32 %169, 511
%171 = icmp ne i32 %170, 384
br i1 %171, label %172, label %174
172: ; preds = %167
%173 = call i32 @error1(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 160, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.16, i64 0, i64 0))
br label %174
174: ; preds = %172, %167
%175 = getelementptr inbounds %struct.stat, %struct.stat* %9, i32 0, i32 2
%176 = load i32, i32* %175
%177 = icmp ne i32 %176, 1001
br i1 %177, label %182, label %178
178: ; preds = %174
%179 = getelementptr inbounds %struct.stat, %struct.stat* %9, i32 0, i32 3
%180 = load i32, i32* %179
%181 = icmp ne i32 %180, 1000
br i1 %181, label %182, label %184
182: ; preds = %178, %174
%183 = call i32 @error1(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 163, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.17, i64 0, i64 0))
br label %184
184: ; preds = %182, %178
%185 = call i32 @stat(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), %struct.stat* %9)
%186 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 165, i32 %185)
%187 = getelementptr inbounds %struct.stat, %struct.stat* %9, i32 0, i32 1
%188 = load i32, i32* %187
%189 = call i32 @S_ISDIR(i32 %188)
%190 = icmp ne i32 %189, 0
br i1 %190, label %193, label %191
191: ; preds = %184
%192 = call i32 @error1(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 167, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.15, i64 0, i64 0))
br label %193
193: ; preds = %191, %184
%194 = load i32, i32* @O_RDWR
%195 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i32 %194)
%196 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 170, i32 %195)
store i32 %196, i32* %1
%197 = load i32, i32* %1
%198 = call i32 @ftruncate(i32 %197, i32 50)
%199 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 171, i32 %198)
%200 = load i32, i32* %1
%201 = call i32 @fstat(i32 %200, %struct.stat* %9)
%202 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 172, i32 %201)
%203 = load i32, i32* %1
%204 = call i32 @close(i32 %203)
%205 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 173, i32 %204)
%206 = getelementptr inbounds %struct.stat, %struct.stat* %9, i32 0, i32 0
%207 = load i32, i32* %206
%208 = icmp ne i32 %207, 50
br i1 %208, label %209, label %211
209: ; preds = %193
%210 = call i32 @error1(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 176, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i64 0, i64 0))
br label %211
211: ; preds = %209, %193
%212 = getelementptr inbounds %struct.stat, %struct.stat* %9, i32 0, i32 1
%213 = load i32, i32* %212
%214 = call i32 @S_ISREG(i32 %213)
%215 = icmp ne i32 %214, 0
br i1 %215, label %218, label %216
216: ; preds = %211
%217 = call i32 @error1(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 178, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.15, i64 0, i64 0))
br label %218
218: ; preds = %216, %211
%219 = call i32 @symlink(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0))
%220 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 181, i32 %219)
%221 = call i32 @lstat(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0), %struct.stat* %9)
%222 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 182, i32 %221)
%223 = getelementptr inbounds %struct.stat, %struct.stat* %9, i32 0, i32 1
%224 = load i32, i32* %223
%225 = call i32 @S_ISLNK(i32 %224)
%226 = icmp ne i32 %225, 0
br i1 %226, label %229, label %227
227: ; preds = %218
%228 = call i32 @error1(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 184, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.15, i64 0, i64 0))
br label %229
229: ; preds = %227, %218
%230 = call i32* @opendir(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
store i32* %230, i32** %12
%231 = load i32*, i32** %12
%232 = icmp ne i32* %231, null
br i1 %232, label %235, label %233
233: ; preds = %229
%234 = call i32 @error1(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 189, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.19, i64 0, i64 0))
br label %235
235: ; preds = %233, %229
store i32 0, i32* %3
br label %236
236: ; preds = %268, %235
%237 = load i32*, i32** %12
%238 = call %struct.dirent* @readdir(i32* %237)
store %struct.dirent* %238, %struct.dirent** %13
%239 = load %struct.dirent*, %struct.dirent** %13
%240 = icmp ne %struct.dirent* %239, null
br i1 %240, label %242, label %241
241: ; preds = %236
br label %271
242: ; preds = %236
%243 = load %struct.dirent*, %struct.dirent** %13
%244 = getelementptr inbounds %struct.dirent, %struct.dirent* %243, i32 0, i32 0
%245 = load i32, i32* %244
%246 = call i64 @strcmp(i32 %245, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.20, i64 0, i64 0))
%247 = icmp ne i64 %246, 0
br i1 %247, label %248, label %268
248: ; preds = %242
%249 = load %struct.dirent*, %struct.dirent** %13
%250 = getelementptr inbounds %struct.dirent, %struct.dirent* %249, i32 0, i32 0
%251 = load i32, i32* %250
%252 = call i64 @strcmp(i32 %251, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.21, i64 0, i64 0))
%253 = icmp ne i64 %252, 0
br i1 %253, label %254, label %268
254: ; preds = %248
%255 = load %struct.dirent*, %struct.dirent** %13
%256 = getelementptr inbounds %struct.dirent, %struct.dirent* %255, i32 0, i32 0
%257 = load i32, i32* %256
%258 = call i64 @strcmp(i32 %257, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%259 = icmp ne i64 %258, 0
br i1 %259, label %260, label %268
260: ; preds = %254
%261 = load %struct.dirent*, %struct.dirent** %13
%262 = getelementptr inbounds %struct.dirent, %struct.dirent* %261, i32 0, i32 0
%263 = load i32, i32* %262
%264 = call i64 @strcmp(i32 %263, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0))
%265 = icmp ne i64 %264, 0
br i1 %265, label %266, label %268
266: ; preds = %260
%267 = call i32 @error1(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 199, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.22, i64 0, i64 0))
br label %268
268: ; preds = %266, %260, %254, %248, %242
%269 = load i32, i32* %3
%270 = add nsw i32 %269, 1
store i32 %270, i32* %3
br label %236
271: ; preds = %241
%272 = load i32*, i32** %12
%273 = call i32 @closedir(i32* %272)
%274 = load i32, i32* %3
%275 = icmp ne i32 %274, 4
br i1 %275, label %276, label %278
276: ; preds = %271
%277 = call i32 @error1(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 204, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.22, i64 0, i64 0))
br label %278
278: ; preds = %276, %271
%279 = call i32 @unlink(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0))
%280 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 206, i32 %279)
%281 = call i32 @unlink(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%282 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 207, i32 %281)
%283 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%284 = call i32 @chdir(i8* %283)
%285 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 208, i32 %284)
%286 = call i32 @rmdir(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%287 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 209, i32 %286)
ret void
}

LLVM IR (-O2):
%struct.stat = type { i32, i32, i32, i32 }
%struct.utimbuf = type { i32, i32 }
%struct.iovec = type { i32*, i32 }
%struct.dirent = type { i32 }
@.str = [26 x i8] c"/tmp/linux-test.tmp/file1\00"
@.str.1 = [26 x i8] c"/tmp/linux-test.tmp/file2\00"
@.str.2 = [26 x i8] c"/tmp/linux-test.tmp/file3\00"
@.str.3 = [20 x i8] c"/tmp/linux-test.tmp\00"
@.str.4 = [148 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/jvesely/qemu-neo1973/refs/heads/master/tests/linux-test.c\00"
@.str.5 = [7 x i8] c"getcwd\00"
@.str.6 = [6 x i8] c"file1\00"
@O_WRONLY = global i32 0
@O_TRUNC = global i32 0
@O_CREAT = global i32 0
@.str.7 = [6 x i8] c"write\00"
@.str.8 = [7 x i8] c"writev\00"
@.str.9 = [6 x i8] c"file2\00"
@O_RDONLY = global i32 0
@.str.10 = [5 x i8] c"read\00"
@.str.11 = [7 x i8] c"memcmp\00"
@SEEK_SET = global i32 0
@.str.12 = [6 x i8] c"lseek\00"
@.str.13 = [6 x i8] c"readv\00"
@R_OK = global i32 0
@.str.14 = [10 x i8] c"stat size\00"
@.str.15 = [10 x i8] c"stat mode\00"
@.str.16 = [11 x i8] c"stat mode2\00"
@.str.17 = [10 x i8] c"stat time\00"
@O_RDWR = global i32 0
@.str.18 = [6 x i8] c"file3\00"
@.str.19 = [8 x i8] c"opendir\00"
@.str.20 = [2 x i8] c".\00"
@.str.21 = [3 x i8] c"..\00"
@.str.22 = [8 x i8] c"readdir\00"
define void @test_file() {
%1 = alloca [300 x i32]
%2 = alloca [300 x i32]
%3 = alloca [300 x i32]
%4 = alloca [1024 x i8]
%5 = alloca %struct.stat
%6 = alloca %struct.utimbuf
%7 = alloca [2 x %struct.iovec]
%8 = bitcast [300 x i32]* %1 to i8*
%9 = bitcast [300 x i32]* %2 to i8*
%10 = bitcast [300 x i32]* %3 to i8*
%11 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%12 = bitcast %struct.stat* %5 to i8*
%13 = bitcast %struct.utimbuf* %6 to i8*
%14 = bitcast [2 x %struct.iovec]* %7 to i8*
%15 = tail call i32 @unlink(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%16 = tail call i32 @unlink(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%17 = tail call i32 @unlink(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%18 = tail call i32 @rmdir(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%19 = call i32* @getcwd(i8* %11, i32 1024)
%20 = icmp eq i32* %19, null
br i1 %20, label %21, label %23
21: ; preds = %0
%22 = call i32 @error1(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 95, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
br label %23
23: ; preds = %21, %0
%24 = call i32 @mkdir(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 493)
%25 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 97, i32 %24)
%26 = call i32 @chdir(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%27 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 99, i32 %26)
%28 = load i32, i32* @O_WRONLY
%29 = load i32, i32* @O_TRUNC
%30 = or i32 %29, %28
%31 = load i32, i32* @O_CREAT
%32 = or i32 %30, %31
%33 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i32 %32, i32 420)
%34 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 103, i32 %33)
br label %35
35: ; preds = %45, %23
%36 = phi i64 [ 0, %23 ], [ %66, %45 ]
%37 = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %23 ], [ %67, %45 ]
%38 = add <4 x i32> %37, <i32 4, i32 4, i32 4, i32 4>
%39 = getelementptr inbounds [300 x i32], [300 x i32]* %1, i64 0, i64 %36
%40 = bitcast i32* %39 to <4 x i32>*
store <4 x i32> %37, <4 x i32>* %40
%41 = getelementptr inbounds i32, i32* %39, i64 4
%42 = bitcast i32* %41 to <4 x i32>*
store <4 x i32> %38, <4 x i32>* %42
%43 = or i64 %36, 8
%44 = icmp eq i64 %43, 296
br i1 %44, label %68, label %45
45: ; preds = %35
%46 = add <4 x i32> %37, <i32 8, i32 8, i32 8, i32 8>
%47 = add <4 x i32> %37, <i32 12, i32 12, i32 12, i32 12>
%48 = getelementptr inbounds [300 x i32], [300 x i32]* %1, i64 0, i64 %43
%49 = bitcast i32* %48 to <4 x i32>*
store <4 x i32> %46, <4 x i32>* %49
%50 = getelementptr inbounds i32, i32* %48, i64 4
%51 = bitcast i32* %50 to <4 x i32>*
store <4 x i32> %47, <4 x i32>* %51
%52 = or i64 %36, 16
%53 = add <4 x i32> %37, <i32 16, i32 16, i32 16, i32 16>
%54 = add <4 x i32> %37, <i32 20, i32 20, i32 20, i32 20>
%55 = getelementptr inbounds [300 x i32], [300 x i32]* %1, i64 0, i64 %52
%56 = bitcast i32* %55 to <4 x i32>*
store <4 x i32> %53, <4 x i32>* %56
%57 = getelementptr inbounds i32, i32* %55, i64 4
%58 = bitcast i32* %57 to <4 x i32>*
store <4 x i32> %54, <4 x i32>* %58
%59 = or i64 %36, 24
%60 = add <4 x i32> %37, <i32 24, i32 24, i32 24, i32 24>
%61 = add <4 x i32> %37, <i32 28, i32 28, i32 28, i32 28>
%62 = getelementptr inbounds [300 x i32], [300 x i32]* %1, i64 0, i64 %59
%63 = bitcast i32* %62 to <4 x i32>*
store <4 x i32> %60, <4 x i32>* %63
%64 = getelementptr inbounds i32, i32* %62, i64 4
%65 = bitcast i32* %64 to <4 x i32>*
store <4 x i32> %61, <4 x i32>* %65
%66 = add nuw nsw i64 %36, 32
%67 = add <4 x i32> %37, <i32 32, i32 32, i32 32, i32 32>
br label %35
68: ; preds = %35
%69 = getelementptr inbounds [300 x i32], [300 x i32]* %1, i64 0, i64 296
store i32 296, i32* %69
%70 = getelementptr inbounds [300 x i32], [300 x i32]* %1, i64 0, i64 297
store i32 297, i32* %70
%71 = getelementptr inbounds [300 x i32], [300 x i32]* %1, i64 0, i64 298
store i32 298, i32* %71
%72 = getelementptr inbounds [300 x i32], [300 x i32]* %1, i64 0, i64 299
store i32 299, i32* %72
%73 = getelementptr inbounds [300 x i32], [300 x i32]* %1, i64 0, i64 0
%74 = call i32 @write(i32 %34, i32* %73, i32 150)
%75 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 106, i32 %74)
%76 = icmp eq i32 %75, 150
br i1 %76, label %79, label %77
77: ; preds = %68
%78 = call i32 @error1(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 108, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
br label %79
79: ; preds = %77, %68
%80 = getelementptr inbounds [300 x i32], [300 x i32]* %1, i64 0, i64 150
%81 = getelementptr inbounds [2 x %struct.iovec], [2 x %struct.iovec]* %7, i64 0, i64 0
%82 = getelementptr inbounds [2 x %struct.iovec], [2 x %struct.iovec]* %7, i64 0, i64 0, i32 0
store i32* %80, i32** %82
%83 = getelementptr inbounds [2 x %struct.iovec], [2 x %struct.iovec]* %7, i64 0, i64 0, i32 1
store i32 16, i32* %83
%84 = getelementptr inbounds [300 x i32], [300 x i32]* %1, i64 0, i64 166
%85 = getelementptr inbounds [2 x %struct.iovec], [2 x %struct.iovec]* %7, i64 0, i64 1, i32 0
store i32* %84, i32** %85
%86 = getelementptr inbounds [2 x %struct.iovec], [2 x %struct.iovec]* %7, i64 0, i64 1, i32 1
store i32 134, i32* %86
%87 = call i32 @writev(i32 %34, %struct.iovec* %81, i32 2)
%88 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 113, i32 %87)
%89 = icmp eq i32 %88, 150
br i1 %89, label %92, label %90
90: ; preds = %79
%91 = call i32 @error1(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 115, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
br label %92
92: ; preds = %90, %79
%93 = call i32 @close(i32 %34)
%94 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 116, i32 %93)
%95 = call i32 @rename(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%96 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 118, i32 %95)
%97 = load i32, i32* @O_RDONLY
%98 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i32 %97)
%99 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 120, i32 %98)
%100 = getelementptr inbounds [300 x i32], [300 x i32]* %2, i64 0, i64 0
%101 = call i32 @read(i32 %99, i32* %100, i32 300)
%102 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 122, i32 %101)
%103 = icmp eq i32 %102, 300
br i1 %103, label %106, label %104
104: ; preds = %92
%105 = call i32 @error1(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 124, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0))
br label %106
106: ; preds = %104, %92
%107 = call i64 @memcmp(i32* %73, i32* %100, i32 300)
%108 = icmp eq i64 %107, 0
br i1 %108, label %111, label %109
109: ; preds = %106
%110 = call i32 @error1(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 126, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0))
br label %111
111: ; preds = %109, %106
%112 = load i32, i32* @SEEK_SET
%113 = call i32 @lseek(i32 %99, i32 16, i32 %112)
%114 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 129, i32 %113)
%115 = icmp eq i32 %114, 16
br i1 %115, label %118, label %116
116: ; preds = %111
%117 = call i32 @error1(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 131, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0))
br label %118
118: ; preds = %116, %111
%119 = getelementptr inbounds [300 x i32], [300 x i32]* %3, i64 0, i64 0
store i32* %119, i32** %82
store i32 32, i32* %83
%120 = getelementptr inbounds [300 x i32], [300 x i32]* %3, i64 0, i64 32
store i32* %120, i32** %85
store i32 252, i32* %86
%121 = call i32 @readv(i32 %99, %struct.iovec* %81, i32 2)
%122 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 136, i32 %121)
%123 = icmp eq i32 %122, 284
br i1 %123, label %126, label %124
124: ; preds = %118
%125 = call i32 @error1(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 138, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0))
br label %126
126: ; preds = %124, %118
%127 = getelementptr inbounds [300 x i32], [300 x i32]* %1, i64 0, i64 16
%128 = call i64 @memcmp(i32* %127, i32* %119, i32 284)
%129 = icmp eq i64 %128, 0
br i1 %129, label %132, label %130
130: ; preds = %126
%131 = call i32 @error1(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 140, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0))
br label %132
132: ; preds = %130, %126
%133 = call i32 @close(i32 %99)
%134 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 142, i32 %133)
%135 = load i32, i32* @R_OK
%136 = call i32 @access(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i32 %135)
%137 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 145, i32 %136)
%138 = call i32 @chmod(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i32 384)
%139 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 149, i32 %138)
%140 = getelementptr inbounds %struct.utimbuf, %struct.utimbuf* %6, i64 0, i32 0
store i32 1001, i32* %140
%141 = getelementptr inbounds %struct.utimbuf, %struct.utimbuf* %6, i64 0, i32 1
store i32 1000, i32* %141
%142 = call i32 @truncate(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i32 100)
%143 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 152, i32 %142)
%144 = call i32 @utime(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), %struct.utimbuf* %6)
%145 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 153, i32 %144)
%146 = call i32 @stat(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), %struct.stat* %5)
%147 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 154, i32 %146)
%148 = getelementptr inbounds %struct.stat, %struct.stat* %5, i64 0, i32 0
%149 = load i32, i32* %148
%150 = icmp eq i32 %149, 100
br i1 %150, label %153, label %151
151: ; preds = %132
%152 = call i32 @error1(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 156, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i64 0, i64 0))
br label %153
153: ; preds = %151, %132
%154 = getelementptr inbounds %struct.stat, %struct.stat* %5, i64 0, i32 1
%155 = load i32, i32* %154
%156 = call i32 @S_ISREG(i32 %155)
%157 = icmp eq i32 %156, 0
br i1 %157, label %158, label %160
158: ; preds = %153
%159 = call i32 @error1(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 158, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.15, i64 0, i64 0))
br label %160
160: ; preds = %158, %153
%161 = and i32 %155, 511
%162 = icmp eq i32 %161, 384
br i1 %162, label %165, label %163
163: ; preds = %160
%164 = call i32 @error1(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 160, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.16, i64 0, i64 0))
br label %165
165: ; preds = %163, %160
%166 = getelementptr inbounds %struct.stat, %struct.stat* %5, i64 0, i32 2
%167 = load i32, i32* %166
%168 = icmp ne i32 %167, 1001
%169 = getelementptr inbounds %struct.stat, %struct.stat* %5, i64 0, i32 3
%170 = load i32, i32* %169
%171 = icmp ne i32 %170, 1000
%172 = select i1 %168, i1 true, i1 %171
br i1 %172, label %173, label %175
173: ; preds = %165
%174 = call i32 @error1(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 163, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.17, i64 0, i64 0))
br label %175
175: ; preds = %165, %173
%176 = call i32 @stat(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), %struct.stat* %5)
%177 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 165, i32 %176)
%178 = load i32, i32* %154
%179 = call i32 @S_ISDIR(i32 %178)
%180 = icmp eq i32 %179, 0
br i1 %180, label %181, label %183
181: ; preds = %175
%182 = call i32 @error1(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 167, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.15, i64 0, i64 0))
br label %183
183: ; preds = %181, %175
%184 = load i32, i32* @O_RDWR
%185 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i32 %184)
%186 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 170, i32 %185)
%187 = call i32 @ftruncate(i32 %186, i32 50)
%188 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 171, i32 %187)
%189 = call i32 @fstat(i32 %186, %struct.stat* %5)
%190 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 172, i32 %189)
%191 = call i32 @close(i32 %186)
%192 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 173, i32 %191)
%193 = load i32, i32* %148
%194 = icmp eq i32 %193, 50
br i1 %194, label %197, label %195
195: ; preds = %183
%196 = call i32 @error1(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 176, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i64 0, i64 0))
br label %197
197: ; preds = %195, %183
%198 = load i32, i32* %154
%199 = call i32 @S_ISREG(i32 %198)
%200 = icmp eq i32 %199, 0
br i1 %200, label %201, label %203
201: ; preds = %197
%202 = call i32 @error1(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 178, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.15, i64 0, i64 0))
br label %203
203: ; preds = %201, %197
%204 = call i32 @symlink(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0))
%205 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 181, i32 %204)
%206 = call i32 @lstat(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0), %struct.stat* %5)
%207 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 182, i32 %206)
%208 = load i32, i32* %154
%209 = call i32 @S_ISLNK(i32 %208)
%210 = icmp eq i32 %209, 0
br i1 %210, label %211, label %213
211: ; preds = %203
%212 = call i32 @error1(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 184, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.15, i64 0, i64 0))
br label %213
213: ; preds = %211, %203
%214 = call i32* @opendir(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%215 = icmp eq i32* %214, null
br i1 %215, label %216, label %218
216: ; preds = %213
%217 = call i32 @error1(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 189, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.19, i64 0, i64 0))
br label %218
218: ; preds = %216, %213
%219 = call %struct.dirent* @readdir(i32* %214)
%220 = icmp eq %struct.dirent* %219, null
br i1 %220, label %221, label %223
221: ; preds = %218
%222 = call i32 @closedir(i32* %214)
br label %251
223: ; preds = %218, %244
%224 = phi %struct.dirent* [ %246, %244 ], [ %219, %218 ]
%225 = phi i32 [ %245, %244 ], [ 0, %218 ]
%226 = getelementptr inbounds %struct.dirent, %struct.dirent* %224, i64 0, i32 0
%227 = load i32, i32* %226
%228 = call i64 @strcmp(i32 %227, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.20, i64 0, i64 0))
%229 = icmp eq i64 %228, 0
br i1 %229, label %244, label %230
230: ; preds = %223
%231 = load i32, i32* %226
%232 = call i64 @strcmp(i32 %231, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.21, i64 0, i64 0))
%233 = icmp eq i64 %232, 0
br i1 %233, label %244, label %234
234: ; preds = %230
%235 = load i32, i32* %226
%236 = call i64 @strcmp(i32 %235, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%237 = icmp eq i64 %236, 0
br i1 %237, label %244, label %238
238: ; preds = %234
%239 = load i32, i32* %226
%240 = call i64 @strcmp(i32 %239, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0))
%241 = icmp eq i64 %240, 0
br i1 %241, label %244, label %242
242: ; preds = %238
%243 = call i32 @error1(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 199, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.22, i64 0, i64 0))
br label %244
244: ; preds = %242, %238, %234, %230, %223
%245 = add nuw nsw i32 %225, 1
%246 = call %struct.dirent* @readdir(i32* %214)
%247 = icmp eq %struct.dirent* %246, null
br i1 %247, label %248, label %223
248: ; preds = %244
%249 = icmp eq i32 %245, 4
%250 = call i32 @closedir(i32* %214)
br i1 %249, label %253, label %251
251: ; preds = %221, %248
%252 = call i32 @error1(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 204, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.22, i64 0, i64 0))
br label %253
253: ; preds = %251, %248
%254 = call i32 @unlink(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0))
%255 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 206, i32 %254)
%256 = call i32 @unlink(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%257 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 207, i32 %256)
%258 = call i32 @chdir(i8* %11)
%259 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 208, i32 %258)
%260 = call i32 @rmdir(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%261 = call i32 @__chk_error(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.4, i64 0, i64 0), i32 209, i32 %260)
ret void
}