#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 /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ EXIT_SUCCESS;
int MAP_ANONYMOUS;
char *MAP_FAILED;
int MAP_PRIVATE;
int PROT_READ;
int PROT_WRITE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ fork();
scalar_t__ mmap(int /*<<< orphan*/ *, size_t, int, int, int,
                int /*<<< orphan*/);
int munmap(char *, size_t);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ wait(int /*<<< orphan*/ *);
void mmapAnonPrivate() {
  size_t mmapLen = 8;
  char *ptr = (char *)mmap(NULL, mmapLen, PROT_READ | PROT_WRITE,
                           MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
  if (ptr == MAP_FAILED) {
    perror("mmap");
    exit(EXIT_FAILURE);
  }
  printf("memory is initialized to zero with MAP_ANONYMOUS\n");
  for (unsigned int i = 0; i < mmapLen; i++)
    printf("ptr[%u] = %d\n", i, ptr[i]);
  if (fork() == 0) {
    for (unsigned int i = 0; i < mmapLen; i++)
      printf("child: ptr[%u] = %d\n", i, ptr[i]);
    printf("Child exited\n");
    exit(EXIT_SUCCESS);
  }
  printf("Parent is writing data to the mmap'd area\n");
  for (unsigned int i = 0; i < mmapLen; i++)
    ptr[i] = i;
  printf("Parent is done writing data to the mmap'd area\n");
  printf("Parent is waiting for the child to finish\n");
  wait(NULL);
  printf("Parent detected that child exited.\n");
  printf("Contents after we store values in memory.\n");
  for (unsigned int i = 0; i < mmapLen; i++)
    printf("ptr[%u] = %d\n", i, ptr[i]);
  if (munmap(ptr, mmapLen) == -1) {
    perror("munmap");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<mmapAnonPrivate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x8,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    0x2e6d(%rip),%rax
mov    (%rax),%edx
mov    0x2e34(%rip),%rax
or     (%rax),%edx
mov    0x2e43(%rip),%rax
mov    (%rax),%ecx
mov    0x2e12(%rip),%rax
or     (%rax),%ecx
xor    %eax,%eax
mov    %eax,%edi
mov    $0xffffffff,%r8d
xor    %r9d,%r9d
call   1030 <mmap@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2de7(%rip),%rcx
cmp    (%rcx),%rax
jne    11ec <mmapAnonPrivate+0x7c>
lea    0xe27(%rip),%rdi
call   1060 <perror@plt>
mov    0x2deb(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>
lea    0xe12(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%rax
jae    1238 <mmapAnonPrivate+0xc8>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
movsbl (%rax,%rcx,1),%edx
lea    0xe1b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1201 <mmapAnonPrivate+0x91>
mov    $0x0,%al
call   1090 <fork@plt>
cmp    $0x0,%rax
jne    12a3 <mmapAnonPrivate+0x133>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%rax
jae    1287 <mmapAnonPrivate+0x117>
mov    -0x18(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
movsbl (%rax,%rcx,1),%edx
lea    0xdc5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1250 <mmapAnonPrivate+0xe0>
lea    0xdbe(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2d24(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>
lea    0xdb0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%rax
jae    12e2 <mmapAnonPrivate+0x172>
mov    -0x1c(%rbp),%eax
mov    %al,%dl
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    %dl,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    12b8 <mmapAnonPrivate+0x148>
lea    0xd9c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xdbe(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1080 <wait@plt>
lea    0xdd2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xde8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x8(%rbp),%rax
jae    1361 <mmapAnonPrivate+0x1f1>
mov    -0x20(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%ecx
movsbl (%rax,%rcx,1),%edx
lea    0xcf2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    132a <mmapAnonPrivate+0x1ba>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1050 <munmap@plt>
cmp    $0xffffffff,%eax
jne    1391 <mmapAnonPrivate+0x221>
lea    0xdb1(%rip),%rdi
call   1060 <perror@plt>
mov    0x2c46(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmapAnonPrivate>:
push   %r14
push   %rbx
push   %rax
mov    0x2e6d(%rip),%rax
mov    0x2e36(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
mov    0x2e43(%rip),%rax
mov    0x2e14(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
mov    $0x8,%esi
xor    %edi,%edi
mov    $0xffffffff,%r8d
xor    %r9d,%r9d
call   1040 <mmap@plt>
mov    %rax,%rbx
mov    0x2de9(%rip),%rax
cmp    %rbx,(%rax)
je     1390 <mmapAnonPrivate+0x210>
lea    0xe4a(%rip),%rdi
call   1030 <puts@plt>
movsbl (%rbx),%edx
lea    0xe26(%rip),%r14
mov    %r14,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x1(%rbx),%edx
mov    %r14,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x2(%rbx),%edx
mov    %r14,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x3(%rbx),%edx
mov    %r14,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x4(%rbx),%edx
mov    %r14,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x5(%rbx),%edx
mov    %r14,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x6(%rbx),%edx
mov    %r14,%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x7(%rbx),%edx
mov    %r14,%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   10a0 <fork@plt>
test   %rax,%rax
je     139c <mmapAnonPrivate+0x21c>
lea    0xdc4(%rip),%rdi
call   1030 <puts@plt>
movabs $0x706050403020100,%rax
05 06 07
mov    %rax,(%rbx)
lea    0xdd5(%rip),%rdi
call   1030 <puts@plt>
lea    0xdf8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1090 <wait@plt>
lea    0xe0f(%rip),%rdi
call   1030 <puts@plt>
lea    0xe26(%rip),%rdi
call   1030 <puts@plt>
movsbl (%rbx),%edx
lea    0xd2b(%rip),%r14
mov    %r14,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x1(%rbx),%edx
mov    %r14,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x2(%rbx),%edx
mov    %r14,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x3(%rbx),%edx
mov    %r14,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x4(%rbx),%edx
mov    %r14,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x5(%rbx),%edx
mov    %r14,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x6(%rbx),%edx
mov    %r14,%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x7(%rbx),%edx
mov    %r14,%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x8,%esi
mov    %rbx,%rdi
call   1060 <munmap@plt>
cmp    $0xffffffff,%eax
je     1451 <mmapAnonPrivate+0x2d1>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xc69(%rip),%rdi
jmp    1458 <mmapAnonPrivate+0x2d8>
movsbl (%rbx),%edx
lea    0xc5f(%rip),%r14
mov    %r14,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x1(%rbx),%edx
mov    %r14,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x2(%rbx),%edx
mov    %r14,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x3(%rbx),%edx
mov    %r14,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x4(%rbx),%edx
mov    %r14,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x5(%rbx),%edx
mov    %r14,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x6(%rbx),%edx
mov    %r14,%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x7(%rbx),%edx
mov    %r14,%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xce4(%rip),%rdi
call   1030 <puts@plt>
mov    0x2b76(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>
lea    0xbc2(%rip),%rdi
call   1070 <perror@plt>
mov    0x2b6c(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_ANONYMOUS = global i32 0
@MAP_PRIVATE = global i32 0
@MAP_FAILED = global i8* null
@.str = [5 x i8] c"mmap\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [50 x i8] c"memory is initialized to zero with MAP_ANONYMOUS\0A\00"
@.str.2 = [14 x i8] c"ptr[%u] = %d\0A\00"
@.str.3 = [21 x i8] c"child: ptr[%u] = %d\0A\00"
@.str.4 = [14 x i8] c"Child exited\0A\00"
@EXIT_SUCCESS = global i32 0
@.str.5 = [43 x i8] c"Parent is writing data to the mmap'd area\0A\00"
@.str.6 = [48 x i8] c"Parent is done writing data to the mmap'd area\0A\00"
@.str.7 = [43 x i8] c"Parent is waiting for the child to finish\0A\00"
@.str.8 = [36 x i8] c"Parent detected that child exited.\0A\00"
@.str.9 = [43 x i8] c"Contents after we store values in memory.\0A\00"
@.str.10 = [7 x i8] c"munmap\00"
define void @mmapAnonPrivate() {
%1 = alloca i64
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i64 8, i64* %1
%7 = load i64, i64* %1
%8 = load i32, i32* @PROT_READ
%9 = load i32, i32* @PROT_WRITE
%10 = or i32 %8, %9
%11 = load i32, i32* @MAP_ANONYMOUS
%12 = load i32, i32* @MAP_PRIVATE
%13 = or i32 %11, %12
%14 = call i64 @mmap(i32* null, i64 %7, i32 %10, i32 %13, i32 -1, i32 0)
%15 = inttoptr i64 %14 to i8*
store i8* %15, i8** %2
%16 = load i8*, i8** %2
%17 = load i8*, i8** @MAP_FAILED
%18 = icmp eq i8* %16, %17
br i1 %18, label %19, label %23
19: ; preds = %0
%20 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%21 = load i32, i32* @EXIT_FAILURE
%22 = call i32 @exit(i32 %21)
unreachable
23: ; preds = %0
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %3
br label %25
25: ; preds = %39, %23
%26 = load i32, i32* %3
%27 = zext i32 %26 to i64
%28 = load i64, i64* %1
%29 = icmp ult i64 %27, %28
br i1 %29, label %30, label %42
30: ; preds = %25
%31 = load i32, i32* %3
%32 = load i8*, i8** %2
%33 = load i32, i32* %3
%34 = zext i32 %33 to i64
%35 = getelementptr inbounds i8, i8* %32, i64 %34
%36 = load i8, i8* %35
%37 = sext i8 %36 to i32
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %31, i32 %37)
br label %39
39: ; preds = %30
%40 = load i32, i32* %3
%41 = add i32 %40, 1
store i32 %41, i32* %3
br label %25
42: ; preds = %25
%43 = call i64 (...) @fork()
%44 = icmp eq i64 %43, 0
br i1 %44, label %45, label %67
45: ; preds = %42
store i32 0, i32* %4
br label %46
46: ; preds = %60, %45
%47 = load i32, i32* %4
%48 = zext i32 %47 to i64
%49 = load i64, i64* %1
%50 = icmp ult i64 %48, %49
br i1 %50, label %51, label %63
51: ; preds = %46
%52 = load i32, i32* %4
%53 = load i8*, i8** %2
%54 = load i32, i32* %4
%55 = zext i32 %54 to i64
%56 = getelementptr inbounds i8, i8* %53, i64 %55
%57 = load i8, i8* %56
%58 = sext i8 %57 to i32
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32 %52, i32 %58)
br label %60
60: ; preds = %51
%61 = load i32, i32* %4
%62 = add i32 %61, 1
store i32 %62, i32* %4
br label %46
63: ; preds = %46
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
%65 = load i32, i32* @EXIT_SUCCESS
%66 = call i32 @exit(i32 %65)
unreachable
67: ; preds = %42
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %5
br label %69
69: ; preds = %81, %67
%70 = load i32, i32* %5
%71 = zext i32 %70 to i64
%72 = load i64, i64* %1
%73 = icmp ult i64 %71, %72
br i1 %73, label %74, label %84
74: ; preds = %69
%75 = load i32, i32* %5
%76 = trunc i32 %75 to i8
%77 = load i8*, i8** %2
%78 = load i32, i32* %5
%79 = zext i32 %78 to i64
%80 = getelementptr inbounds i8, i8* %77, i64 %79
store i8 %76, i8* %80
br label %81
81: ; preds = %74
%82 = load i32, i32* %5
%83 = add i32 %82, 1
store i32 %83, i32* %5
br label %69
84: ; preds = %69
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.6, i64 0, i64 0))
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.7, i64 0, i64 0))
%87 = call i32 @wait(i32* null)
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.8, i64 0, i64 0))
%89 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.9, i64 0, i64 0))
store i32 0, i32* %6
br label %90
90: ; preds = %104, %84
%91 = load i32, i32* %6
%92 = zext i32 %91 to i64
%93 = load i64, i64* %1
%94 = icmp ult i64 %92, %93
br i1 %94, label %95, label %107
95: ; preds = %90
%96 = load i32, i32* %6
%97 = load i8*, i8** %2
%98 = load i32, i32* %6
%99 = zext i32 %98 to i64
%100 = getelementptr inbounds i8, i8* %97, i64 %99
%101 = load i8, i8* %100
%102 = sext i8 %101 to i32
%103 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %96, i32 %102)
br label %104
104: ; preds = %95
%105 = load i32, i32* %6
%106 = add i32 %105, 1
store i32 %106, i32* %6
br label %90
107: ; preds = %90
%108 = load i8*, i8** %2
%109 = load i64, i64* %1
%110 = call i32 @munmap(i8* %108, i64 %109)
%111 = icmp eq i32 %110, -1
br i1 %111, label %112, label %116
112: ; preds = %107
%113 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0))
%114 = load i32, i32* @EXIT_FAILURE
%115 = call i32 @exit(i32 %114)
unreachable
116: ; preds = %107
ret void
}

LLVM IR (-O2):
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_ANONYMOUS = global i32 0
@MAP_PRIVATE = global i32 0
@MAP_FAILED = global i8* null
@.str = [5 x i8] c"mmap\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [14 x i8] c"ptr[%u] = %d\0A\00"
@.str.3 = [21 x i8] c"child: ptr[%u] = %d\0A\00"
@EXIT_SUCCESS = global i32 0
@.str.10 = [7 x i8] c"munmap\00"
@str = [49 x i8] c"memory is initialized to zero with MAP_ANONYMOUS\00"
@str.11 = [42 x i8] c"Parent is writing data to the mmap'd area\00"
@str.12 = [47 x i8] c"Parent is done writing data to the mmap'd area\00"
@str.13 = [42 x i8] c"Parent is waiting for the child to finish\00"
@str.14 = [35 x i8] c"Parent detected that child exited.\00"
@str.15 = [42 x i8] c"Contents after we store values in memory.\00"
@str.16 = [13 x i8] c"Child exited\00"
define void @mmapAnonPrivate() {
%1 = load i32, i32* @PROT_READ
%2 = load i32, i32* @PROT_WRITE
%3 = or i32 %2, %1
%4 = load i32, i32* @MAP_ANONYMOUS
%5 = load i32, i32* @MAP_PRIVATE
%6 = or i32 %5, %4
%7 = tail call i64 @mmap(i32* null, i64 8, i32 %3, i32 %6, i32 -1, i32 0)
%8 = inttoptr i64 %7 to i8*
%9 = load i8*, i8** @MAP_FAILED
%10 = icmp eq i8* %9, %8
br i1 %10, label %11, label %15
11: ; preds = %0
%12 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%13 = load i32, i32* @EXIT_FAILURE
%14 = tail call i32 @exit(i32 %13)
unreachable
15: ; preds = %0
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str, i64 0, i64 0))
%17 = load i8, i8* %8
%18 = sext i8 %17 to i32
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 0, i32 %18)
%20 = getelementptr inbounds i8, i8* %8, i64 1
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 1, i32 %22)
%24 = getelementptr inbounds i8, i8* %8, i64 2
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 2, i32 %26)
%28 = getelementptr inbounds i8, i8* %8, i64 3
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 3, i32 %30)
%32 = getelementptr inbounds i8, i8* %8, i64 4
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 4, i32 %34)
%36 = getelementptr inbounds i8, i8* %8, i64 5
%37 = load i8, i8* %36
%38 = sext i8 %37 to i32
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 5, i32 %38)
%40 = getelementptr inbounds i8, i8* %8, i64 6
%41 = load i8, i8* %40
%42 = sext i8 %41 to i32
%43 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 6, i32 %42)
%44 = getelementptr inbounds i8, i8* %8, i64 7
%45 = load i8, i8* %44
%46 = sext i8 %45 to i32
%47 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 7, i32 %46)
%48 = tail call i64 (...) @fork()
%49 = icmp eq i64 %48, 0
br i1 %49, label %50, label %78
50: ; preds = %15
%51 = load i8, i8* %8
%52 = sext i8 %51 to i32
%53 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32 0, i32 %52)
%54 = load i8, i8* %20
%55 = sext i8 %54 to i32
%56 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32 1, i32 %55)
%57 = load i8, i8* %24
%58 = sext i8 %57 to i32
%59 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32 2, i32 %58)
%60 = load i8, i8* %28
%61 = sext i8 %60 to i32
%62 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32 3, i32 %61)
%63 = load i8, i8* %32
%64 = sext i8 %63 to i32
%65 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32 4, i32 %64)
%66 = load i8, i8* %36
%67 = sext i8 %66 to i32
%68 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32 5, i32 %67)
%69 = load i8, i8* %40
%70 = sext i8 %69 to i32
%71 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32 6, i32 %70)
%72 = load i8, i8* %44
%73 = sext i8 %72 to i32
%74 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32 7, i32 %73)
%75 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.16, i64 0, i64 0))
%76 = load i32, i32* @EXIT_SUCCESS
%77 = tail call i32 @exit(i32 %76)
unreachable
78: ; preds = %15
%79 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.11, i64 0, i64 0))
store i8 0, i8* %8
store i8 1, i8* %20
store i8 2, i8* %24
store i8 3, i8* %28
store i8 4, i8* %32
store i8 5, i8* %36
store i8 6, i8* %40
store i8 7, i8* %44
%80 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.12, i64 0, i64 0))
%81 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.13, i64 0, i64 0))
%82 = tail call i32 @wait(i32* null)
%83 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.14, i64 0, i64 0))
%84 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.15, i64 0, i64 0))
%85 = load i8, i8* %8
%86 = sext i8 %85 to i32
%87 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 0, i32 %86)
%88 = load i8, i8* %20
%89 = sext i8 %88 to i32
%90 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 1, i32 %89)
%91 = load i8, i8* %24
%92 = sext i8 %91 to i32
%93 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 2, i32 %92)
%94 = load i8, i8* %28
%95 = sext i8 %94 to i32
%96 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 3, i32 %95)
%97 = load i8, i8* %32
%98 = sext i8 %97 to i32
%99 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 4, i32 %98)
%100 = load i8, i8* %36
%101 = sext i8 %100 to i32
%102 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 5, i32 %101)
%103 = load i8, i8* %40
%104 = sext i8 %103 to i32
%105 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 6, i32 %104)
%106 = load i8, i8* %44
%107 = sext i8 %106 to i32
%108 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 7, i32 %107)
%109 = tail call i32 @munmap(i8* %8, i64 8)
%110 = icmp eq i32 %109, -1
br i1 %110, label %111, label %115
111: ; preds = %78
%112 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0))
%113 = load i32, i32* @EXIT_FAILURE
%114 = tail call i32 @exit(i32 %113)
unreachable
115: ; preds = %78
ret void
}