// https://syzkaller.appspot.com/bug?id=2c5a7f4f63ffede20ef6eb849b369a88f798cf3f
// autogenerated by syzkaller (https://github.com/google/syzkaller)

#define _GNU_SOURCE

#include <dirent.h>
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <pthread.h>
#include <setjmp.h>
#include <signal.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/mount.h>
#include <sys/prctl.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <time.h>
#include <unistd.h>

#include <linux/futex.h>
#include <linux/loop.h>

#ifndef __NR_memfd_create
#define __NR_memfd_create 319
#endif
#ifndef __NR_pwritev2
#define __NR_pwritev2 328
#endif

static unsigned long long procid;

static void sleep_ms(uint64_t ms)
{
  usleep(ms * 1000);
}

static uint64_t current_time_ms(void)
{
  struct timespec ts;
  if (clock_gettime(CLOCK_MONOTONIC, &ts))
    exit(1);
  return (uint64_t)ts.tv_sec * 1000 + (uint64_t)ts.tv_nsec / 1000000;
}

static void use_temporary_dir(void)
{
  char tmpdir_template[] = "./syzkaller.XXXXXX";
  char* tmpdir = mkdtemp(tmpdir_template);
  if (!tmpdir)
    exit(1);
  if (chmod(tmpdir, 0777))
    exit(1);
  if (chdir(tmpdir))
    exit(1);
}

static void thread_start(void* (*fn)(void*), void* arg)
{
  pthread_t th;
  pthread_attr_t attr;
  pthread_attr_init(&attr);
  pthread_attr_setstacksize(&attr, 128 << 10);
  int i = 0;
  for (; i < 100; i++) {
    if (pthread_create(&th, &attr, fn, arg) == 0) {
      pthread_attr_destroy(&attr);
      return;
    }
    if (errno == EAGAIN) {
      usleep(50);
      continue;
    }
    break;
  }
  exit(1);
}

typedef struct {
  int state;
} event_t;

static void event_init(event_t* ev)
{
  ev->state = 0;
}

static void event_reset(event_t* ev)
{
  ev->state = 0;
}

static void event_set(event_t* ev)
{
  if (ev->state)
    exit(1);
  __atomic_store_n(&ev->state, 1, __ATOMIC_RELEASE);
  syscall(SYS_futex, &ev->state, FUTEX_WAKE | FUTEX_PRIVATE_FLAG, 1000000);
}

static void event_wait(event_t* ev)
{
  while (!__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE))
    syscall(SYS_futex, &ev->state, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, 0, 0);
}

static int event_isset(event_t* ev)
{
  return __atomic_load_n(&ev->state, __ATOMIC_ACQUIRE);
}

static int event_timedwait(event_t* ev, uint64_t timeout)
{
  uint64_t start = current_time_ms();
  uint64_t now = start;
  for (;;) {
    uint64_t remain = timeout - (now - start);
    struct timespec ts;
    ts.tv_sec = remain / 1000;
    ts.tv_nsec = (remain % 1000) * 1000 * 1000;
    syscall(SYS_futex, &ev->state, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, 0, &ts);
    if (__atomic_load_n(&ev->state, __ATOMIC_ACQUIRE))
      return 1;
    now = current_time_ms();
    if (now - start > timeout)
      return 0;
  }
}

static bool write_file(const char* file, const char* what, ...)
{
  char buf[1024];
  va_list args;
  va_start(args, what);
  vsnprintf(buf, sizeof(buf), what, args);
  va_end(args);
  buf[sizeof(buf) - 1] = 0;
  int len = strlen(buf);
  int fd = open(file, O_WRONLY | O_CLOEXEC);
  if (fd == -1)
    return false;
  if (write(fd, buf, len) != len) {
    int err = errno;
    close(fd);
    errno = err;
    return false;
  }
  close(fd);
  return true;
}

//% This code is derived from puff.{c,h}, found in the zlib development. The
//% original files come with the following copyright notice:

//% Copyright (C) 2002-2013 Mark Adler, all rights reserved
//% version 2.3, 21 Jan 2013
//% This software is provided 'as-is', without any express or implied
//% warranty.  In no event will the author be held liable for any damages
//% arising from the use of this software.
//% Permission is granted to anyone to use this software for any purpose,
//% including commercial applications, and to alter it and redistribute it
//% freely, subject to the following restrictions:
//% 1. The origin of this software must not be misrepresented; you must not
//%    claim that you wrote the original software. If you use this software
//%    in a product, an acknowledgment in the product documentation would be
//%    appreciated but is not required.
//% 2. Altered source versions must be plainly marked as such, and must not be
//%    misrepresented as being the original software.
//% 3. This notice may not be removed or altered from any source distribution.
//% Mark Adler    madler@alumni.caltech.edu

//% BEGIN CODE DERIVED FROM puff.{c,h}

#define MAXBITS 15
#define MAXLCODES 286
#define MAXDCODES 30
#define MAXCODES (MAXLCODES + MAXDCODES)
#define FIXLCODES 288

