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

#define _GNU_SOURCE

#include <endian.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <unistd.h>

uint64_t r[1] = {0xffffffffffffffff};

int main(void)
{
  syscall(__NR_mmap, 0x1ffff000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul);
  syscall(__NR_mmap, 0x20000000ul, 0x1000000ul, 7ul, 0x32ul, -1, 0ul);
  syscall(__NR_mmap, 0x21000000ul, 0x1000ul, 0ul, 0x32ul, -1, 0ul);
  intptr_t res = 0;
  memcpy((void*)0x200000c0, "/dev/uinput\000", 12);
  res = syscall(__NR_openat, 0xffffffffffffff9cul, 0x200000c0ul, 0ul, 0ul);
  if (res != -1)
    r[0] = res;
  *(uint16_t*)0x20000340 = 0x2f;
  *(uint32_t*)0x20000344 = 0;
  *(uint32_t*)0x20000348 = 0xfffffffc;
  *(uint32_t*)0x2000034c = 0x19f4029c;
  *(uint32_t*)0x20000350 = 0;
  *(uint32_t*)0x20000354 = 8;
  *(uint32_t*)0x20000358 = 0x7ffb;
  syscall(__NR_ioctl, r[0], 0x401c5504, 0x20000340ul);
  syscall(__NR_ioctl, r[0], 0x40045564, 3ul);
  *(uint16_t*)0x20000000 = 0;
  *(uint16_t*)0x20000002 = 0;
  *(uint16_t*)0x20000004 = 0;
  *(uint16_t*)0x20000006 = 0;
  memcpy((void*)0x20000008,
         "syz0\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\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",
         80);
  *(uint32_t*)0x20000058 = 0;
  syscall(__NR_ioctl, r[0], 0x405c5503, 0x20000000ul);
  syscall(__NR_ioctl, r[0], 0x5501, 0);
  return 0;
}