// 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, 1, 0);
  if (res != -1)
    r[0] = res;
  *(uint32_t*)0x20000400 = 1;
  syscall(__NR_setsockopt, (long)r[0], 6, 0x13, 0x20000400, 0x285);
  *(uint32_t*)0x20000140 = 0;
  *(uint16_t*)0x20000144 = 0xa;
  *(uint16_t*)0x20000146 = htobe16(0);
  *(uint32_t*)0x20000148 = htobe32(0);
  *(uint8_t*)0x2000014c = -1;
  *(uint8_t*)0x2000014d = 1;
  *(uint8_t*)0x2000014e = 0;
  *(uint8_t*)0x2000014f = 0;
  *(uint8_t*)0x20000150 = 0;
  *(uint8_t*)0x20000151 = 0;
  *(uint8_t*)0x20000152 = 0;
  *(uint8_t*)0x20000153 = 0;
  *(uint8_t*)0x20000154 = 0;
  *(uint8_t*)0x20000155 = 0;
  *(uint8_t*)0x20000156 = 0;
  *(uint8_t*)0x20000157 = 0;
  *(uint8_t*)0x20000158 = 0;
  *(uint8_t*)0x20000159 = 0;
  *(uint8_t*)0x2000015a = 0;
  *(uint8_t*)0x2000015b = 1;
  *(uint32_t*)0x2000015c = 0;
  syscall(__NR_setsockopt, (long)r[0], 0x29, 0x2a, 0x20000140, 0x88);
  *(uint16_t*)0x20000900 = 0xa;
  *(uint16_t*)0x20000902 = htobe16(0);
  *(uint32_t*)0x20000904 = htobe32(0);
  *(uint8_t*)0x20000908 = 0;
  *(uint8_t*)0x20000909 = 0;
  *(uint8_t*)0x2000090a = 0;
  *(uint8_t*)0x2000090b = 0;
  *(uint8_t*)0x2000090c = 0;
  *(uint8_t*)0x2000090d = 0;
  *(uint8_t*)0x2000090e = 0;
  *(uint8_t*)0x2000090f = 0;
  *(uint8_t*)0x20000910 = 0;
  *(uint8_t*)0x20000911 = 0;
  *(uint8_t*)0x20000912 = -1;
  *(uint8_t*)0x20000913 = -1;
  *(uint32_t*)0x20000914 = htobe32(0x7f000001);
  *(uint32_t*)0x20000918 = 0;
  syscall(__NR_connect, (long)r[0], 0x20000900, 0x1c);
  *(uint32_t*)0x20000080 = 2;
  syscall(__NR_setsockopt, (long)r[0], 0x29, 1, 0x20000080, 4);
  return 0;
}