// https://syzkaller.appspot.com/bug?id=7660dfcb77e48ec6c95cccde2edaec7d5038d04e
// 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[2] = {0xffffffffffffffff, 0xffffffffffffffff};

int main(void)
{
  syscall(__NR_mmap, 0x20000000, 0x1000000, 3, 0x32, -1, 0);
  intptr_t res = 0;
  res = syscall(__NR_socket, 0x10, 3, 0);
  if (res != -1)
    r[0] = res;
  memcpy((void*)0x200000c0, "dummy0\000\000\000\000\000\000\000\000\000\000",
         16);
  *(uint32_t*)0x200000d0 = 0;
  res = syscall(__NR_ioctl, r[0], 0x8933, 0x200000c0);
  if (res != -1)
    r[1] = *(uint32_t*)0x200000d0;
  *(uint64_t*)0x2000a000 = 0;
  *(uint32_t*)0x2000a008 = 0x1e3;
  *(uint64_t*)0x2000a010 = 0x20000080;
  *(uint64_t*)0x20000080 = 0x20000240;
  memcpy((void*)0x20000240, "\x50\x00\x00\x00\x13\x00\x01\x00\x00\x00\x00\x00"
                            "\x00\x00\x00\x00\x00\x00\x00\x00",
         20);
  *(uint32_t*)0x20000254 = r[1];
  memcpy((void*)0x20000258,
         "\x00\x00\xfe\x00\x00\x00\x00\x00\x30\x00\x16\x00\x2c\x00\x01\x00\x28"
         "\x00\x01\x00\x00\x00\x46\xdc\x42\xb1\xd0\xf3\x74\x98\x96\x6f\x4a\x82"
         "\x00\x39\x89\xd0\x6d\x6d\xf0\xaf\x7f\xdc\x84\xb8\x30\x8c\xa3\xbc\xd6"
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xb4\xdd\x10\x00\x00\x00"
         "\x3e\x83\xed\x74\x9a\xe9\x35\xd4\x09\x5c\xef\x15\x92\x84\xb5\x5a\x23"
         "\x61\x25\x4c\x42\xc7\xb8\xe9\x95\xe1\x40\xfb\x4b\xb3\x80\x70\x43\x7a"
         "\xda\x0b\x76\x07\xf9\x6e\x10\xa2\xe0\x2a\xd1\x95\x53\x3c\x29\x59\xb5"
         "\x96\x96\xc3\x12\xef\xb5\xb2\x13\x89\xde\xfa\xd3\xa9\x12\xf7\xd8\x79"
         "\x52\xc1\x9d\x64\x4b\x60\x87\xae\x37\xd8\x2e\x2d\xe2\x82\x82\x68\xef"
         "\x53\xd9\x92\x3b\x5f\x36\x85\xa3\xf2",
         162);
  *(uint64_t*)0x20000088 = 0x50;
  *(uint64_t*)0x2000a018 = 1;
  *(uint64_t*)0x2000a020 = 0;
  *(uint64_t*)0x2000a028 = 0;
  *(uint32_t*)0x2000a030 = 0;
  syscall(__NR_sendmsg, r[0], 0x2000a000, 0);
  return 0;
}