#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 */

/* Variables and functions */
int MAP_ANONYMOUS;
char *MAP_FAILED;
int MAP_PRIVATE;
int /*<<< orphan*/ PROT_NONE;
int /*<<< orphan*/ _SC_PAGE_SIZE;
int /*<<< orphan*/ dump_maps();
scalar_t__ errno;
char *mmap(void *, unsigned long, int /*<<< orphan*/, unsigned long, int,
           int /*<<< orphan*/);
scalar_t__ munmap(void *, unsigned long);
int /*<<< orphan*/ printf(char *, ...);
unsigned long sysconf(int /*<<< orphan*/);
int main(void) {
  unsigned long flags, addr, size, page_size;
  char *p;
  page_size = sysconf(_SC_PAGE_SIZE);
  flags = MAP_PRIVATE | MAP_ANONYMOUS | 0x100000;
  errno = 0;
  addr = (256ul * 1024 * 1024);
  size = 5 * page_size;
  p = mmap((void *)addr, size, PROT_NONE, flags, -1, 0);
  printf("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p);
  if (p == MAP_FAILED) {
    dump_maps();
    printf("Error: couldn't map the space we need for the test\n");
    return 1;
  }
  errno = 0;
  if (munmap((void *)addr, 5 * page_size) != 0) {
    dump_maps();
    printf("Error: munmap failed!?\n");
    return 1;
  }
  printf("unmap() successful\n");
  errno = 0;
  addr = (256ul * 1024 * 1024) + page_size;
  size = 3 * page_size;
  p = mmap((void *)addr, size, PROT_NONE, flags, -1, 0);
  printf("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p);
  if (p == MAP_FAILED) {
    dump_maps();
    printf("Error: first mmap() failed unexpectedly\n");
    return 1;
  }
  errno = 0;
  addr = (256ul * 1024 * 1024);
  size = 5 * page_size;
  p = mmap((void *)addr, size, PROT_NONE, flags, -1, 0);
  printf("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p);
  if (p != MAP_FAILED) {
    dump_maps();
    printf("Error:1: mmap() succeeded when it shouldn't have\n");
    return 1;
  }
  errno = 0;
  addr = (256ul * 1024 * 1024) + (2 * page_size);
  size = page_size;
  p = mmap((void *)addr, size, PROT_NONE, flags, -1, 0);
  printf("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p);
  if (p != MAP_FAILED) {
    dump_maps();
    printf("Error:2: mmap() succeeded when it shouldn't have\n");
    return 1;
  }
  errno = 0;
  addr = (256ul * 1024 * 1024) + (3 * page_size);
  size = 2 * page_size;
  p = mmap((void *)addr, size, PROT_NONE, flags, -1, 0);
  printf("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p);
  if (p != MAP_FAILED) {
    dump_maps();
    printf("Error:3: mmap() succeeded when it shouldn't have\n");
    return 1;
  }
  errno = 0;
  addr = (256ul * 1024 * 1024);
  size = 2 * page_size;
  p = mmap((void *)addr, size, PROT_NONE, flags, -1, 0);
  printf("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p);
  if (p != MAP_FAILED) {
    dump_maps();
    printf("Error:4: mmap() succeeded when it shouldn't have\n");
    return 1;
  }
  errno = 0;
  addr = (256ul * 1024 * 1024);
  size = page_size;
  p = mmap((void *)addr, size, PROT_NONE, flags, -1, 0);
  printf("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p);
  if (p == MAP_FAILED) {
    dump_maps();
    printf("Error:5: mmap() failed when it shouldn't have\n");
    return 1;
  }
  errno = 0;
  addr = (256ul * 1024 * 1024) + (4 * page_size);
  size = page_size;
  p = mmap((void *)addr, size, PROT_NONE, flags, -1, 0);
  printf("mmap() @ 0x%lx-0x%lx p=%p result=%m\n", addr, addr + size, p);
  if (p == MAP_FAILED) {
    dump_maps();
    printf("Error:6: mmap() failed when it shouldn't have\n");
    return 1;
  }
  addr = (256ul * 1024 * 1024);
  size = 5 * page_size;
  if (munmap((void *)addr, size) != 0) {
    dump_maps();
    printf("Error: munmap failed!?\n");
    return 1;
  }
  printf("unmap() successful\n");
  printf("OK\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e62(%rip),%rax
mov    (%rax),%edi
call   1070 <sysconf@plt>
mov    %rax,-0x28(%rbp)
mov    0x2e48(%rip),%rax
mov    (%rax),%eax
mov    0x2e5f(%rip),%rcx
or     (%rcx),%eax
or     $0x100000,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    0x2e3b(%rip),%rax
movq   $0x0,(%rax)
movq   $0x10000000,-0x18(%rbp)
10
imul   $0x5,-0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    0x2e34(%rip),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rcx
mov    $0xffffffff,%r8d
xor    %r9d,%r9d
call   1030 <mmap@plt>
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x18(%rbp),%rdx
add    -0x20(%rbp),%rdx
mov    -0x30(%rbp),%rcx
lea    0xe15(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%rax
mov    0x2dbb(%rip),%rcx
cmp    (%rcx),%rax
jne    1227 <main+0xd7>
mov    $0x0,%al
call   1060 <dump_maps@plt>
lea    0xe11(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    173b <main+0x5eb>
mov    0x2da2(%rip),%rax
movq   $0x0,(%rax)
mov    -0x18(%rbp),%rdi
imul   $0x5,-0x28(%rbp),%rsi
call   1050 <munmap@plt>
cmp    $0x0,%rax
je     126e <main+0x11e>
mov    $0x0,%al
call   1060 <dump_maps@plt>
lea    0xdfe(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    173b <main+0x5eb>
lea    0xdfc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2d4d(%rip),%rax
movq   $0x0,(%rax)
mov    -0x28(%rbp),%rax
add    $0x10000000,%rax
mov    %rax,-0x18(%rbp)
imul   $0x3,-0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    0x2d40(%rip),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rcx
mov    $0xffffffff,%r8d
xor    %r9d,%r9d
call   1030 <mmap@plt>
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x18(%rbp),%rdx
add    -0x20(%rbp),%rdx
mov    -0x30(%rbp),%rcx
lea    0xd21(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%rax
mov    0x2cc7(%rip),%rcx
cmp    (%rcx),%rax
jne    131b <main+0x1cb>
mov    $0x0,%al
call   1060 <dump_maps@plt>
lea    0xd7d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    173b <main+0x5eb>
mov    0x2cae(%rip),%rax
movq   $0x0,(%rax)
movq   $0x10000000,-0x18(%rbp)
10
imul   $0x5,-0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    0x2ca7(%rip),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rcx
mov    $0xffffffff,%r8d
xor    %r9d,%r9d
call   1030 <mmap@plt>
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x18(%rbp),%rdx
add    -0x20(%rbp),%rdx
mov    -0x30(%rbp),%rcx
lea    0xc88(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%rax
mov    0x2c2e(%rip),%rcx
cmp    (%rcx),%rax
je     13b4 <main+0x264>
mov    $0x0,%al
call   1060 <dump_maps@plt>
lea    0xd0d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    173b <main+0x5eb>
mov    0x2c15(%rip),%rax
movq   $0x0,(%rax)
mov    -0x28(%rbp),%rax
shl    $0x1,%rax
add    $0x10000000,%rax
mov    %rax,-0x18(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    0x2c05(%rip),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rcx
mov    $0xffffffff,%r8d
xor    %r9d,%r9d
call   1030 <mmap@plt>
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x18(%rbp),%rdx
add    -0x20(%rbp),%rdx
mov    -0x30(%rbp),%rcx
lea    0xbe6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%rax
mov    0x2b8c(%rip),%rcx
cmp    (%rcx),%rax
je     1456 <main+0x306>
mov    $0x0,%al
call   1060 <dump_maps@plt>
lea    0xc9d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    173b <main+0x5eb>
mov    0x2b73(%rip),%rax
movq   $0x0,(%rax)
imul   $0x3,-0x28(%rbp),%rax
add    $0x10000000,%rax
mov    %rax,-0x18(%rbp)
mov    -0x28(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    0x2b62(%rip),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rcx
mov    $0xffffffff,%r8d
xor    %r9d,%r9d
call   1030 <mmap@plt>
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x18(%rbp),%rdx
add    -0x20(%rbp),%rdx
mov    -0x30(%rbp),%rcx
lea    0xb43(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%rax
mov    0x2ae9(%rip),%rcx
cmp    (%rcx),%rax
je     14f9 <main+0x3a9>
mov    $0x0,%al
call   1060 <dump_maps@plt>
lea    0xc2c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    173b <main+0x5eb>
mov    0x2ad0(%rip),%rax
movq   $0x0,(%rax)
movq   $0x10000000,-0x18(%rbp)
10
mov    -0x28(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    0x2ac6(%rip),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rcx
mov    $0xffffffff,%r8d
xor    %r9d,%r9d
call   1030 <mmap@plt>
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x18(%rbp),%rdx
add    -0x20(%rbp),%rdx
mov    -0x30(%rbp),%rcx
lea    0xaa7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%rax
mov    0x2a4d(%rip),%rcx
cmp    (%rcx),%rax
je     1595 <main+0x445>
mov    $0x0,%al
call   1060 <dump_maps@plt>
lea    0xbc2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    173b <main+0x5eb>
mov    0x2a34(%rip),%rax
movq   $0x0,(%rax)
movq   $0x10000000,-0x18(%rbp)
10
mov    -0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    0x2a2e(%rip),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rcx
mov    $0xffffffff,%r8d
xor    %r9d,%r9d
call   1030 <mmap@plt>
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x18(%rbp),%rdx
add    -0x20(%rbp),%rdx
mov    -0x30(%rbp),%rcx
lea    0xa0f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%rax
mov    0x29b5(%rip),%rcx
cmp    (%rcx),%rax
jne    162d <main+0x4dd>
mov    $0x0,%al
call   1060 <dump_maps@plt>
lea    0xb5c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    173b <main+0x5eb>
mov    0x299c(%rip),%rax
movq   $0x0,(%rax)
mov    -0x28(%rbp),%rax
shl    $0x2,%rax
add    $0x10000000,%rax
mov    %rax,-0x18(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    0x298c(%rip),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rcx
mov    $0xffffffff,%r8d
xor    %r9d,%r9d
call   1030 <mmap@plt>
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x18(%rbp),%rdx
add    -0x20(%rbp),%rdx
mov    -0x30(%rbp),%rcx
lea    0x96d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%rax
mov    0x2913(%rip),%rcx
cmp    (%rcx),%rax
jne    16cf <main+0x57f>
mov    $0x0,%al
call   1060 <dump_maps@plt>
lea    0xae9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    173b <main+0x5eb>
movq   $0x10000000,-0x18(%rbp)
10
imul   $0x5,-0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1050 <munmap@plt>
cmp    $0x0,%rax
je     1718 <main+0x5c8>
mov    $0x0,%al
call   1060 <dump_maps@plt>
lea    0x954(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    173b <main+0x5eb>
lea    0x952(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xaa7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    0x2e53(%rip),%rax
mov    (%rax),%edi
call   1080 <sysconf@plt>
mov    0x2e3d(%rip),%rcx
mov    (%rcx),%ecx
mov    0x2e54(%rip),%rdx
or     (%rdx),%ecx
mov    %rax,%r15
movslq %ecx,%r12
or     $0x100000,%r12
mov    0x2e2e(%rip),%r13
movq   $0x0,0x0(%r13)
lea    (%rax,%rax,4),%r14
mov    0x2e3b(%rip),%rax
mov    (%rax),%edx
mov    $0x10000000,%edi
mov    %r14,%rsi
mov    %r12,%rcx
mov    $0xffffffff,%r8d
xor    %r9d,%r9d
call   1040 <mmap@plt>
mov    %rax,%rbp
lea    (%r15,%r15,4),%rbx
add    $0x10000000,%rbx
lea    0xe1b(%rip),%rdi
mov    $0x10000000,%esi
mov    %rbx,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x2dba(%rip),%rax
cmp    (%rax),%rbp
je     1232 <main+0xd2>
movq   $0x0,0x0(%r13)
mov    $0x10000000,%edi
mov    %r14,%rsi
call   1060 <munmap@plt>
test   %rax,%rax
je     125b <main+0xfb>
xor    %eax,%eax
call   1070 <dump_maps@plt>
mov    $0x1,%ebx
lea    0xf53(%rip),%rdi
jmp    1245 <main+0xe5>
xor    %eax,%eax
call   1070 <dump_maps@plt>
mov    $0x1,%ebx
lea    0xf55(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %r14,(%rsp)
mov    %rbx,0x8(%rsp)
lea    0xdba(%rip),%rdi
call   1030 <puts@plt>
movq   $0x0,0x0(%r13)
lea    0x10000000(%r15),%rbp
lea    (%r15,%r15,2),%r14
mov    0x2d66(%rip),%rbx
mov    (%rbx),%edx
mov    %rbp,%rdi
mov    %r14,%rsi
mov    %r12,%rcx
mov    $0xffffffff,%r8d
xor    %r9d,%r9d
call   1040 <mmap@plt>
mov    %rax,%r13
mov    %r14,0x20(%rsp)
lea    (%r15,%r14,1),%rdx
add    $0x10000000,%rdx
lea    0xd43(%rip),%rdi
mov    %rbp,%rsi
mov    %rax,%rcx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x2ce7(%rip),%rax
cmp    (%rax),%r13
je     134f <main+0x1ef>
mov    %rbp,0x18(%rsp)
mov    0x2cee(%rip),%r13
movq   $0x0,0x0(%r13)
mov    0x2cff(%rip),%rax
mov    (%rax),%edx
mov    $0x10000000,%edi
mov    (%rsp),%rsi
mov    %r12,%rcx
mov    $0xffffffff,%r8d
xor    %r9d,%r9d
call   1040 <mmap@plt>
mov    %rax,%rbp
lea    0xce9(%rip),%rdi
mov    $0x10000000,%esi
mov    0x8(%rsp),%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x2c86(%rip),%rax
cmp    (%rax),%rbp
je     1367 <main+0x207>
xor    %eax,%eax
call   1070 <dump_maps@plt>
mov    $0x1,%ebx
lea    0xde0(%rip),%rdi
jmp    1245 <main+0xe5>
xor    %eax,%eax
call   1070 <dump_maps@plt>
mov    $0x1,%ebx
lea    0xdf9(%rip),%rdi
jmp    1245 <main+0xe5>
movq   $0x0,0x0(%r13)
lea    (%r15,%r15,1),%r14
add    $0x10000000,%r14
mov    0x2c6f(%rip),%rax
mov    (%rax),%edx
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rcx
mov    $0xffffffff,%r8d
xor    %r9d,%r9d
call   1040 <mmap@plt>
mov    %rax,%rbp
lea    (%r15,%r15,2),%rdx
add    $0x10000000,%rdx
lea    0xc51(%rip),%rdi
mov    %r14,%rsi
mov    %rax,%rcx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x2bf5(%rip),%rax
cmp    (%rax),%rbp
je     13e0 <main+0x280>
xor    %eax,%eax
call   1070 <dump_maps@plt>
mov    $0x1,%ebx
lea    0xd1e(%rip),%rdi
jmp    1245 <main+0xe5>
mov    %r14,0x10(%rsp)
lea    (%r15,%r15,1),%r14
movq   $0x0,0x0(%r13)
mov    0x20(%rsp),%rbx
lea    0x10000000(%rbx),%r13
mov    0x2bec(%rip),%rax
mov    (%rax),%edx
mov    %r13,%rdi
mov    %r14,%rsi
mov    %r12,%rcx
mov    $0xffffffff,%r8d
xor    %r9d,%r9d
call   1040 <mmap@plt>
mov    %rax,%rbp
lea    (%rbx,%r14,1),%rdx
add    $0x10000000,%rdx
lea    0xbce(%rip),%rdi
mov    %r13,%rsi
mov    %rax,%rcx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x2b72(%rip),%rax
cmp    (%rax),%rbp
je     1463 <main+0x303>
xor    %eax,%eax
call   1070 <dump_maps@plt>
mov    $0x1,%ebx
lea    0xc6a(%rip),%rdi
jmp    1245 <main+0xe5>
mov    0x2b66(%rip),%r13
movq   $0x0,0x0(%r13)
mov    0x2b77(%rip),%rax
mov    (%rax),%edx
mov    $0x10000000,%edi
mov    %r14,%rsi
mov    %r12,%rcx
mov    $0xffffffff,%r8d
xor    %r9d,%r9d
call   1040 <mmap@plt>
mov    %rax,%rbp
lea    0xb62(%rip),%rdi
mov    $0x10000000,%esi
mov    0x10(%rsp),%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x2aff(%rip),%rax
cmp    (%rax),%rbp
je     14d6 <main+0x376>
xor    %eax,%eax
call   1070 <dump_maps@plt>
mov    $0x1,%ebx
lea    0xbc6(%rip),%rdi
jmp    1245 <main+0xe5>
movq   $0x0,0x0(%r13)
mov    0x2b0b(%rip),%rax
mov    (%rax),%edx
mov    $0x10000000,%edi
mov    %r15,%rsi
mov    %r12,%rcx
mov    $0xffffffff,%r8d
xor    %r9d,%r9d
call   1040 <mmap@plt>
mov    %rax,%rbp
lea    0xaf6(%rip),%rdi
mov    $0x10000000,%esi
mov    0x18(%rsp),%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x2a93(%rip),%rax
cmp    (%rax),%rbp
je     15b3 <main+0x453>
movq   $0x0,0x0(%r13)
lea    0x10000000(,%r15,4),%rbp
10
mov    0x2aab(%rip),%rcx
mov    (%rcx),%edx
mov    %rbp,%rdi
mov    %r15,%rsi
mov    %r12,%rcx
mov    $0xffffffff,%r8d
xor    %r9d,%r9d
mov    %rax,%r15
call   1040 <mmap@plt>
mov    %rax,%rbx
lea    0xa95(%rip),%rdi
mov    %rbp,%rsi
mov    0x8(%rsp),%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   1050 <printf@plt>
cmp    (%r15),%rbx
je     15cb <main+0x46b>
mov    $0x10000000,%edi
mov    (%rsp),%rsi
call   1060 <munmap@plt>
test   %rax,%rax
jne    121d <main+0xbd>
lea    0xa85(%rip),%rdi
call   1030 <puts@plt>
xor    %ebx,%ebx
lea    0xa8a(%rip),%rdi
jmp    1245 <main+0xe5>
xor    %eax,%eax
call   1070 <dump_maps@plt>
mov    $0x1,%ebx
lea    0xaa3(%rip),%rdi
jmp    1245 <main+0xe5>
xor    %eax,%eax
call   1070 <dump_maps@plt>
mov    $0x1,%ebx
lea    0xa5d(%rip),%rdi
jmp    1245 <main+0xe5>

LLVM IR (-O0):
@_SC_PAGE_SIZE = global i32 0
@MAP_PRIVATE = global i32 0
@MAP_ANONYMOUS = global i32 0
@errno = global i64 0
@PROT_NONE = global i32 0
@.str = [37 x i8] c"mmap() @ 0x%lx-0x%lx p=%p result=%m\0A\00"
@MAP_FAILED = global i8* null
@.str.1 = [52 x i8] c"Error: couldn't map the space we need for the test\0A\00"
@.str.2 = [24 x i8] c"Error: munmap failed!?\0A\00"
@.str.3 = [20 x i8] c"unmap() successful\0A\00"
@.str.4 = [41 x i8] c"Error: first mmap() failed unexpectedly\0A\00"
@.str.5 = [50 x i8] c"Error:1: mmap() succeeded when it shouldn't have\0A\00"
@.str.6 = [50 x i8] c"Error:2: mmap() succeeded when it shouldn't have\0A\00"
@.str.7 = [50 x i8] c"Error:3: mmap() succeeded when it shouldn't have\0A\00"
@.str.8 = [50 x i8] c"Error:4: mmap() succeeded when it shouldn't have\0A\00"
@.str.9 = [47 x i8] c"Error:5: mmap() failed when it shouldn't have\0A\00"
@.str.10 = [47 x i8] c"Error:6: mmap() failed when it shouldn't have\0A\00"
@.str.11 = [4 x i8] c"OK\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8*
store i32 0, i32* %1
%7 = load i32, i32* @_SC_PAGE_SIZE
%8 = call i64 @sysconf(i32 %7)
store i64 %8, i64* %5
%9 = load i32, i32* @MAP_PRIVATE
%10 = load i32, i32* @MAP_ANONYMOUS
%11 = or i32 %9, %10
%12 = or i32 %11, 1048576
%13 = sext i32 %12 to i64
store i64 %13, i64* %2
store i64 0, i64* @errno
store i64 268435456, i64* %3
%14 = load i64, i64* %5
%15 = mul i64 5, %14
store i64 %15, i64* %4
%16 = load i64, i64* %3
%17 = inttoptr i64 %16 to i8*
%18 = load i64, i64* %4
%19 = load i32, i32* @PROT_NONE
%20 = load i64, i64* %2
%21 = call i8* @mmap(i8* %17, i64 %18, i32 %19, i64 %20, i32 -1, i32 0)
store i8* %21, i8** %6
%22 = load i64, i64* %3
%23 = load i64, i64* %3
%24 = load i64, i64* %4
%25 = add i64 %23, %24
%26 = load i8*, i8** %6
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i64 %22, i64 %25, i8* %26)
%28 = load i8*, i8** %6
%29 = load i8*, i8** @MAP_FAILED
%30 = icmp eq i8* %28, %29
br i1 %30, label %31, label %34
31: ; preds = %0
%32 = call i32 (...) @dump_maps()
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %1
br label %214
34: ; preds = %0
store i64 0, i64* @errno
%35 = load i64, i64* %3
%36 = inttoptr i64 %35 to i8*
%37 = load i64, i64* %5
%38 = mul i64 5, %37
%39 = call i64 @munmap(i8* %36, i64 %38)
%40 = icmp ne i64 %39, 0
br i1 %40, label %41, label %44
41: ; preds = %34
%42 = call i32 (...) @dump_maps()
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %1
br label %214
44: ; preds = %34
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
store i64 0, i64* @errno
%46 = load i64, i64* %5
%47 = add i64 268435456, %46
store i64 %47, i64* %3
%48 = load i64, i64* %5
%49 = mul i64 3, %48
store i64 %49, i64* %4
%50 = load i64, i64* %3
%51 = inttoptr i64 %50 to i8*
%52 = load i64, i64* %4
%53 = load i32, i32* @PROT_NONE
%54 = load i64, i64* %2
%55 = call i8* @mmap(i8* %51, i64 %52, i32 %53, i64 %54, i32 -1, i32 0)
store i8* %55, i8** %6
%56 = load i64, i64* %3
%57 = load i64, i64* %3
%58 = load i64, i64* %4
%59 = add i64 %57, %58
%60 = load i8*, i8** %6
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i64 %56, i64 %59, i8* %60)
%62 = load i8*, i8** %6
%63 = load i8*, i8** @MAP_FAILED
%64 = icmp eq i8* %62, %63
br i1 %64, label %65, label %68
65: ; preds = %44
%66 = call i32 (...) @dump_maps()
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %1
br label %214
68: ; preds = %44
store i64 0, i64* @errno
store i64 268435456, i64* %3
%69 = load i64, i64* %5
%70 = mul i64 5, %69
store i64 %70, i64* %4
%71 = load i64, i64* %3
%72 = inttoptr i64 %71 to i8*
%73 = load i64, i64* %4
%74 = load i32, i32* @PROT_NONE
%75 = load i64, i64* %2
%76 = call i8* @mmap(i8* %72, i64 %73, i32 %74, i64 %75, i32 -1, i32 0)
store i8* %76, i8** %6
%77 = load i64, i64* %3
%78 = load i64, i64* %3
%79 = load i64, i64* %4
%80 = add i64 %78, %79
%81 = load i8*, i8** %6
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i64 %77, i64 %80, i8* %81)
%83 = load i8*, i8** %6
%84 = load i8*, i8** @MAP_FAILED
%85 = icmp ne i8* %83, %84
br i1 %85, label %86, label %89
86: ; preds = %68
%87 = call i32 (...) @dump_maps()
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.5, i64 0, i64 0))
store i32 1, i32* %1
br label %214
89: ; preds = %68
store i64 0, i64* @errno
%90 = load i64, i64* %5
%91 = mul i64 2, %90
%92 = add i64 268435456, %91
store i64 %92, i64* %3
%93 = load i64, i64* %5
store i64 %93, i64* %4
%94 = load i64, i64* %3
%95 = inttoptr i64 %94 to i8*
%96 = load i64, i64* %4
%97 = load i32, i32* @PROT_NONE
%98 = load i64, i64* %2
%99 = call i8* @mmap(i8* %95, i64 %96, i32 %97, i64 %98, i32 -1, i32 0)
store i8* %99, i8** %6
%100 = load i64, i64* %3
%101 = load i64, i64* %3
%102 = load i64, i64* %4
%103 = add i64 %101, %102
%104 = load i8*, i8** %6
%105 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i64 %100, i64 %103, i8* %104)
%106 = load i8*, i8** %6
%107 = load i8*, i8** @MAP_FAILED
%108 = icmp ne i8* %106, %107
br i1 %108, label %109, label %112
109: ; preds = %89
%110 = call i32 (...) @dump_maps()
%111 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.6, i64 0, i64 0))
store i32 1, i32* %1
br label %214
112: ; preds = %89
store i64 0, i64* @errno
%113 = load i64, i64* %5
%114 = mul i64 3, %113
%115 = add i64 268435456, %114
store i64 %115, i64* %3
%116 = load i64, i64* %5
%117 = mul i64 2, %116
store i64 %117, i64* %4
%118 = load i64, i64* %3
%119 = inttoptr i64 %118 to i8*
%120 = load i64, i64* %4
%121 = load i32, i32* @PROT_NONE
%122 = load i64, i64* %2
%123 = call i8* @mmap(i8* %119, i64 %120, i32 %121, i64 %122, i32 -1, i32 0)
store i8* %123, i8** %6
%124 = load i64, i64* %3
%125 = load i64, i64* %3
%126 = load i64, i64* %4
%127 = add i64 %125, %126
%128 = load i8*, i8** %6
%129 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i64 %124, i64 %127, i8* %128)
%130 = load i8*, i8** %6
%131 = load i8*, i8** @MAP_FAILED
%132 = icmp ne i8* %130, %131
br i1 %132, label %133, label %136
133: ; preds = %112
%134 = call i32 (...) @dump_maps()
%135 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.7, i64 0, i64 0))
store i32 1, i32* %1
br label %214
136: ; preds = %112
store i64 0, i64* @errno
store i64 268435456, i64* %3
%137 = load i64, i64* %5
%138 = mul i64 2, %137
store i64 %138, i64* %4
%139 = load i64, i64* %3
%140 = inttoptr i64 %139 to i8*
%141 = load i64, i64* %4
%142 = load i32, i32* @PROT_NONE
%143 = load i64, i64* %2
%144 = call i8* @mmap(i8* %140, i64 %141, i32 %142, i64 %143, i32 -1, i32 0)
store i8* %144, i8** %6
%145 = load i64, i64* %3
%146 = load i64, i64* %3
%147 = load i64, i64* %4
%148 = add i64 %146, %147
%149 = load i8*, i8** %6
%150 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i64 %145, i64 %148, i8* %149)
%151 = load i8*, i8** %6
%152 = load i8*, i8** @MAP_FAILED
%153 = icmp ne i8* %151, %152
br i1 %153, label %154, label %157
154: ; preds = %136
%155 = call i32 (...) @dump_maps()
%156 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.8, i64 0, i64 0))
store i32 1, i32* %1
br label %214
157: ; preds = %136
store i64 0, i64* @errno
store i64 268435456, i64* %3
%158 = load i64, i64* %5
store i64 %158, i64* %4
%159 = load i64, i64* %3
%160 = inttoptr i64 %159 to i8*
%161 = load i64, i64* %4
%162 = load i32, i32* @PROT_NONE
%163 = load i64, i64* %2
%164 = call i8* @mmap(i8* %160, i64 %161, i32 %162, i64 %163, i32 -1, i32 0)
store i8* %164, i8** %6
%165 = load i64, i64* %3
%166 = load i64, i64* %3
%167 = load i64, i64* %4
%168 = add i64 %166, %167
%169 = load i8*, i8** %6
%170 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i64 %165, i64 %168, i8* %169)
%171 = load i8*, i8** %6
%172 = load i8*, i8** @MAP_FAILED
%173 = icmp eq i8* %171, %172
br i1 %173, label %174, label %177
174: ; preds = %157
%175 = call i32 (...) @dump_maps()
%176 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.9, i64 0, i64 0))
store i32 1, i32* %1
br label %214
177: ; preds = %157
store i64 0, i64* @errno
%178 = load i64, i64* %5
%179 = mul i64 4, %178
%180 = add i64 268435456, %179
store i64 %180, i64* %3
%181 = load i64, i64* %5
store i64 %181, i64* %4
%182 = load i64, i64* %3
%183 = inttoptr i64 %182 to i8*
%184 = load i64, i64* %4
%185 = load i32, i32* @PROT_NONE
%186 = load i64, i64* %2
%187 = call i8* @mmap(i8* %183, i64 %184, i32 %185, i64 %186, i32 -1, i32 0)
store i8* %187, i8** %6
%188 = load i64, i64* %3
%189 = load i64, i64* %3
%190 = load i64, i64* %4
%191 = add i64 %189, %190
%192 = load i8*, i8** %6
%193 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i64 %188, i64 %191, i8* %192)
%194 = load i8*, i8** %6
%195 = load i8*, i8** @MAP_FAILED
%196 = icmp eq i8* %194, %195
br i1 %196, label %197, label %200
197: ; preds = %177
%198 = call i32 (...) @dump_maps()
%199 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.10, i64 0, i64 0))
store i32 1, i32* %1
br label %214
200: ; preds = %177
store i64 268435456, i64* %3
%201 = load i64, i64* %5
%202 = mul i64 5, %201
store i64 %202, i64* %4
%203 = load i64, i64* %3
%204 = inttoptr i64 %203 to i8*
%205 = load i64, i64* %4
%206 = call i64 @munmap(i8* %204, i64 %205)
%207 = icmp ne i64 %206, 0
br i1 %207, label %208, label %211
208: ; preds = %200
%209 = call i32 (...) @dump_maps()
%210 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %1
br label %214
211: ; preds = %200
%212 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%213 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0))
store i32 0, i32* %1
br label %214
214: ; preds = %211, %208, %197, %174, %154, %133, %109, %86, %65, %41, %31
%215 = load i32, i32* %1
ret i32 %215
}