struct puff_state {
  unsigned char* out;
  unsigned long outlen;
  unsigned long outcnt;
  const unsigned char* in;
  unsigned long inlen;
  unsigned long incnt;
  int bitbuf;
  int bitcnt;
  jmp_buf env;
};
static int puff_bits(struct puff_state* s, int need)
{
  long val = s->bitbuf;
  while (s->bitcnt < need) {
    if (s->incnt == s->inlen)
      longjmp(s->env, 1);
    val |= (long)(s->in[s->incnt++]) << s->bitcnt;
    s->bitcnt += 8;
  }
  s->bitbuf = (int)(val >> need);
  s->bitcnt -= need;
  return (int)(val & ((1L << need) - 1));
}
static int puff_stored(struct puff_state* s)
{
  s->bitbuf = 0;
  s->bitcnt = 0;
  if (s->incnt + 4 > s->inlen)
    return 2;
  unsigned len = s->in[s->incnt++];
  len |= s->in[s->incnt++] << 8;
  if (s->in[s->incnt++] != (~len & 0xff) ||
      s->in[s->incnt++] != ((~len >> 8) & 0xff))
    return -2;
  if (s->incnt + len > s->inlen)
    return 2;
  if (s->outcnt + len > s->outlen)
    return 1;
  for (; len--; s->outcnt++, s->incnt++) {
    if (s->in[s->incnt])
      s->out[s->outcnt] = s->in[s->incnt];
  }
  return 0;
}
struct puff_huffman {
  short* count;
  short* symbol;
};
static int puff_decode(struct puff_state* s, const struct puff_huffman* h)
{
  int first = 0;
  int index = 0;
  int bitbuf = s->bitbuf;
  int left = s->bitcnt;
  int code = first = index = 0;
  int len = 1;
  short* next = h->count + 1;
  while (1) {
    while (left--) {
      code |= bitbuf & 1;
      bitbuf >>= 1;
      int count = *next++;
      if (code - count < first) {
        s->bitbuf = bitbuf;
        s->bitcnt = (s->bitcnt - len) & 7;
        return h->symbol[index + (code - first)];
      }
      index += count;
      first += count;
      first <<= 1;
      code <<= 1;
      len++;
    }
    left = (MAXBITS + 1) - len;
    if (left == 0)
      break;
    if (s->incnt == s->inlen)
      longjmp(s->env, 1);
    bitbuf = s->in[s->incnt++];
    if (left > 8)
      left = 8;
  }
  return -10;
}
static int puff_construct(struct puff_huffman* h, const short* length, int n)
{
  int len;
  for (len = 0; len <= MAXBITS; len++)
    h->count[len] = 0;
  int symbol;
  for (symbol = 0; symbol < n; symbol++)
    (h->count[length[symbol]])++;
  if (h->count[0] == n)
    return 0;
  int left = 1;
  for (len = 1; len <= MAXBITS; len++) {
    left <<= 1;
    left -= h->count[len];
    if (left < 0)
      return left;
  }
  short offs[MAXBITS + 1];
  offs[1] = 0;
  for (len = 1; len < MAXBITS; len++)
    offs[len + 1] = offs[len] + h->count[len];
  for (symbol = 0; symbol < n; symbol++)
    if (length[symbol] != 0)
      h->symbol[offs[length[symbol]]++] = symbol;
  return left;
}
static int puff_codes(struct puff_state* s, const struct puff_huffman* lencode,
                      const struct puff_huffman* distcode)
{
  static const short lens[29] = {3,  4,  5,  6,   7,   8,   9,   10,  11, 13,
                                 15, 17, 19, 23,  27,  31,  35,  43,  51, 59,
                                 67, 83, 99, 115, 131, 163, 195, 227, 258};
  static const short lext[29] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2,
                                 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0};
  static const short dists[30] = {
      1,    2,    3,    4,    5,    7,    9,    13,    17,    25,
      33,   49,   65,   97,   129,  193,  257,  385,   513,   769,
      1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577};
  static const short dext[30] = {0, 0, 0,  0,  1,  1,  2,  2,  3,  3,
                                 4, 4, 5,  5,  6,  6,  7,  7,  8,  8,
                                 9, 9, 10, 10, 11, 11, 12, 12, 13, 13};
  int symbol;
  do {
    symbol = puff_decode(s, lencode);
    if (symbol < 0)
      return symbol;
    if (symbol < 256) {
      if (s->outcnt == s->outlen)
        return 1;
      if (symbol)
        s->out[s->outcnt] = symbol;
      s->outcnt++;
    } else if (symbol > 256) {
      symbol -= 257;
      if (symbol >= 29)
        return -10;
      int len = lens[symbol] + puff_bits(s, lext[symbol]);
      symbol = puff_decode(s, distcode);
      if (symbol < 0)
        return symbol;
      unsigned dist = dists[symbol] + puff_bits(s, dext[symbol]);
      if (dist > s->outcnt)
        return -11;
      if (s->outcnt + len > s->outlen)
        return 1;
      while (len--) {
        if (dist <= s->outcnt && s->out[s->outcnt - dist])
          s->out[s->outcnt] = s->out[s->outcnt - dist];
        s->outcnt++;
      }
    }
  } while (symbol != 256);
  return 0;
}
static int puff_fixed(struct puff_state* s)
{
  static int virgin = 1;
  static short lencnt[MAXBITS + 1], lensym[FIXLCODES];
  static short distcnt[MAXBITS + 1], distsym[MAXDCODES];
  static struct puff_huffman lencode, distcode;
  if (virgin) {
    lencode.count = lencnt;
    lencode.symbol = lensym;
    distcode.count = distcnt;
    distcode.symbol = distsym;
    short lengths[FIXLCODES];
    int symbol;
    for (symbol = 0; symbol < 144; symbol++)
      lengths[symbol] = 8;
    for (; symbol < 256; symbol++)
      lengths[symbol] = 9;
    for (; symbol < 280; symbol++)
      lengths[symbol] = 7;
    for (; symbol < FIXLCODES; symbol++)
      lengths[symbol] = 8;
    puff_construct(&lencode, lengths, FIXLCODES);
    for (symbol = 0; symbol < MAXDCODES; symbol++)
      lengths[symbol] = 5;
    puff_construct(&distcode, lengths, MAXDCODES);
    virgin = 0;
  }
  return puff_codes(s, &lencode, &distcode);
}
static int puff_dynamic(struct puff_state* s)
{
  static const short order[19] = {16, 17, 18, 0, 8,  7, 9,  6, 10, 5,
                                  11, 4,  12, 3, 13, 2, 14, 1, 15};
  int nlen = puff_bits(s, 5) + 257;
  int ndist = puff_bits(s, 5) + 1;
  int ncode = puff_bits(s, 4) + 4;
  if (nlen > MAXLCODES || ndist > MAXDCODES)
    return -3;
  short lengths[MAXCODES];
  int index;
  for (index = 0; index < ncode; index++)
    lengths[order[index]] = puff_bits(s, 3);
  for (; index < 19; index++)
    lengths[order[index]] = 0;
  short lencnt[MAXBITS + 1], lensym[MAXLCODES];
  struct puff_huffman lencode = {lencnt, lensym};
  int err = puff_construct(&lencode, lengths, 19);
  if (err != 0)
    return -4;
  index = 0;
  while (index < nlen + ndist) {
    int symbol;
    int len;
    symbol = puff_decode(s, &lencode);
    if (symbol < 0)
      return symbol;
    if (symbol < 16)
      lengths[index++] = symbol;
    else {
      len = 0;
      if (symbol == 16) {
        if (index == 0)
          return -5;
        len = lengths[index - 1];
        symbol = 3 + puff_bits(s, 2);
      } else if (symbol == 17)
        symbol = 3 + puff_bits(s, 3);
      else
        symbol = 11 + puff_bits(s, 7);
      if (index + symbol > nlen + ndist)
        return -6;
      while (symbol--)
        lengths[index++] = len;
    }
  }
  if (lengths[256] == 0)
    return -9;
  err = puff_construct(&lencode, lengths, nlen);
  if (err && (err < 0 || nlen != lencode.count[0] + lencode.count[1]))
    return -7;
  short distcnt[MAXBITS + 1], distsym[MAXDCODES];
  struct puff_huffman distcode = {distcnt, distsym};
  err = puff_construct(&distcode, lengths + nlen, ndist);
  if (err && (err < 0 || ndist != distcode.count[0] + distcode.count[1]))
    return -8;
  return puff_codes(s, &lencode, &distcode);
}
static int puff(unsigned char* dest, unsigned long* destlen,
                const unsigned char* source, unsigned long sourcelen)
{
  struct puff_state s = {
      .out = dest,
      .outlen = *destlen,
      .outcnt = 0,
      .in = source,
      .inlen = sourcelen,
      .incnt = 0,
      .bitbuf = 0,
      .bitcnt = 0,
  };
  int err;
  if (setjmp(s.env) != 0)
    err = 2;
  else {
    int last;
    do {
      last = puff_bits(&s, 1);
      int type = puff_bits(&s, 2);
      err = type == 0 ? puff_stored(&s)
                      : (type == 1 ? puff_fixed(&s)
                                   : (type == 2 ? puff_dynamic(&s) : -1));
      if (err != 0)
        break;
    } while (!last);
  }
  *destlen = s.outcnt;
  return err;
}

