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

#define _GNU_SOURCE

#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <setjmp.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_memfd_create
#define __NR_memfd_create 319
#endif
#ifndef __NR_pwritev2
#define __NR_pwritev2 328
#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) {
    errno = EMSGSIZE;
    return -1;
  }
  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, 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) {
    if (strstr(opts, "errors=panic") || strstr(opts, "errors=remount-ro") == 0)
      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;
}

uint64_t r[1] = {0xffffffffffffffff};

int main(void)
{
  syscall(__NR_mmap, 0x1ffff000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul);
  syscall(__NR_mmap, 0x20000000ul, 0x1000000ul, 7ul, 0x32ul, -1, 0ul);
  syscall(__NR_mmap, 0x21000000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul);
  intptr_t res = 0;
  memcpy((void*)0x20000600, "hfsplus\000", 8);
  memcpy((void*)0x20000140, "./file0\000", 8);
  memcpy((void*)0x20000280,
         "\x66\x6f\x72\x63\x65\x00\x00\x69\x61\xe3\x8c\x1c\xdc\x32\xe0\xee\x73"
         "\x6b\x3d\x30\x30\x30\x30\x30\x30\x30\x3f\x01\x10\x1b\xb0\x30\x31\x39"
         "\x2c\x63\x72\x65\x61\x4c\xd9\xbb\x3d\x25\xf4\xea\x83\x66\xa8\xf9\x13"
         "\x02\x00\x6f\x72",
         55);
  *(uint8_t*)0x200002b7 = -1;
  sprintf((char*)0x200002b8, "0x%016llx", (long long)-1);
  memcpy(
      (void*)0x20000c40,
      "\x78\x9c\xec\xdd\x4d\x6f\x1b\xc7\x1d\x07\xe0\xdf\xd2\x92\x2c\xba\x80\xa3"
      "\x24\x76\x62\x14\x01\x2a\xc4\x40\x5a\x54\xa8\xad\x17\x28\xad\x7a\xa9\x5b"
      "\x14\x85\x0e\x41\x11\xa4\x87\x9e\x05\x9b\x8e\x09\xd3\x4a\x20\x31\x85\x92"
      "\x16\x85\xfb\x7e\xed\x21\x1f\x20\x3d\xe8\xd6\x53\xd1\x1e\x7a\x33\x90\x9e"
      "\xdb\x5b\xae\x3a\x06\x28\xd0\x4b\x4e\xba\xb9\xd8\xe5\x92\x62\x64\x49\xa1"
      "\x1c\xdb\xa4\x9d\xe7\x31\x86\x33\xc3\xd9\x99\x9d\xf9\xef\x72\xc9\xa5\x60"
      "\x30\xc0\x57\xd6\xfa\x42\xa6\xee\xa5\xc8\xfa\xc2\x1b\x3b\x65\x7d\x6f\x77"
      "\xa5\xb3\xb7\xbb\x72\xb6\x6e\xee\x24\x29\xcb\x8d\x64\xaa\x97\xa5\xd8\x4c"
      "\x8a\x8f\x93\x6b\xe9\xa5\x4c\x0f\x0d\x57\x1c\xb7\x9f\x0f\xdb\x6b\x6f\x7d"
      "\xf2\xd9\xde\xa7\x49\xce\x1c\xda\xbe\x71\x52\xbf\xd1\xdc\xad\x53\xe6\xeb"
      "\xf1\xe7\x8f\xdc\x6c\xfa\xa1\xc6\xbb\x7e\xec\x78\xa3\x2a\x06\x2b\x2c\x03"
      "\x76\xb9\x1f\x38\x18\xb7\xfb\x0f\xb8\x7b\x9a\xee\x5f\xf2\x75\x0b\x4c\x82"
      "\x62\xf0\xbe\xfc\xcb\xbf\xf7\xae\x03\xbd\xda\x5c\x72\x2e\xc9\x6c\xfd\x39"
      "\x20\xf5\xd5\xa1\x31\xb6\x89\x3e\x22\xa7\xba\xca\x01\x00\x00\xc0\x24\x68"
      "\x9e\xbe\xcb\x73\xfb\xd9\xcf\x4e\xce\x3f\x8e\xe9\x00\x00\x00\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\xb3\xaa\xfe\xfd\xff\xa2\x4e\x8d\x7e\x79\x3e\x45\xff\xf7"
      "\xff\x67\xea\xe7\x52\x97\x9f\x6a\xf7\xc6\x3d\x01\x00\x00\x00\x00\x00\x00"
      "\x00\x78\x04\xbe\xb1\x9f\xfd\xec\xe4\x7c\xbf\x7e\xbf\xa8\xfe\xe6\xff\x6a"
      "\x55\xb9\x50\x3d\x7e\x2d\xef\x65\x3b\xad\x6c\xe5\x4a\x76\xb2\x91\x6e\xba"
      "\xd9\xca\x52\x92\xb9\xa1\x81\x66\x76\x36\xba\xdd\xad\xa5\x11\x7a\x2e\x1f"
      "\xd9\x73\xf9\xc9\xac\x17\x00\x00\x00\x00\x00\x00\x00\x9e\x51\xbf\xcd\xfa"
      "\xc1\xdf\xff\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x60\x12\x14\xc9"
      "\x99\x5e\x56\xa5\x0b\xfd\xf2\x5c\x1a\x53\x49\x66\x93\xcc\x94\xdb\xdd\x4d"
      "\xfe\xd3\x2f\x3f\x0d\xce\x1e\xf3\xfc\xbd\x27\x3c\x0f\x00\x00\x00\x18\x87"
      "\xe7\xf6\xb3\x9f\x9d\x9c\xef\xd7\xef\x17\xd5\x3d\xff\x4b\xd5\x7d\xff\x6c"
      "\xde\xcb\x66\xba\x69\xa7\x9b\x4e\x5a\xb9\x51\x7d\x17\xd0\xbb\xeb\x6f\xec"
      "\xed\xae\x74\xf6\x76\x57\xee\x94\xe9\xc1\x71\x7f\xf8\xbf\x53\x4d\xa3\x1a"
      "\x31\xbd\xef\x1e\x8e\xde\xf3\xa5\x6a\x8b\x66\x6e\xa6\x5d\x3d\x73\x25\xd7"
      "\xf3\x4e\x3a\xb9\x91\x46\xd5\xb3\x74\xa9\x3f\x9f\xa3\xe7\xf5\x9b\x72\x4e"
      "\xc5\x0f\x6a\x23\xce\xec\x46\x9d\x97\x2b\xff\x73\x9d\x4f\x86\xb9\x2a\x22"
      "\xd3\x83\x88\x2c\xd6\x73\x2b\xa3\xf1\xfc\xc9\x91\x38\xe5\xd1\x39\xbc\xa7"
      "\xa5\x34\x06\xdf\xfc\x5c\x78\x0c\x31\x3f\x57\xe7\xe5\x7a\xfe\x38\xd1\x31"
      "\x5f\x1e\x3a\xfb\x5e\x3a\x39\x12\xc9\x37\xff\xf1\xd7\x9f\xdf\xea\x6c\xde"
      "\xbe\x75\x73\x7b\x61\x72\x96\xf4\x90\x0e\x47\x62\x65\x28\x12\x2f\x7f\xa5"
      "\x22\xb1\x58\x45\xe2\xe2\xa0\xbe\x9e\x9f\xe4\x67\x59\xc8\x7c\xde\xcc\x56"
      "\xda\xf9\x45\x36\xd2\x4d\x2b\xf3\xf9\x71\x55\xda\xa8\xcf\xe7\xf2\x71\xee"
      "\xe4\x48\x5d\xfb\x5c\xed\xcd\x2f\x9a\xc9\x4c\x7d\x5c\x7a\x57\xd1\xd3\xcd"
      "\xe9\xd5\xaa\xef\xf9\xb4\xf3\xd3\xbc\x93\x1b\x69\xe5\xf5\xea\xdf\x72\x96"
      "\xf2\xdd\xac\x66\x35\x6b\x43\x47\xf8\xe2\x08\xaf\xfa\xc6\xe9\x5e\xf5\x97"
      "\xbf\x55\x17\x9a\x49\xfe\x54\xe7\x93\xa1\x8c\xeb\xf3\x43\x71\x1d\xbe\xe6"
      "\xce\x55\x6d\xc3\xcf\x1c\x44\xe9\x85\xe3\xa3\x54\x3c\xe4\xb5\x71\xea\xeb"
      "\x75\xa1\xdc\xc7\xef\xea\x7c\x32\x1c\x8e\xc4\xd2\x50\x24\x5e\xec\x47\xa0"
      "\xc8\x74\x92\xc3\xe7\xcb\x5f\xee\x97\x8f\xdb\x9d\xcd\xdb\x5b\xb7\x36\xde"
      "\x1d\x71\x7f\xaf\xd5\x79\x19\xca\x3f\x4c\xd4\xbb\x44\x79\xbe\xbc\x50\x1e"
      "\xac\xaa\xf6\xf9\xb3\xa3\x6c\x7b\xf1\xc8\xb6\xa5\xaa\xed\xc2\xa0\xad\xf1"
      "\x40\xdb\xc5\x41\xdb\x17\xbd\x52\x67\xea\xcf\x70\x0f\x8e\xb4\x5c\xb5\xbd"
      "\x7c\x64\xdb\x4a\xd5\x76\x69\xa8\xed\xa8\xcf\x5b\x00\x4c\xaa\x7f\xf6\x0b"
      "\xe7\xbe\x7d\x6e\xa6\xf9\xdf\xe6\xbf\x9b\x1f\x35\x7f\xdf\xbc\xd5\x7c\x63"
      "\xf6\x47\x67\xbf\x77\xf6\x95\x99\x4c\xff\x6b\xfa\xfb\x53\x8b\x67\x5e\x6b"
      "\xbc\x52\xfc\x2d\x1f\xe5\xd7\x07\xf7\xff\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc0\xc3\xdb"
      "\x7e\xff\x83\xdb\x1b\x9d\x4e\x6b\x6b\xcc\x85\xa2\xfe\x21\x9f\x27\xb4\xd3"
      "\xa2\x18\xff\x92\x9f\xf1\xc2\x4c\x26\x62\x1a\x0a\x27\x15\x32\x9b\xe3\x0e"
      "\xd3\xb8\xaf\x4c\xc0\xe3\x76\xb5\x7b\xe7\xdd\xab\xdb\xef\x7f\xf0\x9d\xf6"
      "\x9d\x8d\xb7\x5b\x6f\xb7\x36\xa7\x57\x57\xd7\x16\xd7\x56\x5f\x5f\xb9\x7a"
      "\xb3\xdd\x69\x2d\xf6\x1e\xc7\x3d\x4b\xe0\x71\x38\x78\xd3\x1f\xf7\x4c\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x80\x51\x3d\x89\xff\x69\x30\xee\x35\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\x4f\xb7\xf5\x85\x4c\xdd\x4b\x91\xa5\xc5\x2b\x8b\x65\x7d\x6f"
      "\x77\xa5\x53\xa6\x7e\xf9\x60\xcb\xa9\x24\x8d\x24\xc5\xaf\x92\xe2\xe3\xe4"
      "\x5a\x7a\x29\x73\x43\xc3\x15\xc7\xed\xe7\xc3\xf6\xda\x5b\x9f\x7c\xb6\xf7"
      "\xe9\xc1\x58\x53\xfd\xed\x1b\x27\xf5\x1b\xcd\xdd\x3a\x65\x3e\xc9\x99\x3a"
      "\x7f\x54\xe3\x5d\xff\xd2\xe3\x15\x83\x15\x96\x01\xbb\xdc\x0f\x1c\x8c\xdb"
      "\xff\x03\x00\x00\xff\xff\xb6\x47\x0a\xd3",
      1540);
  syz_mount_image(0x20000600, 0x20000140, 0x2a00010, 0x20000280, 3, 0x604,
                  0x20000c40);
  memcpy((void*)0x20000540, "./file2\000", 8);
  res = syscall(__NR_openat, 0xffffff9c, 0x20000540ul, 0x6a142ul, 0ul);
  if (res != -1)
    r[0] = res;
  *(uint64_t*)0x20000200 = 0x200001c0;
  memset((void*)0x200001c0, 23, 1);
  *(uint64_t*)0x20000208 = 1;
  syscall(__NR_pwritev2, r[0], 0x20000200ul, 1ul, 0x5405, 0, 0ul);
  return 0;
}