#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_ANON;
void *MAP_FAILED;
int MAP_PRIVATE;
int PROT_READ;
int PROT_WRITE;
int /*<<< orphan*/ _SC_PAGESIZE;
int /*<<< orphan*/ errno;
void *mmap(int /*<<< orphan*/ *, int, int, int, int /*<<< orphan*/,
           int /*<<< orphan*/);
int random();
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
scalar_t__ sysconf(int /*<<< orphan*/);
int /*<<< orphan*/ test_daemon();
scalar_t__ test_go();
int /*<<< orphan*/ test_init(int, char **);
int /*<<< orphan*/ test_msg(char *, ...);
int /*<<< orphan*/ test_waitsig();
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  void *mem;
  int i, fail = 0;
  unsigned rover = 1;
  unsigned backup[16] = {};
  srand(time(NULL));
  test_init(argc, argv);
  mem = mmap(NULL, 16 * (unsigned int)(sysconf(_SC_PAGESIZE)),
             PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, 0, 0);
  if (mem == MAP_FAILED)
    return 1;
  test_msg("mem %p backup %p\n", mem, backup);
  test_daemon();
  while (test_go()) {
    unsigned pfn;
    pfn = random() % 16;
    *(unsigned *)(mem + pfn * (unsigned int)(sysconf(_SC_PAGESIZE))) = rover;
    backup[pfn] = rover;
    test_msg("t %u %u\n", pfn, rover);
    rover++;
    sleep(1);
  }
  test_waitsig();
  test_msg("final rover %u\n", rover);
  for (i = 0; i < 16; i++)
    if (backup[i] !=
        *(unsigned *)(mem + i * (unsigned int)(sysconf(_SC_PAGESIZE)))) {
      test_msg("Page %u differs want %u has %u\n", i, backup[i],
               *(unsigned *)(mem + i * (unsigned int)(sysconf(_SC_PAGESIZE))));
      fail = 1;
    } else
      test_msg("Page %u matches %u\n", i, backup[i]);
  if (fail)
    test_msg("FAIL: %s:%d: "
             "Memory corruption\n"
             " (errno = %d (%s))\n",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/LK4D4/criu/refs/heads/master/test/zdtm/"
             "live/static/mem-touch.c",
             55, errno, strerror(errno));
  else
    test_msg("PASS\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x1,-0x24(%rbp)
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1060 <memset@plt>
xor    %eax,%eax
mov    %eax,%edi
call   10a0 <time@plt>
mov    %eax,%edi
call   1080 <srand@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <test_init@plt>
mov    0x2db6(%rip),%rax
mov    (%rax),%edi
call   10d0 <sysconf@plt>
mov    %eax,%esi
shl    $0x4,%esi
mov    0x2dbb(%rip),%rax
mov    (%rax),%edx
mov    0x2d82(%rip),%rax
or     (%rax),%edx
mov    0x2d69(%rip),%rax
mov    (%rax),%ecx
mov    0x2d68(%rip),%rax
or     (%rax),%ecx
xor    %eax,%eax
mov    %eax,%edi
xor    %r9d,%r9d
mov    %r9d,%r8d
call   1040 <mmap@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    0x2d38(%rip),%rcx
cmp    (%rcx),%rax
jne    128d <main+0xbd>
movl   $0x1,-0x4(%rbp)
jmp    14ca <main+0x2fa>
mov    -0x18(%rbp),%rsi
lea    -0x70(%rbp),%rdx
lea    0xd64(%rip),%rdi
mov    $0x0,%al
call   1070 <test_msg@plt>
mov    $0x0,%al
call   1050 <test_daemon@plt>
mov    $0x0,%al
call   10c0 <test_go@plt>
cmp    $0x0,%rax
je     1346 <main+0x176>
mov    $0x0,%al
call   10b0 <random@plt>
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %edx,-0x74(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x84(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    -0x74(%rbp),%eax
mov    %eax,-0x88(%rbp)
mov    0x2cf2(%rip),%rax
mov    (%rax),%edi
call   10d0 <sysconf@plt>
mov    -0x88(%rbp),%ecx
mov    -0x84(%rbp),%edx
mov    %rax,%rsi
mov    -0x80(%rbp),%rax
imul   %esi,%ecx
mov    %ecx,%ecx
mov    %edx,(%rax,%rcx,1)
mov    -0x24(%rbp),%ecx
mov    -0x74(%rbp),%eax
mov    %ecx,-0x70(%rbp,%rax,4)
mov    -0x74(%rbp),%esi
mov    -0x24(%rbp),%edx
lea    0xceb(%rip),%rdi
mov    $0x0,%al
call   1070 <test_msg@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    $0x1,%edi
call   10f0 <sleep@plt>
jmp    12aa <main+0xda>
mov    $0x0,%al
call   1090 <test_waitsig@plt>
mov    -0x24(%rbp),%esi
lea    0xcc4(%rip),%rdi
mov    $0x0,%al
call   1070 <test_msg@plt>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x10,-0x1c(%rbp)
jge    1466 <main+0x296>
movslq -0x1c(%rbp),%rax
mov    -0x70(%rbp,%rax,4),%eax
mov    %eax,-0x8c(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x98(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x9c(%rbp)
mov    0x2c48(%rip),%rax
mov    (%rax),%edi
call   10d0 <sysconf@plt>
mov    -0x9c(%rbp),%edx
mov    -0x98(%rbp),%rcx
mov    %rax,%rsi
mov    -0x8c(%rbp),%eax
imul   %esi,%edx
mov    %edx,%edx
cmp    (%rcx,%rdx,1),%eax
je     143a <main+0x26a>
mov    -0x1c(%rbp),%eax
mov    %eax,-0xb0(%rbp)
movslq -0x1c(%rbp),%rax
mov    -0x70(%rbp,%rax,4),%eax
mov    %eax,-0xac(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0xa8(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0xb4(%rbp)
mov    0x2beb(%rip),%rax
mov    (%rax),%edi
call   10d0 <sysconf@plt>
mov    -0xb4(%rbp),%ecx
mov    -0xb0(%rbp),%esi
mov    -0xac(%rbp),%edx
mov    %rax,%rdi
mov    -0xa8(%rbp),%rax
imul   %edi,%ecx
mov    %ecx,%ecx
mov    (%rax,%rcx,1),%ecx
lea    0xc04(%rip),%rdi
mov    $0x0,%al
call   1070 <test_msg@plt>
movl   $0x1,-0x20(%rbp)
jmp    1453 <main+0x283>
mov    -0x1c(%rbp),%esi
movslq -0x1c(%rbp),%rax
mov    -0x70(%rbp,%rax,4),%edx
lea    0xbff(%rip),%rdi
mov    $0x0,%al
call   1070 <test_msg@plt>
jmp    1458 <main+0x288>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1365 <main+0x195>
cmpl   $0x0,-0x20(%rbp)
je     14b5 <main+0x2e5>
mov    0x2b59(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xb8(%rbp)
mov    0x2b4a(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
mov    -0xb8(%rbp),%ecx
mov    %eax,%r8d
lea    0xbc2(%rip),%rdi
lea    0xbee(%rip),%rsi
mov    $0x37,%edx
mov    $0x0,%al
call   1070 <test_msg@plt>
jmp    14c3 <main+0x2f3>
lea    0xc6f(%rip),%rdi
mov    $0x0,%al
call   1070 <test_msg@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
xorps  %xmm0,%xmm0
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
xor    %edi,%edi
call   1090 <time@plt>
mov    %eax,%edi
call   1070 <srand@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <test_init@plt>
mov    0x2dd7(%rip),%r13
mov    0x0(%r13),%edi
call   10c0 <sysconf@plt>
shl    $0x4,%eax
mov    0x2ddc(%rip),%rcx
mov    0x2da5(%rip),%rdx
mov    (%rdx),%edx
or     (%rcx),%edx
mov    0x2d8a(%rip),%rsi
mov    0x2d8b(%rip),%rcx
mov    (%rcx),%ecx
or     (%rsi),%ecx
xor    %edi,%edi
mov    %eax,%esi
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1040 <mmap@plt>
mov    %rax,%r12
mov    0x2d5e(%rip),%rax
cmp    (%rax),%r12
je     139d <main+0x1dd>
lea    0xd9e(%rip),%rdi
lea    0x10(%rsp),%rdx
mov    %r12,%rsi
xor    %eax,%eax
call   1060 <test_msg@plt>
xor    %eax,%eax
call   1050 <test_daemon@plt>
xor    %eax,%eax
call   10b0 <test_go@plt>
mov    $0x1,%ebp
test   %rax,%rax
je     12e1 <main+0x121>
lea    0xd82(%rip),%r14
xor    %eax,%eax
call   10a0 <random@plt>
mov    %eax,%ebx
lea    0xf(%rbx),%eax
test   %ebx,%ebx
cmovns %ebx,%eax
and    $0xfffffff0,%eax
sub    %eax,%ebx
mov    0x0(%r13),%edi
call   10c0 <sysconf@plt>
imul   %ebx,%eax
mov    %ebp,(%r12,%rax,1)
mov    %ebp,0x10(%rsp,%rbx,4)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1060 <test_msg@plt>
add    $0x1,%ebp
mov    $0x1,%edi
call   10e0 <sleep@plt>
xor    %eax,%eax
call   10b0 <test_go@plt>
test   %rax,%rax
jne    1290 <main+0xd0>
xor    %eax,%eax
call   1080 <test_waitsig@plt>
lea    0xd2c(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1060 <test_msg@plt>
mov    $0x1,%r15b
lea    0xd49(%rip),%r14
xor    %ebp,%ebp
mov    %r15d,0xc(%rsp)
nopl   0x0(%rax)
mov    0x10(%rsp,%rbp,4),%r15d
mov    0x0(%r13),%edi
call   10c0 <sysconf@plt>
imul   %ebp,%eax
mov    0x10(%rsp,%rbp,4),%ebx
cmp    (%r12,%rax,1),%r15d
jne    1350 <main+0x190>
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1060 <test_msg@plt>
add    $0x1,%rbp
cmp    $0x10,%rbp
jne    1310 <main+0x150>
jmp    1384 <main+0x1c4>
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x0(%r13),%edi
call   10c0 <sysconf@plt>
imul   %ebp,%eax
mov    (%r12,%rax,1),%ecx
xor    %r15d,%r15d
lea    0xcc1(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1060 <test_msg@plt>
lea    0x1(%rbp),%rax
cmp    $0xf,%rbp
mov    %rax,%rbp
jne    1304 <main+0x144>
jmp    13a4 <main+0x1e4>
testb  $0x1,0xc(%rsp)
je     13a4 <main+0x1e4>
lea    0xd99(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1060 <test_msg@plt>
jmp    13d5 <main+0x215>
mov    $0x1,%ebx
jmp    13d5 <main+0x215>
mov    0x2c25(%rip),%rax
mov    (%rax),%ebp
mov    %ebp,%edi
call   10d0 <strerror@plt>
lea    0xca4(%rip),%rdi
lea    0xcd0(%rip),%rsi
xor    %ebx,%ebx
mov    $0x37,%edx
mov    %ebp,%ecx
mov    %eax,%r8d
xor    %eax,%eax
call   1060 <test_msg@plt>
mov    %ebx,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@_SC_PAGESIZE = global i32 0
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_PRIVATE = global i32 0
@MAP_ANON = global i32 0
@MAP_FAILED = global i8* null
@.str = [18 x i8] c"mem %p backup %p\0A\00"
@.str.1 = [9 x i8] c"t %u %u\0A\00"
@.str.2 = [16 x i8] c"final rover %u\0A\00"
@.str.3 = [32 x i8] c"Page %u differs want %u has %u\0A\00"
@.str.4 = [20 x i8] c"Page %u matches %u\0A\00"
@.str.5 = [51 x i8] c"FAIL: %s:%d: Memory corruption\0A (errno = %d (%s))\0A\00"
@.str.6 = [153 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/LK4D4/criu/refs/heads/master/test/zdtm/live/static/mem-touch.c\00"
@errno = global i32 0
@.str.7 = [6 x i8] c"PASS\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca [16 x i32]
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %8
store i32 1, i32* %9
%12 = bitcast [16 x i32]* %10 to i8*
%13 = call i32 @time(i32* null)
%14 = call i32 @srand(i32 %13)
%15 = load i32, i32* %4
%16 = load i8**, i8*** %5
%17 = call i32 @test_init(i32 %15, i8** %16)
%18 = load i32, i32* @_SC_PAGESIZE
%19 = call i64 @sysconf(i32 %18)
%20 = trunc i64 %19 to i32
%21 = mul i32 16, %20
%22 = load i32, i32* @PROT_READ
%23 = load i32, i32* @PROT_WRITE
%24 = or i32 %22, %23
%25 = load i32, i32* @MAP_PRIVATE
%26 = load i32, i32* @MAP_ANON
%27 = or i32 %25, %26
%28 = call i8* @mmap(i32* null, i32 %21, i32 %24, i32 %27, i32 0, i32 0)
store i8* %28, i8** %6
%29 = load i8*, i8** %6
%30 = load i8*, i8** @MAP_FAILED
%31 = icmp eq i8* %29, %30
br i1 %31, label %32, label %33
32: ; preds = %2
store i32 1, i32* %3
br label %126
33: ; preds = %2
%34 = load i8*, i8** %6
%35 = getelementptr inbounds [16 x i32], [16 x i32]* %10, i64 0, i64 0
%36 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %34, i32* %35)
%37 = call i32 (...) @test_daemon()
br label %38
38: ; preds = %41, %33
%39 = call i64 (...) @test_go()
%40 = icmp ne i64 %39, 0
br i1 %40, label %41, label %64
41: ; preds = %38
%42 = call i32 (...) @random()
%43 = srem i32 %42, 16
store i32 %43, i32* %11
%44 = load i32, i32* %9
%45 = load i8*, i8** %6
%46 = load i32, i32* %11
%47 = load i32, i32* @_SC_PAGESIZE
%48 = call i64 @sysconf(i32 %47)
%49 = trunc i64 %48 to i32
%50 = mul i32 %46, %49
%51 = zext i32 %50 to i64
%52 = getelementptr i8, i8* %45, i64 %51
%53 = bitcast i8* %52 to i32*
store i32 %44, i32* %53
%54 = load i32, i32* %9
%55 = load i32, i32* %11
%56 = zext i32 %55 to i64
%57 = getelementptr inbounds [16 x i32], [16 x i32]* %10, i64 0, i64 %56
store i32 %54, i32* %57
%58 = load i32, i32* %11
%59 = load i32, i32* %9
%60 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %58, i32 %59)
%61 = load i32, i32* %9
%62 = add i32 %61, 1
store i32 %62, i32* %9
%63 = call i32 @sleep(i32 1)
br label %38
64: ; preds = %38
%65 = call i32 (...) @test_waitsig()
%66 = load i32, i32* %9
%67 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %66)
store i32 0, i32* %7
br label %68
68: ; preds = %112, %64
%69 = load i32, i32* %7
%70 = icmp slt i32 %69, 16
br i1 %70, label %71, label %115
71: ; preds = %68
%72 = load i32, i32* %7
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds [16 x i32], [16 x i32]* %10, i64 0, i64 %73
%75 = load i32, i32* %74
%76 = load i8*, i8** %6
%77 = load i32, i32* %7
%78 = load i32, i32* @_SC_PAGESIZE
%79 = call i64 @sysconf(i32 %78)
%80 = trunc i64 %79 to i32
%81 = mul i32 %77, %80
%82 = zext i32 %81 to i64
%83 = getelementptr i8, i8* %76, i64 %82
%84 = bitcast i8* %83 to i32*
%85 = load i32, i32* %84
%86 = icmp ne i32 %75, %85
br i1 %86, label %87, label %104
87: ; preds = %71
%88 = load i32, i32* %7
%89 = load i32, i32* %7
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds [16 x i32], [16 x i32]* %10, i64 0, i64 %90
%92 = load i32, i32* %91
%93 = load i8*, i8** %6
%94 = load i32, i32* %7
%95 = load i32, i32* @_SC_PAGESIZE
%96 = call i64 @sysconf(i32 %95)
%97 = trunc i64 %96 to i32
%98 = mul i32 %94, %97
%99 = zext i32 %98 to i64
%100 = getelementptr i8, i8* %93, i64 %99
%101 = bitcast i8* %100 to i32*
%102 = load i32, i32* %101
%103 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), i32 %88, i32 %92, i32 %102)
store i32 1, i32* %8
br label %111
104: ; preds = %71
%105 = load i32, i32* %7
%106 = load i32, i32* %7
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds [16 x i32], [16 x i32]* %10, i64 0, i64 %107
%109 = load i32, i32* %108
%110 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i32 %105, i32 %109)
br label %111
111: ; preds = %104, %87
br label %112
112: ; preds = %111
%113 = load i32, i32* %7
%114 = add nsw i32 %113, 1
store i32 %114, i32* %7
br label %68
115: ; preds = %68
%116 = load i32, i32* %8
%117 = icmp ne i32 %116, 0
br i1 %117, label %118, label %123
118: ; preds = %115
%119 = load i32, i32* @errno
%120 = load i32, i32* @errno
%121 = call i32 @strerror(i32 %120)
%122 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str.6, i64 0, i64 0), i32 55, i32 %119, i32 %121)
br label %125
123: ; preds = %115
%124 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
br label %125
125: ; preds = %123, %118
store i32 0, i32* %3
br label %126
126: ; preds = %125, %32
%127 = load i32, i32* %3
ret i32 %127
}

LLVM IR (-O2):
@_SC_PAGESIZE = global i32 0
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_PRIVATE = global i32 0
@MAP_ANON = global i32 0
@MAP_FAILED = global i8* null
@.str = [18 x i8] c"mem %p backup %p\0A\00"
@.str.1 = [9 x i8] c"t %u %u\0A\00"
@.str.2 = [16 x i8] c"final rover %u\0A\00"
@.str.3 = [32 x i8] c"Page %u differs want %u has %u\0A\00"
@.str.4 = [20 x i8] c"Page %u matches %u\0A\00"
@.str.5 = [51 x i8] c"FAIL: %s:%d: Memory corruption\0A (errno = %d (%s))\0A\00"
@.str.6 = [153 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/LK4D4/criu/refs/heads/master/test/zdtm/live/static/mem-touch.c\00"
@errno = global i32 0
@.str.7 = [6 x i8] c"PASS\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca [16 x i32]
%4 = bitcast [16 x i32]* %3 to i8*
%5 = tail call i32 @time(i32* null)
%6 = tail call i32 @srand(i32 %5)
%7 = tail call i32 @test_init(i32 %0, i8** %1)
%8 = load i32, i32* @_SC_PAGESIZE
%9 = tail call i64 @sysconf(i32 %8)
%10 = trunc i64 %9 to i32
%11 = shl i32 %10, 4
%12 = load i32, i32* @PROT_READ
%13 = load i32, i32* @PROT_WRITE
%14 = or i32 %13, %12
%15 = load i32, i32* @MAP_PRIVATE
%16 = load i32, i32* @MAP_ANON
%17 = or i32 %16, %15
%18 = tail call i8* @mmap(i32* null, i32 %11, i32 %14, i32 %17, i32 0, i32 0)
%19 = load i8*, i8** @MAP_FAILED
%20 = icmp eq i8* %18, %19
br i1 %20, label %89, label %21
21: ; preds = %2
%22 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 0
%23 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %18, i32* %22)
%24 = call i32 (...) @test_daemon()
%25 = call i64 (...) @test_go()
%26 = icmp eq i64 %25, 0
br i1 %26, label %45, label %27
27: ; preds = %21, %27
%28 = phi i32 [ %41, %27 ], [ 1, %21 ]
%29 = call i32 (...) @random()
%30 = srem i32 %29, 16
%31 = load i32, i32* @_SC_PAGESIZE
%32 = call i64 @sysconf(i32 %31)
%33 = trunc i64 %32 to i32
%34 = mul i32 %30, %33
%35 = zext i32 %34 to i64
%36 = getelementptr i8, i8* %18, i64 %35
%37 = bitcast i8* %36 to i32*
store i32 %28, i32* %37
%38 = zext i32 %30 to i64
%39 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 %38
store i32 %28, i32* %39
%40 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %30, i32 %28)
%41 = add i32 %28, 1
%42 = call i32 @sleep(i32 1)
%43 = call i64 (...) @test_go()
%44 = icmp eq i64 %43, 0
br i1 %44, label %45, label %27
45: ; preds = %27, %21
%46 = phi i32 [ 1, %21 ], [ %41, %27 ]
%47 = call i32 (...) @test_waitsig()
%48 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %46)
br label %49
49: ; preds = %70, %45
%50 = phi i64 [ %80, %70 ], [ 0, %45 ]
%51 = phi i1 [ false, %70 ], [ true, %45 ]
br label %52
52: ; preds = %49, %66
%53 = phi i64 [ %68, %66 ], [ %50, %49 ]
%54 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 %53
%55 = load i32, i32* %54
%56 = load i32, i32* @_SC_PAGESIZE
%57 = call i64 @sysconf(i32 %56)
%58 = mul i64 %53, %57
%59 = and i64 %58, 4294967295
%60 = getelementptr i8, i8* %18, i64 %59
%61 = bitcast i8* %60 to i32*
%62 = load i32, i32* %61
%63 = icmp eq i32 %55, %62
%64 = trunc i64 %53 to i32
%65 = load i32, i32* %54
br i1 %63, label %66, label %70
66: ; preds = %52
%67 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i32 %64, i32 %65)
%68 = add nuw nsw i64 %53, 1
%69 = icmp eq i64 %68, 16
br i1 %69, label %82, label %52
70: ; preds = %52
%71 = trunc i64 %53 to i32
%72 = load i32, i32* @_SC_PAGESIZE
%73 = call i64 @sysconf(i32 %72)
%74 = mul i64 %53, %73
%75 = and i64 %74, 4294967295
%76 = getelementptr i8, i8* %18, i64 %75
%77 = bitcast i8* %76 to i32*
%78 = load i32, i32* %77
%79 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), i32 %71, i32 %65, i32 %78)
%80 = add nuw nsw i64 %53, 1
%81 = icmp eq i64 %80, 16
br i1 %81, label %83, label %49
82: ; preds = %66
br i1 %51, label %87, label %83
83: ; preds = %70, %82
%84 = load i32, i32* @errno
%85 = call i32 @strerror(i32 %84)
%86 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str.6, i64 0, i64 0), i32 55, i32 %84, i32 %85)
br label %89
87: ; preds = %82
%88 = call i32 (i8*, ...) @test_msg(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
br label %89
89: ; preds = %83, %87, %2
%90 = phi i32 [ 1, %2 ], [ 0, %87 ], [ 0, %83 ]
ret i32 %90
}