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

#define _GNU_SOURCE
#include <endian.h>
#include <stdint.h>
#include <string.h>
#include <sys/syscall.h>
#include <unistd.h>

static void test();

void loop()
{
  while (1) {
    test();
  }
}

long r[1];
void test()
{
  memset(r, -1, sizeof(r));
  syscall(__NR_mmap, 0x20000000, 0xfff000, 3, 0x32, -1, 0);
  r[0] = syscall(__NR_socket, 0x10, 3, 6);
  *(uint64_t*)0x2000b000 = 0x2000f000;
  *(uint32_t*)0x2000b008 = 0xc;
  *(uint64_t*)0x2000b010 = 0x205a6ff0;
  *(uint64_t*)0x2000b018 = 1;
  *(uint64_t*)0x2000b020 = 0;
  *(uint64_t*)0x2000b028 = 0;
  *(uint32_t*)0x2000b030 = 0;
  *(uint16_t*)0x2000f000 = 0x10;
  *(uint16_t*)0x2000f002 = 0;
  *(uint32_t*)0x2000f004 = 0;
  *(uint32_t*)0x2000f008 = 0;
  *(uint64_t*)0x205a6ff0 = 0x201ff000;
  *(uint64_t*)0x205a6ff8 = 0x140;
  *(uint32_t*)0x201ff000 = 0x140;
  *(uint16_t*)0x201ff004 = 0x10;
  *(uint16_t*)0x201ff006 = 0x713;
  *(uint32_t*)0x201ff008 = 0;
  *(uint32_t*)0x201ff00c = 0;
  *(uint8_t*)0x201ff010 = 0;
  *(uint8_t*)0x201ff011 = 0;
  *(uint8_t*)0x201ff012 = 0;
  *(uint8_t*)0x201ff013 = 0;
  *(uint8_t*)0x201ff014 = 0;
  *(uint8_t*)0x201ff015 = 0;
  *(uint8_t*)0x201ff016 = 0;
  *(uint8_t*)0x201ff017 = 0;
  *(uint8_t*)0x201ff018 = 0;
  *(uint8_t*)0x201ff019 = 0;
  *(uint8_t*)0x201ff01a = 0;
  *(uint8_t*)0x201ff01b = 0;
  *(uint8_t*)0x201ff01c = 0;
  *(uint8_t*)0x201ff01d = 0;
  *(uint8_t*)0x201ff01e = 0;
  *(uint8_t*)0x201ff01f = 0;
  *(uint32_t*)0x201ff020 = htobe32(0xe0000002);
  *(uint16_t*)0x201ff030 = 0;
  *(uint16_t*)0x201ff032 = htobe16(0);
  *(uint16_t*)0x201ff034 = 0;
  *(uint16_t*)0x201ff036 = htobe16(0);
  *(uint16_t*)0x201ff038 = 0;
  *(uint8_t*)0x201ff03a = 0;
  *(uint8_t*)0x201ff03b = 0;
  *(uint8_t*)0x201ff03c = 0;
  *(uint32_t*)0x201ff040 = 0;
  *(uint32_t*)0x201ff044 = 0;
  *(uint32_t*)0x201ff048 = htobe32(0x7f000001);
  *(uint32_t*)0x201ff058 = 0;
  *(uint8_t*)0x201ff05c = 0x6c;
  *(uint64_t*)0x201ff060 = htobe64(0);
  *(uint64_t*)0x201ff068 = htobe64(1);
  *(uint64_t*)0x201ff070 = 0;
  *(uint64_t*)0x201ff078 = 0;
  *(uint64_t*)0x201ff080 = 0;
  *(uint64_t*)0x201ff088 = 0;
  *(uint64_t*)0x201ff090 = 0;
  *(uint64_t*)0x201ff098 = 0;
  *(uint64_t*)0x201ff0a0 = 0;
  *(uint64_t*)0x201ff0a8 = 0;
  *(uint64_t*)0x201ff0b0 = 0;
  *(uint64_t*)0x201ff0b8 = 0;
  *(uint64_t*)0x201ff0c0 = 0;
  *(uint64_t*)0x201ff0c8 = 0;
  *(uint32_t*)0x201ff0d0 = 0;
  *(uint32_t*)0x201ff0d4 = 0;
  *(uint32_t*)0x201ff0d8 = 0;
  *(uint32_t*)0x201ff0dc = 0;
  *(uint32_t*)0x201ff0e0 = 0;
  *(uint16_t*)0x201ff0e4 = 2;
  *(uint8_t*)0x201ff0e6 = 0;
  *(uint8_t*)0x201ff0e7 = 0;
  *(uint8_t*)0x201ff0e8 = 0;
  *(uint16_t*)0x201ff0f0 = 8;
  *(uint16_t*)0x201ff0f2 = 0xc;
  *(uint32_t*)0x201ff0f4 = 0;
  *(uint16_t*)0x201ff0f8 = 0x48;
  *(uint16_t*)0x201ff0fa = 3;
  memcpy((void*)0x201ff0fc,
         "\x64\x65\x66\x6c\x61\x74\x65\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
         "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
         64);
  *(uint32_t*)0x201ff13c = 0;
  syscall(__NR_sendmsg, r[0], 0x2000b000, 0);
}

int main()
{
  for (;;) {
    loop();
  }
}