// https://syzkaller.appspot.com/bug?id=038c47c353490e96ed3592dfd723466c8d2f0648
// 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_connect
#define __NR_connect 362
#endif
#ifndef __NR_mmap
#define __NR_mmap 192
#endif
#ifndef __NR_setsockopt
#define __NR_setsockopt 366
#endif
#ifndef __NR_socket
#define __NR_socket 359
#endif
#undef __NR_mmap
#define __NR_mmap __NR_mmap2

uint64_t r[1] = {0xffffffffffffffff};

int main(void)
{
  syscall(__NR_mmap, 0x20000000, 0x1000000, 3, 0x32, -1, 0);
  long res = 0;
  res = syscall(__NR_socket, 0xa, 2, 0);
  if (res != -1)
    r[0] = res;
  *(uint8_t*)0x20000180 = -1;
  *(uint8_t*)0x20000181 = 2;
  *(uint8_t*)0x20000182 = 0;
  *(uint8_t*)0x20000183 = 0;
  *(uint8_t*)0x20000184 = 0;
  *(uint8_t*)0x20000185 = 0;
  *(uint8_t*)0x20000186 = 0;
  *(uint8_t*)0x20000187 = 0;
  *(uint8_t*)0x20000188 = 0;
  *(uint8_t*)0x20000189 = 0;
  *(uint8_t*)0x2000018a = 0;
  *(uint8_t*)0x2000018b = 0;
  *(uint8_t*)0x2000018c = 0;
  *(uint8_t*)0x2000018d = 0;
  *(uint8_t*)0x2000018e = 0;
  *(uint8_t*)0x2000018f = 1;
  *(uint32_t*)0x20000190 = 0;
  syscall(__NR_setsockopt, (long)r[0], 0x29, 0x14, 0x20000180, 0x14);
  *(uint16_t*)0x200000c0 = 0xa;
  *(uint16_t*)0x200000c2 = htobe16(0);
  *(uint32_t*)0x200000c4 = 0;
  *(uint8_t*)0x200000c8 = 0;
  *(uint8_t*)0x200000c9 = 0;
  *(uint8_t*)0x200000ca = 0;
  *(uint8_t*)0x200000cb = 0;
  *(uint8_t*)0x200000cc = 0;
  *(uint8_t*)0x200000cd = 0;
  *(uint8_t*)0x200000ce = 0;
  *(uint8_t*)0x200000cf = 0;
  *(uint8_t*)0x200000d0 = 0;
  *(uint8_t*)0x200000d1 = 0;
  *(uint8_t*)0x200000d2 = -1;
  *(uint8_t*)0x200000d3 = -1;
  *(uint32_t*)0x200000d4 = htobe32(0x7f000001);
  *(uint32_t*)0x200000d8 = 0;
  syscall(__NR_connect, (long)r[0], 0x200000c0, 0x1c);
  *(uint32_t*)0x20000080 = 2;
  syscall(__NR_setsockopt, (long)r[0], 0x29, 1, 0x20000080, 0xfffffe56);
  return 0;
}