//% END CODE DERIVED FROM puff.{c,h}

#define ZLIB_HEADER_WIDTH 2

static int puff_zlib_to_file(const unsigned char* source,
                             unsigned long sourcelen, int dest_fd)
{
  if (sourcelen < ZLIB_HEADER_WIDTH)
    return 0;
  source += ZLIB_HEADER_WIDTH;
  sourcelen -= ZLIB_HEADER_WIDTH;
  const unsigned long max_destlen = 132 << 20;
  void* ret = mmap(0, max_destlen, PROT_WRITE | PROT_READ,
                   MAP_PRIVATE | MAP_ANON, -1, 0);
  if (ret == MAP_FAILED)
    return -1;
  unsigned char* dest = (unsigned char*)ret;
  unsigned long destlen = max_destlen;
  int err = puff(dest, &destlen, source, sourcelen);
  if (err) {
    munmap(dest, max_destlen);
    errno = -err;
    return -1;
  }
  if (write(dest_fd, dest, destlen) != (ssize_t)destlen) {
    munmap(dest, max_destlen);
    return -1;
  }
  return munmap(dest, max_destlen);
}

static int setup_loop_device(unsigned char* data, unsigned long size,
                             const char* loopname, int* loopfd_p)
{
  int err = 0, loopfd = -1;
  int memfd = syscall(__NR_memfd_create, "syzkaller", 0);
  if (memfd == -1) {
    err = errno;
    goto error;
  }
  if (puff_zlib_to_file(data, size, memfd)) {
    err = errno;
    goto error_close_memfd;
  }
  loopfd = open(loopname, O_RDWR);
  if (loopfd == -1) {
    err = errno;
    goto error_close_memfd;
  }
  if (ioctl(loopfd, LOOP_SET_FD, memfd)) {
    if (errno != EBUSY) {
      err = errno;
      goto error_close_loop;
    }
    ioctl(loopfd, LOOP_CLR_FD, 0);
    usleep(1000);
    if (ioctl(loopfd, LOOP_SET_FD, memfd)) {
      err = errno;
      goto error_close_loop;
    }
  }
  close(memfd);
  *loopfd_p = loopfd;
  return 0;

error_close_loop:
  close(loopfd);
error_close_memfd:
  close(memfd);
error:
  errno = err;
  return -1;
}

static long syz_mount_image(volatile long fsarg, volatile long dir,
                            volatile long flags, volatile long optsarg,
                            volatile long change_dir,
                            volatile unsigned long size, volatile long image)
{
  unsigned char* data = (unsigned char*)image;
  int res = -1, err = 0, loopfd = -1, need_loop_device = !!size;
  char* mount_opts = (char*)optsarg;
  char* target = (char*)dir;
  char* fs = (char*)fsarg;
  char* source = NULL;
  char loopname[64];
  if (need_loop_device) {
    memset(loopname, 0, sizeof(loopname));
    snprintf(loopname, sizeof(loopname), "/dev/loop%llu", procid);
    if (setup_loop_device(data, size, loopname, &loopfd) == -1)
      return -1;
    source = loopname;
  }
  mkdir(target, 0777);
  char opts[256];
  memset(opts, 0, sizeof(opts));
  if (strlen(mount_opts) > (sizeof(opts) - 32)) {
  }
  strncpy(opts, mount_opts, sizeof(opts) - 32);
  if (strcmp(fs, "iso9660") == 0) {
    flags |= MS_RDONLY;
  } else if (strncmp(fs, "ext", 3) == 0) {
    bool has_remount_ro = false;
    char* remount_ro_start = strstr(opts, "errors=remount-ro");
    if (remount_ro_start != NULL) {
      char after = *(remount_ro_start + strlen("errors=remount-ro"));
      char before = remount_ro_start == opts ? '\0' : *(remount_ro_start - 1);
      has_remount_ro = ((before == '\0' || before == ',') &&
                        (after == '\0' || after == ','));
    }
    if (strstr(opts, "errors=panic") || !has_remount_ro)
      strcat(opts, ",errors=continue");
  } else if (strcmp(fs, "xfs") == 0) {
    strcat(opts, ",nouuid");
  }
  res = mount(source, target, fs, flags, opts);
  if (res == -1) {
    err = errno;
    goto error_clear_loop;
  }
  res = open(target, O_RDONLY | O_DIRECTORY);
  if (res == -1) {
    err = errno;
    goto error_clear_loop;
  }
  if (change_dir) {
    res = chdir(target);
    if (res == -1) {
      err = errno;
    }
  }

error_clear_loop:
  if (need_loop_device) {
    ioctl(loopfd, LOOP_CLR_FD, 0);
    close(loopfd);
  }
  errno = err;
  return res;
}

#define FS_IOC_SETFLAGS _IOW('f', 2, long)
static void remove_dir(const char* dir)
{
  int iter = 0;
  DIR* dp = 0;
retry:
  while (umount2(dir, MNT_DETACH | UMOUNT_NOFOLLOW) == 0) {
  }
  dp = opendir(dir);
  if (dp == NULL) {
    if (errno == EMFILE) {
      exit(1);
    }
    exit(1);
  }
  struct dirent* ep = 0;
  while ((ep = readdir(dp))) {
    if (strcmp(ep->d_name, ".") == 0 || strcmp(ep->d_name, "..") == 0)
      continue;
    char filename[FILENAME_MAX];
    snprintf(filename, sizeof(filename), "%s/%s", dir, ep->d_name);
    while (umount2(filename, MNT_DETACH | UMOUNT_NOFOLLOW) == 0) {
    }
    struct stat st;
    if (lstat(filename, &st))
      exit(1);
    if (S_ISDIR(st.st_mode)) {
      remove_dir(filename);
      continue;
    }
    int i;
    for (i = 0;; i++) {
      if (unlink(filename) == 0)
        break;
      if (errno == EPERM) {
        int fd = open(filename, O_RDONLY);
        if (fd != -1) {
          long flags = 0;
          if (ioctl(fd, FS_IOC_SETFLAGS, &flags) == 0) {
          }
          close(fd);
          continue;
        }
      }
      if (errno == EROFS) {
        break;
      }
      if (errno != EBUSY || i > 100)
        exit(1);
      if (umount2(filename, MNT_DETACH | UMOUNT_NOFOLLOW))
        exit(1);
    }
  }
  closedir(dp);
  for (int i = 0;; i++) {
    if (rmdir(dir) == 0)
      break;
    if (i < 100) {
      if (errno == EPERM) {
        int fd = open(dir, O_RDONLY);
        if (fd != -1) {
          long flags = 0;
          if (ioctl(fd, FS_IOC_SETFLAGS, &flags) == 0) {
          }
          close(fd);
          continue;
        }
      }
      if (errno == EROFS) {
        break;
      }
      if (errno == EBUSY) {
        if (umount2(dir, MNT_DETACH | UMOUNT_NOFOLLOW))
          exit(1);
        continue;
      }
      if (errno == ENOTEMPTY) {
        if (iter < 100) {
          iter++;
          goto retry;
        }
      }
    }
    exit(1);
  }
}

