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

#define BITMASK(bf_off, bf_len) (((1ull << (bf_len)) - 1) << (bf_off))
#define STORE_BY_BITMASK(type, htobe, addr, val, bf_off, bf_len)               \
  *(type*)(addr) =                                                             \
      htobe((htobe(*(type*)(addr)) & ~BITMASK((bf_off), (bf_len))) |           \
            (((type)(val) << (bf_off)) & BITMASK((bf_off), (bf_len))))

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

int main(void)
{
  syscall(__NR_mmap, 0x20000000ul, 0x1000000ul, 3ul, 0x32ul, -1, 0);
  intptr_t res = 0;
  res = syscall(__NR_socket, 0x10ul, 3ul, 0xcul);
  if (res != -1)
    r[0] = res;
  *(uint64_t*)0x20001080 = 0;
  *(uint32_t*)0x20001088 = 0;
  *(uint64_t*)0x20001090 = 0x20001040;
  *(uint64_t*)0x20001040 = 0x20000f80;
  *(uint32_t*)0x20000f80 = 0x48;
  *(uint8_t*)0x20000f84 = 2;
  *(uint8_t*)0x20000f85 = 6;
  *(uint16_t*)0x20000f86 = 0x201;
  *(uint32_t*)0x20000f88 = 0;
  *(uint32_t*)0x20000f8c = 0;
  *(uint8_t*)0x20000f90 = 0;
  *(uint8_t*)0x20000f91 = 0;
  *(uint16_t*)0x20000f92 = htobe16(0);
  *(uint16_t*)0x20000f94 = 0xd;
  *(uint16_t*)0x20000f96 = 3;
  memcpy((void*)0x20000f98, "hash:mac\000", 9);
  *(uint16_t*)0x20000fa4 = 5;
  *(uint16_t*)0x20000fa6 = 4;
  *(uint8_t*)0x20000fa8 = 0;
  *(uint16_t*)0x20000fac = 9;
  *(uint16_t*)0x20000fae = 2;
  memcpy((void*)0x20000fb0, "syz1\000", 5);
  *(uint16_t*)0x20000fb8 = 5;
  *(uint16_t*)0x20000fba = 5;
  *(uint8_t*)0x20000fbc = 0;
  *(uint16_t*)0x20000fc0 = 5;
  *(uint16_t*)0x20000fc2 = 1;
  *(uint8_t*)0x20000fc4 = 7;
  *(uint64_t*)0x20001048 = 0x48;
  *(uint64_t*)0x20001098 = 1;
  *(uint64_t*)0x200010a0 = 0;
  *(uint64_t*)0x200010a8 = 0;
  *(uint32_t*)0x200010b0 = 0;
  syscall(__NR_sendmsg, r[0], 0x20001080ul, 0ul);
  res = syscall(__NR_socket, 0x10ul, 3ul, 0xcul);
  if (res != -1)
    r[1] = res;
  *(uint64_t*)0x200001c0 = 0;
  *(uint32_t*)0x200001c8 = 0;
  *(uint64_t*)0x200001d0 = 0x20000180;
  *(uint64_t*)0x20000180 = 0x20000040;
  *(uint32_t*)0x20000040 = 0x114;
  *(uint8_t*)0x20000044 = 0xb;
  *(uint8_t*)0x20000045 = 6;
  *(uint16_t*)0x20000046 = 5;
  *(uint32_t*)0x20000048 = 0x70bd28;
  *(uint32_t*)0x2000004c = 0x25dfdbfd;
  *(uint8_t*)0x20000050 = 0;
  *(uint8_t*)0x20000051 = 0;
  *(uint16_t*)0x20000052 = htobe16(7);
  *(uint16_t*)0x20000054 = 9;
  *(uint16_t*)0x20000056 = 2;
  memcpy((void*)0x20000058, "syz2\000", 5);
  *(uint16_t*)0x20000060 = 5;
  *(uint16_t*)0x20000062 = 1;
  *(uint8_t*)0x20000064 = 7;
  *(uint16_t*)0x20000068 = 0xa0;
  STORE_BY_BITMASK(uint16_t, , 0x2000006a, 8, 0, 14);
  STORE_BY_BITMASK(uint16_t, , 0x2000006b, 0, 6, 1);
  STORE_BY_BITMASK(uint16_t, , 0x2000006b, 1, 7, 1);
  *(uint16_t*)0x2000006c = 0xc;
  STORE_BY_BITMASK(uint16_t, , 0x2000006e, 7, 0, 14);
  STORE_BY_BITMASK(uint16_t, , 0x2000006f, 0, 6, 1);
  STORE_BY_BITMASK(uint16_t, , 0x2000006f, 1, 7, 1);
  *(uint16_t*)0x20000070 = 8;
  STORE_BY_BITMASK(uint16_t, , 0x20000072, 0xb, 0, 14);
  STORE_BY_BITMASK(uint16_t, , 0x20000073, 1, 6, 1);
  STORE_BY_BITMASK(uint16_t, , 0x20000073, 0, 7, 1);
  *(uint32_t*)0x20000074 = htobe32(1);
  *(uint16_t*)0x20000078 = 0x1c;
  STORE_BY_BITMASK(uint16_t, , 0x2000007a, 7, 0, 14);
  STORE_BY_BITMASK(uint16_t, , 0x2000007b, 0, 6, 1);
  STORE_BY_BITMASK(uint16_t, , 0x2000007b, 1, 7, 1);
  *(uint16_t*)0x2000007c = 0x18;
  STORE_BY_BITMASK(uint16_t, , 0x2000007e, 2, 0, 14);
  STORE_BY_BITMASK(uint16_t, , 0x2000007f, 0, 6, 1);
  STORE_BY_BITMASK(uint16_t, , 0x2000007f, 1, 7, 1);
  *(uint16_t*)0x20000080 = 0x14;
  STORE_BY_BITMASK(uint16_t, , 0x20000082, 2, 0, 14);
  STORE_BY_BITMASK(uint16_t, , 0x20000083, 1, 6, 1);
  STORE_BY_BITMASK(uint16_t, , 0x20000083, 0, 7, 1);
  memcpy((void*)0x20000084,
         "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000",
         16);
  *(uint16_t*)0x20000094 = 0x10;
  STORE_BY_BITMASK(uint16_t, , 0x20000096, 7, 0, 14);
  STORE_BY_BITMASK(uint16_t, , 0x20000097, 0, 6, 1);
  STORE_BY_BITMASK(uint16_t, , 0x20000097, 1, 7, 1);
  *(uint16_t*)0x20000098 = 0xc;
  STORE_BY_BITMASK(uint16_t, , 0x2000009a, 0x1b, 0, 14);
  STORE_BY_BITMASK(uint16_t, , 0x2000009b, 1, 6, 1);
  STORE_BY_BITMASK(uint16_t, , 0x2000009b, 0, 7, 1);
  *(uint64_t*)0x2000009c = htobe64(3);
  *(uint16_t*)0x200000a4 = 0xc;
  STORE_BY_BITMASK(uint16_t, , 0x200000a6, 7, 0, 14);
  STORE_BY_BITMASK(uint16_t, , 0x200000a7, 0, 6, 1);
  STORE_BY_BITMASK(uint16_t, , 0x200000a7, 1, 7, 1);
  *(uint16_t*)0x200000a8 = 5;
  *(uint16_t*)0x200000aa = 7;
  *(uint8_t*)0x200000ac = 0x73;
  *(uint16_t*)0x200000b0 = 0x10;
  STORE_BY_BITMASK(uint16_t, , 0x200000b2, 7, 0, 14);
  STORE_BY_BITMASK(uint16_t, , 0x200000b3, 0, 6, 1);
  STORE_BY_BITMASK(uint16_t, , 0x200000b3, 1, 7, 1);
  *(uint16_t*)0x200000b4 = 0xa;
  *(uint16_t*)0x200000b6 = 0x11;
  *(uint8_t*)0x200000b8 = 1;
  *(uint8_t*)0x200000b9 = 0x80;
  *(uint8_t*)0x200000ba = 0xc2;
  *(uint8_t*)0x200000bb = 0;
  *(uint8_t*)0x200000bc = 0;
  *(uint8_t*)0x200000bd = 3;
  *(uint16_t*)0x200000c0 = 0xc;
  STORE_BY_BITMASK(uint16_t, , 0x200000c2, 7, 0, 14);
  STORE_BY_BITMASK(uint16_t, , 0x200000c3, 0, 6, 1);
  STORE_BY_BITMASK(uint16_t, , 0x200000c3, 1, 7, 1);
  *(uint16_t*)0x200000c4 = 5;
  *(uint16_t*)0x200000c6 = 7;
  *(uint8_t*)0x200000c8 = 1;
  *(uint16_t*)0x200000cc = 0x10;
  STORE_BY_BITMASK(uint16_t, , 0x200000ce, 7, 0, 14);
  STORE_BY_BITMASK(uint16_t, , 0x200000cf, 0, 6, 1);
  STORE_BY_BITMASK(uint16_t, , 0x200000cf, 1, 7, 1);
  *(uint16_t*)0x200000d0 = 0xc;
  STORE_BY_BITMASK(uint16_t, , 0x200000d2, 0x1b, 0, 14);
  STORE_BY_BITMASK(uint16_t, , 0x200000d3, 1, 6, 1);
  STORE_BY_BITMASK(uint16_t, , 0x200000d3, 0, 7, 1);
  *(uint64_t*)0x200000d4 = htobe64(0x20);
  *(uint16_t*)0x200000dc = 0xc;
  STORE_BY_BITMASK(uint16_t, , 0x200000de, 7, 0, 14);
  STORE_BY_BITMASK(uint16_t, , 0x200000df, 0, 6, 1);
  STORE_BY_BITMASK(uint16_t, , 0x200000df, 1, 7, 1);
  *(uint16_t*)0x200000e0 = 8;
  STORE_BY_BITMASK(uint16_t, , 0x200000e2, 6, 0, 14);
  STORE_BY_BITMASK(uint16_t, , 0x200000e3, 1, 6, 1);
  STORE_BY_BITMASK(uint16_t, , 0x200000e3, 0, 7, 1);
  *(uint32_t*)0x200000e4 = htobe32(0x101);
  *(uint16_t*)0x200000e8 = 0x10;
  STORE_BY_BITMASK(uint16_t, , 0x200000ea, 7, 0, 14);
  STORE_BY_BITMASK(uint16_t, , 0x200000eb, 0, 6, 1);
  STORE_BY_BITMASK(uint16_t, , 0x200000eb, 1, 7, 1);
  *(uint16_t*)0x200000ec = 0xa;
  *(uint16_t*)0x200000ee = 0x11;
  *(uint8_t*)0x200000f0 = -1;
  *(uint8_t*)0x200000f1 = -1;
  *(uint8_t*)0x200000f2 = -1;
  *(uint8_t*)0x200000f3 = -1;
  *(uint8_t*)0x200000f4 = -1;
  *(uint8_t*)0x200000f5 = -1;
  *(uint16_t*)0x200000f8 = 0x10;
  STORE_BY_BITMASK(uint16_t, , 0x200000fa, 7, 0, 14);
  STORE_BY_BITMASK(uint16_t, , 0x200000fb, 0, 6, 1);
  STORE_BY_BITMASK(uint16_t, , 0x200000fb, 1, 7, 1);
  *(uint16_t*)0x200000fc = 0xa;
  *(uint16_t*)0x200000fe = 0x11;
  *(uint8_t*)0x20000100 = 1;
  *(uint8_t*)0x20000101 = 0x80;
  *(uint8_t*)0x20000102 = 0xc2;
  *(uint8_t*)0x20000103 = 0;
  *(uint8_t*)0x20000104 = 0;
  *(uint8_t*)0x20000105 = 1;
  *(uint16_t*)0x20000108 = 9;
  *(uint16_t*)0x2000010a = 2;
  memcpy((void*)0x2000010c, "syz2\000", 5);
  *(uint16_t*)0x20000114 = 5;
  *(uint16_t*)0x20000116 = 1;
  *(uint8_t*)0x20000118 = 7;
  *(uint16_t*)0x2000011c = 9;
  *(uint16_t*)0x2000011e = 2;
  memcpy((void*)0x20000120, "syz1\000", 5);
  *(uint16_t*)0x20000128 = 0x2c;
  STORE_BY_BITMASK(uint16_t, , 0x2000012a, 7, 0, 14);
  STORE_BY_BITMASK(uint16_t, , 0x2000012b, 0, 6, 1);
  STORE_BY_BITMASK(uint16_t, , 0x2000012b, 1, 7, 1);
  *(uint16_t*)0x2000012c = 8;
  STORE_BY_BITMASK(uint16_t, , 0x2000012e, 6, 0, 14);
  STORE_BY_BITMASK(uint16_t, , 0x2000012f, 1, 6, 1);
  STORE_BY_BITMASK(uint16_t, , 0x2000012f, 0, 7, 1);
  *(uint32_t*)0x20000130 = htobe32(0xee);
  *(uint16_t*)0x20000134 = 0xc;
  STORE_BY_BITMASK(uint16_t, , 0x20000136, 0x1b, 0, 14);
  STORE_BY_BITMASK(uint16_t, , 0x20000137, 1, 6, 1);
  STORE_BY_BITMASK(uint16_t, , 0x20000137, 0, 7, 1);
  *(uint64_t*)0x20000138 = htobe64(0xac);
  *(uint16_t*)0x20000140 = 8;
  STORE_BY_BITMASK(uint16_t, , 0x20000142, 9, 0, 14);
  STORE_BY_BITMASK(uint16_t, , 0x20000143, 1, 6, 1);
  STORE_BY_BITMASK(uint16_t, , 0x20000143, 0, 7, 1);
  *(uint32_t*)0x20000144 = htobe32(8);
  *(uint16_t*)0x20000148 = 0xc;
  STORE_BY_BITMASK(uint16_t, , 0x2000014a, 0x1b, 0, 14);
  STORE_BY_BITMASK(uint16_t, , 0x2000014b, 1, 6, 1);
  STORE_BY_BITMASK(uint16_t, , 0x2000014b, 0, 7, 1);
  *(uint64_t*)0x2000014c = htobe64(5);
  *(uint64_t*)0x20000188 = 0x114;
  *(uint64_t*)0x200001d8 = 1;
  *(uint64_t*)0x200001e0 = 0;
  *(uint64_t*)0x200001e8 = 0;
  *(uint32_t*)0x200001f0 = 0x4000;
  syscall(__NR_sendmsg, r[1], 0x200001c0ul, 0x800ul);
  return 0;
}