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

#define _GNU_SOURCE

#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <setjmp.h>
#include <signal.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>

static unsigned long long procid;

static __thread int skip_segv;
static __thread jmp_buf segv_env;

static void segv_handler(int sig, siginfo_t* info, void* ctx)
{
  uintptr_t addr = (uintptr_t)info->si_addr;
  const uintptr_t prog_start = 1 << 20;
  const uintptr_t prog_end = 100 << 20;
  int skip = __atomic_load_n(&skip_segv, __ATOMIC_RELAXED) != 0;
  int valid = addr < prog_start || addr > prog_end;
  if (skip && valid) {
    _longjmp(segv_env, 1);
  }
  exit(sig);
}

static void install_segv_handler(void)
{
  struct sigaction sa;
  memset(&sa, 0, sizeof(sa));
  sa.sa_handler = SIG_IGN;
  syscall(SYS_rt_sigaction, 0x20, &sa, NULL, 8);
  syscall(SYS_rt_sigaction, 0x21, &sa, NULL, 8);
  memset(&sa, 0, sizeof(sa));
  sa.sa_sigaction = segv_handler;
  sa.sa_flags = SA_NODEFER | SA_SIGINFO;
  sigaction(SIGSEGV, &sa, NULL);
  sigaction(SIGBUS, &sa, NULL);
}

#define NONFAILING(...)                                                        \
  ({                                                                           \
    int ok = 1;                                                                \
    __atomic_fetch_add(&skip_segv, 1, __ATOMIC_SEQ_CST);                       \
    if (_setjmp(segv_env) == 0) {                                              \
      __VA_ARGS__;                                                             \
    } else                                                                     \
      ok = 0;                                                                  \
    __atomic_fetch_sub(&skip_segv, 1, __ATOMIC_SEQ_CST);                       \
    ok;                                                                        \
  })

#define SIZEOF_IO_URING_SQE 64
#define SIZEOF_IO_URING_CQE 16
#define SQ_HEAD_OFFSET 0
#define SQ_TAIL_OFFSET 64
#define SQ_RING_MASK_OFFSET 256
#define SQ_RING_ENTRIES_OFFSET 264
#define SQ_FLAGS_OFFSET 276
#define SQ_DROPPED_OFFSET 272
#define CQ_HEAD_OFFSET 128
#define CQ_TAIL_OFFSET 192
#define CQ_RING_MASK_OFFSET 260
#define CQ_RING_ENTRIES_OFFSET 268
#define CQ_RING_OVERFLOW_OFFSET 284
#define CQ_FLAGS_OFFSET 280
#define CQ_CQES_OFFSET 320

struct io_sqring_offsets {
  uint32_t head;
  uint32_t tail;
  uint32_t ring_mask;
  uint32_t ring_entries;
  uint32_t flags;
  uint32_t dropped;
  uint32_t array;
  uint32_t resv1;
  uint64_t resv2;
};

struct io_cqring_offsets {
  uint32_t head;
  uint32_t tail;
  uint32_t ring_mask;
  uint32_t ring_entries;
  uint32_t overflow;
  uint32_t cqes;
  uint64_t resv[2];
};

struct io_uring_params {
  uint32_t sq_entries;
  uint32_t cq_entries;
  uint32_t flags;
  uint32_t sq_thread_cpu;
  uint32_t sq_thread_idle;
  uint32_t features;
  uint32_t resv[4];
  struct io_sqring_offsets sq_off;
  struct io_cqring_offsets cq_off;
};

#define IORING_OFF_SQ_RING 0
#define IORING_OFF_SQES 0x10000000ULL

#define sys_io_uring_setup 425
static long syz_io_uring_setup(volatile long a0, volatile long a1,
                               volatile long a2, volatile long a3,
                               volatile long a4, volatile long a5)
{
  uint32_t entries = (uint32_t)a0;
  struct io_uring_params* setup_params = (struct io_uring_params*)a1;
  void* vma1 = (void*)a2;
  void* vma2 = (void*)a3;
  void** ring_ptr_out = (void**)a4;
  void** sqes_ptr_out = (void**)a5;
  uint32_t fd_io_uring = syscall(sys_io_uring_setup, entries, setup_params);
  uint32_t sq_ring_sz =
      setup_params->sq_off.array + setup_params->sq_entries * sizeof(uint32_t);
  uint32_t cq_ring_sz = setup_params->cq_off.cqes +
                        setup_params->cq_entries * SIZEOF_IO_URING_CQE;
  uint32_t ring_sz = sq_ring_sz > cq_ring_sz ? sq_ring_sz : cq_ring_sz;
  *ring_ptr_out = mmap(vma1, ring_sz, PROT_READ | PROT_WRITE,
                       MAP_SHARED | MAP_POPULATE | MAP_FIXED, fd_io_uring,
                       IORING_OFF_SQ_RING);
  uint32_t sqes_sz = setup_params->sq_entries * SIZEOF_IO_URING_SQE;
  *sqes_ptr_out =
      mmap(vma2, sqes_sz, PROT_READ | PROT_WRITE,
           MAP_SHARED | MAP_POPULATE | MAP_FIXED, fd_io_uring, IORING_OFF_SQES);
  return fd_io_uring;
}

