// https://syzkaller.appspot.com/bug?id=3b6e72e3c873c0c6175fb5803c23d9d88aab4a7e
// 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_memfd_create
#define __NR_memfd_create 319
#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, 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;
}

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);

  memcpy((void*)0x20000100, "udf\000", 4);
  memcpy((void*)0x20000040, "./file0\000", 8);
  memcpy((void*)0x20000400, "partition", 9);
  *(uint8_t*)0x20000409 = 0x3d;
  sprintf((char*)0x2000040a, "%020llu", (long long)3);
  *(uint8_t*)0x2000041e = 0x2c;
  memcpy((void*)0x2000041f, "iocharset", 9);
  *(uint8_t*)0x20000428 = 0x3d;
  memcpy((void*)0x20000429, "iso8859-9", 9);
  *(uint8_t*)0x20000432 = 0x2c;
  memcpy((void*)0x20000433, "dmode", 5);
  *(uint8_t*)0x20000438 = 0x3d;
  sprintf((char*)0x20000439, "%023llo", (long long)8);
  *(uint8_t*)0x20000450 = 0x2c;
  memcpy((void*)0x20000451, "noadinicb", 9);
  *(uint8_t*)0x2000045a = 0x2c;
  memcpy((void*)0x2000045b, "unhide", 6);
  *(uint8_t*)0x20000461 = 0x2c;
  memcpy((void*)0x20000462, "shortad", 7);
  *(uint8_t*)0x20000469 = 0x2c;
  memcpy((void*)0x2000046a, "uid=ignore", 10);
  *(uint8_t*)0x20000474 = 0x2c;
  *(uint8_t*)0x20000475 = 0;
  memcpy(
      (void*)0x20001040,
      "\x78\x9c\xec\xdd\x4f\x6c\x1c\xd7\x7d\x07\xf0\xdf\x1b\xfe\x97\xdb\x8a\x89"
      "\x1d\xc5\x6e\xe3\x62\xd3\x16\xa9\xcc\x58\xae\xfe\xc5\x54\xac\xc2\x5d\xd5"
      "\x34\xdb\x00\xb2\x4c\x84\x62\x6e\x01\xb8\x22\x29\x75\x61\x6a\x49\x90\x54"
      "\x23\x1b\x69\xc1\xf4\xd2\x43\x0f\x01\x8a\xa2\x87\x9c\x08\xb4\x46\x81\x14"
      "\x0d\x8c\xa6\x08\x7a\x64\x5b\x17\x48\x2e\x3e\x14\x39\xf5\x44\xb4\xb0\x11"
      "\x14\x3d\xb0\x45\x80\x9c\x02\x16\x33\xfb\x96\x5a\xd2\x94\xa5\x8a\xa2\x44"
      "\xda\x9f\x8f\x4d\x7d\x67\x66\xdf\x9b\x79\x6f\x66\x3c\x23\x0b\x7a\xfb\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\x88\xf8\xdd\x57\x2f"
      "\x9d\x3e\x93\x1e\x77\x2b\x00\x80\x47\xe9\xca\xe4\x57\x4f\x9f\xf5\xfe\x07"
      "\x80\x4f\x94\xab\xfe\xff\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x0e\xbb\x14\x45\x3c\x19\x29\x16\xaf\x6c\xa6\xe9\x6a\xbd\x6d\xf0\x72\xb3"
      "\x75\xeb\xf6\xd4\xd8\xf8\xde\xd5\x86\x52\x55\xb3\xa7\x2a\x5f\xfe\x0c\x9e"
      "\x39\x7b\xee\xfc\x97\x5e\x1c\xbd\xd0\xc9\x8f\xae\xff\xb0\x3d\x13\xaf\x4f"
      "\x5e\xbd\x54\x7b\x65\xe1\xe6\xe2\xd2\xdc\xf2\xf2\xdc\x6c\x6d\xaa\xd5\x9c"
      "\x59\x98\x9d\xbb\xef\x3d\xec\xb7\xfe\x6e\x23\xd5\x09\xa8\xdd\x7c\xe3\xd6"
      "\xec\xf5\xeb\xcb\xb5\xb3\x2f\x9c\xdb\xf1\xf1\xed\xe1\x0f\x06\x9e\x38\x31"
      "\x7c\x71\xf4\xb9\x53\xcf\x76\xca\x4e\x8d\x8d\x8f\x4f\x76\x95\xe9\xed\x7b"
      "\xe0\xa3\x47\xff\xae\xf5\xbb\x8d\xf0\xe8\x8f\x22\x4e\x45\x8a\xe7\xbf\xf7"
      "\x93\xd4\x88\x88\x22\xf6\x7f\x2e\xee\x71\xef\x1c\xb4\xa1\xaa\x13\x23\x55"
      "\x27\xa6\xc6\xc6\xab\x8e\xcc\x37\x1b\xad\x95\xf2\xc3\x89\xce\x89\x28\x22"
      "\x6a\x5d\x95\xea\x9d\x73\x74\x00\xd7\xe2\xa1\xaa\x47\xac\x96\xcd\x2f\x1b"
      "\x3c\x52\x76\x6f\x72\xb1\xb1\xd4\xb8\x36\x3f\x57\x9b\x68\x2c\xad\x34\x57"
      "\x9a\x0b\xad\x89\xd4\x6e\x6d\xd9\x9f\x5a\x14\x71\x21\x45\xac\x45\xc4\xc6"
      "\xc0\x87\x77\xd7\x17\x45\xf4\x46\x8a\xef\x1c\xdf\x4c\xd7\x22\xa2\xa7\x73"
      "\x1e\xbe\x58\x0d\x0c\xbe\x7b\x3b\x8a\x03\xec\xe3\x7d\x28\xdb\x59\xeb\x8b"
      "\x58\x2b\x8e\xc0\x35\x3b\xc4\x06\xa2\x88\xd7\x22\xc5\x4f\xdf\x3d\x19\x33"
      "\xe5\x39\xcb\x3f\xf1\x85\x88\xd7\xca\xfc\x41\xc4\xdb\x65\xbe\x1c\x91\xca"
      "\x1b\xe3\x7c\xc4\xfb\x7b\xdc\x47\x1c\x4d\xbd\x51\xc4\x9f\x95\xd7\xff\xe2"
      "\x66\x9a\xad\x9e\x07\x9d\xe7\xca\xe5\xaf\xd5\xbe\xd2\xba\xbe\xd0\x55\xb6"
      "\xf3\x5c\x39\xa2\xef\x87\xa1\x5d\xf9\x68\x1c\xf2\x67\xd3\x60\x14\xd1\xa8"
      "\x9e\xf8\x9b\xe9\xc1\x7f\xb3\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\xc0\xc3\x36\x14\x45\x3c\x13\x29\x5e\xfd\xb7\x3f\xac\xc6\x15\x47"
      "\x35\x2e\xfd\xf8\xc5\xd1\xdf\x1b\xfe\xc5\xee\x31\xe3\x4f\xdf\x63\x3f\x65"
      "\xd9\x17\x22\x62\xb5\xb8\xbf\x31\xb9\xfd\x79\x08\xf1\x44\x9a\x48\xe9\x31"
      "\x8f\x25\xfe\x24\x1b\x8c\x22\xfe\x28\x8f\xff\xfb\xd6\xe3\x6e\x0c\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc0\x27\x5a\x11\x3f\x8e"
      "\x14\x2f\xbd\x77\x32\xad\x45\xf7\x9c\xe2\xcd\xd6\x8d\xda\xd5\xc6\xb5\xf9"
      "\xf6\xac\xb0\x9d\xb9\x7f\x3b\x73\xa6\x6f\x6d\x6d\x6d\xd5\x52\x3b\xeb\x39"
      "\xa7\x73\xae\xe6\x5c\xcb\xb9\x9e\x73\x23\x67\x14\xb9\x7e\xce\x7a\xce\xe9"
      "\x9c\xab\x39\xd7\x72\xae\xe7\xdc\xc8\x19\x3d\xb9\x7e\xce\x7a\xce\xe9\x9c"
      "\xab\x39\xd7\x72\xae\xe7\xdc\xc8\x19\xbd\xb9\x7e\xce\x7a\xce\xe9\x9c\xab"
      "\x39\xd7\x72\xae\xe7\xdc\xc8\x19\x87\x64\xee\x5e\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x80\x8f\x93\x22\x8a\xf8\x79\xa4\xf8\xf6\x37\x36\x53\xa4"
      "\x88\xa8\x47\x4c\x47\x3b\xd7\x07\x1e\x77\xeb\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\xd2\x40\x2a\xe2\xfb"
      "\x91\xa2\xf6\xfb\xf5\xed\x6d\xbd\x11\x91\xaa\x7f\xdb\x4e\x96\xbf\x9c\x8f"
      "\x7a\x7f\x99\x9f\x8e\xfa\x68\x99\x2f\x47\xfd\x52\xce\x46\x95\xbd\xf5\x6f"
      "\x3d\x86\xf6\xb3\x3f\x7d\xa9\x88\x1f\x45\x8a\x81\xc1\x77\xb6\x2f\x78\xbe"
      "\xfe\x7d\xed\xb5\xed\xdb\x20\xde\xfe\xe6\x9d\xb5\x5f\xee\x6d\x67\x4f\xe7"
      "\xc3\xe1\x0f\x06\x9e\x38\x71\xfc\xe2\xe8\xf8\xaf\x3e\x7d\xb7\xe5\xb4\x57"
      "\x03\x46\x2e\x37\x5b\xb7\x6e\xd7\xa6\xc6\xc6\xc7\x27\xbb\x36\xf7\xe6\xa3"
      "\x7f\xba\x6b\xdb\x70\x3e\x6e\xf1\x70\xba\x4e\x44\x2c\xbf\xf9\xd6\x1b\x8d"
      "\xf9\xf9\xb9\xa5\x07\x5f\x28\x6f\x81\x7d\x54\xb7\x60\xe1\xb0\x2e\x44\xef"
      "\xa1\x68\xc6\xc1\x2f\xec\xf1\x28\x78\xdc\x4f\x26\x1e\x85\xf2\xfd\xff\x7e"
      "\xa4\xf8\xad\xf7\xfe\xbd\xf3\xc2\xef\xbc\xff\x7f\xa1\xbd\xb6\xfd\x86\x8f"
      "\x9f\xfd\xf1\x9d\xf7\xff\x4b\xbb\x77\x74\x40\xef\xff\x27\xbb\xb6\xbd\x94"
      "\x7f\x37\xd2\xd7\x1b\x31\xb8\x72\x73\xb1\xef\x44\xc4\xe0\xf2\x9b\x6f\x9d"
      "\x6a\xde\x6c\xdc\x98\xbb\x31\xd7\x3a\x7f\xfa\xf4\x97\x47\x47\xbf\x7c\xee"
      "\x74\x5f\x7f\xc4\xe0\xf5\xe6\xfc\x5c\xd7\xd2\xbe\x4f\x15\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\xc0\xa3\x95\x8a\xf8\x9d\x48\xd1\xf8\xd1"
      "\x66\xaa\x45\xc4\xed\x6a\xbc\xd6\xf0\xc5\xd1\xe7\x4e\x3d\xdb\x13\x3d\xd5"
      "\x78\xab\x1d\xe3\xb6\x5e\x9f\xbc\x7a\xa9\xf6\xca\xc2\xcd\xc5\xa5\xb9\xe5"
      "\xe5\xb9\xd9\xda\x54\xab\x39\xb3\x30\x3b\x77\xbf\x87\x1b\xac\x86\x7b\x4d"
      "\x8d\x8d\x1f\x48\x67\xee\x69\xe8\x80\xdb\x3f\x34\xf8\xca\xc2\xe2\x9b\x4b"
      "\xcd\x1b\x7f\xb0\xb2\xe7\xe7\xc7\x06\x2f\x5d\x5b\x5e\x59\x6a\xcc\xec\xfd"
      "\x71\x0c\x45\x11\x51\xef\xde\x32\x52\x35\x78\x6a\x6c\xbc\x6a\xf4\x7c\xb3"
      "\xd1\xaa\xaa\x4e\xec\x39\x98\xee\xff\xaf\x2f\x0d\xc5\x7f\x44\x8a\x99\xf3"
      "\xb5\xf4\xf9\xbc\x2d\x8f\xff\xdb\x3d\xc2\x7f\xc7\xf8\xff\xd5\xdd\x3b\x3a"
      "\xa0\xf1\x7f\x9f\xea\xda\x56\x1e\x33\xa5\x22\x7e\x16\x29\x7e\xf3\xcf\x9f"
      "\x8e\xcf\x57\xed\x3c\x16\x1f\x3a\x67\xb9\xdc\x5f\x47\x8a\x91\x0b\x9f\xcb"
      "\xe5\xa2\xbf\x2c\xd7\x69\x43\xfb\x7b\x05\xda\x23\x03\xcb\xb2\xff\x13\x29"
      "\xfe\xfe\xe7\x3b\xcb\x76\xc6\x43\x3e\x79\xa7\xec\x99\xfb\x3e\xb1\x47\x44"
      "\x5f\x2a\xe2\x78\xa4\xf8\xfe\x9f\x7e\x37\x7e\x2d\x6f\xdb\xf9\xfd\x0f\x7b"
      "\x5f\xff\x63\xbb\x77\x74\x40\xd7\xff\xa9\xae\x6d\xc7\x76\x0c\x52\xde\x77"
      "\xd7\xc9\xd7\xff\x54\xa4\x78\xf9\xc9\x77\xe2\xd7\xf3\xb6\x8f\xfa\xfe\x8f"
      "\xce\x77\x6f\x9c\xcc\x85\xb7\xbf\x9f\xe3\x80\xae\xff\x67\xba\xb6\x0d\xe7"
      "\xe3\xfe\xc6\xc3\xe9\x3a\x00\x00\x00\x00\x00\x00\x00\x00\xc0\x91\xd6\x97"
      "\x8a\xf8\x9b\x48\xf1\xec\x78\x6f\x7a\x31\x6f\xbb\x9f\xbf\xff\x37\xbb\x7b"
      "\x47\x07\xf4\xf7\xbf\x3e\xdb\xb5\x6d\xf6\xe1\xcc\x57\x74\xcf\x85\x7d\x9f"
      "\x54\x00\x00\x00\x00\x38\x24\xfa\x52\x11\x3f\x8e\x14\x37\x56\xde\xd9\x1e"
      "\x43\xbd\x73\xfc\x77\xd7\xf8\xcf\xdf\xbe\x33\xfe\x73\x2c\xed\xfa\xb4\xfa"
      "\x73\xbe\x5f\xaa\xbe\x37\xe0\x61\xfe\xf9\x5f\xb7\xe1\x7c\xdc\xe9\xfd\x77"
      "\x1b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0e\x95"
      "\x94\x8a\x78\x31\xcf\xa7\x3e\x7d\x8f\xf9\xd4\xd7\x23\xc5\xab\xff\xf5\x7c"
      "\x2e\x97\x4e\x94\xe5\x3a\xf3\xc0\x0f\x57\xbf\x0e\x5e\x59\x68\x9d\xba\x34"
      "\x3f\xbf\x30\xd3\x58\x69\x5c\x9b\x9f\xab\x4d\x2e\x36\x66\xe6\xca\xba\x4f"
      "\x45\x8a\xcd\xbf\xfa\x5c\xae\x5b\x54\xf3\xab\x77\xe6\x9b\x6f\xcf\xf1\x7e"
      "\x67\x2e\xf6\xa5\x48\x31\xfe\xb7\x9d\xb2\xed\xb9\xd8\x3b\x73\x93\x3f\x75"
      "\xa7\xec\x99\xb2\xec\xa7\x22\xc5\x7f\xfe\xdd\xce\xb2\x9d\x79\xac\x3f\x73"
      "\xa7\xec\xd9\xb2\xec\x5f\x46\x8a\xaf\xff\xe3\xde\x65\x4f\xdc\x29\x7b\xae"
      "\x2c\xfb\xdd\x48\xf1\xc3\xaf\xd7\x3a\x65\x8f\x95\x65\x3b\xdf\x8f\xfa\xd9"
      "\xed\xb2\xfd\x2f\xcc\x2c\x14\x07\x70\x55\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\xf8\xa4\xe9\x4b\x45\xfc\x49\xa4\xf8\xef\x9b"
      "\x6b\xdb\x63\xf9\xf3\xfc\xff\x7d\x5d\xab\x95\xb7\xbf\xd9\x35\xdf\xff\x2e"
      "\xb7\xab\x79\xfe\x87\xab\xf9\xff\xef\xb6\xfc\x20\xf3\xff\x0f\xe7\xf5\xfe"
      "\xfd\x77\x15\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x8e\x8c\x14\x45\xbc\x15\x29\x16\xaf\x6c\xa6\xf5\x81\x72\xbd\x6d"
      "\xf0\x72\xb3\x75\xeb\xf6\xd4\xd8\xf8\xde\xd5\x86\x52\x55\xb3\xa7\x2a\x5f"
      "\xfe\x0c\x9e\x39\x7b\xee\xfc\x97\x5e\x1c\xbd\xd0\xc9\x8f\xae\xff\xb0\x3d"
      "\x13\xaf\x4f\x5e\xbd\x54\x7b\x65\xe1\xe6\xe2\xd2\xdc\xf2\xf2\xdc\x6c\x6d"
      "\xaa\xd5\x9c\x59\x98\x9d\xbb\xef\x3d\xec\xb7\xfe\x6e\x23\xd5\x09\xa8\xdd"
      "\x7c\xe3\xd6\xec\xf5\xeb\xcb\xb5\xb3\x2f\x9c\xdb\xf1\xf1\xed\xe1\x0f\x06"
      "\x9e\x38\x31\x7c\x71\xf4\xb9\x53\xcf\x76\xca\x4e\x8d\x8d\x8f\x4f\x76\x95"
      "\xe9\xed\x7b\xe0\xa3\x7f\x48\xba\xcb\xf6\xfe\x28\xe2\x2f\x22\xc5\xf3\xdf"
      "\xfb\x49\xfa\xa7\x81\x88\x22\xf6\x7f\x2e\xee\x71\xef\x1c\xb4\xa1\xaa\x13"
      "\x23\x55\x27\xa6\xc6\xc6\xab\x8e\xcc\x37\x1b\xad\x95\xf2\xc3\x89\xce\x89"
      "\x28\x22\x6a\x5d\x95\xea\x9d\x73\xf4\x08\xae\xc5\xbe\xd4\x23\x56\xcb\xe6"
      "\x97\x0d\x1e\x29\xbb\x37\xb9\xd8\x58\x6a\x5c\x9b\x9f\xab\x4d\x34\x96\x56"
      "\x9a\x2b\xcd\x85\xd6\x44\x6a\xb7\xb6\xec\x4f\x2d\x8a\xb8\x90\x22\xd6\x22"
      "\x62\x63\xe0\xc3\xbb\xeb\x8b\x22\xde\x88\x14\xdf\x39\xbe\x99\xfe\x79\x20"
      "\xa2\xa7\x73\x1e\xbe\x78\x65\xf2\xab\xa7\xcf\xde\xbd\x1d\xc5\x01\xf6\xf1"
      "\x3e\x94\xed\xac\xf5\x45\xac\x15\x47\xe0\x9a\x1d\x62\x03\x51\xc4\x3f\x44"
      "\x8a\x9f\xbe\x7b\x32\xfe\x65\x20\xa2\x37\xda\x3f\xf1\x85\x88\xd7\xca\xfc"
      "\x41\xc4\xdb\xd1\xbe\xde\xa9\xbc\x31\xce\x47\xbc\xbf\xc7\x7d\xc4\xd1\xd4"
      "\x1b\x45\xfc\x6f\x79\xfd\x2f\x6e\xa6\x77\x07\xca\xe7\x41\xe7\xb9\x72\xf9"
      "\x6b\xb5\xaf\xb4\xae\x2f\x74\x95\xed\x3c\x57\x8e\xfc\xfb\xe1\x51\x3a\xe4"
      "\xcf\xa6\xc1\x28\xe2\x87\xd5\x13\x7f\x33\xfd\xab\xff\xae\x01\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0e\x91\x22\x7e\x25\x52\xbc\xf4\xde"
      "\xc9\x54\x8d\x0f\xde\x1e\x53\xdc\x6c\xdd\xa8\x5d\x6d\x5c\x9b\x6f\x0f\xeb"
      "\xeb\x8c\xfd\xeb\x8c\x99\xde\xda\xda\xda\xaa\xa5\x76\xd6\x73\x4e\xe7\x5c"
      "\xcd\xb9\x96\x73\x3d\xe7\x46\xce\x28\x72\xfd\x9c\xf5\x32\x07\xb7\xb6\xa6"
      "\xf3\xfa\x6a\xce\xb5\x9c\xeb\x39\x37\x72\x46\x4f\xae\x9f\xb3\x9e\x73\x3a"
      "\xe7\x6a\xce\xb5\x9c\xeb\x39\x37\x72\x46\x6f\xae\x9f\xb3\x9e\x73\x3a\xe7"
      "\x6a\xce\xb5\x9c\xeb\x39\x37\x72\xc6\x21\x19\xbb\x07\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7c\xbc\x14\xd5\x3f\x29\xbe\xfd\x8d"
      "\xcd\xb4\x35\xd0\x9e\x5f\x7a\x3a\xda\xb9\x6e\x3e\xd0\x8f\xbd\xff\x0b\x00"
      "\x00\xff\xff\x3e\x64\xf8\x44",
      3085);
  syz_mount_image(0x20000100, 0x20000040, 0x2010008, 0x20000400, 5, 0xc0d,
                  0x20001040);
  memcpy((void*)0x20000200,
         "\023\023w\305\3745\324\024T\325\324\035)\255\032`)"
         "Y\201F\346\276\026nA\255\r\275@T\003<\2373\273\332\202$"
         "\242\363\327r\347cnH\263<\277p\203r\350\361\271\223>"
         "\305\022wC\276\"\006 \236\360-\371\313\362\366\350\200\3238/\000",
         78);
  syscall(__NR_mkdir, 0x20000200ul, 0ul);
  return 0;
}