static void kill_and_wait(int pid, int* status)
{
  kill(-pid, SIGKILL);
  kill(pid, SIGKILL);
  for (int i = 0; i < 100; i++) {
    if (waitpid(-1, status, WNOHANG | __WALL) == pid)
      return;
    usleep(1000);
  }
  DIR* dir = opendir("/sys/fs/fuse/connections");
  if (dir) {
    for (;;) {
      struct dirent* ent = readdir(dir);
      if (!ent)
        break;
      if (strcmp(ent->d_name, ".") == 0 || strcmp(ent->d_name, "..") == 0)
        continue;
      char abort[300];
      snprintf(abort, sizeof(abort), "/sys/fs/fuse/connections/%s/abort",
               ent->d_name);
      int fd = open(abort, O_WRONLY);
      if (fd == -1) {
        continue;
      }
      if (write(fd, abort, 1) < 0) {
      }
      close(fd);
    }
    closedir(dir);
  } else {
  }
  while (waitpid(-1, status, __WALL) != pid) {
  }
}

static void reset_loop()
{
  char buf[64];
  snprintf(buf, sizeof(buf), "/dev/loop%llu", procid);
  int loopfd = open(buf, O_RDWR);
  if (loopfd != -1) {
    ioctl(loopfd, LOOP_CLR_FD, 0);
    close(loopfd);
  }
}

static void setup_test()
{
  prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0);
  setpgrp();
  write_file("/proc/self/oom_score_adj", "1000");
  if (symlink("/dev/binderfs", "./binderfs")) {
  }
}

struct thread_t {
  int created, call;
  event_t ready, done;
};

static struct thread_t threads[16];
static void execute_call(int call);
static int running;

static void* thr(void* arg)
{
  struct thread_t* th = (struct thread_t*)arg;
  for (;;) {
    event_wait(&th->ready);
    event_reset(&th->ready);
    execute_call(th->call);
    __atomic_fetch_sub(&running, 1, __ATOMIC_RELAXED);
    event_set(&th->done);
  }
  return 0;
}

static void execute_one(void)
{
  int i, call, thread;
  for (call = 0; call < 7; call++) {
    for (thread = 0; thread < (int)(sizeof(threads) / sizeof(threads[0]));
         thread++) {
      struct thread_t* th = &threads[thread];
      if (!th->created) {
        th->created = 1;
        event_init(&th->ready);
        event_init(&th->done);
        event_set(&th->done);
        thread_start(thr, th);
      }
      if (!event_isset(&th->done))
        continue;
      event_reset(&th->done);
      th->call = call;
      __atomic_fetch_add(&running, 1, __ATOMIC_RELAXED);
      event_set(&th->ready);
      event_timedwait(&th->done, 50 + (call == 0 ? 4000 : 0));
      break;
    }
  }
  for (i = 0; i < 100 && __atomic_load_n(&running, __ATOMIC_RELAXED); i++)
    sleep_ms(1);
}

static void execute_one(void);

#define WAIT_FLAGS __WALL

static void loop(void)
{
  int iter = 0;
  for (;; iter++) {
    char cwdbuf[32];
    sprintf(cwdbuf, "./%d", iter);
    if (mkdir(cwdbuf, 0777))
      exit(1);
    reset_loop();
    int pid = fork();
    if (pid < 0)
      exit(1);
    if (pid == 0) {
      if (chdir(cwdbuf))
        exit(1);
      setup_test();
      execute_one();
      exit(0);
    }
    int status = 0;
    uint64_t start = current_time_ms();
    for (;;) {
      if (waitpid(-1, &status, WNOHANG | WAIT_FLAGS) == pid)
        break;
      sleep_ms(1);
      if (current_time_ms() - start < 5000)
        continue;
      kill_and_wait(pid, &status);
      break;
    }
    remove_dir(cwdbuf);
  }
}

uint64_t r[3] = {0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff};