static long syz_io_uring_submit(volatile long a0, volatile long a1,
                                volatile long a2, volatile long a3)
{
  char* ring_ptr = (char*)a0;
  char* sqes_ptr = (char*)a1;
  char* sqe = (char*)a2;
  uint32_t sqes_index = (uint32_t)a3;
  uint32_t sq_ring_entries = *(uint32_t*)(ring_ptr + SQ_RING_ENTRIES_OFFSET);
  uint32_t cq_ring_entries = *(uint32_t*)(ring_ptr + CQ_RING_ENTRIES_OFFSET);
  uint32_t sq_array_off =
      (CQ_CQES_OFFSET + cq_ring_entries * SIZEOF_IO_URING_CQE + 63) & ~63;
  if (sq_ring_entries)
    sqes_index %= sq_ring_entries;
  char* sqe_dest = sqes_ptr + sqes_index * SIZEOF_IO_URING_SQE;
  memcpy(sqe_dest, sqe, SIZEOF_IO_URING_SQE);
  uint32_t sq_ring_mask = *(uint32_t*)(ring_ptr + SQ_RING_MASK_OFFSET);
  uint32_t* sq_tail_ptr = (uint32_t*)(ring_ptr + SQ_TAIL_OFFSET);
  uint32_t sq_tail = *sq_tail_ptr & sq_ring_mask;
  uint32_t sq_tail_next = *sq_tail_ptr + 1;
  uint32_t* sq_array = (uint32_t*)(ring_ptr + sq_array_off);
  *(sq_array + sq_tail) = sqes_index;
  __atomic_store_n(sq_tail_ptr, sq_tail_next, __ATOMIC_RELEASE);
  return 0;
}

struct fs_image_segment {
  void* data;
  uintptr_t size;
  uintptr_t offset;
};

#define IMAGE_MAX_SEGMENTS 4096
#define IMAGE_MAX_SIZE (129 << 20)

#define sys_memfd_create 319

static unsigned long fs_image_segment_check(unsigned long size,
                                            unsigned long nsegs,
                                            struct fs_image_segment* segs)
{
  if (nsegs > IMAGE_MAX_SEGMENTS)
    nsegs = IMAGE_MAX_SEGMENTS;
  for (size_t i = 0; i < nsegs; i++) {
    if (segs[i].size > IMAGE_MAX_SIZE)
      segs[i].size = IMAGE_MAX_SIZE;
    segs[i].offset %= IMAGE_MAX_SIZE;
    if (segs[i].offset > IMAGE_MAX_SIZE - segs[i].size)
      segs[i].offset = IMAGE_MAX_SIZE - segs[i].size;
    if (size < segs[i].offset + segs[i].offset)
      size = segs[i].offset + segs[i].offset;
  }
  if (size > IMAGE_MAX_SIZE)
    size = IMAGE_MAX_SIZE;
  return size;
}
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;
  size = fs_image_segment_check(size, nsegs, segs);
  int memfd = syscall(sys_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)
{
  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;
  }

error_clear_loop:
  if (need_loop_device) {
    ioctl(loopfd, LOOP_CLR_FD, 0);
    close(loopfd);
    close(memfd);
  }
  errno = err;
  return res;
}

#ifndef __NR_io_uring_enter
#define __NR_io_uring_enter 426
#endif