LLVM IR (-O2):
@_SC_PAGE_SIZE = global i32 0
@MAP_PRIVATE = global i32 0
@MAP_ANONYMOUS = global i32 0
@errno = global i64 0
@PROT_NONE = global i32 0
@.str = [37 x i8] c"mmap() @ 0x%lx-0x%lx p=%p result=%m\0A\00"
@MAP_FAILED = global i8* null
@str.12 = [19 x i8] c"unmap() successful\00"
@str.13 = [3 x i8] c"OK\00"
@str.15 = [46 x i8] c"Error:6: mmap() failed when it shouldn't have\00"
@str.16 = [46 x i8] c"Error:5: mmap() failed when it shouldn't have\00"
@str.17 = [49 x i8] c"Error:4: mmap() succeeded when it shouldn't have\00"
@str.18 = [49 x i8] c"Error:3: mmap() succeeded when it shouldn't have\00"
@str.19 = [49 x i8] c"Error:2: mmap() succeeded when it shouldn't have\00"
@str.20 = [49 x i8] c"Error:1: mmap() succeeded when it shouldn't have\00"
@str.21 = [40 x i8] c"Error: first mmap() failed unexpectedly\00"
@str.22 = [23 x i8] c"Error: munmap failed!?\00"
@str.23 = [51 x i8] c"Error: couldn't map the space we need for the test\00"
define i32 @main() {
%1 = load i32, i32* @_SC_PAGE_SIZE
%2 = tail call i64 @sysconf(i32 %1)
%3 = load i32, i32* @MAP_PRIVATE
%4 = load i32, i32* @MAP_ANONYMOUS
%5 = or i32 %3, %4
%6 = or i32 %5, 1048576
%7 = sext i32 %6 to i64
store i64 0, i64* @errno
%8 = mul i64 %2, 5
%9 = load i32, i32* @PROT_NONE
%10 = tail call i8* @mmap(i8* inttoptr (i64 268435456 to i8*), i64 %8, i32 %9, i64 %7, i32 -1, i32 0)
%11 = add i64 %8, 268435456
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i64 268435456, i64 %11, i8* %10)
%13 = load i8*, i8** @MAP_FAILED
%14 = icmp eq i8* %10, %13
br i1 %14, label %15, label %17
15: ; preds = %0
%16 = tail call i32 (...) @dump_maps()
br label %101
17: ; preds = %0
store i64 0, i64* @errno
%18 = tail call i64 @munmap(i8* inttoptr (i64 268435456 to i8*), i64 %8)
%19 = icmp eq i64 %18, 0
br i1 %19, label %22, label %20
20: ; preds = %17
%21 = tail call i32 (...) @dump_maps()
br label %101
22: ; preds = %17
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.12, i64 0, i64 0))
store i64 0, i64* @errno
%24 = add i64 %2, 268435456
%25 = mul i64 %2, 3
%26 = inttoptr i64 %24 to i8*
%27 = load i32, i32* @PROT_NONE
%28 = tail call i8* @mmap(i8* %26, i64 %25, i32 %27, i64 %7, i32 -1, i32 0)
%29 = add i64 %24, %25
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i64 %24, i64 %29, i8* %28)
%31 = load i8*, i8** @MAP_FAILED
%32 = icmp eq i8* %28, %31
br i1 %32, label %33, label %35
33: ; preds = %22
%34 = tail call i32 (...) @dump_maps()
br label %101
35: ; preds = %22
store i64 0, i64* @errno
%36 = load i32, i32* @PROT_NONE
%37 = tail call i8* @mmap(i8* inttoptr (i64 268435456 to i8*), i64 %8, i32 %36, i64 %7, i32 -1, i32 0)
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i64 268435456, i64 %11, i8* %37)
%39 = load i8*, i8** @MAP_FAILED
%40 = icmp eq i8* %37, %39
br i1 %40, label %43, label %41
41: ; preds = %35
%42 = tail call i32 (...) @dump_maps()
br label %101
43: ; preds = %35
store i64 0, i64* @errno
%44 = shl i64 %2, 1
%45 = add i64 %44, 268435456
%46 = inttoptr i64 %45 to i8*
%47 = load i32, i32* @PROT_NONE
%48 = tail call i8* @mmap(i8* %46, i64 %2, i32 %47, i64 %7, i32 -1, i32 0)
%49 = add i64 %45, %2
%50 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i64 %45, i64 %49, i8* %48)
%51 = load i8*, i8** @MAP_FAILED
%52 = icmp eq i8* %48, %51
br i1 %52, label %55, label %53
53: ; preds = %43
%54 = tail call i32 (...) @dump_maps()
br label %101
55: ; preds = %43
store i64 0, i64* @errno
%56 = add i64 %25, 268435456
%57 = inttoptr i64 %56 to i8*
%58 = load i32, i32* @PROT_NONE
%59 = tail call i8* @mmap(i8* %57, i64 %44, i32 %58, i64 %7, i32 -1, i32 0)
%60 = add i64 %56, %44
%61 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i64 %56, i64 %60, i8* %59)
%62 = load i8*, i8** @MAP_FAILED
%63 = icmp eq i8* %59, %62
br i1 %63, label %66, label %64
64: ; preds = %55
%65 = tail call i32 (...) @dump_maps()
br label %101
66: ; preds = %55
store i64 0, i64* @errno
%67 = load i32, i32* @PROT_NONE
%68 = tail call i8* @mmap(i8* inttoptr (i64 268435456 to i8*), i64 %44, i32 %67, i64 %7, i32 -1, i32 0)
%69 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i64 268435456, i64 %45, i8* %68)
%70 = load i8*, i8** @MAP_FAILED
%71 = icmp eq i8* %68, %70
br i1 %71, label %74, label %72
72: ; preds = %66
%73 = tail call i32 (...) @dump_maps()
br label %101
74: ; preds = %66
store i64 0, i64* @errno
%75 = load i32, i32* @PROT_NONE
%76 = tail call i8* @mmap(i8* inttoptr (i64 268435456 to i8*), i64 %2, i32 %75, i64 %7, i32 -1, i32 0)
%77 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i64 268435456, i64 %24, i8* %76)
%78 = load i8*, i8** @MAP_FAILED
%79 = icmp eq i8* %76, %78
br i1 %79, label %80, label %82
80: ; preds = %74
%81 = tail call i32 (...) @dump_maps()
br label %101
82: ; preds = %74
store i64 0, i64* @errno
%83 = shl i64 %2, 2
%84 = add i64 %83, 268435456
%85 = inttoptr i64 %84 to i8*
%86 = load i32, i32* @PROT_NONE
%87 = tail call i8* @mmap(i8* %85, i64 %2, i32 %86, i64 %7, i32 -1, i32 0)
%88 = add i64 %84, %2
%89 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i64 %84, i64 %88, i8* %87)
%90 = load i8*, i8** @MAP_FAILED
%91 = icmp eq i8* %87, %90
br i1 %91, label %92, label %94
92: ; preds = %82
%93 = tail call i32 (...) @dump_maps()
br label %101
94: ; preds = %82
%95 = tail call i64 @munmap(i8* inttoptr (i64 268435456 to i8*), i64 %8)
%96 = icmp eq i64 %95, 0
br i1 %96, label %99, label %97
97: ; preds = %94
%98 = tail call i32 (...) @dump_maps()
br label %101
99: ; preds = %94
%100 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.12, i64 0, i64 0))
br label %101
101: ; preds = %99, %97, %92, %80, %72, %64, %53, %41, %33, %20, %15
%102 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @str.13, i64 0, i64 0), %99 ], [ getelementptr inbounds ([23 x i8], [23 x i8]* @str.22, i64 0, i64 0), %97 ], [ getelementptr inbounds ([46 x i8], [46 x i8]* @str.15, i64 0, i64 0), %92 ], [ getelementptr inbounds ([46 x i8], [46 x i8]* @str.16, i64 0, i64 0), %80 ], [ getelementptr inbounds ([49 x i8], [49 x i8]* @str.17, i64 0, i64 0), %72 ], [ getelementptr inbounds ([49 x i8], [49 x i8]* @str.18, i64 0, i64 0), %64 ], [ getelementptr inbounds ([49 x i8], [49 x i8]* @str.19, i64 0, i64 0), %53 ], [ getelementptr inbounds ([49 x i8], [49 x i8]* @str.20, i64 0, i64 0), %41 ], [ getelementptr inbounds ([40 x i8], [40 x i8]* @str.21, i64 0, i64 0), %33 ], [ getelementptr inbounds ([23 x i8], [23 x i8]* @str.22, i64 0, i64 0), %20 ], [ getelementptr inbounds ([51 x i8], [51 x i8]* @str.23, i64 0, i64 0), %15 ]
%103 = phi i32 [ 0, %99 ], [ 1, %97 ], [ 1, %92 ], [ 1, %80 ], [ 1, %72 ], [ 1, %64 ], [ 1, %53 ], [ 1, %41 ], [ 1, %33 ], [ 1, %20 ], [ 1, %15 ]
%104 = tail call i32 @puts(i8* dereferenceable(1) %102)
ret i32 %103
}