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

#define _GNU_SOURCE

#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <sched.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/mount.h>
#include <sys/prctl.h>
#include <sys/resource.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>

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

#ifndef __NR_memfd_create
#define __NR_memfd_create 319
#endif

static unsigned long long procid;

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

struct fs_image_segment {
  void* data;
  uintptr_t size;
  uintptr_t offset;
};
static int setup_loop_device(long unsigned size, long unsigned nsegs,
                             struct fs_image_segment* segs,
                             const char* loopname, int* memfd_p, int* loopfd_p)
{
  int err = 0, loopfd = -1;
  int memfd = syscall(__NR_memfd_create, "syzkaller", 0);
  if (memfd == -1) {
    err = errno;
    goto error;
  }
  if (ftruncate(memfd, size)) {
    err = errno;
    goto error_close_memfd;
  }
  for (size_t i = 0; i < nsegs; i++) {
    if (pwrite(memfd, segs[i].data, segs[i].size, segs[i].offset) < 0) {
    }
  }
  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;
    }
  }
  *memfd_p = 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 unsigned long size,
                            volatile unsigned long nsegs,
                            volatile long segments, volatile long flags,
                            volatile long optsarg, volatile long change_dir)
{
  struct fs_image_segment* segs = (struct fs_image_segment*)segments;
  int res = -1, err = 0, loopfd = -1, memfd = -1, need_loop_device = !!segs;
  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(size, nsegs, segs, loopname, &memfd, &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);
    close(memfd);
  }
  errno = err;
  return res;
}

static void setup_common()
{
  if (mount(0, "/sys/fs/fuse/connections", "fusectl", 0, 0)) {
  }
}

static void setup_binderfs()
{
  if (mkdir("/dev/binderfs", 0777)) {
  }
  if (mount("binder", "/dev/binderfs", "binder", 0, NULL)) {
  }
  if (symlink("/dev/binderfs", "./binderfs")) {
  }
}

static void loop();

static void sandbox_common()
{
  prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0);
  setsid();
  struct rlimit rlim;
  rlim.rlim_cur = rlim.rlim_max = (200 << 20);
  setrlimit(RLIMIT_AS, &rlim);
  rlim.rlim_cur = rlim.rlim_max = 32 << 20;
  setrlimit(RLIMIT_MEMLOCK, &rlim);
  rlim.rlim_cur = rlim.rlim_max = 136 << 20;
  setrlimit(RLIMIT_FSIZE, &rlim);
  rlim.rlim_cur = rlim.rlim_max = 1 << 20;
  setrlimit(RLIMIT_STACK, &rlim);
  rlim.rlim_cur = rlim.rlim_max = 128 << 20;
  setrlimit(RLIMIT_CORE, &rlim);
  rlim.rlim_cur = rlim.rlim_max = 256;
  setrlimit(RLIMIT_NOFILE, &rlim);
  if (unshare(CLONE_NEWNS)) {
  }
  if (mount(NULL, "/", NULL, MS_REC | MS_PRIVATE, NULL)) {
  }
  if (unshare(CLONE_NEWIPC)) {
  }
  if (unshare(0x02000000)) {
  }
  if (unshare(CLONE_NEWUTS)) {
  }
  if (unshare(CLONE_SYSVSEM)) {
  }
  typedef struct {
    const char* name;
    const char* value;
  } sysctl_t;
  static const sysctl_t sysctls[] = {
      {"/proc/sys/kernel/shmmax", "16777216"},
      {"/proc/sys/kernel/shmall", "536870912"},
      {"/proc/sys/kernel/shmmni", "1024"},
      {"/proc/sys/kernel/msgmax", "8192"},
      {"/proc/sys/kernel/msgmni", "1024"},
      {"/proc/sys/kernel/msgmnb", "1024"},
      {"/proc/sys/kernel/sem", "1024 1048576 500 1024"},
  };
  unsigned i;
  for (i = 0; i < sizeof(sysctls) / sizeof(sysctls[0]); i++)
    write_file(sysctls[i].name, sysctls[i].value);
}

static int wait_for_loop(int pid)
{
  if (pid < 0)
    exit(1);
  int status = 0;
  while (waitpid(-1, &status, __WALL) != pid) {
  }
  return WEXITSTATUS(status);
}

static void drop_caps(void)
{
  struct __user_cap_header_struct cap_hdr = {};
  struct __user_cap_data_struct cap_data[2] = {};
  cap_hdr.version = _LINUX_CAPABILITY_VERSION_3;
  cap_hdr.pid = getpid();
  if (syscall(SYS_capget, &cap_hdr, &cap_data))
    exit(1);
  const int drop = (1 << CAP_SYS_PTRACE) | (1 << CAP_SYS_NICE);
  cap_data[0].effective &= ~drop;
  cap_data[0].permitted &= ~drop;
  cap_data[0].inheritable &= ~drop;
  if (syscall(SYS_capset, &cap_hdr, &cap_data))
    exit(1);
}

static int do_sandbox_none(void)
{
  if (unshare(CLONE_NEWPID)) {
  }
  int pid = fork();
  if (pid != 0)
    return wait_for_loop(pid);
  setup_common();
  sandbox_common();
  drop_caps();
  if (unshare(CLONE_NEWNET)) {
  }
  write_file("/proc/sys/net/ipv4/ping_group_range", "0 65535");
  setup_binderfs();
  loop();
  exit(1);
}

uint64_t r[1] = {0xffffffffffffffff};