void execute_call(int call)
{
  intptr_t res = 0;
  switch (call) {
  case 0:
    memcpy((void*)0x200000c0, "reiserfs\000", 9);
    memcpy((void*)0x20000040, "./file1\000", 8);
    memcpy(
        (void*)0x20001940,
        "\x78\x9c\xec\xd8\x31\x6b\x14\x41\x18\x06\xe0\x77\xf6\xce\x98\xa0\xb0"
        "\x72\xe9\x17\x4b\x0b\x09\x91\xb3\x56\x53\x28\x5c\x6b\xab\x95\x92\xce"
        "\x2a\x69\x2d\xee\xc7\xd8\xf8\x5f\x24\x95\x7d\x48\xaf\x45\x2a\xcb\x95"
        "\xdd\xcd\xba\x08\xe1\x54\x12\x53\xe8\xf3\xc0\x30\x73\xdf\xbd\xb3\x33"
        "\x53\xce\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3a\xf3"
        "\xe4\x4b\x49\x76\xab\x64\x31\xd6\xaa\x24\x25\x69\x9a\x93\xd5\x59\x92"
        "\x66\xac\xdf\xfb\x34\xab\x52\xf2\xf2\x70\x75\xfc\xfc\x68\xf9\xe2\x78"
        "\x88\xa5\x4a\x79\x95\x94\x6e\x56\xca\xc7\x27\x43\x76\xb9\x58\x2e\x1e"
        "\x2d\x1e\xef\x1e\x8c\x93\xdf\x1d\x1e\xf5\xfd\x9b\x3b\x25\x4d\x4e\xcf"
        "\xaf\xf5\x14\x3b\xb9\xd8\xcb\x6c\x43\xa8\xdb\xe0\xf6\x8f\x34\x00\x00"
        "\x00\xfc\x3f\xda\x2b\xab\x7f\x6f\xa1\x6f\x77\xff\xd2\xfa\x00\x00\x00"
        "\xc0\xaf\x5c\xef\x6b\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc0\x9f\x6b"
        "\xeb\x69\xbc\x35\x0e\xaa\x24\x25\x69\x9a\x93\xd5\x59\x92\xe6\x92\x79"
        "\xb7\x6e\x68\x7f\x00\x00\x00\xc0\xd5\x95\x54\x79\x5d\x5f\x56\x1f\x9e"
        "\x01\x26\x0f\xf3\xb9\x2e\x7d\xbd\x6b\xed\xe0\x69\x95\xfd\x7c\xa8\xb3"
        "\xd3\x47\xe6\x53\xba\xda\xb4\xe8\xc6\x3f\x01\x00\x00\xe0\x9f\xd7\xde"
        "\xee\xbb\xfb\x29\xeb\xe9\x9a\x5c\xb6\xca\x7a\xbc\x8f\x3f\xc8\x7c\xaa"
        "\xf7\xc9\x79\xf6\xf6\x86\xdf\x17\x5d\xbe\x1e\x24\xb3\xac\xb7\xf7\x7f"
        "\xfe\xf6\xce\xb3\x24\xa7\xe7\xef\xdf\x76\xad\xb4\xb3\x1b\x3a\x12\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf0\x9d\x1d\x38\x16\x00\x00"
        "\x00\x00\x10\xe6\x6f\x9d\x46\xc7\x06\x00\x00\x00\x00\x00\x00\x00\x00"
        "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7c\x15\x00\x00\xff\xff"
        "\x19\x69\xda\xb8",
        4373);
    res = -1;
    res = syz_mount_image(/*fs=*/0x200000c0, /*dir=*/0x20000040,
                          /*flags=*/0x800c, /*opts=*/0x20000300, /*chdir=*/0xfd,
                          /*size=*/0x1115, /*img=*/0x20001940);
    if (res != -1)
      r[0] = res;
    break;
  case 1:
    memcpy((void*)0x20000000, "memory.numa_stat\000", 17);
    res = syscall(__NR_openat, /*fd=*/0xffffff9c, /*file=*/0x20000000ul,
                  /*flags=*/0x275aul, /*mode=*/0ul);
    if (res != -1)
      r[1] = res;
    break;
  case 2:
    memcpy((void*)0x20000040, "blkio.bfq.io_service_bytes_recursive\000", 37);
    res = syscall(__NR_openat, /*fd=*/0xffffff9c, /*file=*/0x20000040ul,
                  /*flags=*/0x275aul, /*mode=*/0ul);
    if (res != -1)
      r[2] = res;
    break;
  case 3:
    syscall(__NR_write, /*fd=*/r[2], /*data=*/0x200001c0ul,
            /*len=*/0x208e24bul);
    break;
  case 4:
    *(uint64_t*)0x200018c0 = 0;
    *(uint64_t*)0x200018c8 = 0;
    *(uint64_t*)0x200018d0 = 0;
    *(uint64_t*)0x200018d8 = 0;
    *(uint64_t*)0x200018e0 = 0x20000540;
    memcpy(
        (void*)0x20000540,
        "\x5e\x9e\x3d\xf7\x56\x6a\x14\xd7\x2f\xdf\xd4\x24\x92\xe1\x5b\xcf\x42"
        "\xd3\xd2\x57\xd2\x07\x34\x3a\x51\x09\x60\xd6\x4a\x61\x4d\x74\xda\x1e"
        "\xd6\xa7\x1c\x48\x0f\xed\x87\x2d\x37\xd7\xa8\x75\xaf\x27\xa9\x7a\x57"
        "\xe8\xb0\x1b\x49\xfd\xef\xc1\x7d\x81\xff\xeb\x18\xbc\xf2\x7a\xcb\x20"
        "\x7d\xb7\x9b\xef\xdc\x74\xc5\x36\x4d\x44\xb0\xf9\x6a\x38\x5f\xe1\x00"
        "\x96\x06\x3c\x04\xe8\x8c\xe3\x15\x6c\x25\xc0\xbc\xe2\x50\xfb\x3b\xb2"
        "\xb8\xaf\x53\x28\x04\xbd\x31\x65\xc3\xfc\xee\xb0\xce\x8e\x35\x96\x76"
        "\xed\x40\x87\x3e\x2e\x3d\x05\x39\xbd\x33\xdc\x5d\x5b\x9b\xef\x86\x5e"
        "\x3a\x8a\x6b\x0a\x93\x6c\x6a\x77\x2d\xb5\xa8\xa6\xbe\x90\x83\x43\x36"
        "\x8e\xef\xa4\xdd\x88\xcc\x70\x9e\xba\x15\x31\x48\x45\xef\x74\xfe\xb1"
        "\x70\xea\xb9\x3e\x62\x82\x25\xb1\xf1\xfe\x83\x40\x59\xb0\x7d\xc0\x9c"
        "\x89\x14\xc6\x06\x11\x05\x46\xff\x8e\x4a\x24\xc7\xf8\x0f\x70\xdc\x9a"
        "\x2c\xf4\x2c\x42\xa0\x99\x3a\x93\x6a\xb3\xfe\x0f\xc3\xa8\xd7\x2c\x01"
        "\x67\xec\x14\xf2\x91\xf0\x2a\x1e\x57\xba\x20\xf8\x1b\x60\xde\xbb\x17"
        "\xd3\xdf\x78\x50\xfd\x60\x18\x33\x39\x27\x66\x77\xec\x60\xba\x08\x05"
        "\xd9\x37\x67\x39\xa5\x7c\x6f\xa1\x9a\xd5\xc6\x44\x26\x78\x0d\xcf\x7c"
        "\xd4\x30\xe3\x71\x69\xe5\x61\x40\xdd\x80\x98\xf6\xa5\x45\xda\xfe\xf1"
        "\xe0\x39\x6c\x8c\xca\xba\x01\xe2\xe6\xbe\xec\x01\x52\xa3\x90\x45\xea"
        "\x61\x0b\x42\x17\x04\x5f\x73\x20\xd2\xcc\x5a\x1b\x4c\x6a\x78\x82\x26"
        "\x17\xa0\x03\xaa\x12\xde\xd0\xb2\x9f\xf7\x57\x6d\xbd\xae\xdc\xec\x6a"
        "\xcb\x96\x24\xf0\x53\xfe\x0c\x23\x07\x08\xd3\xbf\x14\x7a\x1d\xde\xe8"
        "\x0b\x70\xd6\xb7\xfb\x2d\x83\x90\xfc\xbf\x57\x4e\x02\x26\x91\x1d\x48"
        "\xd6\x70\xdd\xbc\xba\x62\xc8\x53\x89\x1a\x94\xeb\xe4\x49\x79\xca\xb6"
        "\x7a\xf2\x0b\x59\x8f\x52\x32\xdc\x16\x85\x7e\x72\xe2\x25\x3c\x94\x0e"
        "\xd7\x52\x7a\xa6\xf3\xd1\x6a\x09\xb5\x5e\x23\x60\xd0\xa0\x8f\x43\xa3"
        "\xcb\x7b\x6b\x84\x25\x36\x55\xa9\x67\x11\x03\x6c\x5d\x3f\xed\xe6\x21"
        "\x30\xec\xff\x39\x51\x06\x40\xf9\x96\x03\xac\xd7\xaf\xc4\x25\x31\xf9"
        "\x55\x0f\x79\x4a\xf0\x29\xdc\x90\xa5\x5d\xf3\x71\x52\xe5\x4d\x4d\xe7"
        "\x34\xce\xb2\xf4\x49\x28\xf9\xa9\x4b\xd9\x41\xf4\xb1\x9a\xe8\xb8\xfb"
        "\xde\x3e\x56\xe7\x14\x72\xf6\xe1\x34\x47\x25\x77\xd0\x47\xb7\xfe\xd4"
        "\x0a\x7b\x7a\x63\x50\xd6\x17\x38\x59\xee\xa0\x8d\x4d\xeb\x17\xb5\x9f"
        "\x4d\x9a\x82\xa9\x80\x96\xe9\xb9\xff\xa7\xf3\x9e\x86\x86\x09\x1a\xc2"
        "\xc5\x02\x1f\xd1\x9f\xe1\xdf\x6e\xb6\x5e\x60\xe6\xf8\xa8\x3d\xff\x64"
        "\x9b\x0a\xeb\xb5\xf0\x25\x2d\x87\x8b\xb2\x37\x51\x84\x43\x20\xbc\xb3"
        "\xe1\x87\x17\x20\x94\x6b\x80\x47\x53\x75\x33\x23\x10\xe7\x61\x99\xeb"
        "\x88\x2e\x99\x73\x61\xd9\x2d\x92\x1e\xd0\xd2\xba\xcc\x5c\xeb\xd3\x42"
        "\xd4\xe0\x6e\x54\xcf\x28\x23\x9f\x05\x63\xd8\x15\x93\xe7\xd1\xef\xe5"
        "\x1d\x45\xc1\xdf\x17\xd1\x77\xe4\xdd\x71\x9a\x75\x24\xaa\x43\xd9\x2d"
        "\x35\x5e\x9d\x14\x94\x62\xd7\x77\x7a\x33\x94\xeb\xd3\x94\x65\xc2\xc8"
        "\xa6\x3c\x70\x8d\x58\x7b\x6b\xee\xcf\x91\x50\x9e\xef\x99\xc1\x2b\x70"
        "\x82\x9c\x89\xc7\xea\xa3\xcb\xd4\x41\x14\x40\x24\xf6\xd7\xdc\x93\x2c"
        "\x30\xaf\x90\xd7\xa9\xe5\xf3\x37\xf9\x62\x4d\xb5\x24\x0d\x92\x15\xea"
        "\xdf\x62\x51\xc3\x35\x40\xb7\x0e\x88\xcc\x99\x23\xc5\xf0\x4b\x64\x5f"
        "\x37\x5a\x49\x36\x7d\xcd\x86\x37\x2b\x95\xe4\x52\xac\xdc\x50\x57\xe1"
        "\x54\x9e\x46\xe0\xaa\xf1\xcf\xb7\x39\xcf\x1c\x78\x83\xa0\x3e\xc5\x41"
        "\xc8\x4e\xdc\x10\xfc\x45\xbb\x3c\xd0\xa8\x45\xd7\xe7\xba\x00\xf5\x60"
        "\x56\x2f\x2d\x6b\x62\xd3\x16\x70\xe8\xd7\xae\x3d\x16\x61\xb2\x1d\xc7"
        "\xa5\x94\x99\x10\xf4\xa4\x5d\xe2\xc8\x70\x83\x8d\xcb\x7a\xb3\x4b\xba"
        "\x5c\x00\x96\x89\x85\x9e\xf1\xa2\x17\x8e\x8a\x62\x4e\xe5\xbc\x2f\x90"
        "\x54\xc5\x28\x42\x70\x10\x1d\x48\xe8\x6a\x6d\x4e\x25\x63\xbb\x70\xba"
        "\x14\xf9\xbb\x51\x47\xfa\xe2\x6c\xa7\x0d\x7e\x38\xfd\x48\x4f\x9b\x3e"
        "\x67\xf7\xd0\x34\x48\x28\x1e\x53\x0a\x2c\x9f\x4e\x8f\xfc\x40\x5c\x3c"
        "\x28\x36\x20\x4b\xd4\x68\x1f\xc9\xe5\xdf\x62\xca\xf6\xcc\x54\x5e\xba"
        "\x9f\x1e\x28\xa8\x9d\x04\xd3\xca\x88\x6e\xb6\x84\xd7\x30\xec\x5a\xdd"
        "\x8c\xa9\x7e\x70\xe1\xee\x7d\x24\xe1\xf3\xb5\xbb\x03\x74\x97\x10\xd5"
        "\xa7\x77\xee\x10\x84\xb0\xe8\x28\x9c\xab\x7d\xbb\x6a\x86\xbe\xb2\x7f"
        "\x6f\x8f\xc0\x90\xcf\xbe\x63\xe0\x4f\x5f\xf2\x29\x30\x67\xad\x93\x8e"
        "\x59\xb4\x3f\x8c\x97\x00\x34\xf6\x5e\x8b\x80\x95\x8b\x95\xea\x4f\xd0"
        "\x4c\xa7\xb5\xdb\xde\xca\x2b\x9b\x58\x02\x96\x50\x9d\xb8\xfc\xa5\xf3"
        "\xb2\x69\x37\x60\xbb\xfc\x3f\x68\x5d\x67\x29\xf2\x2a\xff\x56\xf6\x4b"
        "\xb3\xbe\xa8\xfb\x3e\xcd\x52\x9f\x58\xc8\x13\xc0\x43\xfe\x0b\xc3\xea"
        "\x78\x1d\xf7\x44\x22\xff\xb2\x19\x7b\xbe\x8e\x67\x07\xd4\xba\x39\x47"
        "\x67\x97\x29\xc3\x6e\x0e\xab\xc6\x34\x0e\x08\xa7\x92\x26\xda\xfc\x0e"
        "\xf1\x81\x24\x3f\x6e\xe8\x16\xb0\xc7\x16\xbe\x6b\xc2\x9a\x2d\xa7\x95"
        "\xe3\x55\xa9\xe1\x63\xc7\x92\xa2\x3d\xff\x47\x86\x40\x8c\x3c\xa4\x44"
        "\x03\x4b\xa7\x5c\x89\x95\x88\xee\x90\x9f\x69\x41\x59\xa0\xde\x1f\xc1"
        "\x90\x2b\x31\x14\x3f\xe8\x87\x2f\x57\xbe\xc3\x1e\x86\x97\xca\xf9\x1b"
        "\xd5\x51\xb1\xcf\xdc\x3c\xc7\xa5\xd9\x14\x46\x62\x14\x91\x1c\x12\xfc"
        "\x1e\x07\xa4\xd7\xa9\x34\x4e\x18\x71\x22\xde\xc6\x66\x00\xb7\x09\x4e"
        "\xdf\xcd\xa5\xb4\x5a\xd4\x55\x57\x0d\xa8\x2a\x6a\x66\x5e\x47\x0c\xef"
        "\x48\x0c\xf0\xd2\xe5\x15\x12\x8e\x0c\x43\x8d\xa0\x44\x31\x0e\x0a\x72"
        "\xaf\xd4\x09\x0c\xe0\x56\x6a\xb5\x84\x87\x7f\xc0\x8f\x4a\xf4\x12\x81"
        "\xa8\x92\x2e\xc5\xf4\xa8\xd4\xf6\xc7\x21\x4e\xd8\x46\x76\x29\x8d\xab"
        "\x60\xd1\x99\x1c\xfe\x31\x76\x58\xa0\xa1\x64\xad\xca\xe9\x32\xff\xe4"
        "\x32\x24\x1f\x30\x0e\x73\xb6\xff\x30\xbe\xc4\x5f\xf6\xd9\x29\x89\xfd"
        "\x6e\x1d\x57\x06\xf1\x0c\x9b\x2e\x02\x1f\x93\x9a\x75\xc6\x88\x1e\xe1"
        "\xef\x7e\x93\xea\x10\x7f\xf1\x49\x76\x34\x5b\x3f\xf0\xf2\x8e\xe3\x6c"
        "\xd0\x6b\x55\xf1\xa7\x6f\xb4\xd6\x26\x0d\xd4\x79\x46\x69\x25\x7e\x6f"
        "\x87\x1f\xa6\xb1\x8f\x08\x32\x70\xb6\x80\x72\x67\xdf\xed\x70\x11\x7a"
        "\xdb\x77\xb9\x50\xd4\x52\x3a\xc3\x8d\x18\x6d\xa0\xbf\x60\xe1\x0d\x51"
        "\x86\xb2\x0d\xe3\xb1\x7f\x3f\x16\x43\x7c\xc5\x88\x4e\x8e\x69\x4c\xa0"
        "\x8a\xbe\x87\x78\x05\xcf\x6c\x70\xa9\x91\x94\xc9\x98\x88\xce\x49\x82"
        "\x94\xa7\x9b\x1a\xec\xed\x25\x9e\x91\x09\xdc\x8a\xc3\x1a\x30\xdb\xed"
        "\xc0\x33\x33\x79\x40\x5f\xc9\x93\x1f\x8d\x60\x00\xbe\x14\x27\xa5\x97"
        "\x9a\x0f\xaa\xbc\x65\x34\x96\x9c\xfd\x2e\x52\x6f\x1b\x2c\x28\xf9\x79"
        "\x5f\xfd\x16\x8e\x1e\xc8\x23\x7b\xbb\xc9\x19\xe4\x7e\x5f\x19\x98\x54"
        "\xe9\x2b\x79\x98\xdf\x63\x4e\x10\xd6\x5b\xdf\xcc\x08\x3c\x02\x42\x53"
        "\x9b\xcd\x27\x13\x38\x7f\xa5\xfa\xb1\xc5\xe4\xbb\xe9\xc6\x6b\x3f\xe7"
        "\xe9\xc7\x5b\x14\xa4\x56\x72\xca\xc3\x1b\x7f\x08\x78\x65\x9e\xd1\x2b"
        "\xb0\x33\x9b\x21\x8b\xb5\xb6\x4d\x88\x8d\xfc\x42\x3a\x74\x68\xa3\xe1"
        "\xd3\xb0\x48\x01\x24\xc4\x2f\xb9\x74\xc8\xcf\x9a\x06\x6d\xc8\x39\x0d"
        "\xae\x57\x46\xf4\xb2\x6f\xc7\x05\xb5\xc1\xd1\x13\x09\x05\x86\x19\xed"
        "\xa0\x52\x5e\xe2\x49\x03\xa8\x22\xb0\x24\xc8\xea\x99\xa4\x32\x1b\x7a"
        "\x6d\x04\x61\xb3\x7c\x27\x04\x40\x6c\x11\x5d\xa4\xc6\xee\x1f\x00\x5d"
        "\x3a\xb3\xbb\xfe\xb3\x26\x58\xcf\x28\xb3\x25\x65\x19\x48\x24\xd0\xcd"
        "\x77\x1b\xe0\x17\xb8\xfe\x45\x65\xc2\xe3\x0f\xb9\x53\x7e\x09\xdd\x4c"
        "\x1f\xd8\x51\x65\xab\xc4\x3f\x83\x14\x4f\x40\xb0\x00\x6c\x86\xad\x6f"
        "\xa0\x3c\xd8\x02\x37\x94\x36\x74\x44\x64\xcb\xdc\x31\x2f\xb1\x91\xb8"
        "\x90\x3f\x6d\xd0\x28\xf4\x95\xb8\xc5\x6c\x06\xeb\x7b\x45\x3f\x70\x49"
        "\xd5\xd7\xe3\xfb\x8f\xfe\xca\x8c\x2d\x4d\x34\xf5\xe4\x14\xbe\x09\x09"
        "\x5e\x2d\xb2\xe8\xbb\xac\xba\xd7\x29\x39\xd2\x96\x72\x66\xd4\x85\x83"
        "\x0f\xe7\xeb\xa6\x2d\x87\x0a\x7c\x1c\x99\xe9\xdb\x75\xaa\x91\x2e\xd8"
        "\x3c\x71\x5b\xd1\x57\xa2\x81\xd4\xa7\xa1\x54\xfb\xa2\x5a\xed\xd2\x1e"
        "\x8f\x63\x72\x01\x28\x7f\xe2\xb9\x8b\xcd\xd7\xe0\xda\xf0\x6a\x42\xe9"
        "\x1c\x38\xdf\xcd\x36\x83\x1c\xd8\xca\x7a\x25\xce\xe7\x45\x0b\x52\x2c"
        "\x00\x06\x8b\xa9\xca\xb5\x1f\x1c\xac\xd0\x99\xeb\x8b\x47\x64\x3a\x88"
        "\xf6\xe5\x3e\x54\x45\xb1\x64\x74\xeb\x82\xd2\x42\x49\xda\x76\xd5\x1a"
        "\x64\x19\x0c\xcb\x7c\x31\x2f\x57\x50\xa9\xd3\x53\xbb\x9c\x34\x4c\x0d"
        "\x96\x74\x49\x26\x03\x98\xdc\xef\x98\xda\xb1\x74\x4a\x6a\x3e\x4f\x19"
        "\xab\xe4\x5d\x02\x55\xe1\xd5\xcf\x29\x9f\x11\x41\xd7\xeb\x0e\x50\x0f"
        "\xd0\xf0\xb3\xeb\xbd\x78\x86\x4f\xa9\x51\x3c\x23\xd4\x37\xa0\x2b\xc1"
        "\xda\x12\x4a\xe3\x37\x4b\x98\xbb\x2b\x4b\x01\xf1\xa8\xd1\x11\xf3\xed"
        "\xcb\x11\x22\xc8\x9a\x07\x04\x2f\x76\xa3\x32\xac\x80\x6c\xc2\x77\x55"
        "\xdf\x54\x13\xfe\x10\x0b\x0e\x7d\xde\x69\xe2\x3b\x64\x51\xd5\x63\x21"
        "\xc1\xc2\xb0\x24\x50\x9a\x5b\x74\xa5\x35\x7d\x81\xc7\xf3\xff\x8f\x44"
        "\x9c\x10\x9b\x70\x14\xfd\x9e\x8a\xed\x0e\x5a\x86\x7c\x96\x21\xa1\xba"
        "\x88\x9e\x43\xf6\x65\x80\x35\x08\x65\x93\x86\x72\x21\x31\xee\x4c\x8b"
        "\x53\x7c\x57\x95\x37\xc2\x51\xa2\x05\xea\xe3\x6b\x70\x1c\x45\xac\x1b"
        "\xc5\x62\x10\xec\xdb\x34\x2d\x45\xef\xd8\x7c\x42\xbc\xd5\x8e\x67\x12"
        "\x7e\x59\xf6\x92\x8f\x88\x7f\xa1\xce\xb3\x73\x6f\x7b\xea\x9b\x26\xa8"
        "\x1d\xb3\xd5\xdd\xfb\x89\xf2\x37\x05\xf3\x74\x9f\x2e\xe5\x5b\x99\x71"
        "\xf4\x23\x81\x46\x73\xe4\x9a\x9d\x7c\xc6\x69\xee\xd5\xb6\xc0\xfd\x1a"
        "\xec\x45\xf5\x15\xb0\x24\x7e\x6d\xb0\xed\xc4\x26\xdd\x17\x02\x8a\x0e"
        "\x9a\x09\x13\xbe\x90\x60\xec\x18\x1d\xbb\xe9\xbb\x3d\x83\xf8\x48\xf0"
        "\x64\x08\x3e\x0d\x42\x83\xa0\x54\x54\x36\xac\xdc\x25\x7d\x05\x60\xda"
        "\xce\x62\x31\xe6\x8f\x51\x23\x10\x43\x92\x42\xf2\x14\x87\x34\x0f\x74"
        "\xd3\x00\xaa\x27\xb3\x8d\x13\x8c\xbc\x72\x8b\x4a\xd1\x2b\x7d\x94\xdd"
        "\x30\xa1\x18\xff\xa4\x08\x5e\xa2\xc1\xb2\x64\xef\x91\xfb\x30\xf4\x3d"
        "\xf1\x73\x33\xd2\xec\x63\xf1\x9d\xd4\xa8\xbe\xad\x1a\x85\xce\x75\xf4"
        "\x7d\xe4\x95\x7f\x10\x6d\xb0\xd4\x6c\xfe\x6a\x3f\x75\x18\x0c\xd4\x17"
        "\x48\x19\x92\xd8\xd7\x75\x00\x75\xbc\xca\x06\x4b\xf8\xe2\xd4\x17\x47"
        "\x42\xe1\x75\x5d\x54\x23\xb6\xf2\x08\xf6\xeb\xa6\xa5\x55\xe7\x86\x4d"
        "\x7f\xc7\x21\x58\x45\xa5\x31\x35\x75\xeb\x41\xf6\x12\x5d\x09\xf1\x83"
        "\x1f\x89\xf1\x9c\xf9\x02\x9e\x83\xd1\xb7\x7c\x9c\xfc\xb0\x8a\x16\xd4"
        "\x0f\x5b\x1a\xd6\x58\xe1\x1f\xa8\x8b\x2e\x48\xc5\x17\x93\xb9\x89\xf7"
        "\x11\x49\xe5\x23\xdf\xc3\x7d\x64\xb5\x8d\xbc\x7c\xcd\xa8\x9d\x84\xe2"
        "\x55\xd7\x8a\xfe\x17\xcd\x20\x64\x9e\xd9\x78\xf7\xaf\x16\xd1\x02\xc6"
        "\xf8\xfe\xa0\x9e\xe0\x5c\xbf\x0f\x47\x0e\xf5\x41\x2b\x46\x12\x91\x54"
        "\xbd\x6d\x19\x9d\xb6\x05\x1f\x20\xc7\x9e\xbf\xe3\xb6\x40\x8a\x04\xb2"
        "\x8d\x7c\xc3\x9f\x8c\x67\x41\xc7\x09\x88\xfe\xd2\xd7\x75\x63\xc6\x7f"
        "\x73\x80\xe1\x08\x87\x68\x51\x88\x9a\x5f\x89\xd8\xdc\x2b\x08\xaf\x2a"
        "\x8f\xee\x7e\xde\xb7\x29\x3d\xae\x57\xa8\xcd\xca\xe9\xfa\xc5\x88\x55"
        "\x26\x38\x74\x95\xa9\x86\xcf\x5c\x67\x33\x47\xa5\xaf\xea\x38\x48\x10"
        "\x0e\x60\xf8\x69\xa8\x77\x5c\x1a\x3f\xf5\xfe\x72\x85\x06\x45\x57\xf8"
        "\xd5\xcd\x62\xcb\xad\x9e\xd8\x3b\x07\x13\xf7\xd8\x59\xfe\xe3\xd0\xcb"
        "\xd5\x53\xb3\xbf\x1e\x21\xaf\x87\xbf\x7a\x4e\x79\x10\x65\xcb\xf8\x92"
        "\x90\xce\x68\x3c\x2a\x14\x98\xd5\xac\x5d\xf5\xc7\x25\x0a\x2c\xb7\x4e"
        "\x93\xdb\x9d\xa1\xa9\x56\x14\x5e\xc3\x1a\xea\xd9\x72\xb7\x77\xb0\x21"
        "\x54\x83\xf7\x98\xfb\x77\x52\xb1\xa2\x37\x63\x96\xd5\x67\x70\x08\x01"
        "\x8f\x2d\x07\xcf\x05\xdc\x3d\x03\xd4\xa7\x1b\x9e\x5d\xbf\x60\xaf\x66"
        "\x6f\x6a\xcf\xc0\x0b\xd6\x62\xe7\x9c\x8a\xbe\x8d\x61\x28\x2e\x2a\x9d"
        "\xf4\xb0\xd3\xd2\x32\x3a\x4a\xfa\xfa\xd6\x2f\x77\x05\x6c\xec\x93\xe9"
        "\x63",
        2585);
    *(uint64_t*)0x200018e8 = 0xa19;
    syscall(__NR_pwritev2, /*fd=*/r[1], /*vec=*/0x200018c0ul, /*vlen=*/3ul,
            /*off_low=*/0, /*off_high=*/0, /*flags=*/0ul);
    break;
  case 5:
    syscall(__NR_dup2, /*oldfd=*/r[0], /*newfd=*/r[1]);
    break;
  case 6:
    memcpy((void*)0x20000000, "./file0\000", 8);
    syscall(__NR_mknod, /*file=*/0x20000000ul, /*mode=*/0ul,
            /*dev=*/0x701 + procid * 2);
    break;
  }
}
int main(void)
{
  syscall(__NR_mmap, /*addr=*/0x1ffff000ul, /*len=*/0x1000ul, /*prot=*/0ul,
          /*flags=*/0x32ul, /*fd=*/-1, /*offset=*/0ul);
  syscall(__NR_mmap, /*addr=*/0x20000000ul, /*len=*/0x1000000ul, /*prot=*/7ul,
          /*flags=*/0x32ul, /*fd=*/-1, /*offset=*/0ul);
  syscall(__NR_mmap, /*addr=*/0x21000000ul, /*len=*/0x1000ul, /*prot=*/0ul,
          /*flags=*/0x32ul, /*fd=*/-1, /*offset=*/0ul);
  for (procid = 0; procid < 6; procid++) {
    if (fork() == 0) {
      use_temporary_dir();
      loop();
    }
  }
  sleep(1000000);
  return 0;
}