uint64_t r[3] = {0xffffffffffffffff, 0x0, 0x0};

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);
  install_segv_handler();
  intptr_t res = 0;
  NONFAILING(*(uint32_t*)0x20000184 = 0);
  NONFAILING(*(uint32_t*)0x20000188 = 0);
  NONFAILING(*(uint32_t*)0x2000018c = 0);
  NONFAILING(*(uint32_t*)0x20000190 = 0);
  NONFAILING(*(uint32_t*)0x20000198 = -1);
  NONFAILING(memset((void*)0x2000019c, 0, 12));
  res = -1;
  NONFAILING(res = syz_io_uring_setup(0x3ede, 0x20000180, 0x20002000,
                                      0x20ffd000, 0x20000200, 0x20000140));
  if (res != -1) {
    r[0] = res;
    NONFAILING(r[1] = *(uint64_t*)0x20000200);
    NONFAILING(r[2] = *(uint64_t*)0x20000140);
  }
  NONFAILING(*(uint64_t*)0x20005ac0 = 0x20002980);
  NONFAILING(memcpy(
      (void*)0x20002980,
      "\x09\xed\x29\x6e\x15\xdf\x5b\xdd\x5f\x81\x2e\xf4\x6e\xa8\xd6\xf1\x85\x49"
      "\x2f\x8c\x47\x6b\x96\x0a\x1a\x2e\x54\x19\x54\x20\xd6\xcb\x82\x02\x3c\xb4"
      "\xf0\xc4\xe3\x21\x1a\xcc\x11\xc9\x2f\x46\x66\x3d\x23\x73\x52\xa5\x45\x19"
      "\xda\xd7\x75\x59\x7e\x5b\x24\x7f\xef\x41\xcc\xf8\xea\x43\xa6\x13\x7d\x0f"
      "\xf5\x0f\xff\x1f\xb9\x98\xfc\x45\x09\xe2\x0b\xc7\xeb\xe4\x67\xf3\xdb\xa8"
      "\xe3\xfb\x72\x02\xcd\x43\x86\x8b\xd3\x70\xdd\x23\x44\x87\x44\xd0\xbb\xa3"
      "\x75\xa8\x33\x84\x78\x35\xb4\xda\x40\xf0\xe3\x07\x19\x09\x71\xa7\xd1\x50"
      "\x1e\xdf\x04\x58\x22\x71\x08\x28\xfb\x48\x90\xa7\xc0\xd9\x14\x31\x1e\x44"
      "\xf0\xab\xbd\x83\x5d\xc0\x35\xf5\x70\xfd\x8a\x50\x23\xdb\xbd\xf9\xff\x3b"
      "\x0e\xd1\xc3\x27\xcd\x05\x2f\xbf\xd4\x73\x29\xe1\x63\xfd\x4b\xdf\xa4\xd7"
      "\x99\xb1\xc2\x12\x94\x4e\x5a\x3b\x7a\x90\xb5\xc6\xa6\x63\x6a\x70\x03\xbb"
      "\x09\x6f\x7d\x84\xd4\xa6\x90\x5a\x9b\xd0\x5f\x56\x3a\x7a\x12\x75\xe7\x82"
      "\xc4\xb6\x1a\x42\xa3\x28\x28\x2c\x4a\x31\xba\x5b\xc9\x33\x2f\xd4\xed\x0a"
      "\xee\x64\x78\x6b\xa0\x5d\xbb\x51\xd6\xd9\xa2\x0f\x37\x19\x0f\x5d\x8a\x15"
      "\xde\x1d\x71\xb1\x0a\x42\xae\x0d\x50\xff\x0d\xbb\x59\xdc\x0d\x15\x32\x59"
      "\xeb\xfb\x96\x03\xd4\x40\xac\xfc\xa6\x6e\xec\x3a\x93\xc2\xa7\x02\xab\x13"
      "\x27\x3d\xd2\x67\xe5\x71\xe6\x27\x24\x62\x46\x6a\x6c\x81\x32\x3e\xb7\xc5"
      "\x6f\x4c\x9e\x9d\x08\xf9\xa2\xb1\x45\x09\x4d\xca\xeb\x9b\x06\x76\xc0\xaa"
      "\xf7\x35\x2b\x9f\xae\x9e\xb5\x78\xa2\x56\x1e\x2c\x00\x8d\xd1\xe1\xd2\x4a"
      "\xe5\xda\x6e\x07\xdb\xab\x33\xb3\xe0\xf3\x84\xf1\xae\x16\xf3\x29\xc0\xd0"
      "\x55\x08\x50\xb3\x34\x3d\xa8\x65\xb7\x1c\xd9\xb3\x20\x86\xc0\x46\xb7\x16"
      "\x06\x62\x83\xf7\x6b\x9d\x03\x72\xc8\x16\x7f\x79\x63\x9e\xfe\x62\x14\x6b"
      "\x6f\x85\x12\x42\xfb\x5b\xd3\x81\x19\x08\xd1\x47\x63\x09\xd7\x0f\x35\x66"
      "\xab\xd1\xaf\x21\xd4\xae\x54\x39\xfd\x5a\x01\x54\x52\x34\xa9\x6a\x6d\x47"
      "\xb5\x67\x27\xf5\xc7\xdc\xd6\x22\x36\x38\xb9\x0f\xd7\xbd\x01\xe3\x5e\x3c"
      "\xa4\x40\x9f\xb4\x52\xac\x24\xbe\x42\x98\xad\xb1\x6f\x7b\x8e\x8e\x15\x26"
      "\xe5\x0b\xe7\xbe\xde\x33\x99\x09\x7e\x1d\xde\x5b\x25\x16\x8a\xf0\x84\x87"
      "\x29\x54\x49\x9e\xfd\x27\x45\x26\xcc\x94\xa7\xb5\x65\x44\x95\x3b\xd9\xa5"
      "\x52\x96\x3c\x9d\x28\x31\xde\xc3",
      512));
  NONFAILING(*(uint64_t*)0x20005ac8 = 0x200);
  NONFAILING(*(uint64_t*)0x20005ad0 = 0);
  NONFAILING(syz_mount_image(0, 0, 0, 1, 0x20005ac0, 0, 0));
  NONFAILING(*(uint8_t*)0x20000000 = 0x16);
  NONFAILING(*(uint8_t*)0x20000001 = 0);
  NONFAILING(*(uint16_t*)0x20000002 = 0);
  NONFAILING(*(uint32_t*)0x20000004 = 5);
  NONFAILING(*(uint64_t*)0x20000008 = 0);
  NONFAILING(*(uint64_t*)0x20000010 = 0x20000040);
  NONFAILING(*(uint32_t*)0x20000018 = 0x12);
  NONFAILING(*(uint32_t*)0x2000001c = 0);
  NONFAILING(*(uint64_t*)0x20000020 = 0);
  NONFAILING(*(uint16_t*)0x20000028 = 0);
  NONFAILING(*(uint16_t*)0x2000002a = 0);
  NONFAILING(memset((void*)0x2000002c, 0, 20));
  NONFAILING(syz_io_uring_submit(r[1], r[2], 0x20000000, 0));
  NONFAILING(*(uint64_t*)0x200027c0 = 0);
  NONFAILING(*(uint32_t*)0x200027c8 = 0);
  NONFAILING(*(uint64_t*)0x200027d0 = 0x20002740);
  NONFAILING(*(uint64_t*)0x20002740 = 0x20001540);
  NONFAILING(memcpy(
      (void*)0x20001540,
      "\x72\x7a\x25\x62\x8a\x78\xe7\xe6\x1b\x36\x6f\x75\x01\x55\x99\x3d\x84\x9a"
      "\x0a\x60\x69\x05\x09\x7b\x8d\x0d\xfa\x35\xc0\x96\x8a\xa7\x11\xd1\x94\xc6"
      "\x4a\xef\xf9\x83\xb9\x1e\x4a\x37\xf5\x94\x7a\xb8\xea\xf8\x29\xb2\x02\xb4"
      "\xf4\x6f\x2a\xf9\x27\x10\xb2\x4f\xf2\x9b\xcb\x98\x50\x00\x6c\x20\x9c\x08"
      "\x28\x83\x79\x96\x20\xad\xc8\x93\x3f\x3b\x76\xf0\x3a\x2b\xad\x17\xdd\x51"
      "\xc2\x90\x85\x52\x71\x1e\x27\x74\x86\xe6\x75\xe9\xb2\xe9\x14\x12\x27\x9c"
      "\xf6\x51\x47\xac\xed\xe0\x95\x62\xe7\x98\xbb\xd2\x69\x51\x97\x90\x02\x47"
      "\x3c\x50\xd0\xe2\xd8\xfc\xbf\x0a\xce\xae\x8b\xdc\x3f\x3b\xa0\x97\xf7\x6e"
      "\xe1\x03\x94\xdb\x1d\x16\x7d\xdf\x8d\x7f\x17\xbc\x52\x4d\xb4\xa9\x96\xc9"
      "\x09\x08\xfa\xb7\xa1\xe0\xb3\x02\x80\xc1\x12\x60\x2a\x7d\x1f\xed\xf7\x49"
      "\x71\x45\xb8\xb8\x06\x19\x2a\x3d\xe2\x4e\x76\x79\x90\xc5\x43\x2d\xc2\x5e"
      "\x8f\xf7\x12\x7b\x61\x12\x5f\x83\x22\x64\xa9\x33\x94\x38\x37\x38\xde\x26"
      "\x14\xff\x9d\x63\x76\x15\x9d\x4c\xb0\xae\x9b\x80\x78\xdd\x98\x3b\x71\x50"
      "\x97\x16\x8c\x65\xfd\x3f\x74\xc6\x34\x74\xfb\x6c\xb4\x19\x56\x67\x22\x26"
      "\xc7\x8c\xc4\x5f\x02\xfc\x2c\x7e\xdc\x84\xc9\x88\xc5\x25\x7f\xbe\x81\x29"
      "\x02\x93\x54\x07\x34\xd9\x9e\xec\xb6\xb5\x05\x74\x7f\xfc\x8a\xfb\xc8\x85"
      "\x34\x06\x70\x6e\xa8\xdc\xa7\x91\x4a\xba\xf9\x89\xbc\xa7\x52\xeb\x6d\x71"
      "\x9b\x35\xf0\x7d\x89\x94\xfc\x27\xd7\x1c\x3b\x8c\x21\x2c\x9e\xc1\x16\x5f"
      "\x61\xed\x3b\x7d\x94\x2b\xf2\x40\xfb\x02\x58\x73\x07\xfe\xcb\xac\x51\xdd"
      "\x3f\xe9\x77\xaf\x20\x41\xa4\x09\x90\x01\x95\x16\xd1\xd5\x51\x49\x86\x05"
      "\xc3\x7f\x72\xd1\xb4\x72\x11\xe0\xbe\x7c\x43\x9d\xc5\x45\x5e\x96\x69\x79"
      "\x0d\x32\xa9\xe3\x58\xc9\xa3\xa1\x56\xc7\xd9\xd8\x21\x00\x28\x88\x90\x48"
      "\x97\xf7\x61\xe7\x1b\x97\x7c\x88\x8d\xb2\xa6\x7e\x2c\x7e\x62\xa7\x47\x79"
      "\x9c\xa5\x4d\xaa\xc7\x44\xef\x83\x4f\x99\x93\xe5\x9d\xd1\xb6\x85\x3b\x90"
      "\xd3\x4c\x08\x54\x28\xe3\xd4\xdf\x37\x4a\x1d\xe8\xb0\x29\x74\x8e\xe5\xf7"
      "\xab\xcb\xd3\x71\x3a\x5a\xb9\x26\xd5\x3e\x6a\x71\x22\xf4\x6c\x8e\xf9\x35"
      "\x62\xb2\x65\xee\xae\xdb\x41\x59\x31\x56\x8d\xbb\xdc\x23\xbc\xd2\xa6\xf5"
      "\xe2\x04\x97\xce\x2c\x9b\xb4\x49\x5e\x80\xde\xdf\xa6\xd7\xe8\xf5\x61\x0f"
      "\xc0\x36\x8a\x19\x78\xd9\x3f\x2d\x72\xe0\x55\xed\xa0\xdd\x46\x80\xcf\xd2"
      "\x16\xcd\xd3\x94\x1b\xae\x02\x29\x26\xe2\x54\x60\x8a\x47\x8b\xe4\xf6\xb3"
      "\xab\x79\x8b\x9f\xdc\xfa\x92\xb1\x5e\xf7\xcc\x92\x89\x00\xf5\xf0\x19\xbe"
      "\xd1\xe9\x05\x51\x18\x06\x84\x66\x82\x7f\xbb\xed\x23\x97\x16\x19\x24\x77"
      "\x2b\xe1\xfa\x5b\x8b\x15\x54\xd7\xe0\xe0\x51\xc1\x0e\x23\x86\x7e\xce\x44"
      "\xdc\x79\x4f\x25\x6d\x2d\x75\x4b\x77\xe3\xd3\x51\xe2\xca\xed\x2d\x61\x56"
      "\x24\x39\xc4\x5a\x1f\xe7\x24\x21\x96\x3d\x46\x15\x9c\xa0\x76\x3b\xdb\x5b"
      "\xc4\x13\x12\xbd\xb5\x32\x67\x3f\x1a\x23\xb1\x52\x42\x8d\x8d\xbe\xc8\x18"
      "\xb5\xb4\xb1\x03\xc7\x24\x9c\x43\xc2\xcd\x54\x59\x7c\xcd\x48\x4b\xf9\x4f"
      "\x99\x42\x98\x8a\x92\x2d\x7f\x6c\x97\xe9\xa8\x29\xbb\xcf\x02\xa6\x14\x82"
      "\x54\x10\x0c\xdc\xe0\xc4\x9a\x01\x70\x9d\x9b\x2c\xea\x55\x76\x22\x23\x28"
      "\xa3\x63\x05\x5a\x32\x7d\x3e\xdb\xcd\xe8\xf1\x5f\xe6\x14\x3a\xf7\xd5\x62"
      "\x6e\x7b\x5a\x92\x64\x8e\x44\xa3\xac\x51\xb7\xd8\x85\xa7\xc2\xf3\xd7\x44"
      "\x8a\xb8\x3f\x30\x60\xf1\xca\xee\x17\xe2\xf1\x29\xc4\x6f\xbf\x70\xff\xd9"
      "\xe9\x23\xd4\x6f\x84\xae\x8b\x7f\xe9\x69\xf3\xf4\x49\xe8\xe8\xa1\x8f\x89"
      "\xd6\x14\x12\x41\xf8\x9c\x7a\xa2\x56\x5e\x1a\x6a\x29\xc7\x32\x59\x96\x4c"
      "\x9a\xf9\x0f\xf8\x1c\x49\x0d\xab\x73\x45\x56\xe8\x41\xe3\x57\x9d\xc2\xed"
      "\xf7\x55\x37\xce\xdd\x35\xd3\x70\x33\xc9\xe9\x3c\x1e\xe1\x92\x27\x64\x6c"
      "\x06\xb7\x0a\x81\x98\xa1\xd1\x91\xe4\x1c\xa1\xf4\xd0\x53\x04\xb0\xfc\x14"
      "\x58\x98\x3e\x5f\x55\xf6\xc8\x3f\x2f\xab\x3e\x02\x06\x19\x4e\xd2\x83\x89"
      "\x7b\xfb\xc3\xb9\xfd\x18\xae\x33\x53\xf4\x09\xf8\x0d\xd5\xe4\x37\xd2\x21"
      "\x07\x00\x42\xdb\xee\xc9\xce\x9e\xe3\xaf\x1c\x5f\xc3\x7b\x1b\x0c\x0e\x1f"
      "\x18\x83\xec\x0f\xce\x0b\x47\x71\xda\xb9\x2b\x87\x94\x4d\x88\x33\x0b\x16"
      "\x52\xc4\x3f\x8d\xd0\xed\x8f\xe9\x50\x3a\x04\xd8\x2d\xb5\x46\xb8\x4b\xdd"
      "\x77\xec\x8f\x95\x45\xf0\xfd\x9a\x2c\x4b\x18\xe8\xc6\xe7\x12\x32\x7e\x22"
      "\xe7\xb8\x8b\xe5\x11\xa2\xf2\xb2\x9a\xec\x4a\xf6\xa2\x5f\xac\x5d\x26\x2b"
      "\x95\x35\x08\x61\xdf\x49\xf8\xf8\xc3\x9c\x72\x36\x62\xff\x92\x90\xf7\x92"
      "\xc1\x79\x03\xc4\x43\x34\x6a\x86\x8e\x6c\x2c\x3d\x9a\x4f\xcf\xe6\x8e\xde"
      "\x8a\x54\xcc\x18\x6b\xe6\xaf\x8d\x6f\x2c\x95\x5e\x5b\x8d\xce\x12\x19\x86"
      "\xb4\xef\x5d\x38\xbc\x67\x55\x21\x80\x41\x04\x25\xfa\xc7\x41\x52\x3c\x11"
      "\x84\x63\x69\x0e\x5e\x30\x29\xa8\xc6\xef\x31\x3c\x56\xc5\x36\xfd\x38\x6d"
      "\xb3\x4f\x73\x6f\x37\x7a\x6a\x3e\x3e\x7a\x3a\x6d\x7a\xb8\x9b\xa7\xd2\x06"
      "\x78\x03\x47\x29\xab\xc4\x8a\xba\x59\x8f\x43\xd9\xbe\xcb\x41\xb5\xb0\xbf"
      "\xc3\x19\xb5\x65\x37\xe9\x61\x3e\x79\xb9\x86\x45\x2c\x62\x2a\x5a\x6d\x7c"
      "\x89\x3c\x41\xcb\x78\x94\x4d\xf6\xd4\x0e\xc0\xfe\x7e\x55\xd0\xda\xad\x6a"
      "\x81\x85\xb2\xa1\xdd\x18\x1a\x88\x5f\x3a\x18\x4a\xa8\xb5\x72\x99\x75\xc1"
      "\x32\x64\xd3\x65\xf8\x0f\x6e\x78\xc9\xc4\x8f\xfc\x6d\xed\x48\xc8\xcc\x34"
      "\x13\x93\x85\x9a\x03\xa8\xfd\xf1\xa3\x5e\x8b\xfe\x31\x56\x68\x8f\xa9\x13"
      "\x49\x5f\xee\x33\xa5\x91\x4f\xde\x10\x16\x67\x1f\x7f\xe0\x52\x7d\xdb\xb4"
      "\xe6\xc0\x28\xef\xd0\x63\xe6\x28\xbb\xeb\xc7\x8d\xa1\x3d\x21\x8b\x42\x31"
      "\x19\xa3\x44\x7e\xf6\xd2\xfa\xad\x43\x68\xed\x75\x47\x0f\x09\xb4\x1c\x62"
      "\x8f\x8e\x6b\xaf\x58\xba\xb4\x22\xd6\x85\xb6\x8c\xb5\x27\xeb\x14\x02\x59"
      "\xb4\x93\xd5\x83\x47\x57\x1e\xbf\x02\xb3\xd2\x88\xbc\xc6\x80\x32\xd9\x62"
      "\x14\x0e\x4a\x21\x3d\x75\x41\x26\xb6\xb1\x34\x84\xaf\xea\x6e\x68\x6a\xae"
      "\xd6\xb4\x88\x24\x8c\xf8\x65\xa7\xbc\xcc\x44\xa3\x6a\xa8\x89\x00\x21\x73"
      "\xd0\x7a\xec\x52\x4c\x5a\x6d\x45\x44\x64\x9f\x9b\x51\x9f\xb8\xb1\x57\x9b"
      "\x8c\x7c\x11\x60\xa1\x2a\x48\xbc\x21\x2c\x31\x15\xbe\xc5\x26\xba\xe9\xfb"
      "\x98\x9c\xf5\x8f\xe5\x38\x52\x70\x34\x49\x2a\x59\x68\x2c\xfd\x93\x3b\xc5"
      "\x64\x3b\x3e\xac\x82\xa9\x5a\x80\xd2\x4a\xdf\x08\x43\x5d\x5a\x3e\xa3\x22"
      "\xf6\xe7\x1f\xe0\x9b\x5b\x36\xa2\x5b\x80\x4f\x6a\x5b\x5b\xf7\x8d\x4d\xed"
      "\x24\xbb\x16\xf4\xcb\x08\x8a\x1e\xfc\x71\x25\x22\x27\x0f\xa0\xdf\x83\x50"
      "\xce\x48\x32\x65\x2e\xbc\xa1\x16\xf0\x00\x9f\x2e\x30\x96\xb3\x78\x6f\xe0"
      "\x69\x9e\xc5\xf7\xaf\x27\x8e\xd3\xfc\x01\xa2\x9f\x72\xe4\x97\x70\xb6\xbd"
      "\x86\x72\x53\x78\x0b\x2d\x36\xac\xab\x9d\xb1\x94\xa0\xe3\x1a\x42\x99\x50"
      "\x95\x89\xe7\x39\xb5\x31\xe7\xdd\x38\xcb\x5f\x8e\x0d\xcf\x8e\xe4\x18\x10"
      "\x54\x11\xd0\xfc\x53\x60\xdd\xb9\x4d\x15\xba\x52\x88\x05\xf8\x34\x1f\xd7"
      "\xc0\x64\xd4\x69\x48\x96\x36\xed\x08\x3c\x55\xe1\x9c\x09\x51\xf5\xb4\xbb"
      "\x01\x92\x42\x04\xcd\xd9\x5c\x74\x0d\x65\x78\x4d\x90\x49\x74\x4c\x5b\xc6"
      "\x23\xd7\xfc\x40\x5a\x62\x0a\x04\x5d\x54\x58\x35\xd4\x1b\x3d\x3a\xd0\x80"
      "\x0b\x5c\x61\x70\xa0\xd2\x1a\x2f\x57\x11\x04\xe3\xf7\xd9\xd8\x72\x09\x69"
      "\x49\x19\x6b\x93\x17\x5e\x89\xaf\x5a\xff\xd6\x3b\xf6\x61\x15\x54\x64\xfb"
      "\xe5\xc2\x21\x1b\xe8\x3d\x9d\x3b\x7a\x18\xa3\xb0\x0a\xbc\x69\x8b\xdd\x91"
      "\xa1\x98\x89\x08\xc9\x8b\xee\x41\xc6\x20\x82\x4d\xd0\xdf\x48\xc6\x65\xb9"
      "\xfa\x90\xe6\xe4\x7d\x43\xd1\x7d\x70\x9b\xd3\x0f\x5b\x64\x6c\xac\x6b\xb9"
      "\x6f\xcd\xca\xbc\xd6\x50\x1d\xf2\x20\x6d\x9f\x93\xed\x03\xba\xce\xcb\x2f"
      "\x08\xb7\x2c\x62\x36\x50\x62\x46\xc1\x25\xc5\xce\x78\x9e\x25\x6e\x38\x4c"
      "\xa4\x0e\x0a\x28\xd7\x75\x3f\xec\x88\xe3\xcc\xa0\xbf\x62\x47\xe6\xfb\xea"
      "\x62\xd1\x1f\xe2\x57\x4c\x3d\xdc\x8a\xb9\x2d\x69\x7e\x2b\xdc\xb3\xb0\x10"
      "\x04\x03\xb3\x5a\x81\x14\x76\x89\x82\x06\x87\x58\x08\x32\x19\x52\x85\xf7"
      "\x5b\xb3\xd8\xf5\xc3\x00\x83\x5d\xe6\x5a\x76\xad\x8c\x91\xf2\xe0\x34\x86"
      "\xf3\x86\x88\x1e\xd5\x5f\xf9\xc1\x4e\x25\x81\x1a\x49\xcd\xe5\x0e\xa0\xfb"
      "\xdd\x1c\xc9\x64\xc2\x60\x68\x79\xec\x9e\x7d\xb1\x50\x9e\x41\x8b\x3c\xf7"
      "\x86\x03\x9a\x12\xa9\xaa\x23\x4c\xba\xae\xf1\xe8\x19\x5e\x0e\xb8\x39\x45"
      "\xaf\x41\xee\xdf\xc2\xc4\xce\xfc\x9f\x2c\x8f\xa0\x85\x72\xd8\x18\x9a\x33"
      "\x0d\xca\x2d\x4e\xc4\x4e\xe6\xe8\xe2\x24\xe3\x74\x74\x94\x71\x62\x88\x31"
      "\x2d\xbe\x8b\x1f\x9f\x22\x20\xcd\x85\x74\xc3\x5c\x59\x8a\xcf\xcc\xe4\x5c"
      "\xac\x82\xbb\xe7\x75\xf3\xa3\xa4\x03\x1e\x6e\x53\x7a\xb7\xbf\x54\xde\xa6"
      "\x00\x1f\xb7\x57\x4a\xbd\x8c\x78\x76\x5d\xaa\x30\xcf\x59\x01\x58\x04\xd5"
      "\xbe\xca\x61\xb7\x5d\x2a\x88\xe7\xeb\x5b\x7d\x92\x0f\xa3\x8a\x48\xb6\xb8"
      "\x07\xd8\xff\xb3\x32\x6a\x58\x27\xf0\xd5\xa3\x77\x08\x2c\x0f\xfe\x64\x5b"
      "\xf9\x13\xeb\x2a\xe4\x5e\x77\xf4\x16\x88\x01\xaa\x21\x5e\x6b\x6d\x2e\x0b"
      "\xa7\x8a\xbc\xd8\x57\x35\x81\x40\xa2\x3c\x7f\xc3\xa8\x30\xdc\xfe\x0f\xca"
      "\x8f\x55\x6b\x34\x1b\xff\xeb\x9b\xa9\x97\x1b\x2e\xdb\x24\x50\x9e\x0c\x77"
      "\x0f\xe6\xb2\x5f\x83\x03\xc5\xdc\x70\x6e\x17\xd0\xf4\xab\x14\x1e\x27\xe5"
      "\x5b\x0f\x16\x57\x25\xfe\x18\xeb\x0f\x23\x3d\x6a\xaa\x45\xf6\xbe\xf7\x20"
      "\x9c\xd6\x9c\xe3\x86\x28\x4c\x05\xf5\xad\x39\xbe\x06\xeb\xb8\x0f\xc5\x95"
      "\x35\x2f\xcf\xd9\x1d\x6b\x04\x34\x44\xff\xea\xa2\x5c\x03\x23\xa4\x17\x4c"
      "\xb8\x72\xa3\x31\xa1\x4c\xa6\x49\x8d\x3d\x8f\x54\xfe\x87\x72\x01\x97\xc4"
      "\xea\x20\x22\xe8\x0d\x4e\x6d\xd0\x93\x5c\xe0\xb8\x3c\xe3\xb1\x55\x6f\x2c"
      "\x79\x77\xec\x5b\xe0\xe8\xa0\x4d\x54\xdf\x1c\x01\xfb\xa4\xd8\x48\xfd\xb9"
      "\xf9\xbf\x1f\x35\xfa\xe1\x01\x3c\x2c\x71\xc2\x3a\x30\xc4\xef\x9c\x8e\x9d"
      "\xa6\x40\xd1\xb9\xe7\x33\x35\x05\x3d\x18\xf1\x5f\xe4\x91\x2b\x77\xf8\x19"
      "\xb7\xe8\xaa\x5d\x73\x10\x8c\x1e\xd9\xca\xb3\x46\xdd\xb6\x8c\x30\xca\xa2"
      "\x2a\x1e\x04\x16\xdc\x65\x9a\x55\x04\x61\x5a\xf5\xc4\xc6\xac\x7b\x37\xa2"
      "\xa6\x3f\x67\x61\xd8\xd5\xef\x29\xcb\x6d\x7b\x55\xd1\x88\x3a\x2a\x47\xf8"
      "\x3c\x02\x97\x73\x2c\x8f\xda\xee\x1a\xe1\x7f\xf4\x1a\xa2\x43\xab\x67\x34"
      "\xf9\x1c\x4c\x6d\xab\x3f\x25\x27\x14\xca\x06\x07\xf5\x7a\x54\x8f\x15\x59"
      "\x42\xe1\x47\x00\xf1\x3f\x44\x76\x63\x57\x48\x14\x51\x8a\xfb\xa6\xe1\x27"
      "\xef\x2a\x69\x30\x54\x52\xf3\x71\x06\x7f\xab\x3b\x9d\x1f\x87\x20\x0d\x4a"
      "\x6e\x89\x2c\x1d\x35\xdc\x26\x9e\x9c\x3d\x5a\x48\x6f\xe1\x78\xb4\x6e\xcd"
      "\x34\x36\x0d\x25\xb9\x68\x84\x46\x8b\x93\xeb\xf1\x98\x9c\x8f\x26\xce\x10"
      "\x5c\x02\x71\xbf\xe8\xfd\x42\x9c\x97\xe0\xe8\xf4\x0f\xef\xa6\x10\x5e\xa4"
      "\xb9\x8d\xd6\x3b\x79\x2a\x8a\xa9\x7e\xc0\x9c\x12\x35\xea\x08\xd7\x7d\x36"
      "\x02\x1b\x21\xd0\x7a\x99\x96\x99\xdf\x60\xb0\xc8\xe2\xd3\x3e\xc5\x02\x87"
      "\xb5\x69\xed\xc7\x9d\x6e\x75\x2a\xb5\x86\x5b\xf5\xdb\xf9\x1d\xc5\x08\x9a"
      "\xa8\x66\x33\xe5\x5e\x9c\xe6\x4b\x80\x43\xc7\x68\x68\x49\x3e\xca\xd7\x98"
      "\x46\xb2\xea\x61\xef\xc2\xa2\x01\x92\x43\xbe\x76\x5d\xa0\xa1\xd2\x71\xee"
      "\x3c\xc7\x15\x57\x15\x3a\xfd\xf9\x83\x65\x36\x74\xfd\xc0\x10\x0b\x04\x51"
      "\x7f\xb0\x8a\x0d\x43\xe8\x8a\x50\xf9\x0c\xb7\x8d\x92\x87\xb3\x4f\xe6\x4b"
      "\x9d\x58\x6f\x2c\xb3\x2a\xbe\x31\x5f\xbe\xf5\xb0\xca\x28\xd7\x8d\x70\xaf"
      "\x1e\xea\x9d\x40\x20\x05\xc7\xa6\x47\x9a\x43\xf8\x87\x80\x13\xd1\xfa\x8d"
      "\x69\xf3\xad\x6f\x79\xf7\x9e\x7a\x98\x27\x80\x18\x9f\xc5\xd2\x56\x32\xb1"
      "\xba\x9d\x41\x2d\x3c\xc5\x92\x00\xe3\xce\xbe\x1a\x10\x4f\xed\x50\x3d\x2d"
      "\x10\x3a\x4e\xdf\xff\x0d\xa8\x5c\x7e\x03\x70\x6a\xdb\xa4\x4f\x88\x49\x6b"
      "\x7e\x85\x3f\x85\x12\x2d\xc7\x57\x3b\x91\x0c\xca\x49\x02\xd3\x2c\xb9\xd0"
      "\xe9\xef\x0d\xd6\x72\x8d\xe9\x62\x99\x60\x45\x9a\x5e\x7b\x47\x04\xd1\xaa"
      "\x25\xba\xab\x05\x9a\x8c\xed\xc3\x21\x93\x3a\xa3\x58\xf8\xdb\xc2\x4e\x2a"
      "\x13\x23\x81\x29\xfb\xed\x0b\x6d\xd5\x9f\xc7\xa6\xa6\xf7\x22\x4c\x42\x2e"
      "\xd5\x95\x21\x11\x3f\x5e\x3b\x24\xdf\x8c\x58\xd6\x80\x4d\x9f\x7f\xb7\xc5"
      "\xed\x4e\x8d\xab\x16\x27\x86\xa4\x5a\x2d\x39\x7a\x1b\x91\x24\xaa\xd3\x3b"
      "\x30\x0c\xcf\xed\x65\x1d\x88\xba\x9f\x0a\xef\x97\x90\x80\xdb\x0c\x7b\xdf"
      "\x17\x7d\xe2\xd4\xf0\x79\xb5\xed\x4a\x14\x03\x2a\x07\xa8\x97\x80\x88\xae"
      "\x20\xde\xbe\xcf\x24\xf5\x0f\x51\x1e\xaf\x4f\xf2\x91\xb0\xeb\xea\x1c\xf0"
      "\xf3\xa5\x9e\xd4\x90\xa7\x0f\x3e\x8c\x63\x99\xf7\xc5\xb1\x4c\xb2\xbd\xae"
      "\x31\xe8\x88\xc9\xc9\x32\x67\xe4\xef\xae\xcd\xee\x5c\x9c\xf1\x9b\xe1\xbf"
      "\xc0\xa5\xb5\x5b\x03\x8e\x9f\x04\x97\xf3\x1d\x3f\xb4\xfa\xe1\x32\xde\x86"
      "\xe2\x87\xab\x43\xbd\x60\xb5\x57\xad\x2b\xaa\x62\xc9\xaa\x37\xa3\xdb\xae"
      "\xbc\xcc\x06\xbe\xff\x9c\x22\x00\x8b\x3e\x7b\x1b\x70\x65\x5a\x77\xb1\xc6"
      "\x26\x2d\x57\xdc\xa8\xca\x34\xd1\x96",
      2817));
  NONFAILING(*(uint64_t*)0x20002748 = 0xb01);
  NONFAILING(*(uint64_t*)0x200027d8 = 1);
  NONFAILING(*(uint64_t*)0x200027e0 = 0);
  NONFAILING(*(uint64_t*)0x200027e8 = 0);
  NONFAILING(*(uint32_t*)0x200027f0 = 0);
  NONFAILING(*(uint32_t*)0x200027f8 = 0);
  syscall(__NR_sendmmsg, -1, 0x200027c0ul, 1ul, 0ul);
  syscall(__NR_io_uring_enter, r[0], 0x2ff, 0, 0ul, 0ul, 0ul);
  return 0;
}