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

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

#ifndef __NR_bpf
#define __NR_bpf 321
#endif

uint64_t r[1] = {0xffffffffffffffff};
void loop()
{
  long res = 0;
  *(uint32_t*)0x20000200 = 0xc;
  *(uint32_t*)0x20000204 = 0xe;
  *(uint64_t*)0x20000208 = 0x20000000;
  memcpy((void*)0x20000000,
         "\xb7\x02\x00\x00\x02\x00\x00\x00\xbf\xa3\x00\x00\x00\x00\x00\x00\x07"
         "\x03\x00\x00\x00\xfe\xff\xff\x7a\x0a\xf0\xff\xf8\xff\xff\xff\x79\xa4"
         "\xf0\xff\x00\x00\x00\x00\xb7\x06\x00\x00\xff\xff\xff\xff\x2d\x64\x05"
         "\x00\x00\x00\x00\x00\x65\x04\x04\x00\x01\x00\x00\x00\x04\x04\x00\x00"
         "\x01\x00\x00\x00\xb7\x03\x00\x00\x00\x00\x00\x00\x6a\x0a\x00\xfe\x00"
         "\x00\x00\x00\x85\x00\x00\x00\x2b\x00\x00\x00\xb7\x00\x00\x00\x00\x00"
         "\x00\x00\x95\x00\x00\x00\x00\x00\x00\x00",
         112);
  *(uint64_t*)0x20000210 = 0x20000340;
  memcpy((void*)0x20000340, "syzkaller", 10);
  *(uint32_t*)0x20000218 = 0;
  *(uint32_t*)0x2000021c = 0;
  *(uint64_t*)0x20000220 = 0;
  *(uint32_t*)0x20000228 = 0;
  *(uint32_t*)0x2000022c = 0;
  *(uint8_t*)0x20000230 = 0;
  *(uint8_t*)0x20000231 = 0;
  *(uint8_t*)0x20000232 = 0;
  *(uint8_t*)0x20000233 = 0;
  *(uint8_t*)0x20000234 = 0;
  *(uint8_t*)0x20000235 = 0;
  *(uint8_t*)0x20000236 = 0;
  *(uint8_t*)0x20000237 = 0;
  *(uint8_t*)0x20000238 = 0;
  *(uint8_t*)0x20000239 = 0;
  *(uint8_t*)0x2000023a = 0;
  *(uint8_t*)0x2000023b = 0;
  *(uint8_t*)0x2000023c = 0;
  *(uint8_t*)0x2000023d = 0;
  *(uint8_t*)0x2000023e = 0;
  *(uint8_t*)0x2000023f = 0;
  *(uint32_t*)0x20000240 = 0;
  *(uint32_t*)0x20000244 = 0;
  res = syscall(__NR_bpf, 5, 0x20000200, 0x48);
  if (res != -1)
    r[0] = res;
  *(uint32_t*)0x20000080 = r[0];
  *(uint32_t*)0x20000084 = 0;
  *(uint32_t*)0x20000088 = 0xa6;
  *(uint32_t*)0x2000008c = 0x8b;
  *(uint64_t*)0x20000090 = 0x20000100;
  memcpy((void*)0x20000100,
         "\xba\x32\x6b\x78\x3a\x64\xaf\x2e\x45\x32\x05\xab\x9f\x81\xce\x44\xff"
         "\x3c\x06\x69\xcd\x27\x0e\xef\xea\xdb\x8d\x39\xc7\xbd\x25\x7f\x1f\x56"
         "\xb6\x48\x74\xec\xe3\x64\xa8\xef\x86\x53\x14\xc7\xa4\xcd\x11\x04\x6f"
         "\x7a\xb1\x82\xb7\x1b\x40\x30\x05\xc4\x46\x4d\x6c\x5b\x17\x87\x96\xc2"
         "\x47\xd6\x19\x1b\x69\xad\xd5\x84\x2b\x11\x66\xc3\xce\x9c\xe5\xa2\x90"
         "\xea\x6f\x80\xa7\x7d\xf9\xa5\x07\x48\xa9\xc9\x96\x1b\x8b\x62\xd3\x91"
         "\x2a\x47\x96\xe5\x00\x01\x2c\x05\xab\x96\x97\x1a\xef\x81\x1c\x6c\x62"
         "\xd8\x80\x40\xf0\x9f\x5c\x3e\x49\x40\x4e\x44\x2b\x27\x1a\x82\xc7\x33"
         "\xb0\x6d\x14\x1d\x6d\x22\x6f\x54\x31\xb3\xe9\x8e\xf7\x5d\x69\xb8\x0b"
         "\xa9\x24\xcf\x80\xd4\x6a\x1c\xe3\x5a\x87\x44\x9f\x86",
         166);
  *(uint64_t*)0x20000098 = 0x20000280;
  *(uint32_t*)0x200000a0 = 0x8000;
  *(uint32_t*)0x200000a4 = 0;
  syscall(__NR_bpf, 0xa, 0x20000080, 0x28);
}

int main()
{
  syscall(__NR_mmap, 0x20000000, 0x1000000, 3, 0x32, -1, 0);
  loop();
  return 0;
}