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

#define _GNU_SOURCE

#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <setjmp.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/stat.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <unistd.h>

#include <linux/loop.h>

#ifndef __NR_getdents64
#define __NR_getdents64 61
#endif
#ifndef __NR_memfd_create
#define __NR_memfd_create 279
#endif
#ifndef __NR_mmap
#define __NR_mmap 222
#endif

static unsigned long long procid;

//% 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;
}

uint64_t r[1] = {0xffffffffffffffff};

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);
  intptr_t res = 0;
  memcpy((void*)0x20000040, "hfsplus\000", 8);
  memcpy((void*)0x200000c0, "./file1\000", 8);
  memcpy(
      (void*)0x200009c0,
      "\x78\x9c\xec\xdd\x4d\x6c\x1c\x67\xfd\x07\xf0\xef\xae\xd7\x1b\x6f\x2a\xb9"
      "\x6e\x9b\xb4\xf9\xff\x85\x54\xab\x11\x11\x34\x90\xd8\x59\x4a\x82\x84\x44"
      "\x40\x08\xe5\x50\xa1\x48\x5c\x7a\x35\x89\x93\x58\x71\xd2\xc8\x76\x51\x12"
      "\x21\xe2\x02\x85\x23\x9c\x50\x0e\x3d\x14\xa1\x70\xe8\x09\x71\x40\x2a\xe2"
      "\x80\x28\x67\x24\x24\xee\x11\xd7\x48\xdc\x23\x0e\x2c\x9a\xd9\x59\x7b\x77"
      "\xfd\xb6\x4e\xe2\x38\x0d\x9f\x8f\x34\x3b\xcf\xcc\x3c\x2f\xbf\xf9\xf9\xd9"
      "\xd9\xdd\xb1\xad\x0d\xf0\x3f\xeb\xdc\x3b\x19\x5f\x4d\x2d\xe7\x8e\xbf\x7d"
      "\xb3\xd8\xbe\x7f\xaf\xbd\x78\xff\x5e\xfb\x5a\xaf\x9c\xe4\x40\x92\x7a\xd2"
      "\xe8\xae\x52\xbb\x9e\xd4\x3e\x4d\xce\xa6\xbb\xe4\xff\x8a\x9d\x55\x77\xb5"
      "\xf5\x9e\x9b\x03\xe3\xbc\xf5\xe0\x93\x0f\x8f\xdd\xfd\xb8\x5d\x94\x3b\x9d"
      "\xa2\xaf\x46\xaf\x7e\x7d\xb0\xdd\x56\x3a\x1b\x46\x58\xb7\x5a\x2d\x99\x4e"
      "\x32\x56\xad\x77\xa9\xb1\x55\x7f\x17\x36\xe9\xef\xce\xae\xba\xae\xad\xc5"
      "\x5d\x24\xec\x68\x2f\x71\xb0\xdf\x3a\x1b\xac\xee\xa6\xf9\x08\xcf\x5b\xe0"
      "\x59\x77\x27\x19\x1b\xdf\x64\xff\x54\x72\x30\xc9\x44\xf5\x3e\x20\xd5\xd5"
      "\xa1\x5e\xbe\xca\x7e\x86\xed\xea\x2a\x07\x00\x00\x00\xcf\xa6\x1d\x3f\x9d"
      "\xbf\xf8\x30\x0f\x73\x33\x93\x4f\x27\x1c\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x78\x3e\xd4\xba\xdf\x19\x58\xab\x96\x7a\xaf\x3c\x9d\x5a\xef\xfb\xff"
      "\x9b\xd5\xbe\x42\xb3\xb9\xcf\xf1\x6e\xef\x4b\x3b\x1c\xff\xe0\xd2\x53\x0a"
      "\x04\x00\x00\x00\x00\x00\x00\x00\xf6\xd4\xeb\x0f\xf3\x30\x37\x33\xd9\xdb"
      "\xee\xd4\xca\xdf\xf9\xbf\x51\x6e\x1c\x2a\x1f\x5f\xc8\x7b\x59\xce\x7c\x96"
      "\x72\x22\x37\x33\x97\x95\xac\x64\x29\xb3\xc9\xf8\x64\x5f\x47\xcd\x9b\x73"
      "\x2b\x2b\x4b\xb3\xeb\x2d\x6f\x5c\xee\xb6\xfc\x55\x8a\x96\x9d\x4e\xe7\x4e"
      "\xd5\xf2\x54\x92\xa9\x0d\x2d\x4f\x3d\xad\x33\x06\x00\x00\x00\x00\x00\x00"
      "\x80\xe7\xd2\x8f\x73\x2e\x93\xfb\x1d\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\xf4\xab\x25\x63\xdd\x55\xb9\x1c\xea\x95\xa7\x52\x6f\x24\x99"
      "\x48\xd2\x2c\xea\xad\x26\x7f\xea\x95\x3f\xcb\xfe\xbc\xdf\x01\x00\x00\x00"
      "\xc0\xde\x6b\x55\xeb\xc9\xda\x7f\xba\x85\x4e\xad\xfc\xcc\xff\x6a\xf9\xb9"
      "\x7f\x22\xef\xe5\x7a\x56\xb2\x90\x95\x2c\x66\x3e\x17\xcb\x7b\x01\xdd\x4f"
      "\xfd\xf5\xbf\xaf\xb6\x17\xef\xdf\x6b\x5f\x2b\x96\x8d\x1d\x7f\xf3\x5f\xbb"
      "\x8a\xa3\xec\x31\xc9\x58\xde\xdf\x62\xe4\x99\xa2\xc6\x3f\x0f\xaf\xb5\x38"
      "\x97\xef\xe4\x7b\x39\x9e\xe9\x9c\xcf\x52\x16\xf2\x83\xcc\x65\x25\xf3\x99"
      "\x4e\xab\x38\x89\xcc\xa5\x96\xa9\x56\xf7\xee\xc5\x54\x2f\xce\xcd\xe3\x3d"
      "\x3b\xb0\x75\x7e\x38\xb6\xd7\x87\xb6\x8f\x94\xb1\xb6\x72\x29\x0b\x65\x6c"
      "\x27\x72\xa1\x99\xee\x6d\x93\xf2\x1c\x8a\x31\x8f\xf4\x8d\xf6\x87\x66\x32"
      "\x34\xe2\xfb\x45\x76\x6a\xdf\xa8\x8c\x98\xa3\x8b\x7d\x3f\xaf\x5f\x56\xf7"
      "\x65\x2a\x9d\x17\x47\xec\x63\x6f\x4c\x95\x67\x3e\xbe\x96\x91\x99\x22\xf7"
      "\x55\x36\x5e\xda\x3e\xf7\xbb\x9c\x27\xc3\x23\xcd\xa6\xbe\x76\x0f\xea\xd0"
      "\xfa\x28\xc5\xe6\xf0\x48\xbd\x9c\x7f\x7f\x37\x39\x3f\x58\xad\x8b\x5c\xff"
      "\x6c\x30\xe7\x4f\xda\x2e\x6f\xa5\x0d\x67\xe2\x54\xea\xd5\xec\x4b\x5e\x1d"
      "\xcc\xf9\x8d\xcf\xdf\x7d\xb9\xbf\x69\xef\x24\xae\x5f\xbd\x72\x69\xf9\xf8"
      "\x1e\x9e\xd2\x9e\x1a\xef\x15\x86\x33\xd1\xee\xcb\xc4\x6b\xdb\xcf\xbe\xe4"
      "\x8b\xff\xf8\xcb\xf9\x2b\x8b\x45\x26\x56\x47\xcf\xc4\xf8\xf0\x8e\x89\xc7"
      "\x38\x8f\x27\xa8\x59\x65\xa3\xbc\x14\xa5\x9e\x51\xae\x96\xdf\x2e\x4b\x73"
      "\x79\xa3\x6f\x0a\xbe\x9b\x8b\x99\xcf\xe9\xcc\x64\x36\x67\x32\x93\xaf\xe5"
      "\x54\xda\x03\x33\xec\xf0\x40\x5e\x1b\xed\x6b\x83\x39\x29\x9f\x6b\xf5\x8d"
      "\xd7\xb7\xd6\x36\xc1\x1f\xfd\x42\x5f\xa5\x9f\xef\x50\xf9\xe9\x2a\xf2\xf2"
      "\x52\x5f\x5e\xfb\xaf\x74\x53\xe5\xb1\x6a\xcf\xd9\x5f\x64\xa6\x2f\x4b\x2f"
      "\x6f\x3f\xfb\x86\x5f\x05\x46\x99\x7f\x8d\xff\xaf\x0a\xc5\x18\x3f\x59\x7b"
      "\xc5\x79\x16\x0c\x64\xa2\xba\x36\xf7\xa2\x7b\x65\xfb\x4c\xfc\xba\x53\x3c"
      "\x2e\x2f\x5e\xbf\xba\x74\x65\xee\xc6\x88\xe3\x1d\xab\xd6\x45\xda\x3e\x18"
      "\xbc\x36\xff\xe6\x49\x9c\xcf\xa3\x2b\xe6\x4b\x71\xc5\x6d\x94\x5b\x65\x4e"
      "\x5a\xbd\xf9\x52\x1c\x7b\x65\x2d\xda\xc1\x7c\x35\xab\xdf\xb8\x74\xdb\xd5"
      "\x37\x1c\x3b\xbc\x76\x6c\x2a\x93\x59\xc8\x77\xb7\x7c\xa6\x36\xab\xf7\x70"
      "\x1b\x7b\xea\x1e\x7b\x6d\xd3\x63\xed\xf2\xd8\x91\xbe\x63\x03\xef\x72\xf2"
      "\x6e\x16\xcb\x77\x21\x43\xa6\x9f\x4e\x56\x01\x18\xd9\xc1\x37\x0f\x36\x5b"
      "\x0f\x5a\x7f\x6b\x7d\xd4\xfa\x69\xeb\x4a\xeb\xed\x89\x6f\x1d\x38\x73\xe0"
      "\x73\xcd\x8c\xff\xb5\xf1\xc7\xb1\xdf\xd5\x7f\x5b\xff\x7a\xed\xcd\x7c\x94"
      "\x1f\x65\x72\xbf\x23\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\xe7\xc1\xf2\xad\xdb\x57\xe7"
      "\x16\x17\xe7\x97\xf6\xb0\xd0\x7c\xc4\xb1\x52\xdf\xb1\xce\xbd\x17\x46\xeb"
      "\x30\x53\xc9\xf6\x63\xd5\xaa\x42\x73\xaf\xb3\xf1\xec\x17\x5a\xd9\xa3\x9e"
      "\x7f\x9f\x64\x9b\x3a\xcd\xc7\x1e\xa2\xf6\x18\xf3\x79\x75\xb4\xca\xc5\x44"
      "\x7e\x22\xd9\xe8\x7d\x71\x5a\xb9\xa7\x33\xb6\x8b\xe6\x8d\x5e\xab\xcd\xeb"
      "\x34\xb2\x3c\xb1\xd5\x4f\xf0\xc0\xfa\xb3\x20\x53\x57\xe7\x16\xff\xdd\x19"
      "\xa8\xd3\x4a\xdf\x53\x06\x78\xce\x9d\x5c\xb9\x76\xe3\xe4\xf2\xad\xdb\x5f"
      "\x5e\xb8\x36\x77\x79\xfe\xf2\xfc\xf5\x53\x67\x4e\x9f\x39\xdd\xfe\xea\xec"
      "\x57\x4e\x5e\x5a\x58\x9c\x9f\xe9\x3e\xee\x77\x94\xc0\x5e\x58\xbe\x75\x7b"
      "\x6c\xf4\xda\xc3\x5f\x89\x0d\x00\x00\x00\x00\x00\x00\x00\x00\x00\xec\x87"
      "\xea\xaf\xff\x57\x1e\xf9\x9f\x19\x1a\x3b\xd4\x69\x2e\x2d\x6f\x3e\xb2\xbf"
      "\x25\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\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x46\x73\xee\x9d\x8c\xaf\xa6\x96\xd9\x99\x13\x33\xc5"
      "\xf6\xfd\x7b\xed\xc5\x62\xe9\x95\xd7\x6b\x36\x92\xd4\x93\xd4\x7e\x98\xd4"
      "\x3e\x4d\xce\xa6\xbb\x64\xaa\xaf\xbb\xda\x56\xe3\xbc\xf5\xe0\x93\x0f\x8f"
      "\xdd\xfd\xb8\xbd\xde\x57\xa3\x57\xbf\xbe\x5d\xbb\xd1\xac\x56\x4b\xa6\x93"
      "\x8c\x55\xeb\x9d\x1d\xd8\xa4\x9b\x8d\xfd\x5d\xe8\xeb\x6f\xf5\x91\xc2\xab"
      "\xad\x9d\x61\x91\xb0\xa3\xbd\xc4\xc1\x7e\xfb\x6f\x00\x00\x00\xff\xff\x95"
      "\x58\xfa\x65",
      1767);
  res = -1;
  res = syz_mount_image(/*fs=*/0x20000040, /*dir=*/0x200000c0,
                        /*flags=MS_I_VERSION|MS_RDONLY|MS_DIRSYNC*/ 0x800081,
                        /*opts=*/0x20000080, /*chdir=*/0, /*size=*/0x6e7,
                        /*img=*/0x200009c0);
  if (res != -1)
    r[0] = res;
  syscall(__NR_getdents64, /*fd=*/r[0], /*ent=*/0x20000900ul, /*count=*/0xbdul);
  return 0;
}