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

#define _GNU_SOURCE

#include <dirent.h>
#include <endian.h>
#include <errno.h>
#include <fcntl.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/loop.h>

#ifndef __NR_memfd_create
#define __NR_memfd_create 319
#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 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 void reset_loop_device(const char* loopname)
{
  int loopfd = open(loopname, O_RDWR);
  if (loopfd == -1) {
    return;
  }
  if (ioctl(loopfd, LOOP_CLR_FD, 0)) {
  }
  close(loopfd);
}

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, 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) {
    int loopfd;
    memset(loopname, 0, sizeof(loopname));
    snprintf(loopname, sizeof(loopname), "/dev/loop%llu", procid);
    if (setup_loop_device(data, size, loopname, &loopfd) == -1)
      return -1;
    close(loopfd);
    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)
    reset_loop_device(loopname);
  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;
  const int umount_flags = MNT_FORCE | UMOUNT_NOFOLLOW;

retry:
  while (umount2(dir, umount_flags) == 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, umount_flags) == 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, umount_flags))
        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, umount_flags))
          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")) {
  }
}

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 (;;) {
      sleep_ms(10);
      if (waitpid(-1, &status, WNOHANG | WAIT_FLAGS) == pid)
        break;
      if (current_time_ms() - start < 5000)
        continue;
      kill_and_wait(pid, &status);
      break;
    }
    remove_dir(cwdbuf);
  }
}

uint64_t r[1] = {0xffffffffffffffff};

