#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 */
float atof(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
long generate();
int /*<<< orphan*/ initialize(long, long, float, float);
int /*<<< orphan*/ printf(char *, long);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  float t = 0.0;
  long ts = 0;
  long tsp = 0;
  long tmax = 24 * 60 * 60;
  long seed;
  float Pe = 0.0003;
  float Pn = 0.0048;
  long atol();
  if (argc < 2) {
    fprintf(stderr, "usage: %s seed [tmax] P(ectopy) P(noise)\n", argv[0]);
    exit(1);
  }
  seed = atol(argv[1]);
  if (argc > 2)
    tmax = atol(argv[2]);
  else
    tmax = 115;
  if (tmax < 115)
    tmax = 115;
  if (argc > 3)
    Pe = atof(argv[3]);
  if (argc > 4)
    Pn = atof(argv[4]);
  initialize(seed, tmax, Pe, Pn);
  while ((t += generate()) < tmax) {
    ts = (long)(128 * t + 0.5);
    printf("%5.3f\n", (ts - tsp) / ((float)128));
    tsp = ts;
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x15180,-0x30(%rbp)
movss  0xe56(%rip),%xmm0
movss  %xmm0,-0x3c(%rbp)
movss  0xe45(%rip),%xmm0
movss  %xmm0,-0x40(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    11f0 <main+0x80>
mov    0x2e0f(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe37(%rip),%rsi
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x0,%al
call   1070 <atol@plt>
mov    %rax,-0x38(%rbp)
cmpl   $0x2,-0x8(%rbp)
jle    1225 <main+0xb5>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    $0x0,%al
call   1070 <atol@plt>
mov    %rax,-0x30(%rbp)
jmp    122d <main+0xbd>
movq   $0x73,-0x30(%rbp)
cmpq   $0x73,-0x30(%rbp)
jge    1240 <main+0xd0>
movq   $0x73,-0x30(%rbp)
cmpl   $0x3,-0x8(%rbp)
jle    125c <main+0xec>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1030 <atof@plt>
movss  %xmm0,-0x3c(%rbp)
cmpl   $0x4,-0x8(%rbp)
jle    1278 <main+0x108>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
call   1030 <atof@plt>
movss  %xmm0,-0x40(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
movss  -0x3c(%rbp),%xmm0
movss  -0x40(%rbp),%xmm1
call   1050 <initialize@plt>
mov    $0x0,%al
call   1090 <generate@plt>
cvtsi2ss %rax,%xmm1
addss  -0x14(%rbp),%xmm1
movss  %xmm1,-0x14(%rbp)
cvtsi2ssq -0x30(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1311 <main+0x1a1>
movss  0xd4c(%rip),%xmm0
mulss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd43(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
sub    -0x28(%rbp),%rax
cvtsi2ss %rax,%xmm0
movss  0xd19(%rip),%xmm1
divss  %xmm1,%xmm0
cvttss2si %xmm0,%rsi
lea    0xd43(%rip),%rdi
call   1040 <printf@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    128f <main+0x11f>
xor    %edi,%edi
call   1080 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
cmp    $0x1,%edi
jg     11a1 <main+0x31>
mov    0x2e5a(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xe86(%rip),%rsi
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
mov    %edi,%ebp
mov    0x8(%rbx),%rdi
xor    %eax,%eax
call   1070 <atol@plt>
mov    %rax,%r14
movss  0xe47(%rip),%xmm1
mov    $0x73,%r15d
movss  0xe3d(%rip),%xmm0
cmp    $0x2,%ebp
je     122a <main+0xba>
mov    0x10(%rbx),%rdi
xor    %eax,%eax
call   1070 <atol@plt>
cmp    $0x74,%rax
mov    $0x73,%r15d
cmovge %rax,%r15
cmp    $0x4,%ebp
jb     1202 <main+0x92>
mov    0x18(%rbx),%rdi
call   1030 <atof@plt>
cmp    $0x4,%ebp
jne    1214 <main+0xa4>
movss  0xe00(%rip),%xmm1
jmp    122a <main+0xba>
movss  0xdf6(%rip),%xmm1
movss  0xdf2(%rip),%xmm0
jmp    122a <main+0xba>
mov    0x20(%rbx),%rdi
movss  %xmm0,(%rsp)
call   1030 <atof@plt>
movaps %xmm0,%xmm1
movss  (%rsp),%xmm0
mov    %r14,%rdi
mov    %r15,%rsi
call   1050 <initialize@plt>
xor    %eax,%eax
call   1090 <generate@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
xorps  %xmm1,%xmm1
cvtsi2ss %r15,%xmm1
ucomiss %xmm0,%xmm1
jbe    12e6 <main+0x176>
lea    0xde6(%rip),%rbx
xor    %eax,%eax
movss  %xmm1,0x4(%rsp)
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movss  %xmm0,(%rsp)
movss  (%rsp),%xmm0
mulss  0xd86(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xd82(%rip),%xmm0
cvttsd2si %xmm0,%rbp
mov    %rbp,%rcx
sub    %rax,%rcx
xorps  %xmm0,%xmm0
cvtsi2ss %rcx,%xmm0
mulss  0xd63(%rip),%xmm0
cvttss2si %xmm0,%rsi
mov    %rbx,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1090 <generate@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movss  (%rsp),%xmm1
addss  %xmm0,%xmm1
movss  %xmm1,(%rsp)
movss  0x4(%rsp),%xmm1
movss  (%rsp),%xmm0
ucomiss %xmm0,%xmm1
mov    %rbp,%rax
ja     1270 <main+0x100>
xor    %edi,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [42 x i8] c"usage: %s seed [tmax] P(ectopy) P(noise)\0A\00"
@.str.1 = [7 x i8] c"%5.3f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca float
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca float
%12 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store float 0.000000e+00, float* %6
store i64 0, i64* %7
store i64 0, i64* %8
store i64 86400, i64* %9
store float 0x3F33A92A40000000, float* %11
store float 0x3F73A92A40000000, float* %12
%13 = load i32, i32* %4
%14 = icmp slt i32 %13, 2
br i1 %14, label %15, label %22
15: ; preds = %2
%16 = load i32, i32* @stderr
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 0
%19 = load i8*, i8** %18
%20 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %19)
%21 = call i32 @exit(i32 1)
unreachable
22: ; preds = %2
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 1
%25 = load i8*, i8** %24
%26 = call i64 (i8*, ...) bitcast (i64 (...)* @atol to i64 (i8*, ...)*)(i8* %25)
store i64 %26, i64* %10
%27 = load i32, i32* %4
%28 = icmp sgt i32 %27, 2
br i1 %28, label %29, label %34
29: ; preds = %22
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 2
%32 = load i8*, i8** %31
%33 = call i64 (i8*, ...) bitcast (i64 (...)* @atol to i64 (i8*, ...)*)(i8* %32)
store i64 %33, i64* %9
br label %35
34: ; preds = %22
store i64 115, i64* %9
br label %35
35: ; preds = %34, %29
%36 = load i64, i64* %9
%37 = icmp slt i64 %36, 115
br i1 %37, label %38, label %39
38: ; preds = %35
store i64 115, i64* %9
br label %39
39: ; preds = %38, %35
%40 = load i32, i32* %4
%41 = icmp sgt i32 %40, 3
br i1 %41, label %42, label %47
42: ; preds = %39
%43 = load i8**, i8*** %5
%44 = getelementptr inbounds i8*, i8** %43, i64 3
%45 = load i8*, i8** %44
%46 = call float @atof(i8* %45)
store float %46, float* %11
br label %47
47: ; preds = %42, %39
%48 = load i32, i32* %4
%49 = icmp sgt i32 %48, 4
br i1 %49, label %50, label %55
50: ; preds = %47
%51 = load i8**, i8*** %5
%52 = getelementptr inbounds i8*, i8** %51, i64 4
%53 = load i8*, i8** %52
%54 = call float @atof(i8* %53)
store float %54, float* %12
br label %55
55: ; preds = %50, %47
%56 = load i64, i64* %10
%57 = load i64, i64* %9
%58 = load float, float* %11
%59 = load float, float* %12
%60 = call i32 @initialize(i64 %56, i64 %57, float %58, float %59)
br label %61
61: ; preds = %69, %55
%62 = call i64 (...) @generate()
%63 = sitofp i64 %62 to float
%64 = load float, float* %6
%65 = fadd float %64, %63
store float %65, float* %6
%66 = load i64, i64* %9
%67 = sitofp i64 %66 to float
%68 = fcmp olt float %65, %67
br i1 %68, label %69, label %83
69: ; preds = %61
%70 = load float, float* %6
%71 = fmul float 1.280000e+02, %70
%72 = fpext float %71 to double
%73 = fadd double %72, 5.000000e-01
%74 = fptosi double %73 to i64
store i64 %74, i64* %7
%75 = load i64, i64* %7
%76 = load i64, i64* %8
%77 = sub nsw i64 %75, %76
%78 = sitofp i64 %77 to float
%79 = fdiv float %78, 1.280000e+02
%80 = fptosi float %79 to i64
%81 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i64 %80)
%82 = load i64, i64* %7
store i64 %82, i64* %8
br label %61
83: ; preds = %61
%84 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [42 x i8] c"usage: %s seed [tmax] P(ectopy) P(noise)\0A\00"
@.str.1 = [7 x i8] c"%5.3f\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %1
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = tail call i64 (i8*, ...) bitcast (i64 (...)* @atol to i64 (i8*, ...)*)(i8* %11)
%13 = icmp eq i32 %0, 2
br i1 %13, label %30, label %14
14: ; preds = %9
%15 = getelementptr inbounds i8*, i8** %1, i64 2
%16 = load i8*, i8** %15
%17 = tail call i64 (i8*, ...) bitcast (i64 (...)* @atol to i64 (i8*, ...)*)(i8* %16)
%18 = icmp sgt i64 %17, 115
%19 = select i1 %18, i64 %17, i64 115
%20 = icmp ugt i32 %0, 3
br i1 %20, label %21, label %30
21: ; preds = %14
%22 = getelementptr inbounds i8*, i8** %1, i64 3
%23 = load i8*, i8** %22
%24 = tail call float @atof(i8* %23)
%25 = icmp eq i32 %0, 4
br i1 %25, label %30, label %26
26: ; preds = %21
%27 = getelementptr inbounds i8*, i8** %1, i64 4
%28 = load i8*, i8** %27
%29 = tail call float @atof(i8* %28)
br label %30
30: ; preds = %9, %14, %26, %21
%31 = phi float [ %24, %26 ], [ %24, %21 ], [ 0x3F33A92A40000000, %14 ], [ 0x3F33A92A40000000, %9 ]
%32 = phi i64 [ %19, %26 ], [ %19, %21 ], [ %19, %14 ], [ 115, %9 ]
%33 = phi float [ %29, %26 ], [ 0x3F73A92A40000000, %21 ], [ 0x3F73A92A40000000, %14 ], [ 0x3F73A92A40000000, %9 ]
%34 = tail call i32 @initialize(i64 %12, i64 %32, float %31, float %33)
%35 = tail call i64 (...) @generate()
%36 = sitofp i64 %35 to float
%37 = sitofp i64 %32 to float
%38 = fcmp olt float %36, %37
br i1 %38, label %39, label %55
39: ; preds = %30, %39
%40 = phi float [ %53, %39 ], [ %36, %30 ]
%41 = phi i64 [ %45, %39 ], [ 0, %30 ]
%42 = fmul float %40, 1.280000e+02
%43 = fpext float %42 to double
%44 = fadd double %43, 5.000000e-01
%45 = fptosi double %44 to i64
%46 = sub nsw i64 %45, %41
%47 = sitofp i64 %46 to float
%48 = fmul float %47, 7.812500e-03
%49 = fptosi float %48 to i64
%50 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i64 %49)
%51 = tail call i64 (...) @generate()
%52 = sitofp i64 %51 to float
%53 = fadd float %40, %52
%54 = fcmp olt float %53, %37
br i1 %54, label %39, label %55
55: ; preds = %39, %30
%56 = tail call i32 @exit(i32 0)
unreachable
}