// https://syzkaller.appspot.com/bug?id=26567b12e74b8791e1db50da6039ee1705e5a7ed
// 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>

#ifndef __NR_ioctl
#define __NR_ioctl 54
#endif
#ifndef __NR_mmap
#define __NR_mmap 192
#endif
#ifndef __NR_openat
#define __NR_openat 295
#endif
#undef __NR_mmap
#define __NR_mmap __NR_mmap2

uint64_t r[2] = {0xffffffffffffffff, 0xffffffffffffffff};

int main(void)
{
  syscall(__NR_mmap, 0x1ffff000, 0x1000, 0, 0x32, -1, 0);
  syscall(__NR_mmap, 0x20000000, 0x1000000, 7, 0x32, -1, 0);
  syscall(__NR_mmap, 0x21000000, 0x1000, 0, 0x32, -1, 0);
  intptr_t res = 0;
  memcpy((void*)0x20000140, "/dev/fb1\000", 9);
  res = syscall(__NR_openat, 0xffffff9c, 0x20000140, 0x40000, 0);
  if (res != -1)
    r[0] = res;
  *(uint32_t*)0x20000100 = 0x3f;
  *(uint32_t*)0x20000104 = 1;
  syscall(__NR_ioctl, (intptr_t)r[0], 0x4610, 0x20000100);
  memcpy((void*)0x20000040, "/dev/fb1\000", 9);
  res = syscall(__NR_openat, 0xffffff9c, 0x20000040, 0x101200, 0);
  if (res != -1)
    r[1] = res;
  *(uint32_t*)0x20000080 = 1;
  *(uint32_t*)0x20000084 = 1;
  syscall(__NR_ioctl, (intptr_t)r[1], 0x4610, 0x20000080);
  return 0;
}