void loop(void)
{
  intptr_t res = 0;
  memcpy((void*)0x20000000, "f2fs\000", 5);
  memcpy((void*)0x20000100, "./file0\000", 8);
  *(uint64_t*)0x20000200 = 0x20010a00;
  memcpy((void*)0x20010a00,
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x05\x00"
         "\x00\x00\x00\x00\x00\x06\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00\x00"
         "\x00\x00\x08\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00\x00\x00\x00\x08"
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
         96);
  *(uint64_t*)0x20000208 = 0x60;
  *(uint64_t*)0x20000210 = 0x1e;
  *(uint64_t*)0x20000218 = 0x20010000;
  memcpy((void*)0x20010000,
         "\x10\x20\xf5\xf2\x01\x00\x0e\x00\x09\x00\x00\x00\x03\x00\x00\x00\x10"
         "\x00\x00\x00\x09\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\x00"
         "\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x18\x00\x00\x00\x1f\x00\x00"
         "\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00"
         "\x18\x00\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x06\x00\x00\x00"
         "\x0a\x00\x00\x00\x0e\x00\x00\x00\x10\x00\x00\x03\x00\x00\x00\x01\x00"
         "\x00\x00\x02\x00\x00\x00\x22\x55\x7c\x7f\x4c\x46\x48\x34\xa1\x8d\xa3"
         "\xb1\x91\x54\xb9\x55\x00\x00\x00\x00",
         128);
  *(uint64_t*)0x20000220 = 0x80;
  *(uint64_t*)0x20000228 = 0x400;
  *(uint64_t*)0x20000230 = 0x20010080;
  memcpy(
      (void*)0x20010080,
      "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
      "\000\000\000\000\000\000\000\000\000\000%"
      "\000\000\000mp\000\000\000\000\000\000wm\000\000\000\000\000\000og\000"
      "\000\000\000\000\000jp\000\000\000\000\000\000avi\000\000\000\000\000m4v"
      "\000\000\000\000\000m4p\000\000\000\000\000mkv\000\000\000\000\000mov"
      "\000\000\000\000\000webm\000\000\000\000wav\000\000\000\000\000m4a\000"
      "\000\000\000\0003gp\000\000\000\000\000opus\000\000\000\000flac\000\000"
      "\000\000gif\000\000\000\000\000png\000\000\000\000\000svg\000\000\000"
      "\000\000webp\000\000\000\000jar\000\000\000\000\000deb\000\000\000\000"
      "\000iso\000\000\000\000\000gz\000\000\000\000\000\000xz\000\000\000\000"
      "\000\000zst\000\000\000\000\000pdf\000\000\000\000\000pyc\000\000\000"
      "\000\000ttc\000\000\000\000\000ttf\000\000\000\000\000exe\000\000\000"
      "\000\000apk\000\000\000\000\000cnt\000\000\000\000\000exo\000\000\000"
      "\000\000odex\000\000\000\000vdex\000\000\000\000so\000\000\000\000\000"
      "\000cold\000\000\000\000db\000\000\000\000\000\000\000\000\000\000\000"
      "\000\000\000\000\000\000\000\000\000\000\000",
      352);
  *(uint64_t*)0x20000238 = 0x160;
  *(uint64_t*)0x20000240 = 0x860;
  *(uint64_t*)0x20000248 = 0x200101e0;
  memcpy((void*)0x200101e0,
         "\000\000\000\000Linux version 5.17.11-1rodete2-amd64 "
         "(glinux-team@google.com) (gcc-11 (Debian 11.2.0-20) 11.2.0, GNU ld "
         "(GNU Binutils for Debian) 2.38) #1 SMP PREEMPT Debian "
         "5.17.11-1rodete2 (2022-06-09)\000",
         192);
  *(uint64_t*)0x20000250 = 0xc0;
  *(uint64_t*)0x20000258 = 0xa80;
  *(uint64_t*)0x20000260 = 0x200102a0;
  memcpy((void*)0x200102a0,
         "\000\000\000\000Linux version 5.17.11-1rodete2-amd64 "
         "(glinux-team@google.com) (gcc-11 (Debian 11.2.0-20) 11.2.0, GNU ld "
         "(GNU Binutils for Debian) 2.38) #1 SMP PREEMPT Debian "
         "5.17.11-1rodete2 (2022-06-09)\000",
         192);
  *(uint64_t*)0x20000268 = 0xc0;
  *(uint64_t*)0x20000270 = 0xb80;
  *(uint64_t*)0x20000278 = 0x20000c00;
  memcpy((void*)0x20000c00,
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x5c\xbe"
         "\xd2\xb6\xf0\xe7\xa5\x8a\x8a\xd0\xdd\xc3\x2e\xe9\xda\x62\xa6\x15\xdb"
         "\xf0\x43\x7d\x4d\xec\x34\xaf\xb1\xb0\x85\x2b\x1a\x76\xd3\xcd\xca\xa5"
         "\x75\x3c\x32\xed\xd9\x57\xaa\x75\x68\x80\x0e\xed\x7a\x79\x7c\x50\x87"
         "\xc1\x77\x75\x4c\xfa\xff\x5d\xdb\x3b\xa6\xdd\x08\x4d\x52\x3b\x7a\xa7"
         "\xf1\x59\xab\xf6\xae\xe3\x8a\x48\xb6\xa1\x5a\x4d\x49\xc5\xc8\x35\x73"
         "\x90\x89\xa0\x9e\xeb\x95\x38\x2e\xe0\xd5\x5a\xdf\x96\x60\x99\x24\x32"
         "\x51\xee\xee\x84\xcf\x0a\x1b\xd3\xe5\xf6\x48\x2d\x25\x97\x89\xee\xa5"
         "\x60\x2b\xf6\x1b\x38\xa7\x31\x25\x0a\xf0\x92\x1c\x3c\x0d\x58\x5a\xf9"
         "\xfb\x9e\x1c\xea\xd8\xc4\x26\x14\xeb\x70\x0c\xda\x4f\xeb\xba\x20\xfe"
         "\x27\xe5\x5b\xb9\xd1\x31\xc9\x34\x4f\xcd\x22\x25\xd1\xd9\xe4\x0d\x58"
         "\x87\x5f\x4b\x7b\xad\x28\x26\x02\x1f\xfe\x4e\x68\x67\xb8\xe1\xc4",
         203);
  *(uint64_t*)0x20000280 = 0xcb;
  *(uint64_t*)0x20000288 = 0xc80;
  *(uint64_t*)0x20000290 = 0x20010380;
  memcpy((void*)0x20010380,
         "\x00\x00\x00\x00\x00\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",
         32);
  *(uint64_t*)0x20000298 = 0x20;
  *(uint64_t*)0x200002a0 = 0xec0;
  *(uint64_t*)0x200002a8 = 0x200103a0;
  memcpy((void*)0x200103a0,
         "\x10\x20\xf5\xf2\x01\x00\x0e\x00\x09\x00\x00\x00\x03\x00\x00\x00\x0c"
         "\x00\x00\x00\x09\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\x00"
         "\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x18\x00\x00\x00\x1f\x00\x00"
         "\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00"
         "\x18\x00\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x06\x00\x00\x00"
         "\x0a\x00\x00\x00\x0e\x00\x00\x00\x10\x00\x00\x03\x00\x00\x00\x01\x00"
         "\x00\x00\x02\x00\x00\x00\x22\x55\x7c\x7f\x4c\x46\x48\x34\xa1\x8d\xa3"
         "\xb1\x91\x54\xb9\x55\x00\x00\x00\x00",
         128);
  *(uint64_t*)0x200002b0 = 0x80;
  *(uint64_t*)0x200002b8 = 0x1400;
  *(uint64_t*)0x200002c0 = 0x20010420;
  memcpy(
      (void*)0x20010420,
      "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
      "\000\000\000\000\000\000\000\000\000\000%"
      "\000\000\000mp\000\000\000\000\000\000wm\000\000\000\000\000\000og\000"
      "\000\000\000\000\000jp\000\000\000\000\000\000avi\000\000\000\000\000m4v"
      "\000\000\000\000\000m4p\000\000\000\000\000mkv\000\000\000\000\000mov"
      "\000\000\000\000\000webm\000\000\000\000wav\000\000\000\000\000m4a\000"
      "\000\000\000\0003gp\000\000\000\000\000opus\000\000\000\000flac\000\000"
      "\000\000gif\000\000\000\000\000png\000\000\000\000\000svg\000\000\000"
      "\000\000webp\000\000\000\000jar\000\000\000\000\000deb\000\000\000\000"
      "\000iso\000\000\000\000\000gz\000\000\000\000\000\000xz\000\000\000\000"
      "\000\000zst\000\000\000\000\000pdf\000\000\000\000\000pyc\000\000\000"
      "\000\000ttc\000\000\000\000\000ttf\000\000\000\000\000exe\000\000\000"
      "\000\000apk\000\000\000\000\000cnt\000\000\000\000\000exo\000\000\000"
      "\000\000odex\000\000\000\000vdex\000\000\000\000so\000\000\000\000\000"
      "\000cold\000\000\000\000db\000\000\000\000\000\000\000\000\000\000\000"
      "\000\000\000\000\000\000\000\000\000\000\000",
      352);
  *(uint64_t*)0x200002c8 = 0x160;
  *(uint64_t*)0x200002d0 = 0x1860;
  *(uint64_t*)0x200002d8 = 0x20010580;
  memcpy((void*)0x20010580,
         "\000\000\000\000Linux version 5.17.11-1rodete2-amd64 "
         "(glinux-team@google.com) (gcc-11 (Debian 11.2.0-20) 11.2.0, GNU ld "
         "(GNU Binutils for Debian) 2.38) #1 SMP PREEMPT Debian "
         "5.17.11-1rodete2 (2022-06-09)\000",
         192);
  *(uint64_t*)0x200002e0 = 0xc0;
  *(uint64_t*)0x200002e8 = 0x1a80;
  *(uint64_t*)0x200002f0 = 0x20010640;
  memcpy((void*)0x20010640,
         "\000\000\000\000Linux version 5.17.11-1rodete2-amd64 "
         "(glinux-team@google.com) (gcc-11 (Debian 11.2.0-20) 11.2.0, GNU ld "
         "(GNU Binutils for Debian) 2.38) #1 SMP PREEMPT Debian "
         "5.17.11-1rodete2 (2022-06-09)\000",
         192);
  *(uint64_t*)0x200002f8 = 0xc0;
  *(uint64_t*)0x20000300 = 0x1b80;
  *(uint64_t*)0x20000308 = 0x20010700;
  memcpy((void*)0x20010700,
         "\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000"
         "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000",
         32);
  *(uint64_t*)0x20000310 = 0x20;
  *(uint64_t*)0x20000318 = 0x1c80;
  *(uint64_t*)0x20000320 = 0x20010720;
  memcpy((void*)0x20010720,
         "\x00\x00\x00\x00\x00\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",
         32);
  *(uint64_t*)0x20000328 = 0x20;
  *(uint64_t*)0x20000330 = 0x1ec0;
  *(uint64_t*)0x20000338 = 0x20010a80;
  memcpy(
      (void*)0x20010a80,
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\xb1\xda\x17\x3e"
      "\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x00\x00"
      "\x00\x00\x0d\x00\x00\x00\x10\x00\x00\x00\x12\x00\x00\x00\x00\x00\x00\x00"
      "\x01\x00\x00\x00\x02\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"
      "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\x00\x06\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x0b\x00\x00\x00\x05\x00"
      "\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"
      "\xff\xff\xff\xff\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\xc5\x01\x00\x00\x06\x00\x00\x00\x01\x00\x00\x00\x07\x00\x00\x00"
      "\x07\x00\x00\x00\x0a\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\xfc\x0f"
      "\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00",
      224);
  *(uint64_t*)0x20000340 = 0xe0;
  *(uint64_t*)0x20000348 = 0x2532;
  *(uint64_t*)0x20000350 = 0x20010740;
  memcpy(
      (void*)0x20010740,
      "\xb1\xda\x17\x3e\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x0b\x00"
      "\x00\x00\x00\x00\x00\x00\x0d\x00\x00\x00\x10\x00\x00\x00\x12\x00\x00\x00"
      "\x00\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\xff\xff\xff\xff\xff\xff"
      "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\x00\x06\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x0b\x00"
      "\x00\x00\x05\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"
      "\xff\xff\xff\xff\xff\xff\xff\xff\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\xc5\x01\x00\x00\x06\x00\x00\x00\x01\x00\x00\x00"
      "\x07\x00\x00\x00\x07\x00\x00\x00\x0a\x00\x00\x00\x40\x00\x00\x00\x40\x00"
      "\x00\x00\xfc\x0f\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
      192);
  *(uint64_t*)0x20000358 = 0xc0;
  *(uint64_t*)0x20000360 = 0x200000;
  *(uint64_t*)0x20000368 = 0x20010800;
  memcpy((void*)0x20010800,
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x38\x2c\x77\xa2\x00\x00"
         "\x03\x00\x00\x00\x00\x03\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00"
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
         64);
  *(uint64_t*)0x20000370 = 0x40;
  *(uint64_t*)0x20000378 = 0x200fe0;
  *(uint64_t*)0x20000380 = 0x20010840;
  memcpy(
      (void*)0x20010840,
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06\x00\x00\x00\x00\x00\x02\x0c\x60"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01"
      "\x00\x00\x00\x05\x10\xec\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00"
      "\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x14\x00",
      192);
  *(uint64_t*)0x20000388 = 0xc0;
  *(uint64_t*)0x20000390 = 0x2011e0;
  *(uint64_t*)0x20000398 = 0x20010900;
  memcpy((void*)0x20010900,
         "\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x04\x00\x78\x00\x00\x00"
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00"
         "\x05\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00",
         96);
  *(uint64_t*)0x200003a0 = 0x60;
  *(uint64_t*)0x200003a8 = 0x2012e0;
  *(uint64_t*)0x200003b0 = 0x20010960;
  memcpy((void*)0x20010960,
         "\x00\x00\x00\x0b\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00"
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
         32);
  *(uint64_t*)0x200003b8 = 0x20;
  *(uint64_t*)0x200003c0 = 0x201380;
  *(uint64_t*)0x200003c8 = 0x20010980;
  memcpy((void*)0x20010980,
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
         "\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00"
         "\x00\x00\x08\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x01\x00\x08"
         "\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00",
         64);
  *(uint64_t*)0x200003d0 = 0x40;
  *(uint64_t*)0x200003d8 = 0x2013e0;
  *(uint64_t*)0x200003e0 = 0x200109c0;
  memcpy((void*)0x200109c0,
         "\x03\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x04\x00\x00"
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
         32);
  *(uint64_t*)0x200003e8 = 0x20;
  *(uint64_t*)0x200003f0 = 0x202000;
  *(uint64_t*)0x200003f8 = 0x20000900;
  memcpy((void*)0x20000900,
         "\x00\x00\x8c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
         32);
  *(uint64_t*)0x20000400 = 0x20;
  *(uint64_t*)0x20000408 = 0x202e00;
  *(uint64_t*)0x20000410 = 0x20010b60;
  memcpy((void*)0x20010b60,
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x38\x2c\x77\xa2",
         32);
  *(uint64_t*)0x20000418 = 0x20;
  *(uint64_t*)0x20000420 = 0x205fe0;
  *(uint64_t*)0x20000428 = 0x20010b80;
  memcpy((void*)0x20010b80,
         "\xb1\xda\x17\x3e\x38\x2c\x77\xa2\x00\x00\x00\x00\x00\x00\x00\x00\x00"
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
         32);
  *(uint64_t*)0x20000430 = 0x20;
  *(uint64_t*)0x20000438 = 0x3ff000;
  *(uint64_t*)0x20000440 = 0x20010ba0;
  memcpy((void*)0x20010ba0,
         "\x00\x00\x00\x00\x00\x00\x00\x00\xfe\xff\xff\xff\xff\xff\xff\xff\xff"
         "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"
         "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"
         "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"
         "\xff\xff\xff\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",
         96);
  *(uint64_t*)0x20000448 = 0x60;
  *(uint64_t*)0x20000450 = 0x3ff040;
  *(uint64_t*)0x20000458 = 0x20000a00;
  memcpy(
      (void*)0x20000a00,
      "\xb0\xda\x17\x3e\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x0b\x00"
      "\x00\x00\x00\x00\x00\x00\x0d\x00\x00\x00\x10\x00\x00\x00\x12\x00\x00\x00"
      "\x00\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\xff\xff\xff\xff\xff\xff"
      "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\x00\x06\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x0b\x00"
      "\x00\x00\x05\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"
      "\xff\xff\xff\xff\xff\xff\xff\xff\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\xc5\x00\x00\x00\x06\x00\x00\x00\x01\x00\x00\x00"
      "\x07\x00\x00\x00\x07\x00\x00\x00\x0a\x00\x00\x00\x40\x00\x00\x00\x40\x00"
      "\x00\x00\xfc\x0f\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
      192);
  *(uint64_t*)0x20000460 = 0xc0;
  *(uint64_t*)0x20000468 = 0x400000;
  *(uint64_t*)0x20000470 = 0x20010cc0;
  memcpy((void*)0x20010cc0,
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x5e\x2e\xcb\x6b\x00\x00"
         "\x03\x00\x00\x00\x00\x03\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00"
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
         64);
  *(uint64_t*)0x20000478 = 0x40;
  *(uint64_t*)0x20000480 = 0x400fe0;
  *(uint64_t*)0x20000488 = 0x20010d00;
  memcpy(
      (void*)0x20010d00,
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x06\x00\x00\x00\x00\x00\x02\x0c\x60"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01"
      "\x00\x00\x00\x05\x10\xec\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00"
      "\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x14\x00",
      192);
  *(uint64_t*)0x20000490 = 0xc0;
  *(uint64_t*)0x20000498 = 0x4011e0;
  *(uint64_t*)0x200004a0 = 0x20010dc0;
  memcpy((void*)0x20010dc0,
         "\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x04\x00\x78\x00\x00\x00"
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00"
         "\x05\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00",
         96);
  *(uint64_t*)0x200004a8 = 0x60;
  *(uint64_t*)0x200004b0 = 0x4012e0;
  *(uint64_t*)0x200004b8 = 0x20010e20;
  memcpy((void*)0x20010e20,
         "\x00\x00\x00\x0b\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00"
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
         32);
  *(uint64_t*)0x200004c0 = 0x20;
  *(uint64_t*)0x200004c8 = 0x401380;
  *(uint64_t*)0x200004d0 = 0x20010e40;
  memcpy((void*)0x20010e40,
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
         "\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00"
         "\x00\x00\x08\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x01\x00\x08"
         "\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00",
         64);
  *(uint64_t*)0x200004d8 = 0x40;
  *(uint64_t*)0x200004e0 = 0x4013e0;
  *(uint64_t*)0x200004e8 = 0x20010e80;
  memcpy((void*)0x20010e80,
         "\x03\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x06\x00\x00\x00"
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xf7\x00\x00\x00",
         32);
  *(uint64_t*)0x200004f0 = 0x20;
  *(uint64_t*)0x200004f8 = 0x402000;
  *(uint64_t*)0x20000500 = 0x20010ea0;
  memcpy((void*)0x20010ea0,
         "\000\000p\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
         "\000\000\000\000\000\000\000\000\000\000\000\000\000\000",
         32);
  *(uint64_t*)0x20000508 = 0x20;
  *(uint64_t*)0x20000510 = 0x402e00;
  *(uint64_t*)0x20000518 = 0x20010ec0;
  memcpy((void*)0x20010ec0,
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x05\x00"
         "\x00\x00\x00\x00\x00\x06\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00\x00"
         "\x00\x00\x08\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00\x00\x00\x00\x08"
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
         96);
  *(uint64_t*)0x20000520 = 0x60;
  *(uint64_t*)0x20000528 = 0x402fe0;
  *(uint64_t*)0x20000530 = 0x20010f20;
  memcpy((void*)0x20010f20,
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00",
         32);
  *(uint64_t*)0x20000538 = 0x20;
  *(uint64_t*)0x20000540 = 0x403fe0;
  *(uint64_t*)0x20000548 = 0x20010f40;
  memcpy(
      (void*)0x20010f40,
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\xb0\xda\x17\x3e"
      "\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x0b\x00\x00\x00\x00\x00"
      "\x00\x00\x0d\x00\x00\x00\x10\x00\x00\x00\x12\x00\x00\x00\x00\x00\x00\x00"
      "\x01\x00\x00\x00\x02\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"
      "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\x00\x06\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x0b\x00\x00\x00\x05\x00"
      "\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"
      "\xff\xff\xff\xff\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\xc5\x00\x00\x00\x06\x00\x00\x00\x01\x00\x00\x00\x07\x00\x00\x00"
      "\x07\x00\x00\x00\x0a\x00\x00\x00\x40\x00\x00\x00\x40\x00\x00\x00\xfc\x0f"
      "\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00",
      224);
  *(uint64_t*)0x20000550 = 0xe0;
  *(uint64_t*)0x20000558 = 0x404fe0;
  *(uint64_t*)0x20000560 = 0x20011020;
  memcpy((void*)0x20011020,
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x5e\x2e\xcb\x6b",
         32);
  *(uint64_t*)0x20000568 = 0x20;
  *(uint64_t*)0x20000570 = 0x405fe0;
  *(uint64_t*)0x20000578 = 0x20000140;
  memcpy((void*)0x20000140,
         "\xb0\xda\x8e\xf3\x5e\x2e\xcb\x6b\x00\x00\x00\x00\x00\x00\x00\x00\x00"
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa5\xd9"
         "\x9c\x0d\x43\xae\xe3\x15\xbf\x34\xb1\x4d\xb1\x1d\x58\x8c\xc6\xbc\x7b",
         51);
  *(uint64_t*)0x20000580 = 0x33;
  *(uint64_t*)0x20000588 = 0x5ff000;
  *(uint64_t*)0x20000590 = 0x20011060;
  memcpy((void*)0x20011060,
         "\x00\x00\x00\x00\x00\x00\x00\x00\xfe\xff\xff\xff\xff\xff\xff\xff\xff"
         "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"
         "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"
         "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"
         "\xff\xff\xff\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",
         96);
  *(uint64_t*)0x20000598 = 0x60;
  *(uint64_t*)0x200005a0 = 0x5ff040;
  *(uint64_t*)0x200005a8 = 0x200110c0;
  memcpy((void*)0x200110c0,
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00"
         "\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x03\x00\x00\x00\x01\x10"
         "\x00\x00\x00\x04\x00\x00\x00\x02\x10\x00\x00\x00\x05\x00\x00\x00\x00"
         "\x12\x00\x00\x00\x06\x00\x00\x00\x01\x12\x00\x00\x00\x07\x00\x00\x00"
         "\x02\x12\x00\x00\x00\x08\x00\x00\x00\x05\x12\x00\x00\x00\x09\x00\x00"
         "\x00\x04\x12\x00\x00\x00\x00\x00\x00\x00\x00",
         96);
  *(uint64_t*)0x200005b0 = 0x60;
  *(uint64_t*)0x200005b8 = 0xa00000;
  *(uint64_t*)0x200005c0 = 0x20011120;
  memcpy((void*)0x20011120,
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00"
         "\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x00\x03\x00\x00\x00\x01\x10"
         "\x00\x00\x00\x04\x00\x00\x00\x02\x10\x00\x00\x00\x05\x00\x00\x00\x00"
         "\x12\x00\x00\x00\x06\x00\x00\x00\x01\x12\x00\x00\x00\x07\x00\x00\x00"
         "\x02\x12\x00\x00\x00\x08\x00\x00\x00\x03\x12\x00\x00\x00\x09\x00\x00"
         "\x00\x04\x12\x00\x00\x00\x00\x00\x00\x00\x00",
         96);
  *(uint64_t*)0x200005c8 = 0x60;
  *(uint64_t*)0x200005d0 = 0xc00000;
  *(uint64_t*)0x200005d8 = 0x20011180;
  memcpy((void*)0x20011180,
         "\xed\x41\x00\x20\x80\x76\x10\x00\x53\x5f\x01\x00\x03\x00\x00\x00\x00"
         "\x10\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x5e\x1f"
         "\x1f\x63\x00\x00\x00\x00\x65\x1f\x1f\x63\x00\x00\x00\x00\x65\x1f\x1f"
         "\x63\x00\x00\x00\x00\x00\x00\x00\x00\xc9\x67\x5f\x30\xc9\x67\x5f\x30"
         "\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
         96);
  *(uint64_t*)0x200005e0 = 0x60;
  *(uint64_t*)0x200005e8 = 0x1001000;
  *(uint64_t*)0x200005f0 = 0x200111e0;
  memcpy((void*)0x200111e0,
         "\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x01\x16\x00\x00\x00"
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
         32);
  *(uint64_t*)0x200005f8 = 0x20;
  *(uint64_t*)0x20000600 = 0x1001160;
  *(uint64_t*)0x20000608 = 0x20011200;
  memcpy(
      (void*)0x20011200,
      "\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x03\x00\x00\x00\x00\x00"
      "\x00\x00\xad\xda\x17\x3e\x00\x00\x00\x00\x02\x10\x00\x00\xed\x41\x00\x25"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x7c\x0d\x00\x00\x00\x00"
      "\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x65\x1f\x1f\x63\x00\x00\x00\x00"
      "\x65\x1f\x1f\x63\x00\x00\x00\x00\x65\x1f\x1f\x63\x00\x00\x00\x00\xc9\x67"
      "\x5f\x30\xc9\x67\x5f\x30\xc9\x67\x5f\x30\xc7\x6f\x1e\x44\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x10\x00\x00\x03\x00\x00\x00\x05\x00\x00\x00\x66\x69"
      "\x6c\x65\x30\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
      160);
  *(uint64_t*)0x20000610 = 0xa0;
  *(uint64_t*)0x20000618 = 0x1001fe0;
  *(uint64_t*)0x20000620 = 0x20000940;
  memcpy((void*)0x20000940,
         "\x00\x00\x00\x00\x00\x00\x00\x00\x24\x00\x00\x00\x00\x00\x00\x00\x00"
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
         "\x00\x00\x00\x00\x00\x00\x00\x0c\xbc\x7f\xf0\x8b\x53\x05\xff\x15\xd7"
         "\xa6\x1a\x57\x4c\x00\x00\x00\x00\x00\x00\x00\x00\x0f\x00\x00\x00\x00"
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00"
         "\x00\x01\x00\x02\x00\x00\x00\x00\x03\x00\x00\x00\x02\x00\x02\x4a\x81"
         "\x13\xed\x05\x00\x00\x00\x05\x00\x01\x8d\xce\xce\xda\x45\x06\x00\x00"
         "\x00\x05\x00\x07\x00\x00\x00\x00",
         144);
  *(uint64_t*)0x20000628 = 0x90;
  *(uint64_t*)0x20000630 = 0x1002160;
  *(uint64_t*)0x20000638 = 0x20011320;
  memcpy(
      (void*)0x20011320,
      "\000\000\000\000\000\000\000\000\000\000\000\000."
      "\000\000\000\000\000\000\000.."
      "\000\000\000\000\000\000file0\000\000\000file1\000\000\000\000\000\000"
      "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000",
      64);
  *(uint64_t*)0x20000640 = 0x40;
  *(uint64_t*)0x20000648 = 0x1002960;
  *(uint64_t*)0x20000650 = 0x20000080;
  memcpy((void*)0x20000080,
         "\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x04\x00\x00\x00\x00"
         "\x00\x00\x00\x00\x00\x03\x10\x00\x00\x21\xc8\x89\x93\x32\x92\xea\xb8"
         "\x85\x06\xc2\xbf\x4b\x21\x9e\x41\x58\x6b\x2e\xe7\xe0\xc3\xb5\xdc\x95"
         "\x0e\x5f\xe5\x1e\xd5\xd1\x7f\xe4\x53\x2c\xc4\xdd\xa6\x33\x13\x3c\xc8"
         "\x32\x5e\x59\x6a\xaa\xe7\xbf\x82\x40\xbd\xeb\xa0\xbe\x9e\x65\xd4\x3d"
         "\x3b\x16\x13\x9a\x6e\x1e\x74\x81\x36\x4c\xab\x10\x0c\x31\xc3\x8d\xb2"
         "\x49\x2e\xb6\xb5\x71\x9c\xeb\x4d",
         110);
  *(uint64_t*)0x20000658 = 0x6e;
  *(uint64_t*)0x20000660 = 0x1002fe0;
  *(uint64_t*)0x20000668 = 0x20011380;
  memcpy((void*)0x20011380,
         "\xed\x81\x00\x2b\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x1a"
         "\x04\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x65\x1f"
         "\x1f\x63\x00\x00\x00\x00\x65\x1f\x1f\x63\x00\x00\x00\x00\x65\x1f\x1f"
         "\x63\x00\x00\x00\x00\xc9\x67\x5f\x30\xc9\x67\x5f\x30\xc9\x67\x5f\x30"
         "\x5e\xe7\x8c\x74\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04"
         "\x00\x00\x00\x05\x00\x00\x00\x66\x69\x6c\x65\x30\x00\x00\x00\x00\x00"
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00",
         128);
  *(uint64_t*)0x20000670 = 0x80;
  *(uint64_t*)0x20000678 = 0x1200000;
  *(uint64_t*)0x20000680 = 0x20011400;
  memcpy((void*)0x20011400,
         "\000\000\000\000\000\000\000\000$"
         "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
         "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
         "\000\000\000\000\000syzkallersyzkallersyzkallersyzkallersyzkallersyzk"
         "allersyzkallersyzkallersyzkallersyzkallersyzkallersyzkallersyzkallers"
         "yzkallersyzkallersyzkallersyzkallersyzkallersyzkallersyzkallersyzkall"
         "ersyzkallersyzkallersyzkallersyzkallersyzkallersyzkallersyzkallersyzk"
         "allersyzkallersyzkallersyzkallersyzkallersyzkallersyzkallersyzkallers"
         "yzkallersyzkallersyzkallersyzkallersyzkallersyzkallersyzkallersyzkall"
         "ersyzkallersyzkallersyzkallersyzkallersyzkallersyzkallersyzkallersyzk"
         "allersyzkallersyzkallersyzkallersyzkallersyzkallersyzkallersyzkallers"
         "yzkallersyzkallersyzkallersyzkallersyzkallersyzkallersyzkallersyzkall"
         "ersyzkallersyzkallersyzkallersyzkallersyzkallersyzkallersyzkallersyzk"
         "allersyzkallersyzkallersyzkallersyzkallersyzkallersyzkallersyzkallers"
         "yzkallersyzkallersyzkallersyzkallersyzkallersyzkallersyzkallersyzkall"
         "ersyzkallersyzkallersyzkallersyzkallersyzkallersyzkallersyzkallersyzk"
         "allersyzkallersyzkallersyzkallersyzkallersyzkallersyzkallersyzkallers"
         "yzkallersyzkallersyzkallersyzkallersyzkallersyzkallersyzkallersyzkall"
         "ersyzkallersyzkallersyzkallersyzkal\000\000\000\000\000\000\000\000"
         "\000\000\000\000\000\000\000\000\000\000\000\000\000\000",
         1120);
  *(uint64_t*)0x20000688 = 0x460;
  *(uint64_t*)0x20000690 = 0x1200160;
  *(uint64_t*)0x20000698 = 0x20011860;
  memcpy(
      (void*)0x20011860,
      "\x00\x00\x00\x00\x00\x00\x00\x00\x05\x00\x00\x00\x05\x00\x00\x00\x01\x00"
      "\x00\x00\xad\xda\x17\x3e\x00\x00\x00\x00\x01\x12\x00\x00\xff\xa1\x00\x2b"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x27\x00\x00\x00\x00\x00"
      "\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x65\x1f\x1f\x63\x00\x00\x00\x00"
      "\x65\x1f\x1f\x63\x00\x00\x00\x00\x65\x1f\x1f\x63\x00\x00\x00\x00\xc9\x67"
      "\x5f\x30\xc9\x67\x5f\x30\xc9\x67\x5f\x30\xf1\x68\x9d\x18\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x05\x00\x00\x00\x66\x69"
      "\x6c\x65\x31\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
      160);
  *(uint64_t*)0x200006a0 = 0xa0;
  *(uint64_t*)0x200006a8 = 0x1200fe0;
  *(uint64_t*)0x200006b0 = 0x20011900;
  memcpy((void*)0x20011900,
         "\000\000\000\000\000\000\000\000$"
         "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
         "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
         "\000\000\000\000\000/tmp/syz-imagegen2941961749/file0/"
         "file0\000\000\000\000\000\000\000\000\000",
         96);
  *(uint64_t*)0x200006b8 = 0x60;
  *(uint64_t*)0x200006c0 = 0x1201160;
  *(uint64_t*)0x200006c8 = 0x20011a00;
  memcpy((void*)0x20011a00,
         "\000\000\000\000\000\000\000\000$"
         "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
         "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
         "\000\000\000\000\000syzkallers\000\000\000\000\000\000",
         64);
  *(uint64_t*)0x200006d0 = 0x40;
  *(uint64_t*)0x200006d8 = 0x1202160;
  *(uint64_t*)0x200006e0 = 0x20011a40;
  memcpy((void*)0x20011a40,
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11\x20\xf5\xf2\x01"
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
         "\x00\x00\x01\x06\x06\x00\x78\x61\x74\x74\x72\x31\x78\x61\x74\x74\x72"
         "\x31\x01\x06\x06\x00\x78\x61\x74\x74\x72\x32\x78\x61\x74\x74\x72\x32"
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
         96);
  *(uint64_t*)0x200006e8 = 0x60;
  *(uint64_t*)0x200006f0 = 0x1202f00;
  *(uint64_t*)0x200006f8 = 0x20011aa0;
  memcpy((void*)0x20011aa0,
         "\x00\x00\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00\x07\x00\x00\x00\x01"
         "\x00\x00\x00\xad\xda\x17\x3e\x00\x00\x00\x00\x03\x12\x00\x00",
         32);
  *(uint64_t*)0x20000700 = 0x20;
  *(uint64_t*)0x20000708 = 0x1202fe0;
  *(uint64_t*)0x20000710 = 0x20011ac0;
  memcpy((void*)0x20011ac0,
         "\xed\x81\x01\x2b\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x64"
         "\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x65\x1f"
         "\x1f\x63\x00\x00\x00\x00\x65\x1f\x1f\x63\x00\x00\x00\x00\x65\x1f\x1f"
         "\x63\x00\x00\x00\x00\xc9\x67\x5f\x30\xc9\x67\x5f\x30\xc9\x67\x5f\x30"
         "\x55\x9f\x02\xd3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03"
         "\x00\x00\x00\x09\x00\x00\x00\x66\x69\x6c\x65\x2e\x63\x6f\x6c\x64\x00"
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00",
         128);
  *(uint64_t*)0x20000718 = 0x80;
  *(uint64_t*)0x20000720 = 0x1203ffc;
  *(uint64_t*)0x20000728 = 0x20011b40;
  memcpy((void*)0x20011b40,
         "\000\000\000\000\000\000\000\000$"
         "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
         "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
         "\000\000\000\000\000syzkallersyzkallersyzkallersyzkallersyzkallersyzk"
         "allersyzkallersyzkallersyzkallersyzkallersyzkallers\000\000\000\000"
         "\000\000\000\000\000\000\000\000",
         160);
  *(uint64_t*)0x20000730 = 0xa0;
  *(uint64_t*)0x20000738 = 0x1204160;
  *(uint64_t*)0x20000740 = 0x20011be0;
  memcpy(
      (void*)0x20011be0,
      "\x00\x00\x00\x00\x00\x00\x00\x00\x09\x00\x00\x00\x09\x00\x00\x00\x01\x00"
      "\x00\x00\xad\xda\x17\x3e\x00\x00\x00\x00\x05\x12\x00\x00\xed\x81\x02\x21"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x28\x23\x00\x00\x00\x00"
      "\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x65\x1f\x1f\x63\x00\x00\x00\x00"
      "\x65\x1f\x1f\x63\x00\x00\x00\x00\x65\x1f\x1f\x63\x00\x00\x00\x00\xc9\x67"
      "\x5f\x30\xc9\x67\x5f\x30\xc9\x67\x5f\x30\xb4\x1f\xa9\x09\x00\x00\x00\x00"
      "\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x05\x00\x00\x00\x66\x69"
      "\x6c\x65\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",
      160);
  *(uint64_t*)0x20000748 = 0xa0;
  *(uint64_t*)0x20000750 = 0x1204fe0;
  *(uint64_t*)0x20000758 = 0x20011c80;
  memcpy((void*)0x20011c80,
         "\x02\x16\x00\x00\x03\x00\x00\x00\x24\x00\x00\x00\x00\x00\x00\x00\x00"
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x16\x00\x00\x03\x16\x00"
         "\x00\x04\x16\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
         64);
  *(uint64_t*)0x20000760 = 0x40;
  *(uint64_t*)0x20000768 = 0x1205160;
  *(uint64_t*)0x20000770 = 0x20011cc0;
  memcpy((void*)0x20011cc0,
         "\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x08\x00\x00\x00\x01"
         "\x00\x00\x00\xae\xda\x17\x3e\xb7\xc3\x3c\x19\x06\x12\x00\x00",
         32);
  *(uint64_t*)0x20000778 = 0x20;
  *(uint64_t*)0x20000780 = 0x1205fe0;
  *(uint64_t*)0x20000788 = 0x20011ce0;
  memcpy((void*)0x20011ce0,
         "\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"
         "\x03\x00\x00\x00\x01\x00\x02\x00\x00\x00\x00\x03\x00\x00\x00\x02\x00"
         "\x02\x4a\x81\x13\xed\x04\x00\x00\x00\x05\x00\x02\x8d\xce\xce\x45\x07"
         "\x00\x00\x00\x05\x00\x01\xba\xee\xd0\x6f\x08\x00\x00\x00\x05\x00\x01"
         "\x53\xbf\xc5\x50\x08\x00\x00\x00\x05\x00\x01\x12\x00\x52\x23\x09\x00"
         "\x00\x00\x09\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00",
         128);
  *(uint64_t*)0x20000790 = 0x80;
  *(uint64_t*)0x20000798 = 0x1601000;
  *(uint64_t*)0x200007a0 = 0x20011d60;
  memcpy((void*)0x20011d60,
         "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000."
         "\000\000\000\000\000\000\000.."
         "\000\000\000\000\000\000file0\000\000\000file1\000\000\000file2\000"
         "\000\000file3\000\000\000file."
         "cold\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
         "\000\000\000\000\000\000\000",
         96);
  *(uint64_t*)0x200007a8 = 0x60;
  *(uint64_t*)0x200007b0 = 0x1601940;
  memcpy(
      (void*)0x200007c0,
      "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3f\x10\xe2\xd7\x42\x8f\x7f\xf9"
      "\x9d\x98\xcd\x1c\xdc\x1e\x2f\xa5\x04\x07\xdb\xc9\x57\x39\xe0\x26\xb9\x51"
      "\x76\xc1\xba\x73\x2b\xec\xc3\xdd\xdf\xc7\xf1\x70\x60\xf6\x31\x2d\xa4\x54"
      "\xcb\x4a\x8a\x8d\x40\x42\xfb\x51\xbc\x0f\xa9\x60\x7e\xc5\xcb\xef\x34\x56"
      "\xef\x2a\xda\x10\xe3\x46\x03\xb0\xc1\x15\xab\x20\xb4\xfa\x4b\xd6\xfd\x3a"
      "\x18\xb2\x58\xdf\xf7\xe7\x60\xd0\x71\xcb\x59\x0b\xc8\x38\xaa\xeb\x1d\x95"
      "\x53\x88\x1c\xf5\xe0\xd6\x03\xce\xc2\x94\x0e\x27\xdd\xf9\x3e\x7e\x2a\x9e"
      "\x39\xe4\xb0\x6b\xa0\xbc\x7b\x36\x5a\x4e\x0e\x5a\xa5\x7a\xcb\xe0\x90\xe4"
      "\xbc\x03\x18\xbf\x1c\xba\x37\x24\x28\x2c\x64\xac\xc3\x10\x60\xd2\xe7\x6b"
      "\xa7\xfc\xa4\xd4\x98\x96\xb8\x79\xec\x70\x07\x72\x8c\x7a",
      176);
  syz_mount_image(0x20000000, 0x20000100, 0x4000000, 0x3d, 0x20000200, 0,
                  0x200007c0, 1);
  syscall(__NR_sync);
  memcpy((void*)0x200005c0, "./bus\000", 6);
  res = syscall(__NR_open, 0x200005c0ul, 0xe8b42ul, 0ul);
  if (res != -1)
    r[0] = res;
  *(uint32_t*)0x20000040 = 1;
  *(uint32_t*)0x20000044 = 0;
  memcpy((void*)0x20000048, "\205\272\241t\360\313\021B", 8);
  memset((void*)0x20000050, 0, 24);
  memset((void*)0x2000006c, 0, 20);
  syscall(__NR_ioctl, r[0], 0x4018f50b, 0x20000040ul);
}
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);
  do_sandbox_none();
  return 0;
}