#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 */
double onerun(double, int, int, int, int, double, double, double, double);
int /*<<< orphan*/ printf(char *, double, double);
main() {
  double dt = .05, ibar = -.5, isig = .3333, S, tau = 10.0;
  int ntrials = 100, niter = 200, nstart = 50, n = 100;
  int i;
  double sout;
  for (i = 0; i < 51; i++) {
    S = -1.0 + .08 * i;
    sout = onerun(dt, n, ntrials, niter, nstart, ibar, isig, S, tau);
    printf("%g %g \n", S, sout);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xee1(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xecc(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xeb7(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xea2(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movl   $0x64,-0x34(%rbp)
movl   $0xc8,-0x38(%rbp)
movl   $0x32,-0x3c(%rbp)
movl   $0x64,-0x40(%rbp)
movl   $0x0,-0x44(%rbp)
cmpl   $0x33,-0x44(%rbp)
jge    1205 <main+0xe5>
cvtsi2sdl -0x44(%rbp),%xmm0
movsd  0xe83(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe7f(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x40(%rbp),%edi
mov    -0x34(%rbp),%esi
mov    -0x38(%rbp),%edx
mov    -0x3c(%rbp),%ecx
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm3
movsd  -0x30(%rbp),%xmm4
call   1040 <onerun@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
lea    0xe3e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1186 <main+0x66>
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
xorpd  %xmm0,%xmm0
mov    $0x33,%ebp
lea    0xf02(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
movsd  %xmm0,0x10(%rsp)
mulsd  0xeb2(%rip),%xmm0
addsd  0xeb2(%rip),%xmm0
movapd %xmm0,%xmm3
movsd  %xmm0,0x8(%rsp)
movsd  0xea8(%rip),%xmm0
mov    $0x64,%edi
mov    $0x64,%esi
mov    $0xc8,%edx
mov    $0x32,%ecx
movsd  0xe94(%rip),%xmm1
movsd  0xe94(%rip),%xmm2
movsd  0xe94(%rip),%xmm4
call   1040 <onerun@plt>
movaps %xmm0,%xmm1
mov    %rbx,%rdi
movsd  0x8(%rsp),%xmm0
call   1030 <printf@plt>
movsd  0x10(%rsp),%xmm0
addsd  0xe78(%rip),%xmm0
add    $0xffffffff,%ebp
jne    1140 <main+0x20>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%g %g \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca double
store i32 0, i32* %1
store double 5.000000e-02, double* %2
store double -5.000000e-01, double* %3
store double 3.333000e-01, double* %4
store double 1.000000e+01, double* %6
store i32 100, i32* %7
store i32 200, i32* %8
store i32 50, i32* %9
store i32 100, i32* %10
store i32 0, i32* %11
br label %13
13: ; preds = %33, %0
%14 = load i32, i32* %11
%15 = icmp slt i32 %14, 51
br i1 %15, label %16, label %36
16: ; preds = %13
%17 = load i32, i32* %11
%18 = sitofp i32 %17 to double
%19 = call double @llvm.fmuladd.f64(double 8.000000e-02, double %18, double -1.000000e+00)
store double %19, double* %5
%20 = load double, double* %2
%21 = load i32, i32* %10
%22 = load i32, i32* %7
%23 = load i32, i32* %8
%24 = load i32, i32* %9
%25 = load double, double* %3
%26 = load double, double* %4
%27 = load double, double* %5
%28 = load double, double* %6
%29 = call double @onerun(double %20, i32 %21, i32 %22, i32 %23, i32 %24, double %25, double %26, double %27, double %28)
store double %29, double* %12
%30 = load double, double* %5
%31 = load double, double* %12
%32 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %30, double %31)
br label %33
33: ; preds = %16
%34 = load i32, i32* %11
%35 = add nsw i32 %34, 1
store i32 %35, i32* %11
br label %13
36: ; preds = %13
%37 = load i32, i32* %1
ret i32 %37
}

LLVM IR (-O2):
@.str = [8 x i8] c"%g %g \0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %7, %1 ]
%3 = sitofp i32 %2 to double
%4 = tail call double @llvm.fmuladd.f64(double %3, double 8.000000e-02, double -1.000000e+00)
%5 = tail call double @onerun(double 5.000000e-02, i32 100, i32 100, i32 200, i32 50, double -5.000000e-01, double 3.333000e-01, double %4, double 1.000000e+01)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %4, double %5)
%7 = add nuw nsw i32 %2, 1
%8 = icmp eq i32 %7, 51
br i1 %8, label %9, label %1
9: ; preds = %1
ret i32 0
}