#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*/ alnorm(double, int);
double log(int /*<<< orphan*/);
void init(double work[]) {
  double xstart = -9.0, pi2 = -0.918938533, xx;
  int i;
  xx = xstart;
  for (i = 0; i < 721; ++i) {
    work[0 * 721 + i] = xx;
    work[1 * 721 + i] = pi2 - xx * xx * 0.5;
    work[2 * 721 + i] = log(alnorm(xx, 1));
    work[3 * 721 + i] = log(alnorm(xx, 0));
    xx = xstart + 0.025 * (i + 1.0);
  }
  return;
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movsd  0xed4(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xebf(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x2d1,-0x24(%rbp)
jge    1252 <init+0x132>
movsd  -0x20(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xe77(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x2d1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x20(%rbp),%xmm0
mov    $0x1,%edi
call   1040 <alnorm@plt>
mov    %eax,%edi
call   1030 <log@plt>
mov    -0x8(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x5a2,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x20(%rbp),%xmm0
xor    %edi,%edi
call   1040 <alnorm@plt>
mov    %eax,%edi
call   1030 <log@plt>
mov    -0x8(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x873,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x10(%rbp),%xmm1
cvtsi2sdl -0x24(%rbp),%xmm0
movsd  0xded(%rip),%xmm2
addsd  %xmm2,%xmm0
movsd  0xdd9(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1157 <init+0x37>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
movsd  0xed1(%rip),%xmm0
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  %xmm0,(%r14,%rbx,8)
movsd  %xmm0,(%rsp)
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  0xead(%rip),%xmm1
addsd  0xead(%rip),%xmm1
movsd  %xmm1,0x1688(%r14,%rbx,8)
mov    $0x1,%edi
call   1040 <alnorm@plt>
mov    %eax,%edi
call   1030 <log@plt>
movsd  %xmm0,0x2d10(%r14,%rbx,8)
movsd  (%rsp),%xmm0
xor    %edi,%edi
call   1040 <alnorm@plt>
mov    %eax,%edi
call   1030 <log@plt>
movsd  %xmm0,0x4398(%r14,%rbx,8)
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
addsd  0xe64(%rip),%xmm0
mulsd  0xe64(%rip),%xmm0
addsd  0xe3c(%rip),%xmm0
add    $0x1,%rbx
cmp    $0x2d1,%rbx
jne    1140 <init+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @init(double* %0) {
%2 = alloca double*
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca i32
store double* %0, double** %2
store double -9.000000e+00, double* %3
store double 0xBFED67F1C8489D6C, double* %4
%7 = load double, double* %3
store double %7, double* %5
store i32 0, i32* %6
br label %8
8: ; preds = %50, %1
%9 = load i32, i32* %6
%10 = icmp slt i32 %9, 721
br i1 %10, label %11, label %53
11: ; preds = %8
%12 = load double, double* %5
%13 = load double*, double** %2
%14 = load i32, i32* %6
%15 = add nsw i32 0, %14
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds double, double* %13, i64 %16
store double %12, double* %17
%18 = load double, double* %4
%19 = load double, double* %5
%20 = load double, double* %5
%21 = fmul double %19, %20
%22 = fneg double %21
%23 = call double @llvm.fmuladd.f64(double %22, double 5.000000e-01, double %18)
%24 = load double*, double** %2
%25 = load i32, i32* %6
%26 = add nsw i32 721, %25
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds double, double* %24, i64 %27
store double %23, double* %28
%29 = load double, double* %5
%30 = call i32 @alnorm(double %29, i32 1)
%31 = call double @log(i32 %30)
%32 = load double*, double** %2
%33 = load i32, i32* %6
%34 = add nsw i32 1442, %33
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds double, double* %32, i64 %35
store double %31, double* %36
%37 = load double, double* %5
%38 = call i32 @alnorm(double %37, i32 0)
%39 = call double @log(i32 %38)
%40 = load double*, double** %2
%41 = load i32, i32* %6
%42 = add nsw i32 2163, %41
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds double, double* %40, i64 %43
store double %39, double* %44
%45 = load double, double* %3
%46 = load i32, i32* %6
%47 = sitofp i32 %46 to double
%48 = fadd double %47, 1.000000e+00
%49 = call double @llvm.fmuladd.f64(double 2.500000e-02, double %48, double %45)
store double %49, double* %5
br label %50
50: ; preds = %11
%51 = load i32, i32* %6
%52 = add nsw i32 %51, 1
store i32 %52, i32* %6
br label %8
53: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @init(double* nocapture writeonly %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i64 [ 0, %1 ], [ %23, %2 ]
%4 = phi double [ -9.000000e+00, %1 ], [ %22, %2 ]
%5 = getelementptr inbounds double, double* %0, i64 %3
store double %4, double* %5
%6 = fneg double %4
%7 = fmul double %4, %6
%8 = tail call double @llvm.fmuladd.f64(double %7, double 5.000000e-01, double 0xBFED67F1C8489D6C)
%9 = add nuw nsw i64 %3, 721
%10 = getelementptr inbounds double, double* %0, i64 %9
store double %8, double* %10
%11 = tail call i32 @alnorm(double %4, i32 1)
%12 = tail call double @log(i32 %11)
%13 = add nuw nsw i64 %3, 1442
%14 = getelementptr inbounds double, double* %0, i64 %13
store double %12, double* %14
%15 = tail call i32 @alnorm(double %4, i32 0)
%16 = tail call double @log(i32 %15)
%17 = add nuw nsw i64 %3, 2163
%18 = getelementptr inbounds double, double* %0, i64 %17
store double %16, double* %18
%19 = trunc i64 %3 to i32
%20 = sitofp i32 %19 to double
%21 = fadd double %20, 1.000000e+00
%22 = tail call double @llvm.fmuladd.f64(double %21, double 2.500000e-02, double -9.000000e+00)
%23 = add nuw nsw i64 %3, 1
%24 = icmp eq i64 %23, 721
br i1 %24, label %25, label %2
25: ; preds = %2
ret void
}