#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ buf;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ EINVAL;
scalar_t__ ENOSYS;
unsigned char *MAP_FAILED;
int MAP_FIXED;
int MAP_PRIVATE;
int MAP_SHARED;
int /*<<< orphan*/ PROT_READ;
int /*<<< orphan*/ _SC_PAGESIZE;
int /*<<< orphan*/ assert(int);
scalar_t__ errno;
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int fileno(int /*<<< orphan*/ *);
int /*<<< orphan*/ free(void *);
int fwrite(char *, int, int, int /*<<< orphan*/ *);
void *malloc(int);
unsigned char *mmap(void *, int, int /*<<< orphan*/, int, int, size_t);
unsigned char *mmap64(void *, int, int /*<<< orphan*/, int, int, size_t);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
size_t sysconf(int /*<<< orphan*/);
int /*<<< orphan*/ *tmpfile();
int main(void) {
  int result = 0;
  FILE *fp;
  size_t c;
  char buf[1000];
  int fd;
  unsigned char *ptr;
  size_t ps = sysconf(_SC_PAGESIZE);
  void *mem;
  fp = tmpfile();
  if (fp == NULL) {
    printf("Cannot create temporary file: %m\n");
    return 1;
  }
  fd = fileno(fp);
  for (c = 0; c < sizeof(buf); ++c)
    buf[c] = '0' + (c % 10);
  for (c = 0; c < (ps * 4) / sizeof(buf); ++c)
    if (fwrite(buf, 1, sizeof(buf), fp) != sizeof(buf)) {
      printf("`fwrite' failed: %m\n");
      return 1;
    }
  fflush(fp);
  assert(ps + 1000 < c * sizeof(buf));
  ptr = mmap(NULL, 1000, PROT_READ, MAP_SHARED, fd, ps - 1);
  if (ptr != MAP_FAILED) {
    puts("mapping at offset with mod pagesize != 0 succeeded!");
    result = 1;
  } else if (errno != EINVAL && errno != ENOSYS) {
    puts("wrong error value for mapping at offset with mod pagesize != 0: %m "
         "(should be EINVAL)");
    result = 1;
  }
  ptr = mmap64(NULL, 1000, PROT_READ, MAP_SHARED, fd, ps - 1);
  if (ptr != MAP_FAILED) {
    puts("mapping at offset with mod pagesize != 0 succeeded!");
    result = 1;
  } else if (errno != EINVAL && errno != ENOSYS) {
    puts("wrong error value for mapping at offset with mod pagesize != 0: %m "
         "(should be EINVAL)");
    result = 1;
  }
  ptr = mmap(NULL, 1000, PROT_READ, MAP_PRIVATE, fd, ps - 1);
  if (ptr != MAP_FAILED) {
    puts("mapping at offset with mod pagesize != 0 succeeded!");
    result = 1;
  } else if (errno != EINVAL && errno != ENOSYS) {
    puts("wrong error value for mapping at offset with mod pagesize != 0: %m "
         "(should be EINVAL)");
    result = 1;
  }
  ptr = mmap64(NULL, 1000, PROT_READ, MAP_PRIVATE, fd, ps - 1);
  if (ptr != MAP_FAILED) {
    puts("mapping at offset with mod pagesize != 0 succeeded!");
    result = 1;
  } else if (errno != EINVAL && errno != ENOSYS) {
    puts("wrong error value for mapping at offset with mod pagesize != 0: %m "
         "(should be EINVAL)");
    result = 1;
  }
  mem = malloc(2 * ps);
  if (mem != NULL) {
    ptr = mmap(mem + 1, 1000, PROT_READ, MAP_SHARED | MAP_FIXED, fd, ps);
    if (ptr != MAP_FAILED) {
      puts("mapping at address with mod pagesize != 0 succeeded!");
      result = 1;
    } else if (errno != EINVAL && errno != ENOSYS) {
      puts("wrong error value for mapping at address with mod pagesize != 0: "
           "%m (should be EINVAL)");
      result = 1;
    }
    ptr = mmap64(mem + 1, 1000, PROT_READ, MAP_SHARED | MAP_FIXED, fd, ps);
    if (ptr != MAP_FAILED) {
      puts("mapping at address with mod pagesize != 0 succeeded!");
      result = 1;
    } else if (errno != EINVAL && errno != ENOSYS) {
      puts("wrong error value for mapping at address with mod pagesize != 0: "
           "%m (should be EINVAL)");
      result = 1;
    }
    ptr = mmap(mem + 1, 1000, PROT_READ, MAP_PRIVATE | MAP_FIXED, fd, ps);
    if (ptr != MAP_FAILED) {
      puts("mapping at address with mod pagesize != 0 succeeded!");
      result = 1;
    } else if (errno != EINVAL && errno != ENOSYS) {
      puts("wrong error value for mapping at address with mod pagesize != 0: "
           "%m (should be EINVAL)");
      result = 1;
    }
    ptr = mmap64(mem + 1, 1000, PROT_READ, MAP_PRIVATE | MAP_FIXED, fd, ps);
    if (ptr != MAP_FAILED) {
      puts("mapping at address with mod pagesize != 0 succeeded!");
      result = 1;
    } else if (errno != EINVAL && errno != ENOSYS) {
      puts("wrong error value for mapping at address with mod pagesize != 0: "
           "%m (should be EINVAL)");
      result = 1;
    }
    free(mem);
  }
  ptr = mmap(NULL, 1000, PROT_READ, MAP_SHARED, fd, ps);
  if (ptr == MAP_FAILED) {
    if (errno != ENOSYS) {
      printf("cannot mmap file: %m\n");
      result = 1;
    }
  } else {
    for (c = ps; c < ps + 1000; ++c)
      if (ptr[c - ps] != '0' + (c % 10)) {
        printf("wrong data mapped at offset %zd\n", c);
        result = 1;
      }
  }
  ptr = mmap64(NULL, 1000, PROT_READ, MAP_SHARED, fd, ps);
  if (ptr == MAP_FAILED) {
    if (errno != ENOSYS) {
      printf("cannot mmap file: %m\n");
      result = 1;
    }
  } else {
    for (c = ps; c < ps + 1000; ++c)
      if (ptr[c - ps] != '0' + (c % 10)) {
        printf("wrong data mapped at offset %zd\n", c);
        result = 1;
      }
  }
  return result;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x440,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    0x2df0(%rip),%rax
mov    (%rax),%edi
call   10d0 <sysconf@plt>
mov    %rax,-0x418(%rbp)
mov    $0x0,%al
call   1070 <tmpfile@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    121e <main+0x5e>
lea    0xdf5(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1b6f <main+0x9af>
mov    -0x10(%rbp),%rdi
call   1090 <fileno@plt>
mov    %eax,-0x404(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x3e8,-0x18(%rbp)
jae    1273 <main+0xb3>
mov    -0x18(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
add    $0x30,%rdx
mov    %dl,%cl
mov    -0x18(%rbp),%rax
mov    %cl,-0x400(%rbp,%rax,1)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1235 <main+0x75>
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x428(%rbp)
mov    -0x418(%rbp),%rax
shl    $0x2,%rax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,%rcx
mov    -0x428(%rbp),%rax
cmp    %rcx,%rax
jae    1306 <main+0x146>
lea    -0x400(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
mov    $0x3e8,%edx
call   10e0 <fwrite@plt>
cltq
cmp    $0x3e8,%rax
je     12f0 <main+0x130>
lea    0xd45(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1b6f <main+0x9af>
jmp    12f5 <main+0x135>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    127b <main+0xbb>
mov    -0x10(%rbp),%rdi
call   10c0 <fflush@plt>
mov    -0x418(%rbp),%rax
add    $0x3e8,%rax
imul   $0x3e8,-0x18(%rbp),%rcx
cmp    %rcx,%rax
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
mov    0x2cbd(%rip),%rax
mov    (%rax),%edx
mov    0x2ca4(%rip),%rax
mov    (%rax),%ecx
mov    -0x404(%rbp),%r8d
mov    -0x418(%rbp),%r9
sub    $0x1,%r9
xor    %eax,%eax
mov    %eax,%edi
mov    $0x3e8,%esi
call   1050 <mmap@plt>
mov    %rax,-0x410(%rbp)
mov    -0x410(%rbp),%rax
mov    0x2c25(%rip),%rcx
cmp    (%rcx),%rax
je     139c <main+0x1dc>
lea    0xcac(%rip),%rdi
call   1040 <puts@plt>
movl   $0x1,-0x8(%rbp)
jmp    13e8 <main+0x228>
mov    0x2c1d(%rip),%rax
mov    (%rax),%rax
mov    0x2c0b(%rip),%rcx
cmp    (%rcx),%rax
je     13e3 <main+0x223>
mov    0x2c03(%rip),%rax
mov    (%rax),%rax
mov    0x2c11(%rip),%rcx
cmp    (%rcx),%rax
je     13e3 <main+0x223>
lea    0xc94(%rip),%rdi
call   1040 <puts@plt>
movl   $0x1,-0x8(%rbp)
jmp    13e8 <main+0x228>
mov    0x2c09(%rip),%rax
mov    (%rax),%edx
mov    0x2bf0(%rip),%rax
mov    (%rax),%ecx
mov    -0x404(%rbp),%r8d
mov    -0x418(%rbp),%r9
sub    $0x1,%r9
xor    %eax,%eax
mov    %eax,%edi
mov    $0x3e8,%esi
call   10a0 <mmap64@plt>
mov    %rax,-0x410(%rbp)
mov    -0x410(%rbp),%rax
mov    0x2b71(%rip),%rcx
cmp    (%rcx),%rax
je     1450 <main+0x290>
lea    0xbf8(%rip),%rdi
call   1040 <puts@plt>
movl   $0x1,-0x8(%rbp)
jmp    149c <main+0x2dc>
mov    0x2b69(%rip),%rax
mov    (%rax),%rax
mov    0x2b57(%rip),%rcx
cmp    (%rcx),%rax
je     1497 <main+0x2d7>
mov    0x2b4f(%rip),%rax
mov    (%rax),%rax
mov    0x2b5d(%rip),%rcx
cmp    (%rcx),%rax
je     1497 <main+0x2d7>
lea    0xbe0(%rip),%rdi
call   1040 <puts@plt>
movl   $0x1,-0x8(%rbp)
jmp    149c <main+0x2dc>
mov    0x2b55(%rip),%rax
mov    (%rax),%edx
mov    0x2b04(%rip),%rax
mov    (%rax),%ecx
mov    -0x404(%rbp),%r8d
mov    -0x418(%rbp),%r9
sub    $0x1,%r9
xor    %eax,%eax
mov    %eax,%edi
mov    $0x3e8,%esi
call   1050 <mmap@plt>
mov    %rax,-0x410(%rbp)
mov    -0x410(%rbp),%rax
mov    0x2abd(%rip),%rcx
cmp    (%rcx),%rax
je     1504 <main+0x344>
lea    0xb44(%rip),%rdi
call   1040 <puts@plt>
movl   $0x1,-0x8(%rbp)
jmp    1550 <main+0x390>
mov    0x2ab5(%rip),%rax
mov    (%rax),%rax
mov    0x2aa3(%rip),%rcx
cmp    (%rcx),%rax
je     154b <main+0x38b>
mov    0x2a9b(%rip),%rax
mov    (%rax),%rax
mov    0x2aa9(%rip),%rcx
cmp    (%rcx),%rax
je     154b <main+0x38b>
lea    0xb2c(%rip),%rdi
call   1040 <puts@plt>
movl   $0x1,-0x8(%rbp)
jmp    1550 <main+0x390>
mov    0x2aa1(%rip),%rax
mov    (%rax),%edx
mov    0x2a50(%rip),%rax
mov    (%rax),%ecx
mov    -0x404(%rbp),%r8d
mov    -0x418(%rbp),%r9
sub    $0x1,%r9
xor    %eax,%eax
mov    %eax,%edi
mov    $0x3e8,%esi
call   10a0 <mmap64@plt>
mov    %rax,-0x410(%rbp)
mov    -0x410(%rbp),%rax
mov    0x2a09(%rip),%rcx
cmp    (%rcx),%rax
je     15b8 <main+0x3f8>
lea    0xa90(%rip),%rdi
call   1040 <puts@plt>
movl   $0x1,-0x8(%rbp)
jmp    1604 <main+0x444>
mov    0x2a01(%rip),%rax
mov    (%rax),%rax
mov    0x29ef(%rip),%rcx
cmp    (%rcx),%rax
je     15ff <main+0x43f>
mov    0x29e7(%rip),%rax
mov    (%rax),%rax
mov    0x29f5(%rip),%rcx
cmp    (%rcx),%rax
je     15ff <main+0x43f>
lea    0xa78(%rip),%rdi
call   1040 <puts@plt>
movl   $0x1,-0x8(%rbp)
jmp    1604 <main+0x444>
mov    -0x418(%rbp),%rax
shl    $0x1,%rax
mov    %eax,%edi
call   10b0 <malloc@plt>
mov    %rax,-0x420(%rbp)
cmpq   $0x0,-0x420(%rbp)
je     1937 <main+0x777>
mov    -0x420(%rbp),%rdi
add    $0x1,%rdi
mov    0x29bb(%rip),%rax
mov    (%rax),%edx
mov    0x29a2(%rip),%rax
mov    (%rax),%ecx
mov    0x2959(%rip),%rax
or     (%rax),%ecx
mov    -0x404(%rbp),%r8d
mov    -0x418(%rbp),%r9
mov    $0x3e8,%esi
call   1050 <mmap@plt>
mov    %rax,-0x410(%rbp)
mov    -0x410(%rbp),%rax
mov    0x2922(%rip),%rcx
cmp    (%rcx),%rax
je     169f <main+0x4df>
lea    0xa33(%rip),%rdi
call   1040 <puts@plt>
movl   $0x1,-0x8(%rbp)
jmp    16eb <main+0x52b>
mov    0x291a(%rip),%rax
mov    (%rax),%rax
mov    0x2908(%rip),%rcx
cmp    (%rcx),%rax
je     16e6 <main+0x526>
mov    0x2900(%rip),%rax
mov    (%rax),%rax
mov    0x290e(%rip),%rcx
cmp    (%rcx),%rax
je     16e6 <main+0x526>
lea    0xa1c(%rip),%rdi
call   1040 <puts@plt>
movl   $0x1,-0x8(%rbp)
jmp    16eb <main+0x52b>
mov    -0x420(%rbp),%rdi
add    $0x1,%rdi
mov    0x28fb(%rip),%rax
mov    (%rax),%edx
mov    0x28e2(%rip),%rax
mov    (%rax),%ecx
mov    0x2899(%rip),%rax
or     (%rax),%ecx
mov    -0x404(%rbp),%r8d
mov    -0x418(%rbp),%r9
mov    $0x3e8,%esi
call   10a0 <mmap64@plt>
mov    %rax,-0x410(%rbp)
mov    -0x410(%rbp),%rax
mov    0x2862(%rip),%rcx
cmp    (%rcx),%rax
je     175f <main+0x59f>
lea    0x973(%rip),%rdi
call   1040 <puts@plt>
movl   $0x1,-0x8(%rbp)
jmp    17ab <main+0x5eb>
mov    0x285a(%rip),%rax
mov    (%rax),%rax
mov    0x2848(%rip),%rcx
cmp    (%rcx),%rax
je     17a6 <main+0x5e6>
mov    0x2840(%rip),%rax
mov    (%rax),%rax
mov    0x284e(%rip),%rcx
cmp    (%rcx),%rax
je     17a6 <main+0x5e6>
lea    0x95c(%rip),%rdi
call   1040 <puts@plt>
movl   $0x1,-0x8(%rbp)
jmp    17ab <main+0x5eb>
mov    -0x420(%rbp),%rdi
add    $0x1,%rdi
mov    0x283b(%rip),%rax
mov    (%rax),%edx
mov    0x27ea(%rip),%rax
mov    (%rax),%ecx
mov    0x27d9(%rip),%rax
or     (%rax),%ecx
mov    -0x404(%rbp),%r8d
mov    -0x418(%rbp),%r9
mov    $0x3e8,%esi
call   1050 <mmap@plt>
mov    %rax,-0x410(%rbp)
mov    -0x410(%rbp),%rax
mov    0x27a2(%rip),%rcx
cmp    (%rcx),%rax
je     181f <main+0x65f>
lea    0x8b3(%rip),%rdi
call   1040 <puts@plt>
movl   $0x1,-0x8(%rbp)
jmp    186b <main+0x6ab>
mov    0x279a(%rip),%rax
mov    (%rax),%rax
mov    0x2788(%rip),%rcx
cmp    (%rcx),%rax
je     1866 <main+0x6a6>
mov    0x2780(%rip),%rax
mov    (%rax),%rax
mov    0x278e(%rip),%rcx
cmp    (%rcx),%rax
je     1866 <main+0x6a6>
lea    0x89c(%rip),%rdi
call   1040 <puts@plt>
movl   $0x1,-0x8(%rbp)
jmp    186b <main+0x6ab>
mov    -0x420(%rbp),%rdi
add    $0x1,%rdi
mov    0x277b(%rip),%rax
mov    (%rax),%edx
mov    0x272a(%rip),%rax
mov    (%rax),%ecx
mov    0x2719(%rip),%rax
or     (%rax),%ecx
mov    -0x404(%rbp),%r8d
mov    -0x418(%rbp),%r9
mov    $0x3e8,%esi
call   10a0 <mmap64@plt>
mov    %rax,-0x410(%rbp)
mov    -0x410(%rbp),%rax
mov    0x26e2(%rip),%rcx
cmp    (%rcx),%rax
je     18df <main+0x71f>
lea    0x7f3(%rip),%rdi
call   1040 <puts@plt>
movl   $0x1,-0x8(%rbp)
jmp    192b <main+0x76b>
mov    0x26da(%rip),%rax
mov    (%rax),%rax
mov    0x26c8(%rip),%rcx
cmp    (%rcx),%rax
je     1926 <main+0x766>
mov    0x26c0(%rip),%rax
mov    (%rax),%rax
mov    0x26ce(%rip),%rcx
cmp    (%rcx),%rax
je     1926 <main+0x766>
lea    0x7dc(%rip),%rdi
call   1040 <puts@plt>
movl   $0x1,-0x8(%rbp)
jmp    192b <main+0x76b>
mov    -0x420(%rbp),%rdi
call   1030 <free@plt>
mov    0x26ba(%rip),%rax
mov    (%rax),%edx
mov    0x26a1(%rip),%rax
mov    (%rax),%ecx
mov    -0x404(%rbp),%r8d
mov    -0x418(%rbp),%r9
xor    %eax,%eax
mov    %eax,%edi
mov    $0x3e8,%esi
call   1050 <mmap@plt>
mov    %rax,-0x410(%rbp)
mov    -0x410(%rbp),%rax
mov    0x2626(%rip),%rcx
cmp    (%rcx),%rax
jne    19b7 <main+0x7f7>
mov    0x2636(%rip),%rax
mov    (%rax),%rax
mov    0x2644(%rip),%rcx
cmp    (%rcx),%rax
je     19b2 <main+0x7f2>
lea    0x7a9(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0x8(%rbp)
jmp    1a50 <main+0x890>
mov    -0x418(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x418(%rbp),%rcx
add    $0x3e8,%rcx
cmp    %rcx,%rax
jae    1a4b <main+0x88b>
mov    -0x410(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    -0x418(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
mov    %rax,-0x430(%rbp)
mov    -0x18(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    -0x430(%rbp),%rax
add    $0x30,%rdx
cmp    %rdx,%rax
je     1a35 <main+0x875>
mov    -0x18(%rbp),%rsi
lea    0x73c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0x8(%rbp)
jmp    1a3a <main+0x87a>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    19c2 <main+0x802>
jmp    1a50 <main+0x890>
mov    0x25a1(%rip),%rax
mov    (%rax),%edx
mov    0x2588(%rip),%rax
mov    (%rax),%ecx
mov    -0x404(%rbp),%r8d
mov    -0x418(%rbp),%r9
xor    %eax,%eax
mov    %eax,%edi
mov    $0x3e8,%esi
call   10a0 <mmap64@plt>
mov    %rax,-0x410(%rbp)
mov    -0x410(%rbp),%rax
mov    0x250d(%rip),%rcx
cmp    (%rcx),%rax
jne    1ad0 <main+0x910>
mov    0x251d(%rip),%rax
mov    (%rax),%rax
mov    0x252b(%rip),%rcx
cmp    (%rcx),%rax
je     1acb <main+0x90b>
lea    0x690(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0x8(%rbp)
jmp    1b69 <main+0x9a9>
mov    -0x418(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x418(%rbp),%rcx
add    $0x3e8,%rcx
cmp    %rcx,%rax
jae    1b64 <main+0x9a4>
mov    -0x410(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    -0x418(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
mov    %rax,-0x438(%rbp)
mov    -0x18(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    -0x438(%rbp),%rax
add    $0x30,%rdx
cmp    %rdx,%rax
je     1b4e <main+0x98e>
mov    -0x18(%rbp),%rsi
lea    0x623(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0x8(%rbp)
jmp    1b53 <main+0x993>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1adb <main+0x91b>
jmp    1b69 <main+0x9a9>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x440,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x3f8,%rsp
mov    0x2df8(%rip),%rax
mov    (%rax),%edi
call   10d0 <sysconf@plt>
mov    %rax,%r12
xor    %eax,%eax
call   1070 <tmpfile@plt>
test   %rax,%rax
je     130a <main+0x14a>
mov    %rax,%r14
mov    %rax,%rdi
call   1090 <fileno@plt>
mov    %eax,0x4(%rsp)
movdqa 0xdf7(%rip),%xmm5
movdqa 0xdff(%rip),%xmm4
mov    $0x10,%eax
movdqa 0xe02(%rip),%xmm2
movdqa 0xe0a(%rip),%xmm3
movdqa 0xe11(%rip),%xmm8
movdqa 0xe18(%rip),%xmm9
movdqa 0xe20(%rip),%xmm6
movdqa %xmm4,%xmm7
pmulhuw %xmm2,%xmm7
psrlw  $0x3,%xmm7
pmullw %xmm3,%xmm7
movdqa %xmm4,%xmm1
psubw  %xmm7,%xmm1
movdqa %xmm5,%xmm7
pmulhuw %xmm2,%xmm7
psrlw  $0x3,%xmm7
pmullw %xmm3,%xmm7
movdqa %xmm5,%xmm0
psubw  %xmm7,%xmm0
packuswb %xmm0,%xmm1
por    %xmm8,%xmm1
movdqa %xmm1,(%rsp,%rax,1)
movdqa %xmm5,%xmm0
paddw  %xmm9,%xmm0
movdqa %xmm4,%xmm1
paddw  %xmm9,%xmm1
movdqa %xmm1,%xmm7
pmulhuw %xmm2,%xmm7
psrlw  $0x3,%xmm7
pmullw %xmm3,%xmm7
psubw  %xmm7,%xmm1
movdqa %xmm0,%xmm7
pmulhuw %xmm2,%xmm7
psrlw  $0x3,%xmm7
pmullw %xmm3,%xmm7
psubw  %xmm7,%xmm0
packuswb %xmm0,%xmm1
por    %xmm8,%xmm1
movdqa %xmm1,0x10(%rsp,%rax,1)
paddw  %xmm6,%xmm4
paddw  %xmm6,%xmm5
add    $0x20,%rax
cmp    $0x3f0,%rax
jne    1240 <main+0x80>
movabs $0x3938373635343332,%rax
37 38 39
mov    %rax,0x3f0(%rsp)
lea    0x0(,%r12,4),%rax
cmp    $0x3e8,%rax
jae    1336 <main+0x176>
xor    %r13d,%r13d
jmp    1382 <main+0x1c2>
lea    0xd5f(%rip),%r15
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x1,%r13d
mov    %r13d,%eax
add    $0x3f8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
shr    $0x3,%rax
movabs $0x20c49ba5e353f7cf,%rcx
9b c4 20
mul    %rcx
mov    %rdx,%r13
shr    $0x4,%r13
lea    0x10(%rsp),%rbx
lea    0xd38(%rip),%r15
mov    %r13,%rbp
nopl   (%rax)
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x3e8,%edx
mov    %r14,%rcx
call   10e0 <fwrite@plt>
cmp    $0x3e8,%eax
jne    1311 <main+0x151>
add    $0xffffffffffffffff,%rbp
jne    1360 <main+0x1a0>
mov    %r14,%rdi
call   10c0 <fflush@plt>
lea    0x3e8(%r12),%rcx
imul   $0x3e8,%r13,%rax
xor    %edi,%edi
mov    %rcx,0x8(%rsp)
cmp    %rax,%rcx
setb   %dil
call   1080 <assert@plt>
mov    0x2c45(%rip),%rbx
mov    (%rbx),%edx
mov    0x2c2c(%rip),%rax
mov    (%rax),%ecx
lea    -0x1(%r12),%r15
xor    %r13d,%r13d
xor    %edi,%edi
mov    $0x3e8,%esi
mov    0x4(%rsp),%ebp
mov    %ebp,%r8d
mov    %r15,%r9
call   1050 <mmap@plt>
mov    0x2bbd(%rip),%r14
cmp    (%r14),%rax
je     13f1 <main+0x231>
lea    0xcb8(%rip),%rdi
jmp    141a <main+0x25a>
mov    0x2bc8(%rip),%rax
mov    (%rax),%rax
mov    0x2bb6(%rip),%rcx
cmp    (%rcx),%rax
je     1425 <main+0x265>
mov    0x2bca(%rip),%rcx
cmp    (%rcx),%rax
je     1425 <main+0x265>
lea    0xcc1(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%r13d
mov    (%rbx),%edx
mov    0x2bba(%rip),%rax
mov    (%rax),%ecx
xor    %edi,%edi
mov    $0x3e8,%esi
mov    %ebp,%r8d
mov    %r15,%r9
call   10a0 <mmap64@plt>
cmp    (%r14),%rax
je     1450 <main+0x290>
lea    0xc59(%rip),%rdi
jmp    1479 <main+0x2b9>
mov    0x2b69(%rip),%rax
mov    (%rax),%rax
mov    0x2b57(%rip),%rcx
cmp    (%rcx),%rax
je     1484 <main+0x2c4>
mov    0x2b6b(%rip),%rcx
cmp    (%rcx),%rax
je     1484 <main+0x2c4>
lea    0xc62(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%r13d
mov    (%rbx),%edx
mov    0x2b23(%rip),%rax
mov    (%rax),%ecx
xor    %edi,%edi
mov    $0x3e8,%esi
mov    %ebp,%r8d
mov    %r15,%r9
call   1050 <mmap@plt>
cmp    (%r14),%rax
je     14af <main+0x2ef>
lea    0xbfa(%rip),%rdi
jmp    14d8 <main+0x318>
mov    0x2b0a(%rip),%rax
mov    (%rax),%rax
mov    0x2af8(%rip),%rcx
cmp    (%rcx),%rax
je     14e3 <main+0x323>
mov    0x2b0c(%rip),%rcx
cmp    (%rcx),%rax
je     14e3 <main+0x323>
lea    0xc03(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%r13d
mov    (%rbx),%edx
mov    0x2ac4(%rip),%rax
mov    (%rax),%ecx
xor    %edi,%edi
mov    $0x3e8,%esi
mov    %ebp,%r8d
mov    %r15,%r9
call   10a0 <mmap64@plt>
cmp    (%r14),%rax
je     150e <main+0x34e>
lea    0xb9b(%rip),%rdi
jmp    1537 <main+0x377>
mov    0x2aab(%rip),%rax
mov    (%rax),%rax
mov    0x2a99(%rip),%rcx
cmp    (%rcx),%rax
je     1542 <main+0x382>
mov    0x2aad(%rip),%rcx
cmp    (%rcx),%rax
je     1542 <main+0x382>
lea    0xba4(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%r13d
lea    (%r12,%r12,1),%edi
call   10b0 <malloc@plt>
test   %rax,%rax
je     1738 <main+0x578>
mov    %ebp,%r8d
mov    %rax,%rbp
lea    0x1(%rax),%r15
mov    (%rbx),%edx
mov    0x2a41(%rip),%rbx
mov    (%rbx),%ecx
mov    0x2a78(%rip),%rax
or     (%rax),%ecx
mov    %r15,%rdi
mov    $0x3e8,%esi
mov    %r12,%r9
call   1050 <mmap@plt>
cmp    (%r14),%rax
je     1590 <main+0x3d0>
lea    0xba3(%rip),%rdi
jmp    15b9 <main+0x3f9>
mov    0x2a29(%rip),%rax
mov    (%rax),%rax
mov    0x2a17(%rip),%rcx
cmp    (%rcx),%rax
je     15c4 <main+0x404>
mov    0x2a2b(%rip),%rcx
cmp    (%rcx),%rax
je     15c4 <main+0x404>
lea    0xbad(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%r13d
mov    0x2a2d(%rip),%rax
mov    (%rax),%edx
mov    (%rbx),%ecx
mov    0x2a12(%rip),%rax
or     (%rax),%ecx
mov    %r15,%rdi
mov    $0x3e8,%esi
mov    0x4(%rsp),%r8d
mov    %r12,%r9
call   10a0 <mmap64@plt>
mov    0x29ac(%rip),%rcx
cmp    (%rcx),%rax
je     1602 <main+0x442>
lea    0xb31(%rip),%rdi
jmp    162b <main+0x46b>
mov    0x29b7(%rip),%rax
mov    (%rax),%rax
mov    0x29a5(%rip),%rcx
cmp    (%rcx),%rax
je     1636 <main+0x476>
mov    0x29b9(%rip),%rcx
cmp    (%rcx),%rax
je     1636 <main+0x476>
lea    0xb3b(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%r13d
mov    0x29bb(%rip),%rax
mov    (%rax),%edx
mov    (%rbx),%ecx
mov    0x2968(%rip),%rax
or     (%rax),%ecx
mov    %r15,%rdi
mov    $0x3e8,%esi
mov    0x4(%rsp),%r8d
mov    %r12,%r9
call   1050 <mmap@plt>
mov    0x293a(%rip),%rcx
cmp    (%rcx),%rax
je     1674 <main+0x4b4>
lea    0xabf(%rip),%rdi
jmp    169d <main+0x4dd>
mov    0x2945(%rip),%rax
mov    (%rax),%rax
mov    0x2933(%rip),%rcx
cmp    (%rcx),%rax
je     16a8 <main+0x4e8>
mov    0x2947(%rip),%rcx
cmp    (%rcx),%rax
je     16a8 <main+0x4e8>
lea    0xac9(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%r13d
mov    0x2949(%rip),%rax
mov    (%rax),%edx
mov    (%rbx),%ecx
mov    0x28f6(%rip),%rax
or     (%rax),%ecx
mov    %r15,%rdi
mov    $0x3e8,%esi
mov    0x4(%rsp),%r8d
mov    %r12,%r9
call   10a0 <mmap64@plt>
mov    0x28c8(%rip),%r14
cmp    (%r14),%rax
je     16ed <main+0x52d>
lea    0xa4d(%rip),%rdi
mov    0x290d(%rip),%rbx
jmp    1721 <main+0x561>
mov    0x28cc(%rip),%rax
mov    (%rax),%rax
mov    0x28ba(%rip),%rcx
cmp    (%rcx),%rax
je     18c3 <main+0x703>
mov    0x28ca(%rip),%rcx
cmp    (%rcx),%rax
mov    0x28e0(%rip),%rbx
je     172c <main+0x56c>
lea    0xa45(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%r13d
mov    %rbp,%rdi
call   1030 <free@plt>
mov    0x4(%rsp),%ebp
mov    (%rbx),%edx
mov    0x28a7(%rip),%rax
mov    (%rax),%ecx
xor    %edi,%edi
mov    $0x3e8,%esi
mov    %ebp,%r8d
mov    %r12,%r9
call   1050 <mmap@plt>
cmp    (%r14),%rax
je     17c9 <main+0x609>
cmp    $0xfffffffffffffc17,%r12
ja     17f3 <main+0x633>
mov    %rax,%rbp
movabs $0xcccccccccccccccd,%r14
cc cc cc
lea    0xa58(%rip),%r15
mov    %r12,%rbx
jmp    178f <main+0x5cf>
add    $0x1,%rbx
add    $0x1,%rbp
cmp    0x8(%rsp),%rbx
jae    17f3 <main+0x633>
mov    %rbx,%rax
mul    %r14
shr    $0x2,%rdx
and    $0xfffffffffffffffe,%rdx
lea    (%rdx,%rdx,4),%rax
movzbl 0x0(%rbp),%ecx
mov    %rbx,%rdx
sub    %rax,%rdx
or     $0x30,%rdx
cmp    %rcx,%rdx
je     1780 <main+0x5c0>
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x1,%r13d
jmp    1780 <main+0x5c0>
mov    0x27f0(%rip),%rax
mov    (%rax),%rax
mov    0x27fe(%rip),%rcx
cmp    (%rcx),%rax
je     17f3 <main+0x633>
lea    0x9d7(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x1,%r13d
mov    0x27fe(%rip),%rax
mov    (%rax),%edx
mov    0x27e5(%rip),%rax
mov    (%rax),%ecx
xor    %edi,%edi
mov    $0x3e8,%esi
mov    0x4(%rsp),%r8d
mov    %r12,%r9
call   10a0 <mmap64@plt>
mov    %rax,%rbp
mov    0x277d(%rip),%rax
cmp    (%rax),%rbp
je     189d <main+0x6dd>
cmp    $0xfffffffffffffc17,%r12
ja     1321 <main+0x161>
movabs $0xcccccccccccccccd,%rbx
cc cc cc
lea    0x98d(%rip),%r14
jmp    1863 <main+0x6a3>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r12
add    $0x1,%rbp
cmp    0x8(%rsp),%r12
jae    1321 <main+0x161>
mov    %r12,%rax
mul    %rbx
shr    $0x2,%rdx
and    $0xfffffffffffffffe,%rdx
lea    (%rdx,%rdx,4),%rax
movzbl 0x0(%rbp),%ecx
mov    %r12,%rdx
sub    %rax,%rdx
or     $0x30,%rdx
cmp    %rcx,%rdx
je     1850 <main+0x690>
mov    %r14,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x1,%r13d
jmp    1850 <main+0x690>
mov    0x271c(%rip),%rax
mov    (%rax),%rax
mov    0x272a(%rip),%rcx
cmp    (%rcx),%rax
je     1321 <main+0x161>
lea    0x8ff(%rip),%r15
jmp    1311 <main+0x151>
mov    0x272e(%rip),%rbx
jmp    172c <main+0x56c>

LLVM IR (-O0):
@_SC_PAGESIZE = global i32 0
@.str = [34 x i8] c"Cannot create temporary file: %m\0A\00"
@.str.1 = [21 x i8] c"`fwrite' failed: %m\0A\00"
@PROT_READ = global i32 0
@MAP_SHARED = global i32 0
@MAP_FAILED = global i8* null
@.str.2 = [52 x i8] c"mapping at offset with mod pagesize != 0 succeeded!\00"
@errno = global i64 0
@EINVAL = global i64 0
@ENOSYS = global i64 0
@.str.3 = [86 x i8] c"wrong error value for mapping at offset with mod pagesize != 0: %m (should be EINVAL)\00"
@MAP_PRIVATE = global i32 0
@MAP_FIXED = global i32 0
@.str.4 = [53 x i8] c"mapping at address with mod pagesize != 0 succeeded!\00"
@.str.5 = [87 x i8] c"wrong error value for mapping at address with mod pagesize != 0: %m (should be EINVAL)\00"
@.str.6 = [22 x i8] c"cannot mmap file: %m\0A\00"
@.str.7 = [33 x i8] c"wrong data mapped at offset %zd\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i64
%5 = alloca [1000 x i8]
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i8*
store i32 0, i32* %1
store i32 0, i32* %2
%10 = load i32, i32* @_SC_PAGESIZE
%11 = call i64 @sysconf(i32 %10)
store i64 %11, i64* %8
%12 = call i32* (...) @tmpfile()
store i32* %12, i32** %3
%13 = load i32*, i32** %3
%14 = icmp eq i32* %13, null
br i1 %14, label %15, label %17
15: ; preds = %0
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %1
br label %355
17: ; preds = %0
%18 = load i32*, i32** %3
%19 = call i32 @fileno(i32* %18)
store i32 %19, i32* %6
store i64 0, i64* %4
br label %20
20: ; preds = %30, %17
%21 = load i64, i64* %4
%22 = icmp ult i64 %21, 1000
br i1 %22, label %23, label %33
23: ; preds = %20
%24 = load i64, i64* %4
%25 = urem i64 %24, 10
%26 = add i64 48, %25
%27 = trunc i64 %26 to i8
%28 = load i64, i64* %4
%29 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 %28
store i8 %27, i8* %29
br label %30
30: ; preds = %23
%31 = load i64, i64* %4
%32 = add i64 %31, 1
store i64 %32, i64* %4
br label %20
33: ; preds = %20
store i64 0, i64* %4
br label %34
34: ; preds = %49, %33
%35 = load i64, i64* %4
%36 = load i64, i64* %8
%37 = mul i64 %36, 4
%38 = udiv i64 %37, 1000
%39 = icmp ult i64 %35, %38
br i1 %39, label %40, label %52
40: ; preds = %34
%41 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%42 = load i32*, i32** %3
%43 = call i32 @fwrite(i8* %41, i32 1, i32 1000, i32* %42)
%44 = sext i32 %43 to i64
%45 = icmp ne i64 %44, 1000
br i1 %45, label %46, label %48
46: ; preds = %40
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %1
br label %355
48: ; preds = %40
br label %49
49: ; preds = %48
%50 = load i64, i64* %4
%51 = add i64 %50, 1
store i64 %51, i64* %4
br label %34
52: ; preds = %34
%53 = load i32*, i32** %3
%54 = call i32 @fflush(i32* %53)
%55 = load i64, i64* %8
%56 = add i64 %55, 1000
%57 = load i64, i64* %4
%58 = mul i64 %57, 1000
%59 = icmp ult i64 %56, %58
%60 = zext i1 %59 to i32
%61 = call i32 @assert(i32 %60)
%62 = load i32, i32* @PROT_READ
%63 = load i32, i32* @MAP_SHARED
%64 = load i32, i32* %6
%65 = load i64, i64* %8
%66 = sub i64 %65, 1
%67 = call i8* @mmap(i8* null, i32 1000, i32 %62, i32 %63, i32 %64, i64 %66)
store i8* %67, i8** %7
%68 = load i8*, i8** %7
%69 = load i8*, i8** @MAP_FAILED
%70 = icmp ne i8* %68, %69
br i1 %70, label %71, label %73
71: ; preds = %52
%72 = call i32 @puts(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %2
br label %84
73: ; preds = %52
%74 = load i64, i64* @errno
%75 = load i64, i64* @EINVAL
%76 = icmp ne i64 %74, %75
br i1 %76, label %77, label %83
77: ; preds = %73
%78 = load i64, i64* @errno
%79 = load i64, i64* @ENOSYS
%80 = icmp ne i64 %78, %79
br i1 %80, label %81, label %83
81: ; preds = %77
%82 = call i32 @puts(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %2
br label %83
83: ; preds = %81, %77, %73
br label %84
84: ; preds = %83, %71
%85 = load i32, i32* @PROT_READ
%86 = load i32, i32* @MAP_SHARED
%87 = load i32, i32* %6
%88 = load i64, i64* %8
%89 = sub i64 %88, 1
%90 = call i8* @mmap64(i8* null, i32 1000, i32 %85, i32 %86, i32 %87, i64 %89)
store i8* %90, i8** %7
%91 = load i8*, i8** %7
%92 = load i8*, i8** @MAP_FAILED
%93 = icmp ne i8* %91, %92
br i1 %93, label %94, label %96
94: ; preds = %84
%95 = call i32 @puts(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %2
br label %107
96: ; preds = %84
%97 = load i64, i64* @errno
%98 = load i64, i64* @EINVAL
%99 = icmp ne i64 %97, %98
br i1 %99, label %100, label %106
100: ; preds = %96
%101 = load i64, i64* @errno
%102 = load i64, i64* @ENOSYS
%103 = icmp ne i64 %101, %102
br i1 %103, label %104, label %106
104: ; preds = %100
%105 = call i32 @puts(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %2
br label %106
106: ; preds = %104, %100, %96
br label %107
107: ; preds = %106, %94
%108 = load i32, i32* @PROT_READ
%109 = load i32, i32* @MAP_PRIVATE
%110 = load i32, i32* %6
%111 = load i64, i64* %8
%112 = sub i64 %111, 1
%113 = call i8* @mmap(i8* null, i32 1000, i32 %108, i32 %109, i32 %110, i64 %112)
store i8* %113, i8** %7
%114 = load i8*, i8** %7
%115 = load i8*, i8** @MAP_FAILED
%116 = icmp ne i8* %114, %115
br i1 %116, label %117, label %119
117: ; preds = %107
%118 = call i32 @puts(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %2
br label %130
119: ; preds = %107
%120 = load i64, i64* @errno
%121 = load i64, i64* @EINVAL
%122 = icmp ne i64 %120, %121
br i1 %122, label %123, label %129
123: ; preds = %119
%124 = load i64, i64* @errno
%125 = load i64, i64* @ENOSYS
%126 = icmp ne i64 %124, %125
br i1 %126, label %127, label %129
127: ; preds = %123
%128 = call i32 @puts(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %2
br label %129
129: ; preds = %127, %123, %119
br label %130
130: ; preds = %129, %117
%131 = load i32, i32* @PROT_READ
%132 = load i32, i32* @MAP_PRIVATE
%133 = load i32, i32* %6
%134 = load i64, i64* %8
%135 = sub i64 %134, 1
%136 = call i8* @mmap64(i8* null, i32 1000, i32 %131, i32 %132, i32 %133, i64 %135)
store i8* %136, i8** %7
%137 = load i8*, i8** %7
%138 = load i8*, i8** @MAP_FAILED
%139 = icmp ne i8* %137, %138
br i1 %139, label %140, label %142
140: ; preds = %130
%141 = call i32 @puts(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %2
br label %153
142: ; preds = %130
%143 = load i64, i64* @errno
%144 = load i64, i64* @EINVAL
%145 = icmp ne i64 %143, %144
br i1 %145, label %146, label %152
146: ; preds = %142
%147 = load i64, i64* @errno
%148 = load i64, i64* @ENOSYS
%149 = icmp ne i64 %147, %148
br i1 %149, label %150, label %152
150: ; preds = %146
%151 = call i32 @puts(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %2
br label %152
152: ; preds = %150, %146, %142
br label %153
153: ; preds = %152, %140
%154 = load i64, i64* %8
%155 = mul i64 2, %154
%156 = trunc i64 %155 to i32
%157 = call i8* @malloc(i32 %156)
store i8* %157, i8** %9
%158 = load i8*, i8** %9
%159 = icmp ne i8* %158, null
br i1 %159, label %160, label %267
160: ; preds = %153
%161 = load i8*, i8** %9
%162 = getelementptr i8, i8* %161, i64 1
%163 = load i32, i32* @PROT_READ
%164 = load i32, i32* @MAP_SHARED
%165 = load i32, i32* @MAP_FIXED
%166 = or i32 %164, %165
%167 = load i32, i32* %6
%168 = load i64, i64* %8
%169 = call i8* @mmap(i8* %162, i32 1000, i32 %163, i32 %166, i32 %167, i64 %168)
store i8* %169, i8** %7
%170 = load i8*, i8** %7
%171 = load i8*, i8** @MAP_FAILED
%172 = icmp ne i8* %170, %171
br i1 %172, label %173, label %175
173: ; preds = %160
%174 = call i32 @puts(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %2
br label %186
175: ; preds = %160
%176 = load i64, i64* @errno
%177 = load i64, i64* @EINVAL
%178 = icmp ne i64 %176, %177
br i1 %178, label %179, label %185
179: ; preds = %175
%180 = load i64, i64* @errno
%181 = load i64, i64* @ENOSYS
%182 = icmp ne i64 %180, %181
br i1 %182, label %183, label %185
183: ; preds = %179
%184 = call i32 @puts(i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str.5, i64 0, i64 0))
store i32 1, i32* %2
br label %185
185: ; preds = %183, %179, %175
br label %186
186: ; preds = %185, %173
%187 = load i8*, i8** %9
%188 = getelementptr i8, i8* %187, i64 1
%189 = load i32, i32* @PROT_READ
%190 = load i32, i32* @MAP_SHARED
%191 = load i32, i32* @MAP_FIXED
%192 = or i32 %190, %191
%193 = load i32, i32* %6
%194 = load i64, i64* %8
%195 = call i8* @mmap64(i8* %188, i32 1000, i32 %189, i32 %192, i32 %193, i64 %194)
store i8* %195, i8** %7
%196 = load i8*, i8** %7
%197 = load i8*, i8** @MAP_FAILED
%198 = icmp ne i8* %196, %197
br i1 %198, label %199, label %201
199: ; preds = %186
%200 = call i32 @puts(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %2
br label %212
201: ; preds = %186
%202 = load i64, i64* @errno
%203 = load i64, i64* @EINVAL
%204 = icmp ne i64 %202, %203
br i1 %204, label %205, label %211
205: ; preds = %201
%206 = load i64, i64* @errno
%207 = load i64, i64* @ENOSYS
%208 = icmp ne i64 %206, %207
br i1 %208, label %209, label %211
209: ; preds = %205
%210 = call i32 @puts(i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str.5, i64 0, i64 0))
store i32 1, i32* %2
br label %211
211: ; preds = %209, %205, %201
br label %212
212: ; preds = %211, %199
%213 = load i8*, i8** %9
%214 = getelementptr i8, i8* %213, i64 1
%215 = load i32, i32* @PROT_READ
%216 = load i32, i32* @MAP_PRIVATE
%217 = load i32, i32* @MAP_FIXED
%218 = or i32 %216, %217
%219 = load i32, i32* %6
%220 = load i64, i64* %8
%221 = call i8* @mmap(i8* %214, i32 1000, i32 %215, i32 %218, i32 %219, i64 %220)
store i8* %221, i8** %7
%222 = load i8*, i8** %7
%223 = load i8*, i8** @MAP_FAILED
%224 = icmp ne i8* %222, %223
br i1 %224, label %225, label %227
225: ; preds = %212
%226 = call i32 @puts(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %2
br label %238
227: ; preds = %212
%228 = load i64, i64* @errno
%229 = load i64, i64* @EINVAL
%230 = icmp ne i64 %228, %229
br i1 %230, label %231, label %237
231: ; preds = %227
%232 = load i64, i64* @errno
%233 = load i64, i64* @ENOSYS
%234 = icmp ne i64 %232, %233
br i1 %234, label %235, label %237
235: ; preds = %231
%236 = call i32 @puts(i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str.5, i64 0, i64 0))
store i32 1, i32* %2
br label %237
237: ; preds = %235, %231, %227
br label %238
238: ; preds = %237, %225
%239 = load i8*, i8** %9
%240 = getelementptr i8, i8* %239, i64 1
%241 = load i32, i32* @PROT_READ
%242 = load i32, i32* @MAP_PRIVATE
%243 = load i32, i32* @MAP_FIXED
%244 = or i32 %242, %243
%245 = load i32, i32* %6
%246 = load i64, i64* %8
%247 = call i8* @mmap64(i8* %240, i32 1000, i32 %241, i32 %244, i32 %245, i64 %246)
store i8* %247, i8** %7
%248 = load i8*, i8** %7
%249 = load i8*, i8** @MAP_FAILED
%250 = icmp ne i8* %248, %249
br i1 %250, label %251, label %253
251: ; preds = %238
%252 = call i32 @puts(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %2
br label %264
253: ; preds = %238
%254 = load i64, i64* @errno
%255 = load i64, i64* @EINVAL
%256 = icmp ne i64 %254, %255
br i1 %256, label %257, label %263
257: ; preds = %253
%258 = load i64, i64* @errno
%259 = load i64, i64* @ENOSYS
%260 = icmp ne i64 %258, %259
br i1 %260, label %261, label %263
261: ; preds = %257
%262 = call i32 @puts(i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str.5, i64 0, i64 0))
store i32 1, i32* %2
br label %263
263: ; preds = %261, %257, %253
br label %264
264: ; preds = %263, %251
%265 = load i8*, i8** %9
%266 = call i32 @free(i8* %265)
br label %267
267: ; preds = %264, %153
%268 = load i32, i32* @PROT_READ
%269 = load i32, i32* @MAP_SHARED
%270 = load i32, i32* %6
%271 = load i64, i64* %8
%272 = call i8* @mmap(i8* null, i32 1000, i32 %268, i32 %269, i32 %270, i64 %271)
store i8* %272, i8** %7
%273 = load i8*, i8** %7
%274 = load i8*, i8** @MAP_FAILED
%275 = icmp eq i8* %273, %274
br i1 %275, label %276, label %283
276: ; preds = %267
%277 = load i64, i64* @errno
%278 = load i64, i64* @ENOSYS
%279 = icmp ne i64 %277, %278
br i1 %279, label %280, label %282
280: ; preds = %276
%281 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0))
store i32 1, i32* %2
br label %282
282: ; preds = %280, %276
br label %310
283: ; preds = %267
%284 = load i64, i64* %8
store i64 %284, i64* %4
br label %285
285: ; preds = %306, %283
%286 = load i64, i64* %4
%287 = load i64, i64* %8
%288 = add i64 %287, 1000
%289 = icmp ult i64 %286, %288
br i1 %289, label %290, label %309
290: ; preds = %285
%291 = load i8*, i8** %7
%292 = load i64, i64* %4
%293 = load i64, i64* %8
%294 = sub i64 %292, %293
%295 = getelementptr inbounds i8, i8* %291, i64 %294
%296 = load i8, i8* %295
%297 = zext i8 %296 to i64
%298 = load i64, i64* %4
%299 = urem i64 %298, 10
%300 = add i64 48, %299
%301 = icmp ne i64 %297, %300
br i1 %301, label %302, label %305
302: ; preds = %290
%303 = load i64, i64* %4
%304 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0), i64 %303)
store i32 1, i32* %2
br label %305
305: ; preds = %302, %290
br label %306
306: ; preds = %305
%307 = load i64, i64* %4
%308 = add i64 %307, 1
store i64 %308, i64* %4
br label %285
309: ; preds = %285
br label %310
310: ; preds = %309, %282
%311 = load i32, i32* @PROT_READ
%312 = load i32, i32* @MAP_SHARED
%313 = load i32, i32* %6
%314 = load i64, i64* %8
%315 = call i8* @mmap64(i8* null, i32 1000, i32 %311, i32 %312, i32 %313, i64 %314)
store i8* %315, i8** %7
%316 = load i8*, i8** %7
%317 = load i8*, i8** @MAP_FAILED
%318 = icmp eq i8* %316, %317
br i1 %318, label %319, label %326
319: ; preds = %310
%320 = load i64, i64* @errno
%321 = load i64, i64* @ENOSYS
%322 = icmp ne i64 %320, %321
br i1 %322, label %323, label %325
323: ; preds = %319
%324 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0))
store i32 1, i32* %2
br label %325
325: ; preds = %323, %319
br label %353
326: ; preds = %310
%327 = load i64, i64* %8
store i64 %327, i64* %4
br label %328
328: ; preds = %349, %326
%329 = load i64, i64* %4
%330 = load i64, i64* %8
%331 = add i64 %330, 1000
%332 = icmp ult i64 %329, %331
br i1 %332, label %333, label %352
333: ; preds = %328
%334 = load i8*, i8** %7
%335 = load i64, i64* %4
%336 = load i64, i64* %8
%337 = sub i64 %335, %336
%338 = getelementptr inbounds i8, i8* %334, i64 %337
%339 = load i8, i8* %338
%340 = zext i8 %339 to i64
%341 = load i64, i64* %4
%342 = urem i64 %341, 10
%343 = add i64 48, %342
%344 = icmp ne i64 %340, %343
br i1 %344, label %345, label %348
345: ; preds = %333
%346 = load i64, i64* %4
%347 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0), i64 %346)
store i32 1, i32* %2
br label %348
348: ; preds = %345, %333
br label %349
349: ; preds = %348
%350 = load i64, i64* %4
%351 = add i64 %350, 1
store i64 %351, i64* %4
br label %328
352: ; preds = %328
br label %353
353: ; preds = %352, %325
%354 = load i32, i32* %2
store i32 %354, i32* %1
br label %355
355: ; preds = %353, %46, %15
%356 = load i32, i32* %1
ret i32 %356
}

LLVM IR (-O2):
@_SC_PAGESIZE = global i32 0
@.str = [34 x i8] c"Cannot create temporary file: %m\0A\00"
@.str.1 = [21 x i8] c"`fwrite' failed: %m\0A\00"
@PROT_READ = global i32 0
@MAP_SHARED = global i32 0
@MAP_FAILED = global i8* null
@.str.2 = [52 x i8] c"mapping at offset with mod pagesize != 0 succeeded!\00"
@errno = global i64 0
@EINVAL = global i64 0
@ENOSYS = global i64 0
@.str.3 = [86 x i8] c"wrong error value for mapping at offset with mod pagesize != 0: %m (should be EINVAL)\00"
@MAP_PRIVATE = global i32 0
@MAP_FIXED = global i32 0
@.str.4 = [53 x i8] c"mapping at address with mod pagesize != 0 succeeded!\00"
@.str.5 = [87 x i8] c"wrong error value for mapping at address with mod pagesize != 0: %m (should be EINVAL)\00"
@.str.6 = [22 x i8] c"cannot mmap file: %m\0A\00"
@.str.7 = [33 x i8] c"wrong data mapped at offset %zd\0A\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @_SC_PAGESIZE
%4 = tail call i64 @sysconf(i32 %3)
%5 = tail call i32* (...) @tmpfile()
%6 = icmp eq i32* %5, null
br i1 %6, label %267, label %7
7: ; preds = %0
%8 = tail call i32 @fileno(i32* %5)
br label %9
9: ; preds = %9, %7
%10 = phi i64 [ 0, %7 ], [ %24, %9 ]
%11 = phi <16 x i16> [ <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7, i16 8, i16 9, i16 10, i16 11, i16 12, i16 13, i16 14, i16 15>, %7 ], [ %25, %9 ]
%12 = urem <16 x i16> %11, <i16 10, i16 10, i16 10, i16 10, i16 10, i16 10, i16 10, i16 10, i16 10, i16 10, i16 10, i16 10, i16 10, i16 10, i16 10, i16 10>
%13 = trunc <16 x i16> %12 to <16 x i8>
%14 = or <16 x i8> %13, <i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48>
%15 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 %10
%16 = bitcast i8* %15 to <16 x i8>*
store <16 x i8> %14, <16 x i8>* %16
%17 = or i64 %10, 16
%18 = add <16 x i16> %11, <i16 16, i16 16, i16 16, i16 16, i16 16, i16 16, i16 16, i16 16, i16 16, i16 16, i16 16, i16 16, i16 16, i16 16, i16 16, i16 16>
%19 = urem <16 x i16> %18, <i16 10, i16 10, i16 10, i16 10, i16 10, i16 10, i16 10, i16 10, i16 10, i16 10, i16 10, i16 10, i16 10, i16 10, i16 10, i16 10>
%20 = trunc <16 x i16> %19 to <16 x i8>
%21 = or <16 x i8> %20, <i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48>
%22 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 %17
%23 = bitcast i8* %22 to <16 x i8>*
store <16 x i8> %21, <16 x i8>* %23
%24 = add nuw nsw i64 %10, 32
%25 = add <16 x i16> %11, <i16 32, i16 32, i16 32, i16 32, i16 32, i16 32, i16 32, i16 32, i16 32, i16 32, i16 32, i16 32, i16 32, i16 32, i16 32, i16 32>
%26 = icmp eq i64 %24, 992
br i1 %26, label %29, label %9
27: ; preds = %29
%28 = udiv i64 %38, 1000
br label %40
29: ; preds = %9
%30 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 992
store i8 50, i8* %30
%31 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 993
store i8 51, i8* %31
%32 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 994
store i8 52, i8* %32
%33 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 995
store i8 53, i8* %33
%34 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 996
store i8 54, i8* %34
%35 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 997
store i8 55, i8* %35
%36 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 998
store i8 56, i8* %36
%37 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 999
store i8 57, i8* %37
%38 = shl i64 %4, 2
%39 = icmp ult i64 %38, 1000
br i1 %39, label %47, label %27
40: ; preds = %27, %44
%41 = phi i64 [ %45, %44 ], [ 0, %27 ]
%42 = call i32 @fwrite(i8* %2, i32 1, i32 1000, i32* %5)
%43 = icmp eq i32 %42, 1000
br i1 %43, label %44, label %267
44: ; preds = %40
%45 = add nuw nsw i64 %41, 1
%46 = icmp eq i64 %45, %28
br i1 %46, label %47, label %40
47: ; preds = %44, %29
%48 = phi i64 [ 0, %29 ], [ %28, %44 ]
%49 = tail call i32 @fflush(i32* %5)
%50 = add i64 %4, 1000
%51 = mul i64 %48, 1000
%52 = icmp ult i64 %50, %51
%53 = zext i1 %52 to i32
%54 = tail call i32 @assert(i32 %53)
%55 = load i32, i32* @PROT_READ
%56 = load i32, i32* @MAP_SHARED
%57 = add i64 %4, -1
%58 = tail call i8* @mmap(i8* null, i32 1000, i32 %55, i32 %56, i32 %8, i64 %57)
%59 = load i8*, i8** @MAP_FAILED
%60 = icmp eq i8* %58, %59
br i1 %60, label %61, label %68
61: ; preds = %47
%62 = load i64, i64* @errno
%63 = load i64, i64* @EINVAL
%64 = icmp eq i64 %62, %63
%65 = load i64, i64* @ENOSYS
%66 = icmp eq i64 %62, %65
%67 = select i1 %64, i1 true, i1 %66
br i1 %67, label %71, label %68
68: ; preds = %61, %47
%69 = phi i8* [ getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0), %47 ], [ getelementptr inbounds ([86 x i8], [86 x i8]* @.str.3, i64 0, i64 0), %61 ]
%70 = tail call i32 @puts(i8* dereferenceable(1) %69)
br label %71
71: ; preds = %68, %61
%72 = phi i32 [ 0, %61 ], [ 1, %68 ]
%73 = load i32, i32* @PROT_READ
%74 = load i32, i32* @MAP_SHARED
%75 = tail call i8* @mmap64(i8* null, i32 1000, i32 %73, i32 %74, i32 %8, i64 %57)
%76 = load i8*, i8** @MAP_FAILED
%77 = icmp eq i8* %75, %76
br i1 %77, label %78, label %85
78: ; preds = %71
%79 = load i64, i64* @errno
%80 = load i64, i64* @EINVAL
%81 = icmp eq i64 %79, %80
%82 = load i64, i64* @ENOSYS
%83 = icmp eq i64 %79, %82
%84 = select i1 %81, i1 true, i1 %83
br i1 %84, label %88, label %85
85: ; preds = %78, %71
%86 = phi i8* [ getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0), %71 ], [ getelementptr inbounds ([86 x i8], [86 x i8]* @.str.3, i64 0, i64 0), %78 ]
%87 = tail call i32 @puts(i8* dereferenceable(1) %86)
br label %88
88: ; preds = %85, %78
%89 = phi i32 [ %72, %78 ], [ 1, %85 ]
%90 = load i32, i32* @PROT_READ
%91 = load i32, i32* @MAP_PRIVATE
%92 = tail call i8* @mmap(i8* null, i32 1000, i32 %90, i32 %91, i32 %8, i64 %57)
%93 = load i8*, i8** @MAP_FAILED
%94 = icmp eq i8* %92, %93
br i1 %94, label %95, label %102
95: ; preds = %88
%96 = load i64, i64* @errno
%97 = load i64, i64* @EINVAL
%98 = icmp eq i64 %96, %97
%99 = load i64, i64* @ENOSYS
%100 = icmp eq i64 %96, %99
%101 = select i1 %98, i1 true, i1 %100
br i1 %101, label %105, label %102
102: ; preds = %95, %88
%103 = phi i8* [ getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0), %88 ], [ getelementptr inbounds ([86 x i8], [86 x i8]* @.str.3, i64 0, i64 0), %95 ]
%104 = tail call i32 @puts(i8* dereferenceable(1) %103)
br label %105
105: ; preds = %102, %95
%106 = phi i32 [ %89, %95 ], [ 1, %102 ]
%107 = load i32, i32* @PROT_READ
%108 = load i32, i32* @MAP_PRIVATE
%109 = tail call i8* @mmap64(i8* null, i32 1000, i32 %107, i32 %108, i32 %8, i64 %57)
%110 = load i8*, i8** @MAP_FAILED
%111 = icmp eq i8* %109, %110
br i1 %111, label %112, label %119
112: ; preds = %105
%113 = load i64, i64* @errno
%114 = load i64, i64* @EINVAL
%115 = icmp eq i64 %113, %114
%116 = load i64, i64* @ENOSYS
%117 = icmp eq i64 %113, %116
%118 = select i1 %115, i1 true, i1 %117
br i1 %118, label %122, label %119
119: ; preds = %112, %105
%120 = phi i8* [ getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0), %105 ], [ getelementptr inbounds ([86 x i8], [86 x i8]* @.str.3, i64 0, i64 0), %112 ]
%121 = tail call i32 @puts(i8* dereferenceable(1) %120)
br label %122
122: ; preds = %119, %112
%123 = phi i32 [ %106, %112 ], [ 1, %119 ]
%124 = trunc i64 %4 to i32
%125 = shl i32 %124, 1
%126 = tail call i8* @malloc(i32 %125)
%127 = icmp eq i8* %126, null
br i1 %127, label %207, label %128
128: ; preds = %122
%129 = getelementptr i8, i8* %126, i64 1
%130 = load i32, i32* @PROT_READ
%131 = load i32, i32* @MAP_SHARED
%132 = load i32, i32* @MAP_FIXED
%133 = or i32 %132, %131
%134 = tail call i8* @mmap(i8* %129, i32 1000, i32 %130, i32 %133, i32 %8, i64 %4)
%135 = load i8*, i8** @MAP_FAILED
%136 = icmp eq i8* %134, %135
br i1 %136, label %137, label %144
137: ; preds = %128
%138 = load i64, i64* @errno
%139 = load i64, i64* @EINVAL
%140 = icmp eq i64 %138, %139
%141 = load i64, i64* @ENOSYS
%142 = icmp eq i64 %138, %141
%143 = select i1 %140, i1 true, i1 %142
br i1 %143, label %147, label %144
144: ; preds = %137, %128
%145 = phi i8* [ getelementptr inbounds ([53 x i8], [53 x i8]* @.str.4, i64 0, i64 0), %128 ], [ getelementptr inbounds ([87 x i8], [87 x i8]* @.str.5, i64 0, i64 0), %137 ]
%146 = tail call i32 @puts(i8* dereferenceable(1) %145)
br label %147
147: ; preds = %144, %137
%148 = phi i32 [ %123, %137 ], [ 1, %144 ]
%149 = load i32, i32* @PROT_READ
%150 = load i32, i32* @MAP_SHARED
%151 = load i32, i32* @MAP_FIXED
%152 = or i32 %151, %150
%153 = tail call i8* @mmap64(i8* %129, i32 1000, i32 %149, i32 %152, i32 %8, i64 %4)
%154 = load i8*, i8** @MAP_FAILED
%155 = icmp eq i8* %153, %154
br i1 %155, label %156, label %163
156: ; preds = %147
%157 = load i64, i64* @errno
%158 = load i64, i64* @EINVAL
%159 = icmp eq i64 %157, %158
%160 = load i64, i64* @ENOSYS
%161 = icmp eq i64 %157, %160
%162 = select i1 %159, i1 true, i1 %161
br i1 %162, label %166, label %163
163: ; preds = %156, %147
%164 = phi i8* [ getelementptr inbounds ([53 x i8], [53 x i8]* @.str.4, i64 0, i64 0), %147 ], [ getelementptr inbounds ([87 x i8], [87 x i8]* @.str.5, i64 0, i64 0), %156 ]
%165 = tail call i32 @puts(i8* dereferenceable(1) %164)
br label %166
166: ; preds = %163, %156
%167 = phi i32 [ %148, %156 ], [ 1, %163 ]
%168 = load i32, i32* @PROT_READ
%169 = load i32, i32* @MAP_PRIVATE
%170 = load i32, i32* @MAP_FIXED
%171 = or i32 %170, %169
%172 = tail call i8* @mmap(i8* %129, i32 1000, i32 %168, i32 %171, i32 %8, i64 %4)
%173 = load i8*, i8** @MAP_FAILED
%174 = icmp eq i8* %172, %173
br i1 %174, label %175, label %182
175: ; preds = %166
%176 = load i64, i64* @errno
%177 = load i64, i64* @EINVAL
%178 = icmp eq i64 %176, %177
%179 = load i64, i64* @ENOSYS
%180 = icmp eq i64 %176, %179
%181 = select i1 %178, i1 true, i1 %180
br i1 %181, label %185, label %182
182: ; preds = %175, %166
%183 = phi i8* [ getelementptr inbounds ([53 x i8], [53 x i8]* @.str.4, i64 0, i64 0), %166 ], [ getelementptr inbounds ([87 x i8], [87 x i8]* @.str.5, i64 0, i64 0), %175 ]
%184 = tail call i32 @puts(i8* dereferenceable(1) %183)
br label %185
185: ; preds = %182, %175
%186 = phi i32 [ %167, %175 ], [ 1, %182 ]
%187 = load i32, i32* @PROT_READ
%188 = load i32, i32* @MAP_PRIVATE
%189 = load i32, i32* @MAP_FIXED
%190 = or i32 %189, %188
%191 = tail call i8* @mmap64(i8* %129, i32 1000, i32 %187, i32 %190, i32 %8, i64 %4)
%192 = load i8*, i8** @MAP_FAILED
%193 = icmp eq i8* %191, %192
br i1 %193, label %194, label %201
194: ; preds = %185
%195 = load i64, i64* @errno
%196 = load i64, i64* @EINVAL
%197 = icmp eq i64 %195, %196
%198 = load i64, i64* @ENOSYS
%199 = icmp eq i64 %195, %198
%200 = select i1 %197, i1 true, i1 %199
br i1 %200, label %204, label %201
201: ; preds = %194, %185
%202 = phi i8* [ getelementptr inbounds ([53 x i8], [53 x i8]* @.str.4, i64 0, i64 0), %185 ], [ getelementptr inbounds ([87 x i8], [87 x i8]* @.str.5, i64 0, i64 0), %194 ]
%203 = tail call i32 @puts(i8* dereferenceable(1) %202)
br label %204
204: ; preds = %201, %194
%205 = phi i32 [ %186, %194 ], [ 1, %201 ]
%206 = tail call i32 @free(i8* %126)
br label %207
207: ; preds = %204, %122
%208 = phi i32 [ %205, %204 ], [ %123, %122 ]
%209 = load i32, i32* @PROT_READ
%210 = load i32, i32* @MAP_SHARED
%211 = tail call i8* @mmap(i8* null, i32 1000, i32 %209, i32 %210, i32 %8, i64 %4)
%212 = load i8*, i8** @MAP_FAILED
%213 = icmp eq i8* %211, %212
br i1 %213, label %216, label %214
214: ; preds = %207
%215 = icmp ult i64 %4, -1000
br i1 %215, label %222, label %238
216: ; preds = %207
%217 = load i64, i64* @errno
%218 = load i64, i64* @ENOSYS
%219 = icmp eq i64 %217, %218
br i1 %219, label %238, label %220
220: ; preds = %216
%221 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0))
br label %238
222: ; preds = %214, %234
%223 = phi i32 [ %235, %234 ], [ %208, %214 ]
%224 = phi i64 [ %236, %234 ], [ %4, %214 ]
%225 = sub nuw i64 %224, %4
%226 = getelementptr inbounds i8, i8* %211, i64 %225
%227 = load i8, i8* %226
%228 = zext i8 %227 to i64
%229 = urem i64 %224, 10
%230 = or i64 %229, 48
%231 = icmp eq i64 %230, %228
br i1 %231, label %234, label %232
232: ; preds = %222
%233 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0), i64 %224)
br label %234
234: ; preds = %222, %232
%235 = phi i32 [ 1, %232 ], [ %223, %222 ]
%236 = add nuw i64 %224, 1
%237 = icmp ult i64 %236, %50
br i1 %237, label %222, label %238
238: ; preds = %234, %214, %216, %220
%239 = phi i32 [ 1, %220 ], [ %208, %216 ], [ %208, %214 ], [ %235, %234 ]
%240 = load i32, i32* @PROT_READ
%241 = load i32, i32* @MAP_SHARED
%242 = tail call i8* @mmap64(i8* null, i32 1000, i32 %240, i32 %241, i32 %8, i64 %4)
%243 = load i8*, i8** @MAP_FAILED
%244 = icmp eq i8* %242, %243
br i1 %244, label %247, label %245
245: ; preds = %238
%246 = icmp ult i64 %4, -1000
br i1 %246, label %251, label %270
247: ; preds = %238
%248 = load i64, i64* @errno
%249 = load i64, i64* @ENOSYS
%250 = icmp eq i64 %248, %249
br i1 %250, label %270, label %267
251: ; preds = %245, %263
%252 = phi i32 [ %264, %263 ], [ %239, %245 ]
%253 = phi i64 [ %265, %263 ], [ %4, %245 ]
%254 = sub nuw i64 %253, %4
%255 = getelementptr inbounds i8, i8* %242, i64 %254
%256 = load i8, i8* %255
%257 = zext i8 %256 to i64
%258 = urem i64 %253, 10
%259 = or i64 %258, 48
%260 = icmp eq i64 %259, %257
br i1 %260, label %263, label %261
261: ; preds = %251
%262 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0), i64 %253)
br label %263
263: ; preds = %251, %261
%264 = phi i32 [ 1, %261 ], [ %252, %251 ]
%265 = add nuw i64 %253, 1
%266 = icmp ult i64 %265, %50
br i1 %266, label %251, label %270
267: ; preds = %40, %247, %0
%268 = phi i8* [ getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), %0 ], [ getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), %247 ], [ getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), %40 ]
%269 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %268)
br label %270
270: ; preds = %263, %267, %245, %247
%271 = phi i32 [ %239, %247 ], [ %239, %245 ], [ 1, %267 ], [ %264, %263 ]
ret i32 %271
}