void execute_one(void)
{
  intptr_t res = 0;
  if (write(1, "executing program\n", sizeof("executing program\n") - 1)) {
  }
  memcpy((void*)0x20000780, "ext4\000", 5);
  memcpy((void*)0x20000000, "./file1\000", 8);
  *(uint8_t*)0x200000c0 = 0;
  memcpy(
      (void*)0x200007c0,
      "\x78\x9c\xec\xdd\xcd\x6b\x5c\xe5\x1a\x00\xf0\xe7\x4c\xbe\xd3\xde\x9b\x5c"
      "\xb8\x70\x6f\x5d\x05\x04\x0d\x94\x4e\x4c\x8d\xad\x82\x8b\x8a\x0b\x11\x2c"
      "\x14\x74\xe1\xca\x36\x4c\xa6\xa1\x66\x92\x29\x99\x89\x34\x21\x60\x8a\x08"
      "\x6e\x04\x15\x17\x82\x6e\xba\xf6\xa3\xee\xdc\xfa\xb1\xad\xff\x85\x0b\x69"
      "\xa9\x9a\x16\x2b\x2e\x24\x72\x26\x67\xda\x69\x33\x33\x49\xcc\xc7\xb4\xe4"
      "\xf7\x83\x93\xbc\xef\x9c\x73\xf2\xbc\xcf\x79\xcf\xc7\x3b\x39\x87\x99\x00"
      "\x0e\xac\x91\xf4\x47\x2e\xe2\x48\x44\x7c\x90\x44\x0c\x65\xaf\x27\x11\xd1"
      "\x53\x2b\x75\x47\x9c\x5a\x5f\xee\xce\xea\x72\x21\x9d\x92\x58\x5b\x7b\xf5"
      "\xd7\xa4\xb6\xcc\xed\xd5\xe5\x42\x34\xac\x93\x3a\x94\x55\xfe\x1f\x11\xdf"
      "\xbf\x1b\x71\x34\xb7\x31\x6e\x65\x71\x69\x66\xb2\x54\x2a\xce\x67\xf5\xb1"
      "\xea\xec\xc5\xb1\xca\xe2\xd2\xb1\x0b\xb3\x93\xd3\xc5\xe9\xe2\xdc\x89\xf1"
      "\x89\x89\xe3\x27\x9f\x39\x79\x62\xf7\x72\xfd\xfd\xc7\xa5\xc3\x37\x3e\x7c"
      "\xe9\xc9\xaf\x4e\xfd\xf9\xce\xff\xae\xbe\xff\x43\x12\xa7\xe2\x70\x36\xaf"
      "\x31\x8f\xdd\x32\x12\x23\xd9\x36\xe9\x49\x37\xe1\x7d\x5e\xdc\xed\x60\x1d"
      "\x96\x74\xba\x01\xfc\x23\x13\x11\xd1\xb5\x7e\x94\xc7\x91\x18\x8a\xae\x5a"
      "\xa9\x85\x81\xfd\x6c\x19\x00\xb0\x57\xde\x8e\x88\x35\x00\xe0\x80\x49\x5c"
      "\xff\x01\xe0\x80\xa9\xff\x1f\xe0\xf6\xea\x72\xa1\x3e\xb5\xf9\x77\x41\x9b"
      "\x9b\x03\x8f\xa6\x9b\x2f\x44\x44\xff\x7a\xfe\xf5\xfb\x9b\xeb\x73\xba\x6b"
      "\xf7\xec\xae\x45\x7f\xed\x3e\xe8\xe0\xed\xe4\xbe\xe4\x93\x88\x18\xde\x85"
      "\xf8\x23\x11\xf1\xd9\x37\x6f\x7c\x91\x4e\xb1\x47\xf7\x21\x01\x9a\x59\xb9"
      "\x1c\x11\xe7\x86\x47\x36\x9e\xff\x93\x0d\xcf\x2c\x6c\xd7\x53\x5b\x58\x66"
      "\xe4\x81\x7a\xc3\xf9\xaf\x77\x87\xe1\x81\x4d\x7c\x9b\x8e\x7f\x9e\x6d\x36"
      "\xfe\xcb\x65\xc7\x7f\x7f\xed\xe7\x83\xe3\x9f\xbe\xf5\x63\x77\x65\xa7\xf1"
      "\xdb\x1c\xff\x99\xdc\xf5\x9d\xc6\x68\x27\x1d\xff\x3d\xdf\xf0\x6c\xdb\x9d"
      "\x86\xfc\x33\xc3\x5d\x59\xed\x5f\xb5\x31\x5f\x4f\x72\xfe\x42\xa9\x98\x9e"
      "\xdb\xfe\x1d\x11\xa3\xd1\xd3\x97\xd6\xc7\xdb\xc4\x18\xbd\xf5\xd7\xad\x56"
      "\xf3\x1a\xc7\x7f\xbf\x7d\xf4\xe6\xe7\x69\xfc\xf4\xf7\xbd\x25\x72\xd7\xbb"
      "\xfb\xee\x5f\x67\x6a\xb2\x3a\xb9\x93\x9c\x1b\xdd\xbc\x1c\xf1\x58\x77\xb3"
      "\xfc\x93\xbb\xfd\x9f\xb4\x18\xff\x9e\xd9\x62\x8c\x97\x9f\x7b\xef\xd3\x56"
      "\xf3\xd2\xfc\xd3\x7c\xeb\xd3\xc6\xfc\xf7\xd6\xda\x95\x88\x27\x9a\xf6\xff"
      "\xbd\x27\xda\x92\xb6\xcf\x27\x8e\xd5\x76\x87\xb1\xfa\x4e\xd1\xc4\xd7\x3f"
      "\x7d\x32\xd8\x2a\x7e\x63\xff\xa7\x53\x1a\xbf\xfe\x5e\x60\x3f\xa4\xfd\x3f"
      "\xd8\x3e\xff\xe1\xa4\xf1\x79\xcd\xca\xf6\x63\x5c\xbb\x32\xf4\x5d\xab\x79"
      "\x23\x11\x6b\x59\xa4\x16\xf9\x37\xdf\xff\x7b\x93\xd7\x6a\xe5\xfa\x20\xe1"
      "\xd2\x64\xb5\x3a\x3f\x1e\xd1\x9b\xbc\xb2\xf1\xf5\xe3\xf7\xd6\xad\xd7\xeb"
      "\xcb\xa7\xf9\x8f\x3e\xde\xdb\xf4\xf8\x6f\xb7\xff\xa7\xef\x09\xcf\x6d\x31"
      "\xff\xee\x1b\xbf\x7c\xd9\x26\xff\x8e\xf7\xff\xd4\xb6\xfa\x7f\xfb\x85\xab"
      "\x77\x66\xba\x5a\xc5\xdf\x3c\xff\xb4\xff\x27\x6a\xa5\xd1\xec\x95\xad\x9c"
      "\xff\xb6\xda\xc0\x9d\x6c\x3b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\xd8\xaa\x5c\x44\x1c\x8e\x24\x97\xbf\x5b"
      "\xce\xe5\xf2\xf9\xf5\xef\xf0\xfe\x6f\x0c\xe6\x4a\xe5\x4a\xf5\xe8\xf9\xf2"
      "\xc2\xdc\x54\xd4\xbe\x2b\x7b\x38\x7a\x72\xf5\x8f\xba\x1c\x6a\xf8\x3c\xd4"
      "\xf1\xec\xf3\xf0\xeb\xf5\xe3\x0f\xd4\x9f\x8e\x88\xff\x44\xc4\xc7\x7d\x03"
      "\xb5\x7a\xbe\x50\x2e\x4d\x75\x3a\x79\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\xc8\x1c\x6a\xf1\xfd\xff\xa9\x9f\xfb\x3a\xdd\x3a\x00\x60"
      "\xcf\xf4\x77\xba\x01\x00\xc0\xbe\x73\xfd\x07\x80\x83\xa7\xd5\xf5\x7f\xa5"
      "\xe9\xab\x03\x7b\xda\x16\x00\x60\x7f\x78\xff\x0f\x00\x07\x8f\xeb\x3f\x00"
      "\x1c\x3c\xae\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\xec\xb1\x33\xa7\x4f\xa7\xd3\xda\x1f\xab\xcb\x85\xb4\x3e\x35\x10\x11"
      "\xe5\xb7\x8e\x4d\x15\x2b\x33\xf9\xd9\x85\x42\xbe\x50\x9e\xbf\x98\x9f\x2e"
      "\x97\xa7\x4b\xc5\x7c\xa1\x3c\xdb\xf2\x0f\xad\xac\xff\x2a\x95\xcb\x17\x27"
      "\x62\x6e\xe1\xd2\x58\xb5\x58\xa9\x8e\x55\x16\x97\xce\xce\x96\x17\xe6\xaa"
      "\x67\x2f\xcc\x4e\x4e\x17\xcf\x16\x7b\xf6\x2d\x33\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\xd8\xba\xca\xe2\x52\x12\xa5\x52\x71\xbe\xb2"
      "\xb8\x34\x33\xf9\x68\x17\x92\x88\x48\xa7\x87\xa5\x3d\x0f\x7d\xa1\x2b\xdb"
      "\x09\xda\x2d\x93\x24\x9b\x2f\xb3\x59\xe1\xf5\x5d\x68\x73\x5f\xd6\xd6\xbd"
      "\xde\x2c\xf5\x38\xdb\x59\xab\x2f\x3a\xde\x95\xbb\x5f\x68\x3c\x4b\x0c\xec"
      "\xe3\x19\x09\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe0\xd1\xf2\x77\x00\x00"
      "\x00\xff\xff\x0d\xd1\x14\xf6",
      1969);
  syz_mount_image(/*fs=*/0x20000780, /*dir=*/0x20000000,
                  /*flags=MS_LAZYTIME|MS_NOATIME|MS_DIRSYNC*/ 0x2000480,
                  /*opts=*/0x200000c0, /*chdir=*/1, /*size=*/0x7b1,
                  /*img=*/0x200007c0);
  memcpy((void*)0x20000080, "./file1\000", 8);
  memcpy((void*)0x200000c0, "trusted.overlay.upper\000", 22);
  *(uint8_t*)0x20000f80 = 0;
  *(uint8_t*)0x20000f81 = 0xfb;
  *(uint8_t*)0x20000f82 = 1;
  *(uint8_t*)0x20000f83 = 0;
  *(uint8_t*)0x20000f84 = 0;
  memcpy((void*)0x20000f85,
         "\x40\xdf\xf8\xc0\x22\x8d\xac\x60\x34\x23\xee\x2e\x31\x02\xf6\x88",
         16);
  memcpy(
      (void*)0x20000f95,
      "\x5a\x21\xcc\xa8\xb8\x03\x14\x64\x9e\x7a\x83\x4f\xa4\xb3\x22\xfc\x9c\x5e"
      "\xde\x6b\xfe\x93\x10\xec\x9d\x7e\x2b\x9b\x39\x27\xc3\xbe\xf0\xb0\xec\x7d"
      "\x27\x43\x4c\x4a\x30\xad\xd4\xd8\xca\xac\x31\x38\x05\x7c\x3e\xdf\xb4\x18"
      "\x4f\x53\xbb\x2b\xdb\x65\x00\xa4\x00\x07\x0a\xa9\xdc\xfc\x13\x76\x20\xdc"
      "\xbc\xd1\xba\xe3\xc1\x65\xf3\x8d\xa4\x5e\xe6\xdf\xc1\x0d\xca\xa8\x8c\x6f"
      "\xb5\xbf\x61\x7f\x21\x50\xce\xe2\x73\xa2\x30\xdf\x27\x5e\x09\xdd\xd9\xed"
      "\x3d\xdb\xfa\xf5\x12\xa9\xd4\xd1\x86\xf9\x59\x77\xb9\x40\x66\x8d\xbc\x15"
      "\xc8\x3a\xcc\x29\xa6\x7f\x18\x6c\xea\x35\x3b\x98\x1f\xd4\x1a\xec\xab\x9e"
      "\x55\xe6\xf0\x93\xf2\xe3\xaa\x2a\xf6\xda\x4a\xce\xac\xb4\x16\x9b\x25\x11"
      "\x14\x4f\x6e\x3c\xc8\x7f\xa0\xa9\x9d\xf6\xd4\x48\x03\x8c\xc4\x90\x1d\xd1"
      "\xea\x2d\x71\x96\x47\xd5\x2e\x1f\x3d\x71\xe3\x04\xe4\xe0\xf1\x92\xf4\xc2"
      "\x77\x13\x64\x2b\x47\xc5\xcf\x83\xef\x41\xff\x00\xa1\x9f\xc8\x58\x4e\xc4"
      "\x54\x28\x12\xa5\x63\x27\xe2\x3a\x23\x95\x84\xf6\xa2\x82\x77\x4f\xb8\x85"
      "\xb1\x3d\x2e\x7f\xc5\xf1\x3e\x07\x7e\xe5\x9a\x17\x4e\x76\x07\x67\x47\x12"
      "\x8a\x57\x7f\x3f\x5c\xe6\xe9\x02\x13\x89\xb1\xd9\x81\x39\xa5\xc7\xd7\x30"
      "\xca\xba\x74\x7d\x8a\x92\x19\x73\x8c\xbb\xcb\x8c\xa6\x00\x4e\x8a\x63\x28"
      "\xa2\xce\xbb\xad\xe3\x52\xc6\xdb\x63\x66\x42\x24\x87\x47\x3e\xb2\x07\x7b"
      "\xbf\x12\x8c\x58\xc6\x0b\xd5\xe7\xe0\x54\x0c\x3a\xe6\x96\xaf\x67\xfd\x75"
      "\x8b\x1d\xde\xcd\x4d\xda\x1f\x29\x23\x2f\x61\x3a\xf2\x40\xc9\xb6\x8b\x24"
      "\xec\x8f\x81\x5a\x4f\x31\x53\xe5\xe1\x1b\xad\x51\x09\x83\x55\x05\x6c\xa6"
      "\x00\x63\x62\xc6\xa1\xca\xdf\x13\x25\xb9\x2c\x3b\xbf\x22\x93\xbd\x97\x21"
      "\x6e\x3e\x2c\x38\x81\x87\x74\x69\x14\x22\xd6\x6f\x97\xb6\xfd\x84\x00\xf9"
      "\x74\x0e\x5c\x7b\xdd\xd2\xd0\x17\xa1\xac\x41\x18\x4a\xb3\x76\x6e\x7a\x94"
      "\x5f\x63\x0e\x78\x4b\xe9\x7e\x51\xf4\x43\x41\x2e\xba\x52\x03\x0e\x91\xe1"
      "\x82\xd9\x13\x87\x1f\x15\x4f\x47\x94\x3c\xdc\x5e\x3d\x45\x63\x6a\xf8\xc5"
      "\xde\x34\xcf\x06\x8a\x55\x7a\x34\x00\x02\x74\xd3\xfb\xbd\xb1\x44\x73\x9a"
      "\x0d\x66\x4f\x48\xe4\x52\x66\x24\x22\xc1\x65\xb8\xa2\xdf\xdc\x2e\xb5\x7c"
      "\x54\x08\xf9\x76\x30\xf7\x36\x66\x19\x0f\x7f\x80\x9e\xed\x41\x1f\x06\x60"
      "\xc1\x68\xff\xa2\x80\xcd\x90\xbe\x11\xcb\x83\xf2\x68\x27\x35\x06\x88\xc0"
      "\x40\xee\xb7\x9d\x5f\x4d\x6c\xc1\x15\xc6\x8a\x4a\x8d\xb9\xcb\x5e\x80\x46"
      "\x2e\x70\x9d\x1d\x08\x4a\x67\x36\x13\x4a\xa7\xc1\xa6\x0b\x9c\x7a\x7c\x60"
      "\x98\x21\x21\xcd\x22\x4a\x56\x4b\x42\x55\xa3\xd2\xcf\x5c\x86\x99\x0e\x84"
      "\x7e\x3d\xac\x65\x2e\x76\x83\xa6\xf2\xe4\xb6\xe8\xd8\x4d\x1a\xdf\x56\xd2"
      "\xf4\xa9\xd6\xc0\x41\xcc\xfb\x7e\xdc\x16\xb2\xaa\xd7\xbb\x5b\xbf\xe8\x81"
      "\xba\x9f\x88\x8a\x0a\x04\xaa\xf4\xe5\x76\xe1\x7e\x79\x8b\xbc\x08\x16\x66"
      "\xf2\x0a\x24\x2c\xff\x9c\xed\x65\x89\xd0\xc3\x11\x36\x54\x7f\x0c\x6d\xc3"
      "\x6b\x6b\xfa\x38\xeb\x5d\x71\x87\x04\xb3\x48\xc8\x3b\x25\xc2\x52\xe2\xd9"
      "\xe9\x00\x9e\x74\x16\x66\x25\xb9\xcf\xe4\x8d\xc1\x88\xfe\xea\x05\x96\x37"
      "\xd4\x6e\x21\x03\xc2\xf5\x57\x0d\xf7\x48\xf9\x80\xb3\xf6\xed\x1b\xd2\x25"
      "\x5e\x60\xc3\xf5\x7b\x43\x67\x46\x73\x59\x25\x6e\x2a\x19\x39\x37\x3a\x76"
      "\x13\xcc\x96\x65\x2d\x28\x7e\x44\x95\xe0\xc2\xbc\x17\x3c\x0d\xc7\xe6\x58"
      "\xc4\x8b\x06\xf7\x9b\x8a\xe0\x03\x27\x81\x11\xce\x5f\xbb\x9f\x93\x72\xce"
      "\x11\x5f\xa7\x4b\xe2\x43\x44\xdc\xac\x4c\x02\x3f\x21\x94\xd0\x0d\x29\x0a"
      "\x9e\xa6\x0a\x5f\x5e\xd4\xeb\x83\x59\x55\x4e\x2e\x9c\x6d\x20\xda\xbe\x7d"
      "\xdb\xb7\xdf\x7d\x60\x9b\xa2\x44\x2d\x5e\x53\x09\x89\x01\x5d\xf2\xe5\x12"
      "\x23\x4f\xc9\x1e\xb1\x9c\x1e\xaa\xea\x30\x8e\x62\x0e\xfb\xe9\xb9\xb1\x00"
      "\xa2\x5e\x9b\xbb\xb6\xa6\xc3\xc4\xcc\xcd\x9b\xfb\xdb\x55\x0f\xfe\xdc\x4c"
      "\x8b\x4c\x8b\xfd\x23\x47\x7d\x7c\xed\x8a\x0e\x39\xf6\x41\x3f\x58\x8c\x77"
      "\xc6\x40\xd4\x07\x33\x87\x9a\xc2\x05\xa0\x45\xb4\x47\x7c\x64\x4c\x38\xe6"
      "\x51\x02\xf5\x47\x5b\x54\x17\xb1\x05\xf8\x7f\x49\x9e\x83\x4c\x35\x39\xa0"
      "\x5a\xdc\x41\x56\x70\x67\x50\x87\xe4\x2c\x17\x90\x4b\x83\x24\xc3\xac\x46"
      "\x18\x43\xab\x4b\xbf\x07\x73\xd1\xf4\x20\xee\x01\x29\xd3\xe6\x19\xf2\x0f"
      "\x2d\x01\x02\x0c\x30\xff\xae\x08\xa6\xef\x6f\x5b\x08\x7a\x51\x0a\x59\x3a"
      "\x37\xea\x1c\xb6\x89\xcf\x54\xcc\x78\xad\x13\x64\xef\xfa\xe4\x15\xbc\x8f"
      "\xe6\xb2\x38\x83\x19\xf0\x31\x3b\x66\xfa\x04\x0b\x7b\x93\xad\x56\x52\xbb"
      "\xbf\xaf\xdf\x28\xef\x6d\xd4\xc4\xdf\x7b\xc8\x96\xda\x37\xcb\x74\xb7\xea"
      "\x9a\xb6\x6f\x66\x38\x47\x10\xe5\x3e\x56\x72\xa1\x15\x70\x31\x6e\x33\xea"
      "\x7d\xf0\x1f\x05\xa2\xe8\x7a\x9d\x95\x47\xeb\x3d\x2e\x84\x19\x34\x1b\xef"
      "\x22\x79\x52\x33\xe2\xe6\xbd\x9c\x1a\x4e\xed\x51\x1b\x2d\x63\x6b\x74\xab"
      "\x30\x38\xb2\xdc\xb9\x53\x50\x5b\x58\x54\x89\xa0\xf8\x60\x6f\xd8\x49\x41"
      "\x44\x4b\x37\x45\x10\x2f\xd7\x54\x7b\xfa\xd8\x9f\xad\xe3\x6a\x08\x72\x1a"
      "\xb1\xe8\x67\xbb\x6e\x1b\x3b\x55\x93\x04\xe4\xd3\x2d\x5c\x63\xdb\xf8\x8f"
      "\xcb\x6d\x0a\x9c\x18\x0f\xf0\x8c\x6f\xb3\x82\x76\x4b\x4e\x28\xad\xde\x9f"
      "\xa5\xf9\x38\xdb\x07\x5f\x51\xc1\x41\x65\x21\x85\xe7\x74\x24\xe4\x9a\x6d"
      "\x96\xa0\x1c\x65\x4c\x9d\x08\x02\x60\xb3\x2b\x81\x59\x17\x6a\xbf\x51\x6f"
      "\x7f\x8f\xeb\x9d\x32\xe5\x28\x3f\xc4\xd6\x20\xf3\xb0\x96\xce\xf8\xe9\x53"
      "\x3a\x30\xed\x0a\x27\x62\x34\x97\x54\x8e\xb1\x4a\xf2\xe2\xab\xff\x94\x27"
      "\xe5\xee\x8d\x0a\x17\xb4\xb6\x08\xbb\x0a\xc8\x8f\x71\x2a\xfb\x90\x05\x5b"
      "\x0f\x03\x2f\x1c\x60\xfd\x34\x03\x5a\x11\xd4\x8e\x13\x05\x6e\x13\x26\xe3"
      "\xb2\xaa\xf4\x6f\x82\xfc\x95\x50\x44\xb1\x47\xd3\xbe\x70\x76\x76\xcc\x98"
      "\xb4\xc3\x42\xc3\x62\x27\xf1\x2a\x93\x97\x17\xc1\x54\xb2\x97\x78\xab\xe1"
      "\xda\xdd\xa3\x69\x9a\xfd\x27\xc1\x46\xfa\xea\xd5\x8d\x46\x10\x37\x73\xf3"
      "\x63\x8a\xf8\x74\x39\x19\x86\x55\xdf\x68\xb9\x67\x6c\x49\x9e\xf1\x7a\x95"
      "\x78\x82\x36\x96\xd3\x77\xa1\x0c\x00\xf7\xd4\x54\xc5\x01\x1e\xb2\x92\x90"
      "\x94\xf2\xef\xc6\x19\x74\x99\xd1\x90\x5e\x22\x3e\xac\x4e\x2b\xfe\x58\x0a"
      "\x63\x2a\x45\x6b\xcd\x48\x14\x70\xea\x76\xe8\xee\xc8\xea\xfe\x55\x2e\x4d"
      "\x4b\xb6\xf7\x5d\x34\x69\xfb\x8f\xaf\x0c\x62\xbd\x0e\x83\x79\x37\xbb\xc2"
      "\xaf\xe3\x13\x25\xc3\x58\xcb\xb5\x7d\x10\x66\x2d\x30\x5e\x2d\x2a\xcc\x88"
      "\x48\x80\xe3\xd2\x57\x8c\xe4\x90\x60\xaf\xb3\x26\x78\x44\xd5\xb0\x93\xd6"
      "\x81\xb9\x17\x80\xd1\xab\xc7\x5b\x98\xf2\xbc\x11\xb3\xce\xe0\xf5\xd2\x21"
      "\x65\x14\x33\x4c\x5c\x87\x98\x0e\x3b\x38\x3e\xa0\x23\xac\x40\x3c\x94\xf1"
      "\x40\x66\xcf\x27\xbb\xfb\x44\x1d\xa4\x74\xf0\xe1\x06\x77\x8a\xc7\xea\xde"
      "\x86\x2e\xea\xea\x8f\xd3\xbe\x5e\x31\x1b\x54\xf3\xf0\x19\x91\x66\x71\x56"
      "\xe4\x1c\x0d\x15\xfc\xae\x66\xff\x81\x81\x38\x94\xb1\x2f\x6b\x55\x5b\xde"
      "\x7b\x76\x6a\x97\xd6\x0c\x00\xce\x7f\xba\x13\xf0\xf8\x60\x16\x6a\xbc\x35"
      "\x7d\x40\x6a\xa9\xe4\x30\xc5\x8b\xfb\xd7\x43\x86\xa6\x45\xc3\x57\xbf\xc7"
      "\x78\x5a\xea\x80\xcc\x13\xc4\xa3\x77\x79\xcb\xa0\x35\x21\xc0\xaa\xfd\x9a"
      "\x06\xc8\xc0\xdb\x38\x0b\xd8\x28\x14\x6a\x6b\x9b\xf7\x9f\x19\xa5\xcd\xb7"
      "\xe1\xac\xd0\xde\x7d\x3a\xa1\x4e\x0b\x4e\x63\x53\xb2\x93\x04\xa4\x29\x0d"
      "\x1f\x67\x55\x74\x6e\xb8\x5c\xf3\xab\x64\x45\x47\x48\xbc\xf5\x1b\xb4\x63"
      "\x46\x69\xf0\xa1\x81\xb7\x0d\xe3\xb9\x45\xde\x1d\x61\x65\xdf\xe8\xf0\xa0"
      "\x3e\xa8\xea\xe0\xfe\xe2\x9b\x63\xee\x14\xc4\xcb\xfb\x85\x37\x60\xb6\x5c"
      "\x1e\x79\x5f\xc9\x32\x00\x77\xde\x85\x2e\x21\xf1\xbb\x96\x66\xe2\x3b\xe7"
      "\x7e\x1c\xe4\xa0\xd5\x6d\x73\x50\xed\x54\x68\xaa\xf1\xf8\x72\xaf\x8a\xe5"
      "\xdf\x6b\x2a\xfc\xb3\xef\x20\x7e\x8e\x32\x63\x0b\x0c\x6d\xf9\x1a\x89\x4f"
      "\x10\x0e\x77\xf9\x19\x18\x1f\x8a\xe3\xfc\xe9\x33\xc8\x09\x0d\x2d\x48\x58"
      "\x4b\x84\x7d\xaf\x19\x51\x9d\x06\x49\x6c\xca\x82\x13\x95\xda\x3f\x53\x92"
      "\x26\x3c\x9f\xc8\x93\x0b\x70\x76\x48\xe3\x43\xcc\x88\xea\x94\x0d\x7e\xdd"
      "\x04\x79\x59\x44\xd0\x39\x97\x56",
      1772);
  syscall(__NR_setxattr, /*path=*/0x20000080ul, /*name=*/0x200000c0ul,
          /*val=*/0x20000f80ul, /*size=*/0x701ul, /*flags=*/0ul);
  memcpy((void*)0x20001c00, "blkio.bfq.io_serviced_recursive\000", 32);
  res = syscall(__NR_openat, /*fd=*/0xffffff9c, /*file=*/0x20001c00ul,
                /*flags=*/0x275a, /*mode=*/0);
  if (res != -1)
    r[0] = res;
  syscall(__NR_ioctl, /*fd=*/r[0], /*cmd=*/0x6611, /*arg=*/0ul);
}
int main(void)
{
  syscall(__NR_mmap, /*addr=*/0x1ffff000ul, /*len=*/0x1000ul, /*prot=*/0ul,
          /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-1,
          /*offset=*/0ul);
  syscall(__NR_mmap, /*addr=*/0x20000000ul, /*len=*/0x1000000ul,
          /*prot=PROT_WRITE|PROT_READ|PROT_EXEC*/ 7ul,
          /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-1,
          /*offset=*/0ul);
  syscall(__NR_mmap, /*addr=*/0x21000000ul, /*len=*/0x1000ul, /*prot=*/0ul,
          /*flags=MAP_FIXED|MAP_ANONYMOUS|MAP_PRIVATE*/ 0x32ul, /*fd=*/-1,
          /*offset=*/0ul);
  const char* reason;
  (void)reason;
  use_temporary_dir();
  loop();
  return 0;
}