#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 uint8_t;
typedef double uint32_t;
typedef long uint16_t;

/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ MAP_SHARED;
int /*<<< orphan*/ O_RDWR;
int PROT_READ;
int PROT_WRITE;
int /*<<< orphan*/ _SC_PAGESIZE;
scalar_t__ errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *mmap(int /*<<< orphan*/ *, int /*<<< orphan*/, int, int /*<<< orphan*/,
           int, int);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ sleep(long);
int /*<<< orphan*/ stderr;
int strtol(char *, char **, int);
int /*<<< orphan*/ sysconf(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int fd, i;
  char *end;
  volatile void *cfg, *sts;
  volatile uint32_t *fifo;
  volatile uint8_t *rst;
  volatile uint16_t *cntr;
  long number;
  uint32_t buffer;
  errno = 0;
  number = (argc == 2) ? strtol(argv[1], &end, 10) : -1;
  if (errno != 0 || end == argv[1] || number < 1 || number > 30) {
    fprintf(stderr, "Usage: measure-corr [1-30]\n");
    return EXIT_FAILURE;
  }
  if ((fd = open("/dev/mem", O_RDWR)) < 0) {
    perror("open");
    return EXIT_FAILURE;
  }
  sts = mmap(NULL, sysconf(_SC_PAGESIZE), PROT_READ | PROT_WRITE, MAP_SHARED,
             fd, 0x40000000);
  cfg = mmap(NULL, sysconf(_SC_PAGESIZE), PROT_READ | PROT_WRITE, MAP_SHARED,
             fd, 0x40001000);
  fifo = mmap(NULL, sysconf(_SC_PAGESIZE), PROT_READ | PROT_WRITE, MAP_SHARED,
              fd, 0x4000C000);
  rst = (uint8_t *)(cfg + 3);
  cntr = (uint16_t *)(sts + 28);
  *rst &= ~1;
  *rst |= 1;
  sleep(number + 1);
  if (*cntr < number) {
    fprintf(stderr, "Not enough PPS pulses.\n");
    return EXIT_FAILURE;
  }
  buffer = 0;
  for (i = 0; i < number; ++i) {
    buffer += *fifo + 1;
  }
  printf("%.2f\n", (125.0e6 * number / buffer - 1.0) * 1.0e6);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e1b(%rip),%rax
movq   $0x0,(%rax)
cmpl   $0x2,-0x8(%rbp)
jne    11cc <main+0x4c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x20(%rbp),%rsi
mov    $0xa,%edx
call   1060 <strtol@plt>
mov    %eax,-0x5c(%rbp)
jmp    11d9 <main+0x59>
mov    $0xffffffff,%eax
mov    %eax,-0x5c(%rbp)
jmp    11d9 <main+0x59>
mov    -0x5c(%rbp),%eax
cltq
mov    %rax,-0x50(%rbp)
mov    0x2dcf(%rip),%rax
cmpq   $0x0,(%rax)
jne    121b <main+0x9b>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmp    0x8(%rcx),%rax
je     121b <main+0x9b>
cmpq   $0x1,-0x50(%rbp)
jl     121b <main+0x9b>
cmpq   $0x1e,-0x50(%rbp)
jle    1241 <main+0xc1>
mov    0x2d9e(%rip),%rax
mov    (%rax),%edi
lea    0xded(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2d79(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1447 <main+0x2c7>
mov    0x2d90(%rip),%rax
mov    (%rax),%esi
lea    0xde3(%rip),%rdi
call   1070 <open@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jge    127f <main+0xff>
lea    0xdd4(%rip),%rdi
call   1080 <perror@plt>
mov    0x2d3b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1447 <main+0x2c7>
mov    0x2d4a(%rip),%rax
mov    (%rax),%edi
call   1090 <sysconf@plt>
mov    %eax,%esi
mov    0x2d62(%rip),%rax
mov    (%rax),%edx
mov    0x2d09(%rip),%rax
or     (%rax),%edx
mov    0x2d40(%rip),%rax
mov    (%rax),%ecx
mov    -0x14(%rbp),%r8d
xor    %eax,%eax
mov    %eax,%edi
mov    $0x40000000,%r9d
call   1030 <mmap@plt>
mov    %rax,-0x30(%rbp)
mov    0x2d08(%rip),%rax
mov    (%rax),%edi
call   1090 <sysconf@plt>
mov    %eax,%esi
mov    0x2d20(%rip),%rax
mov    (%rax),%edx
mov    0x2cc7(%rip),%rax
or     (%rax),%edx
mov    0x2cfe(%rip),%rax
mov    (%rax),%ecx
mov    -0x14(%rbp),%r8d
xor    %eax,%eax
mov    %eax,%edi
mov    $0x40001000,%r9d
call   1030 <mmap@plt>
mov    %rax,-0x28(%rbp)
mov    0x2cc6(%rip),%rax
mov    (%rax),%edi
call   1090 <sysconf@plt>
mov    %eax,%esi
mov    0x2cde(%rip),%rax
mov    (%rax),%edx
mov    0x2c85(%rip),%rax
or     (%rax),%edx
mov    0x2cbc(%rip),%rax
mov    (%rax),%ecx
mov    -0x14(%rbp),%r8d
xor    %eax,%eax
mov    %eax,%edi
mov    $0x4000c000,%r9d
call   1030 <mmap@plt>
mov    %rax,-0x38(%rbp)
mov    -0x28(%rbp),%rax
add    $0x3,%rax
mov    %rax,-0x40(%rbp)
mov    -0x30(%rbp),%rax
add    $0x1c,%rax
mov    %rax,-0x48(%rbp)
mov    -0x40(%rbp),%rax
mov    (%rax),%ecx
and    $0xfffffffe,%ecx
mov    %ecx,(%rax)
mov    -0x40(%rbp),%rax
mov    (%rax),%ecx
or     $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x50(%rbp),%rdi
add    $0x1,%rdi
call   10a0 <sleep@plt>
mov    -0x48(%rbp),%rax
mov    (%rax),%rax
cmp    -0x50(%rbp),%rax
jge    13b7 <main+0x237>
mov    0x2c28(%rip),%rax
mov    (%rax),%edi
lea    0xca1(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2c03(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1447 <main+0x2c7>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
movl   $0x0,-0x18(%rbp)
movslq -0x18(%rbp),%rax
cmp    -0x50(%rbp),%rax
jge    1400 <main+0x280>
mov    -0x38(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xc24(%rip),%xmm1
addsd  %xmm1,%xmm0
addsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    13c6 <main+0x246>
cvtsi2sdq -0x50(%rbp),%xmm1
movsd  0xc02(%rip),%xmm0
mulsd  %xmm1,%xmm0
divsd  -0x58(%rbp),%xmm0
movsd  0xbe9(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xbd5(%rip),%xmm1
mulsd  %xmm1,%xmm0
lea    0xc24(%rip),%rdi
call   1040 <printf@plt>
mov    0x2b5e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    0x2e23(%rip),%rbp
movq   $0x0,0x0(%rbp)
cmp    $0x2,%edi
jne    11bf <main+0x3f>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
lea    0x10(%rsp),%rsi
mov    $0xa,%edx
call   1060 <strtol@plt>
cmpq   $0x0,0x0(%rbp)
je     11ec <main+0x6c>
mov    0x2dfa(%rip),%rax
mov    (%rax),%edi
lea    0xe51(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2dd5(%rip),%rax
mov    (%rax),%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %eax,%r15d
mov    0x10(%rsp),%rax
cmp    0x8(%rbx),%rax
je     11bf <main+0x3f>
test   %r15d,%r15d
jle    11bf <main+0x3f>
cmp    $0x1f,%r15d
jge    11bf <main+0x3f>
mov    0x2dcc(%rip),%rax
mov    (%rax),%esi
lea    0xe27(%rip),%rdi
call   1070 <open@plt>
test   %eax,%eax
js     13ce <main+0x24e>
mov    %eax,%ebx
movslq %r15d,%rbp
mov    0x2da2(%rip),%rax
mov    (%rax),%edi
call   1090 <sysconf@plt>
mov    0x2dbc(%rip),%r13
mov    0x2d65(%rip),%r14
mov    (%r14),%edx
or     0x0(%r13),%edx
mov    0x2d97(%rip),%r12
mov    (%r12),%ecx
xor    %edi,%edi
mov    %eax,%esi
mov    %ebx,%r8d
mov    $0x40000000,%r9d
call   1030 <mmap@plt>
mov    %rax,0x8(%rsp)
mov    0x2d5d(%rip),%rax
mov    (%rax),%edi
call   1090 <sysconf@plt>
mov    (%r14),%edx
or     0x0(%r13),%edx
mov    (%r12),%ecx
xor    %edi,%edi
mov    %eax,%esi
mov    %ebx,%r8d
mov    $0x40001000,%r9d
call   1030 <mmap@plt>
mov    %rax,%r12
mov    0x2d2f(%rip),%rax
mov    (%rax),%edi
call   1090 <sysconf@plt>
mov    (%r14),%edx
or     0x0(%r13),%edx
mov    0x2d32(%rip),%rcx
mov    (%rcx),%ecx
xor    %edi,%edi
mov    %eax,%esi
mov    %ebx,%r8d
mov    $0x4000c000,%r9d
call   1030 <mmap@plt>
mov    %rax,%rbx
andl   $0xfffffffe,0x3(%r12)
orl    $0x1,0x3(%r12)
lea    0x1(%rbp),%rdi
call   10a0 <sleep@plt>
mov    0x8(%rsp),%rax
mov    0x1c(%rax),%rax
cmp    %rbp,%rax
jge    1305 <main+0x185>
mov    0x2cc9(%rip),%rax
mov    (%rax),%edi
lea    0xd4a(%rip),%rsi
jmp    11cf <main+0x4f>
lea    -0x1(%rbp),%rcx
mov    %ebp,%eax
and    $0x3,%eax
cmp    $0x3,%rcx
jae    131a <main+0x19a>
xorpd  %xmm1,%xmm1
jmp    1366 <main+0x1e6>
and    $0xfffffffffffffffc,%rbp
xorpd  %xmm1,%xmm1
movsd  0xcd6(%rip),%xmm0
nopw   0x0(%rax,%rax,1)
movsd  (%rbx),%xmm2
addsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
movsd  (%rbx),%xmm1
addsd  %xmm0,%xmm1
addsd  %xmm2,%xmm1
movsd  (%rbx),%xmm2
addsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
movsd  (%rbx),%xmm1
addsd  %xmm0,%xmm1
addsd  %xmm2,%xmm1
add    $0xfffffffffffffffc,%rbp
jne    1330 <main+0x1b0>
test   %rax,%rax
je     1392 <main+0x212>
movsd  0xc8d(%rip),%xmm0
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsd  (%rbx),%xmm2
addsd  %xmm0,%xmm2
addsd  %xmm2,%xmm1
add    $0xffffffffffffffff,%rax
jne    1380 <main+0x200>
xorps  %xmm0,%xmm0
cvtsi2sd %r15d,%xmm0
mulsd  0xc66(%rip),%xmm0
divsd  %xmm1,%xmm0
addsd  0xc62(%rip),%xmm0
mulsd  0xc62(%rip),%xmm0
lea    0xca5(%rip),%rdi
call   1040 <printf@plt>
mov    0x2bd7(%rip),%rax
jmp    11db <main+0x5b>
lea    0xc70(%rip),%rdi
call   1080 <perror@plt>
jmp    11d4 <main+0x54>

LLVM IR (-O0):
@errno = global i64 0
@stderr = global i32 0
@.str = [28 x i8] c"Usage: measure-corr [1-30]\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [9 x i8] c"/dev/mem\00"
@O_RDWR = global i32 0
@.str.2 = [5 x i8] c"open\00"
@_SC_PAGESIZE = global i32 0
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_SHARED = global i32 0
@.str.3 = [24 x i8] c"Not enough PPS pulses.\0A\00"
@.str.4 = [6 x i8] c"%.2f\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca double*
%12 = alloca i32*
%13 = alloca i64*
%14 = alloca i64
%15 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 0, i64* @errno
%16 = load i32, i32* %4
%17 = icmp eq i32 %16, 2
br i1 %17, label %18, label %23
18: ; preds = %2
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
%22 = call i32 @strtol(i8* %21, i8** %8, i32 10)
br label %24
23: ; preds = %2
br label %24
24: ; preds = %23, %18
%25 = phi i32 [ %22, %18 ], [ -1, %23 ]
%26 = sext i32 %25 to i64
store i64 %26, i64* %14
%27 = load i64, i64* @errno
%28 = icmp ne i64 %27, 0
br i1 %28, label %41, label %29
29: ; preds = %24
%30 = load i8*, i8** %8
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 1
%33 = load i8*, i8** %32
%34 = icmp eq i8* %30, %33
br i1 %34, label %41, label %35
35: ; preds = %29
%36 = load i64, i64* %14
%37 = icmp slt i64 %36, 1
br i1 %37, label %41, label %38
38: ; preds = %35
%39 = load i64, i64* %14
%40 = icmp sgt i64 %39, 30
br i1 %40, label %41, label %45
41: ; preds = %38, %35, %29, %24
%42 = load i32, i32* @stderr
%43 = call i32 @fprintf(i32 %42, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%44 = load i32, i32* @EXIT_FAILURE
store i32 %44, i32* %3
br label %126
45: ; preds = %38
%46 = load i32, i32* @O_RDWR
%47 = call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %46)
store i32 %47, i32* %6
%48 = icmp slt i32 %47, 0
br i1 %48, label %49, label %52
49: ; preds = %45
%50 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%51 = load i32, i32* @EXIT_FAILURE
store i32 %51, i32* %3
br label %126
52: ; preds = %45
%53 = load i32, i32* @_SC_PAGESIZE
%54 = call i32 @sysconf(i32 %53)
%55 = load i32, i32* @PROT_READ
%56 = load i32, i32* @PROT_WRITE
%57 = or i32 %55, %56
%58 = load i32, i32* @MAP_SHARED
%59 = load i32, i32* %6
%60 = call i8* @mmap(i32* null, i32 %54, i32 %57, i32 %58, i32 %59, i32 1073741824)
store i8* %60, i8** %10
%61 = load i32, i32* @_SC_PAGESIZE
%62 = call i32 @sysconf(i32 %61)
%63 = load i32, i32* @PROT_READ
%64 = load i32, i32* @PROT_WRITE
%65 = or i32 %63, %64
%66 = load i32, i32* @MAP_SHARED
%67 = load i32, i32* %6
%68 = call i8* @mmap(i32* null, i32 %62, i32 %65, i32 %66, i32 %67, i32 1073745920)
store i8* %68, i8** %9
%69 = load i32, i32* @_SC_PAGESIZE
%70 = call i32 @sysconf(i32 %69)
%71 = load i32, i32* @PROT_READ
%72 = load i32, i32* @PROT_WRITE
%73 = or i32 %71, %72
%74 = load i32, i32* @MAP_SHARED
%75 = load i32, i32* %6
%76 = call i8* @mmap(i32* null, i32 %70, i32 %73, i32 %74, i32 %75, i32 1073790976)
%77 = bitcast i8* %76 to double*
store double* %77, double** %11
%78 = load i8*, i8** %9
%79 = getelementptr i8, i8* %78, i64 3
%80 = bitcast i8* %79 to i32*
store i32* %80, i32** %12
%81 = load i8*, i8** %10
%82 = getelementptr i8, i8* %81, i64 28
%83 = bitcast i8* %82 to i64*
store i64* %83, i64** %13
%84 = load i32*, i32** %12
%85 = load volatile i32, i32* %84
%86 = and i32 %85, -2
store volatile i32 %86, i32* %84
%87 = load i32*, i32** %12
%88 = load volatile i32, i32* %87
%89 = or i32 %88, 1
store volatile i32 %89, i32* %87
%90 = load i64, i64* %14
%91 = add nsw i64 %90, 1
%92 = call i32 @sleep(i64 %91)
%93 = load i64*, i64** %13
%94 = load volatile i64, i64* %93
%95 = load i64, i64* %14
%96 = icmp slt i64 %94, %95
br i1 %96, label %97, label %101
97: ; preds = %52
%98 = load i32, i32* @stderr
%99 = call i32 @fprintf(i32 %98, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
%100 = load i32, i32* @EXIT_FAILURE
store i32 %100, i32* %3
br label %126
101: ; preds = %52
store double 0.000000e+00, double* %15
store i32 0, i32* %7
br label %102
102: ; preds = %113, %101
%103 = load i32, i32* %7
%104 = sext i32 %103 to i64
%105 = load i64, i64* %14
%106 = icmp slt i64 %104, %105
br i1 %106, label %107, label %116
107: ; preds = %102
%108 = load double*, double** %11
%109 = load volatile double, double* %108
%110 = fadd double %109, 1.000000e+00
%111 = load double, double* %15
%112 = fadd double %111, %110
store double %112, double* %15
br label %113
113: ; preds = %107
%114 = load i32, i32* %7
%115 = add nsw i32 %114, 1
store i32 %115, i32* %7
br label %102
116: ; preds = %102
%117 = load i64, i64* %14
%118 = sitofp i64 %117 to double
%119 = fmul double 1.250000e+08, %118
%120 = load double, double* %15
%121 = fdiv double %119, %120
%122 = fsub double %121, 1.000000e+00
%123 = fmul double %122, 1.000000e+06
%124 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), double %123)
%125 = load i32, i32* @EXIT_SUCCESS
store i32 %125, i32* %3
br label %126
126: ; preds = %116, %97, %49, %41
%127 = load i32, i32* %3
ret i32 %127
}

LLVM IR (-O2):
@errno = global i64 0
@stderr = global i32 0
@.str = [28 x i8] c"Usage: measure-corr [1-30]\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [9 x i8] c"/dev/mem\00"
@O_RDWR = global i32 0
@.str.2 = [5 x i8] c"open\00"
@_SC_PAGESIZE = global i32 0
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_SHARED = global i32 0
@.str.3 = [24 x i8] c"Not enough PPS pulses.\0A\00"
@.str.4 = [6 x i8] c"%.2f\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
store i64 0, i64* @errno
%5 = icmp eq i32 %0, 2
br i1 %5, label %6, label %22
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @strtol(i8* %8, i8** %3, i32 10)
%10 = load i64, i64* @errno
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %22
12: ; preds = %6
%13 = sext i32 %9 to i64
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8*, i8** %1, i64 1
%16 = load i8*, i8** %15
%17 = icmp eq i8* %14, %16
%18 = icmp slt i32 %9, 1
%19 = select i1 %17, i1 true, i1 %18
%20 = icmp sgt i32 %9, 30
%21 = select i1 %19, i1 true, i1 %20
br i1 %21, label %22, label %25
22: ; preds = %2, %12, %6
%23 = load i32, i32* @stderr
%24 = tail call i32 @fprintf(i32 %23, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %112
25: ; preds = %12
%26 = load i32, i32* @O_RDWR
%27 = tail call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %26)
%28 = icmp slt i32 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %25
%30 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %112
31: ; preds = %25
%32 = load i32, i32* @_SC_PAGESIZE
%33 = tail call i32 @sysconf(i32 %32)
%34 = load i32, i32* @PROT_READ
%35 = load i32, i32* @PROT_WRITE
%36 = or i32 %35, %34
%37 = load i32, i32* @MAP_SHARED
%38 = tail call i8* @mmap(i32* null, i32 %33, i32 %36, i32 %37, i32 %27, i32 1073741824)
%39 = load i32, i32* @_SC_PAGESIZE
%40 = tail call i32 @sysconf(i32 %39)
%41 = load i32, i32* @PROT_READ
%42 = load i32, i32* @PROT_WRITE
%43 = or i32 %42, %41
%44 = load i32, i32* @MAP_SHARED
%45 = tail call i8* @mmap(i32* null, i32 %40, i32 %43, i32 %44, i32 %27, i32 1073745920)
%46 = load i32, i32* @_SC_PAGESIZE
%47 = tail call i32 @sysconf(i32 %46)
%48 = load i32, i32* @PROT_READ
%49 = load i32, i32* @PROT_WRITE
%50 = or i32 %49, %48
%51 = load i32, i32* @MAP_SHARED
%52 = tail call i8* @mmap(i32* null, i32 %47, i32 %50, i32 %51, i32 %27, i32 1073790976)
%53 = bitcast i8* %52 to double*
%54 = getelementptr i8, i8* %45, i64 3
%55 = bitcast i8* %54 to i32*
%56 = getelementptr i8, i8* %38, i64 28
%57 = bitcast i8* %56 to i64*
%58 = load volatile i32, i32* %55
%59 = and i32 %58, -2
store volatile i32 %59, i32* %55
%60 = load volatile i32, i32* %55
%61 = or i32 %60, 1
store volatile i32 %61, i32* %55
%62 = add nuw nsw i64 %13, 1
%63 = tail call i32 @sleep(i64 %62)
%64 = load volatile i64, i64* %57
%65 = icmp slt i64 %64, %13
br i1 %65, label %72, label %66
66: ; preds = %31
%67 = add nsw i64 %13, -1
%68 = and i64 %13, 3
%69 = icmp ult i64 %67, 3
br i1 %69, label %92, label %70
70: ; preds = %66
%71 = and i64 %13, -4
br label %75
72: ; preds = %31
%73 = load i32, i32* @stderr
%74 = tail call i32 @fprintf(i32 %73, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
br label %112
75: ; preds = %75, %70
%76 = phi double [ 0.000000e+00, %70 ], [ %89, %75 ]
%77 = phi i64 [ 0, %70 ], [ %90, %75 ]
%78 = load volatile double, double* %53
%79 = fadd double %78, 1.000000e+00
%80 = fadd double %76, %79
%81 = load volatile double, double* %53
%82 = fadd double %81, 1.000000e+00
%83 = fadd double %80, %82
%84 = load volatile double, double* %53
%85 = fadd double %84, 1.000000e+00
%86 = fadd double %83, %85
%87 = load volatile double, double* %53
%88 = fadd double %87, 1.000000e+00
%89 = fadd double %86, %88
%90 = add i64 %77, 4
%91 = icmp eq i64 %90, %71
br i1 %91, label %92, label %75
92: ; preds = %75, %66
%93 = phi double [ undef, %66 ], [ %89, %75 ]
%94 = phi double [ 0.000000e+00, %66 ], [ %89, %75 ]
%95 = icmp eq i64 %68, 0
br i1 %95, label %104, label %96
96: ; preds = %92, %96
%97 = phi double [ %101, %96 ], [ %94, %92 ]
%98 = phi i64 [ %102, %96 ], [ 0, %92 ]
%99 = load volatile double, double* %53
%100 = fadd double %99, 1.000000e+00
%101 = fadd double %97, %100
%102 = add i64 %98, 1
%103 = icmp eq i64 %102, %68
br i1 %103, label %104, label %96
104: ; preds = %96, %92
%105 = phi double [ %93, %92 ], [ %101, %96 ]
%106 = sitofp i32 %9 to double
%107 = fmul double %106, 1.250000e+08
%108 = fdiv double %107, %105
%109 = fadd double %108, -1.000000e+00
%110 = fmul double %109, 1.000000e+06
%111 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), double %110)
br label %112
112: ; preds = %104, %72, %29, %22
%113 = phi i32* [ @EXIT_FAILURE, %22 ], [ @EXIT_FAILURE, %29 ], [ @EXIT_FAILURE, %72 ], [ @EXIT_SUCCESS, %104 ]
%114 = load i32, i32* %113
ret i32 %114
}