#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 der;
int /*<<< orphan*/ free(double *);
scalar_t__ malloc(int);
double phi(double);
double sqrt(int);
double sum;
double *t;
double tem;
double emvndrh(int m, double *w, double *x, double rh, double eps) {
  double grh(double), der, *t, tem, sum;
  double romberg(double (*)(double), double, double, double);
  double pnorms(double), phi(double);
  int i, k;
  extern int mm;
  extern double *ww, *xx, rs, r1, r32;
  mm = m;
  rs = sqrt(rh);
  r1 = sqrt(1. - rh);
  r32 = r1 * (1. - rh);
  xx = (double *)malloc((mm + 1) * sizeof(double));
  ww = (double *)malloc((mm + 1) * sizeof(double));
  t = (double *)malloc((mm + 1) * sizeof(double));
  for (i = 1; i <= mm; i++) {
    ww[i] = w[i];
    xx[i] = x[i];
  }
  if (rh >= 0.)
    der = romberg(grh, -6., 6., eps);
  else {
    for (i = 1; i <= mm; i++)
      t[i] = pnorms(x[i]) - pnorms(w[i]);
    for (k = 1, sum = 0.; k <= mm; k++) {
      for (i = 1, tem = 1.; i <= mm; i++) {
        if (i != k) {
          tem *= t[i];
        } else
          tem *= (x[i] * phi(x[i]) - w[i] * phi(w[i]));
      }
      sum += tem;
    }
    der = .5 * sum;
  }
  free(xx);
  free(ww);
  free(t);
  return (der);
}


x86 assembly (clang, -O0):
<emvndrh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x28(%rbp)
mov    -0x4(%rbp),%ecx
mov    0x2e71(%rip),%rax
mov    %ecx,(%rax)
cvttsd2si -0x20(%rbp),%edi
call   1080 <sqrt@plt>
mov    0x2e16(%rip),%rax
movsd  %xmm0,(%rax)
movsd  0xe5a(%rip),%xmm0
subsd  -0x20(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1080 <sqrt@plt>
mov    0x2e35(%rip),%rax
movsd  %xmm0,(%rax)
mov    0x2e2a(%rip),%rax
movsd  (%rax),%xmm0
movsd  0xe2e(%rip),%xmm1
subsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
mov    0x2dd6(%rip),%rax
movsd  %xmm0,(%rax)
mov    0x2e0b(%rip),%rax
mov    (%rax),%eax
add    $0x1,%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,%rcx
mov    0x2dbf(%rip),%rax
mov    %rcx,(%rax)
mov    0x2de5(%rip),%rax
mov    (%rax),%eax
add    $0x1,%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,%rcx
mov    0x2d91(%rip),%rax
mov    %rcx,(%rax)
mov    0x2dbf(%rip),%rax
mov    (%rax),%eax
add    $0x1,%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x38(%rbp)
movl   $0x1,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
mov    0x2d98(%rip),%rcx
cmp    (%rcx),%eax
jg     12b6 <emvndrh+0x156>
mov    -0x10(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x2d44(%rip),%rax
mov    (%rax),%rax
movslq -0x4c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x2d2c(%rip),%rax
mov    (%rax),%rax
movslq -0x4c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    1256 <emvndrh+0xf6>
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     12f3 <emvndrh+0x193>
movsd  -0x28(%rbp),%xmm2
mov    0x2cfc(%rip),%rdi
movsd  0xd34(%rip),%xmm0
movsd  0xd34(%rip),%xmm1
call   1060 <romberg@plt>
movsd  %xmm0,-0x30(%rbp)
jmp    1499 <emvndrh+0x339>
movl   $0x1,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
mov    0x2cf4(%rip),%rcx
cmp    (%rcx),%eax
jg     135c <emvndrh+0x1fc>
mov    -0x18(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1040 <pnorms@plt>
movsd  %xmm0,-0x58(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1040 <pnorms@plt>
movaps %xmm0,%xmm1
movsd  -0x58(%rbp),%xmm0
subsd  %xmm1,%xmm0
mov    -0x38(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    12fa <emvndrh+0x19a>
movl   $0x1,-0x50(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x50(%rbp),%eax
mov    0x2c83(%rip),%rcx
cmp    (%rcx),%eax
jg     1487 <emvndrh+0x327>
movl   $0x1,-0x4c(%rbp)
movsd  0xc74(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x4c(%rbp),%eax
mov    0x2c5d(%rip),%rcx
cmp    (%rcx),%eax
jg     146a <emvndrh+0x30a>
mov    -0x4c(%rbp),%eax
cmp    -0x50(%rbp),%eax
je     13cb <emvndrh+0x26b>
mov    -0x38(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    1457 <emvndrh+0x2f7>
mov    -0x18(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1050 <phi@plt>
movsd  %xmm0,-0x68(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1050 <phi@plt>
movsd  -0x70(%rbp),%xmm1
movsd  -0x68(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x60(%rbp),%xmm0
mulsd  %xmm3,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    145c <emvndrh+0x2fc>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    1391 <emvndrh+0x231>
movsd  -0x40(%rbp),%xmm0
addsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    136b <emvndrh+0x20b>
movsd  0xb79(%rip),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    0x2b28(%rip),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    0x2b11(%rip),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
movsd  -0x30(%rbp),%xmm0
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emvndrh>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
movsd  %xmm1,0x30(%rsp)
movsd  %xmm0,0x18(%rsp)
mov    %rdx,%r14
mov    %rsi,%rbx
mov    0x2e71(%rip),%r12
mov    %edi,(%r12)
cvttsd2si %xmm0,%edi
call   1080 <sqrt@plt>
mov    0x2e15(%rip),%rax
movsd  %xmm0,(%rax)
movsd  0xe59(%rip),%xmm0
subsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
cvttsd2si %xmm0,%edi
call   1080 <sqrt@plt>
mov    0x2e2d(%rip),%rax
movsd  %xmm0,(%rax)
movsd  0x8(%rsp),%xmm1
mulsd  %xmm0,%xmm1
mov    0x2de0(%rip),%rax
movsd  %xmm1,(%rax)
mov    (%r12),%eax
lea    0x8(,%rax,8),%edi
call   1070 <malloc@plt>
mov    0x2dd5(%rip),%r15
mov    %rax,(%r15)
mov    (%r12),%eax
lea    0x8(,%rax,8),%edi
call   1070 <malloc@plt>
mov    0x2db3(%rip),%r13
mov    %rax,0x0(%r13)
mov    (%r12),%eax
lea    0x8(,%rax,8),%edi
call   1070 <malloc@plt>
mov    %rax,%rbp
mov    (%r12),%r9d
test   %r9d,%r9d
jle    13f2 <emvndrh+0x292>
mov    0x0(%r13),%rcx
mov    (%r15),%rdx
lea    0x1(%r9),%rsi
mov    $0x1,%edi
cmp    $0x4,%r9
movsd  0x18(%rsp),%xmm2
jb     1447 <emvndrh+0x2e7>
mov    %r9,0x10(%rsp)
mov    %rbp,0x8(%rsp)
lea    0x8(%rcx),%rbp
lea    (%rcx,%rsi,8),%rax
lea    0x8(%rdx),%r11
lea    (%rdx,%rsi,8),%r13
lea    0x8(%rbx),%r9
lea    (%rbx,%rsi,8),%r10
lea    0x8(%r14),%r15
lea    (%r14,%rsi,8),%r8
cmp    %r13,%rbp
setb   0x28(%rsp)
cmp    %rax,%r11
setb   0x20(%rsp)
cmp    %r10,%rbp
setb   %r12b
cmp    %rax,%r9
setb   0x7(%rsp)
cmp    %r8,%rbp
setb   %bpl
cmp    %rax,%r15
setb   0x6(%rsp)
cmp    %r10,%r11
setb   %r10b
cmp    %r13,%r9
setb   %r9b
cmp    %r8,%r11
setb   %r11b
cmp    %r13,%r15
setb   %r8b
mov    0x20(%rsp),%al
test   %al,0x28(%rsp)
jne    1418 <emvndrh+0x2b8>
and    0x7(%rsp),%r12b
mov    0x2ce1(%rip),%r13
jne    142f <emvndrh+0x2cf>
and    0x6(%rsp),%bpl
mov    0x2d07(%rip),%r12
jne    1436 <emvndrh+0x2d6>
and    %r9b,%r10b
mov    0x2cc7(%rip),%r15
mov    0x8(%rsp),%rbp
jne    1442 <emvndrh+0x2e2>
and    %r8b,%r11b
mov    0x10(%rsp),%r9
jne    1447 <emvndrh+0x2e7>
mov    %r9d,%edi
and    $0xfffffffc,%edi
lea    -0x4(%rdi),%rax
mov    %rax,%r8
shr    $0x2,%r8
add    $0x1,%r8
test   %rax,%rax
je     140b <emvndrh+0x2ab>
mov    %r8,%rax
and    $0xfffffffffffffffe,%rax
mov    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movups (%rbx,%rbp,8),%xmm0
movups 0x10(%rbx,%rbp,8),%xmm1
movups %xmm0,(%rcx,%rbp,8)
movups %xmm1,0x10(%rcx,%rbp,8)
movups (%r14,%rbp,8),%xmm0
movups 0x10(%r14,%rbp,8),%xmm1
movups %xmm0,(%rdx,%rbp,8)
movups %xmm1,0x10(%rdx,%rbp,8)
movups 0x20(%rbx,%rbp,8),%xmm0
movups 0x30(%rbx,%rbp,8),%xmm1
movups %xmm0,0x20(%rcx,%rbp,8)
movups %xmm1,0x30(%rcx,%rbp,8)
movupd 0x20(%r14,%rbp,8),%xmm0
movupd 0x30(%r14,%rbp,8),%xmm1
movupd %xmm0,0x20(%rdx,%rbp,8)
movupd %xmm1,0x30(%rdx,%rbp,8)
add    $0x8,%rbp
add    $0xfffffffffffffffe,%rax
jne    1350 <emvndrh+0x1f0>
test   $0x1,%r8b
je     13de <emvndrh+0x27e>
movups (%rbx,%rbp,8),%xmm0
movups 0x10(%rbx,%rbp,8),%xmm1
movups %xmm0,(%rcx,%rbp,8)
movups %xmm1,0x10(%rcx,%rbp,8)
movupd (%r14,%rbp,8),%xmm0
movupd 0x10(%r14,%rbp,8),%xmm1
movupd %xmm0,(%rdx,%rbp,8)
movupd %xmm1,0x10(%rdx,%rbp,8)
cmp    %rdi,%r9
mov    0x8(%rsp),%rbp
je     14b7 <emvndrh+0x357>
or     $0x1,%rdi
jmp    1447 <emvndrh+0x2e7>
xorpd  %xmm1,%xmm1
movsd  0x18(%rsp),%xmm0
ucomisd %xmm1,%xmm0
jb     162e <emvndrh+0x4ce>
jmp    1608 <emvndrh+0x4a8>
mov    $0x1,%ebp
test   $0x1,%r8b
jne    13b4 <emvndrh+0x254>
jmp    13de <emvndrh+0x27e>
mov    0x2bd9(%rip),%r12
mov    0x2ba2(%rip),%r15
mov    0x2b93(%rip),%r13
jmp    143d <emvndrh+0x2dd>
mov    0x2bc2(%rip),%r12
mov    0x2b8b(%rip),%r15
mov    0x8(%rsp),%rbp
mov    0x10(%rsp),%r9
mov    %rdi,%rax
not    %rax
test   $0x1,%sil
jne    146c <emvndrh+0x30c>
movsd  (%rbx,%rdi,8),%xmm0
movsd  %xmm0,(%rcx,%rdi,8)
movsd  (%r14,%rdi,8),%xmm0
movsd  %xmm0,(%rdx,%rdi,8)
add    $0x1,%rdi
add    %rsi,%rax
je     14b7 <emvndrh+0x357>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  (%rbx,%rdi,8),%xmm0
movsd  %xmm0,(%rcx,%rdi,8)
movsd  (%r14,%rdi,8),%xmm0
movsd  %xmm0,(%rdx,%rdi,8)
movsd  0x8(%rbx,%rdi,8),%xmm0
movsd  %xmm0,0x8(%rcx,%rdi,8)
movsd  0x8(%r14,%rdi,8),%xmm0
movsd  %xmm0,0x8(%rdx,%rdi,8)
add    $0x2,%rdi
cmp    %rdi,%rsi
jne    1480 <emvndrh+0x320>
mov    %rbx,0x10(%rsp)
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm2
jae    1608 <emvndrh+0x4a8>
test   %r9d,%r9d
jle    162e <emvndrh+0x4ce>
mov    %r14,%rbx
mov    %rbp,%r14
xor    %ebp,%ebp
mov    0x10(%rsp),%r13
movsd  0x8(%rbx,%rbp,8),%xmm0
call   1040 <pnorms@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0x8(%r13,%rbp,8),%xmm0
call   1040 <pnorms@plt>
movsd  0x18(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%r14,%rbp,8)
movslq (%r12),%rax
add    $0x1,%rbp
cmp    %rax,%rbp
jl     14e0 <emvndrh+0x380>
test   %eax,%eax
mov    %r14,%rbp
mov    0x2a99(%rip),%r13
xorpd  %xmm1,%xmm1
jle    162e <emvndrh+0x4ce>
mov    %rbp,%r14
mov    %r12,%r15
xorpd  %xmm1,%xmm1
mov    $0x1,%ebp
xor    %r13d,%r13d
jmp    1573 <emvndrh+0x413>
cs nopw 0x0(%rax,%rax,1)
nop
movsd  0xaa8(%rip),%xmm3
addsd  %xmm3,%xmm1
lea    0x1(%rbp),%rcx
movslq %eax,%rdx
add    $0x1,%r13
cmp    %rdx,%rbp
mov    %rcx,%rbp
jge    1662 <emvndrh+0x502>
test   %eax,%eax
jle    1550 <emvndrh+0x3f0>
xor    %r12d,%r12d
movsd  0xa7e(%rip),%xmm3
movsd  %xmm1,0x20(%rsp)
jmp    15fa <emvndrh+0x49a>
nopw   0x0(%rax,%rax,1)
movsd  (%rbx,%rbp,8),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  %xmm3,0x18(%rsp)
call   1050 <phi@plt>
movsd  %xmm0,0x28(%rsp)
mov    0x10(%rsp),%rax
movsd  (%rax,%rbp,8),%xmm0
movsd  %xmm0,0x30(%rsp)
call   1050 <phi@plt>
movsd  0x28(%rsp),%xmm2
movsd  0x20(%rsp),%xmm1
mulsd  0x30(%rsp),%xmm0
mulsd  0x8(%rsp),%xmm2
subsd  %xmm0,%xmm2
movsd  0x18(%rsp),%xmm3
mov    (%r15),%eax
mulsd  %xmm2,%xmm3
movslq %eax,%rcx
add    $0x1,%r12
cmp    %rcx,%r12
jge    1558 <emvndrh+0x3f8>
cmp    %r12,%r13
je     1590 <emvndrh+0x430>
movsd  0x8(%r14,%r12,8),%xmm2
jmp    15e6 <emvndrh+0x486>
mov    0x29c1(%rip),%rdi
movsd  0x9f9(%rip),%xmm0
movsd  0x9f9(%rip),%xmm1
movsd  0x30(%rsp),%xmm2
call   1060 <romberg@plt>
movapd %xmm0,%xmm1
movsd  %xmm1,0x20(%rsp)
mov    (%r15),%rdi
call   1030 <free@plt>
mov    0x0(%r13),%rdi
call   1030 <free@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
movsd  0x20(%rsp),%xmm0
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mulsd  0x99e(%rip),%xmm1
mov    0x2957(%rip),%r15
mov    0x2948(%rip),%r13
mov    %r14,%rbp
jmp    162e <emvndrh+0x4ce>

LLVM IR (-O0):
@mm = external global i32
@rs = external global double
@r1 = external global double
@r32 = external global double
@xx = external global double*
@ww = external global double*
@der = global double 0.000000e+00
@sum = global double 0.000000e+00
@t = global double* null
@tem = global double 0.000000e+00
define double @emvndrh(i32 %0, double* %1, double* %2, double %3, double %4) {
%6 = alloca i32
%7 = alloca double*
%8 = alloca double*
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double*
%13 = alloca double
%14 = alloca double
%15 = alloca i32
%16 = alloca i32
store i32 %0, i32* %6
store double* %1, double** %7
store double* %2, double** %8
store double %3, double* %9
store double %4, double* %10
%17 = load i32, i32* %6
store i32 %17, i32* @mm
%18 = load double, double* %9
%19 = fptosi double %18 to i32
%20 = call double @sqrt(i32 %19)
store double %20, double* @rs
%21 = load double, double* %9
%22 = fsub double 1.000000e+00, %21
%23 = fptosi double %22 to i32
%24 = call double @sqrt(i32 %23)
store double %24, double* @r1
%25 = load double, double* @r1
%26 = load double, double* %9
%27 = fsub double 1.000000e+00, %26
%28 = fmul double %25, %27
store double %28, double* @r32
%29 = load i32, i32* @mm
%30 = add nsw i32 %29, 1
%31 = sext i32 %30 to i64
%32 = mul i64 %31, 8
%33 = trunc i64 %32 to i32
%34 = call i64 @malloc(i32 %33)
%35 = inttoptr i64 %34 to double*
store double* %35, double** @xx
%36 = load i32, i32* @mm
%37 = add nsw i32 %36, 1
%38 = sext i32 %37 to i64
%39 = mul i64 %38, 8
%40 = trunc i64 %39 to i32
%41 = call i64 @malloc(i32 %40)
%42 = inttoptr i64 %41 to double*
store double* %42, double** @ww
%43 = load i32, i32* @mm
%44 = add nsw i32 %43, 1
%45 = sext i32 %44 to i64
%46 = mul i64 %45, 8
%47 = trunc i64 %46 to i32
%48 = call i64 @malloc(i32 %47)
%49 = inttoptr i64 %48 to double*
store double* %49, double** %12
store i32 1, i32* %15
br label %50
50: ; preds = %73, %5
%51 = load i32, i32* %15
%52 = load i32, i32* @mm
%53 = icmp sle i32 %51, %52
br i1 %53, label %54, label %76
54: ; preds = %50
%55 = load double*, double** %7
%56 = load i32, i32* %15
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds double, double* %55, i64 %57
%59 = load double, double* %58
%60 = load double*, double** @ww
%61 = load i32, i32* %15
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds double, double* %60, i64 %62
store double %59, double* %63
%64 = load double*, double** %8
%65 = load i32, i32* %15
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds double, double* %64, i64 %66
%68 = load double, double* %67
%69 = load double*, double** @xx
%70 = load i32, i32* %15
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds double, double* %69, i64 %71
store double %68, double* %72
br label %73
73: ; preds = %54
%74 = load i32, i32* %15
%75 = add nsw i32 %74, 1
store i32 %75, i32* %15
br label %50
76: ; preds = %50
%77 = load double, double* %9
%78 = fcmp oge double %77, 0.000000e+00
br i1 %78, label %79, label %82
79: ; preds = %76
%80 = load double, double* %10
%81 = call double @romberg(double (double)* @grh, double -6.000000e+00, double 6.000000e+00, double %80)
store double %81, double* %11
br label %172
82: ; preds = %76
store i32 1, i32* %15
br label %83
83: ; preds = %105, %82
%84 = load i32, i32* %15
%85 = load i32, i32* @mm
%86 = icmp sle i32 %84, %85
br i1 %86, label %87, label %108
87: ; preds = %83
%88 = load double*, double** %8
%89 = load i32, i32* %15
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds double, double* %88, i64 %90
%92 = load double, double* %91
%93 = call double @pnorms(double %92)
%94 = load double*, double** %7
%95 = load i32, i32* %15
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds double, double* %94, i64 %96
%98 = load double, double* %97
%99 = call double @pnorms(double %98)
%100 = fsub double %93, %99
%101 = load double*, double** %12
%102 = load i32, i32* %15
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds double, double* %101, i64 %103
store double %100, double* %104
br label %105
105: ; preds = %87
%106 = load i32, i32* %15
%107 = add nsw i32 %106, 1
store i32 %107, i32* %15
br label %83
108: ; preds = %83
store i32 1, i32* %16
store double 0.000000e+00, double* %14
br label %109
109: ; preds = %166, %108
%110 = load i32, i32* %16
%111 = load i32, i32* @mm
%112 = icmp sle i32 %110, %111
br i1 %112, label %113, label %169
113: ; preds = %109
store i32 1, i32* %15
store double 1.000000e+00, double* %13
br label %114
114: ; preds = %159, %113
%115 = load i32, i32* %15
%116 = load i32, i32* @mm
%117 = icmp sle i32 %115, %116
br i1 %117, label %118, label %162
118: ; preds = %114
%119 = load i32, i32* %15
%120 = load i32, i32* %16
%121 = icmp ne i32 %119, %120
br i1 %121, label %122, label %130
122: ; preds = %118
%123 = load double*, double** %12
%124 = load i32, i32* %15
%125 = sext i32 %124 to i64
%126 = getelementptr inbounds double, double* %123, i64 %125
%127 = load double, double* %126
%128 = load double, double* %13
%129 = fmul double %128, %127
store double %129, double* %13
br label %158
130: ; preds = %118
%131 = load double*, double** %8
%132 = load i32, i32* %15
%133 = sext i32 %132 to i64
%134 = getelementptr inbounds double, double* %131, i64 %133
%135 = load double, double* %134
%136 = load double*, double** %8
%137 = load i32, i32* %15
%138 = sext i32 %137 to i64
%139 = getelementptr inbounds double, double* %136, i64 %138
%140 = load double, double* %139
%141 = call double @phi(double %140)
%142 = load double*, double** %7
%143 = load i32, i32* %15
%144 = sext i32 %143 to i64
%145 = getelementptr inbounds double, double* %142, i64 %144
%146 = load double, double* %145
%147 = load double*, double** %7
%148 = load i32, i32* %15
%149 = sext i32 %148 to i64
%150 = getelementptr inbounds double, double* %147, i64 %149
%151 = load double, double* %150
%152 = call double @phi(double %151)
%153 = fmul double %146, %152
%154 = fneg double %153
%155 = call double @llvm.fmuladd.f64(double %135, double %141, double %154)
%156 = load double, double* %13
%157 = fmul double %156, %155
store double %157, double* %13
br label %158
158: ; preds = %130, %122
br label %159
159: ; preds = %158
%160 = load i32, i32* %15
%161 = add nsw i32 %160, 1
store i32 %161, i32* %15
br label %114
162: ; preds = %114
%163 = load double, double* %13
%164 = load double, double* %14
%165 = fadd double %164, %163
store double %165, double* %14
br label %166
166: ; preds = %162
%167 = load i32, i32* %16
%168 = add nsw i32 %167, 1
store i32 %168, i32* %16
br label %109
169: ; preds = %109
%170 = load double, double* %14
%171 = fmul double 5.000000e-01, %170
store double %171, double* %11
br label %172
172: ; preds = %169, %79
%173 = load double*, double** @xx
%174 = call i32 @free(double* %173)
%175 = load double*, double** @ww
%176 = call i32 @free(double* %175)
%177 = load double*, double** %12
%178 = call i32 @free(double* %177)
%179 = load double, double* %11
ret double %179
}

LLVM IR (-O2):
@mm = external global i32
@rs = external global double
@r1 = external global double
@r32 = external global double
@xx = external global double*
@ww = external global double*
@der = global double 0.000000e+00
@sum = global double 0.000000e+00
@t = global double* null
@tem = global double 0.000000e+00
define double @emvndrh(i32 %0, double* nocapture %1, double* nocapture %2, double %3, double %4) {
store i32 %0, i32* @mm
%6 = fptosi double %3 to i32
%7 = tail call double @sqrt(i32 %6)
store double %7, double* @rs
%8 = fsub double 1.000000e+00, %3
%9 = fptosi double %8 to i32
%10 = tail call double @sqrt(i32 %9)
store double %10, double* @r1
%11 = fmul double %8, %10
store double %11, double* @r32
%12 = load i32, i32* @mm
%13 = shl i32 %12, 3
%14 = add i32 %13, 8
%15 = tail call i64 @malloc(i32 %14)
%16 = inttoptr i64 %15 to double*
store double* %16, double** @xx
%17 = load i32, i32* @mm
%18 = shl i32 %17, 3
%19 = add i32 %18, 8
%20 = tail call i64 @malloc(i32 %19)
%21 = inttoptr i64 %20 to double*
store double* %21, double** @ww
%22 = load i32, i32* @mm
%23 = shl i32 %22, 3
%24 = add i32 %23, 8
%25 = tail call i64 @malloc(i32 %24)
%26 = inttoptr i64 %25 to double*
%27 = load i32, i32* @mm
%28 = icmp slt i32 %27, 1
br i1 %28, label %186, label %29
29: ; preds = %5
%30 = load double*, double** @ww
%31 = load double*, double** @xx
%32 = add nuw i32 %27, 1
%33 = zext i32 %32 to i64
%34 = add nsw i64 %33, -1
%35 = icmp ult i64 %34, 4
br i1 %35, label %150, label %36
36: ; preds = %29
%37 = getelementptr double, double* %30, i64 1
%38 = getelementptr double, double* %30, i64 %33
%39 = getelementptr double, double* %31, i64 1
%40 = getelementptr double, double* %31, i64 %33
%41 = getelementptr double, double* %1, i64 1
%42 = getelementptr double, double* %1, i64 %33
%43 = getelementptr double, double* %2, i64 1
%44 = getelementptr double, double* %2, i64 %33
%45 = icmp ult double* %37, %40
%46 = icmp ult double* %39, %38
%47 = and i1 %45, %46
%48 = icmp ult double* %37, %42
%49 = icmp ult double* %41, %38
%50 = and i1 %48, %49
%51 = or i1 %47, %50
%52 = icmp ult double* %37, %44
%53 = icmp ult double* %43, %38
%54 = and i1 %52, %53
%55 = or i1 %51, %54
%56 = icmp ult double* %39, %42
%57 = icmp ult double* %41, %40
%58 = and i1 %56, %57
%59 = or i1 %55, %58
%60 = icmp ult double* %39, %44
%61 = icmp ult double* %43, %40
%62 = and i1 %60, %61
%63 = or i1 %59, %62
br i1 %63, label %150, label %64
64: ; preds = %36
%65 = and i64 %34, -4
%66 = or i64 %65, 1
%67 = add nsw i64 %65, -4
%68 = lshr exact i64 %67, 2
%69 = add nuw nsw i64 %68, 1
%70 = and i64 %69, 1
%71 = icmp eq i64 %67, 0
br i1 %71, label %124, label %72
72: ; preds = %64
%73 = and i64 %69, 9223372036854775806
br label %74
74: ; preds = %74, %72
%75 = phi i64 [ 0, %72 ], [ %119, %74 ]
%76 = phi i64 [ 0, %72 ], [ %120, %74 ]
%77 = or i64 %75, 1
%78 = getelementptr inbounds double, double* %1, i64 %77
%79 = bitcast double* %78 to <2 x double>*
%80 = load <2 x double>, <2 x double>* %79
%81 = getelementptr inbounds double, double* %78, i64 2
%82 = bitcast double* %81 to <2 x double>*
%83 = load <2 x double>, <2 x double>* %82
%84 = getelementptr inbounds double, double* %30, i64 %77
%85 = bitcast double* %84 to <2 x double>*
store <2 x double> %80, <2 x double>* %85
%86 = getelementptr inbounds double, double* %84, i64 2
%87 = bitcast double* %86 to <2 x double>*
store <2 x double> %83, <2 x double>* %87
%88 = getelementptr inbounds double, double* %2, i64 %77
%89 = bitcast double* %88 to <2 x double>*
%90 = load <2 x double>, <2 x double>* %89
%91 = getelementptr inbounds double, double* %88, i64 2
%92 = bitcast double* %91 to <2 x double>*
%93 = load <2 x double>, <2 x double>* %92
%94 = getelementptr inbounds double, double* %31, i64 %77
%95 = bitcast double* %94 to <2 x double>*
store <2 x double> %90, <2 x double>* %95
%96 = getelementptr inbounds double, double* %94, i64 2
%97 = bitcast double* %96 to <2 x double>*
store <2 x double> %93, <2 x double>* %97
%98 = or i64 %75, 5
%99 = getelementptr inbounds double, double* %1, i64 %98
%100 = bitcast double* %99 to <2 x double>*
%101 = load <2 x double>, <2 x double>* %100
%102 = getelementptr inbounds double, double* %99, i64 2
%103 = bitcast double* %102 to <2 x double>*
%104 = load <2 x double>, <2 x double>* %103
%105 = getelementptr inbounds double, double* %30, i64 %98
%106 = bitcast double* %105 to <2 x double>*
store <2 x double> %101, <2 x double>* %106
%107 = getelementptr inbounds double, double* %105, i64 2
%108 = bitcast double* %107 to <2 x double>*
store <2 x double> %104, <2 x double>* %108
%109 = getelementptr inbounds double, double* %2, i64 %98
%110 = bitcast double* %109 to <2 x double>*
%111 = load <2 x double>, <2 x double>* %110
%112 = getelementptr inbounds double, double* %109, i64 2
%113 = bitcast double* %112 to <2 x double>*
%114 = load <2 x double>, <2 x double>* %113
%115 = getelementptr inbounds double, double* %31, i64 %98
%116 = bitcast double* %115 to <2 x double>*
store <2 x double> %111, <2 x double>* %116
%117 = getelementptr inbounds double, double* %115, i64 2
%118 = bitcast double* %117 to <2 x double>*
store <2 x double> %114, <2 x double>* %118
%119 = add nuw i64 %75, 8
%120 = add i64 %76, 2
%121 = icmp eq i64 %120, %73
br i1 %121, label %122, label %74
122: ; preds = %74
%123 = or i64 %119, 1
br label %124
124: ; preds = %122, %64
%125 = phi i64 [ 1, %64 ], [ %123, %122 ]
%126 = icmp eq i64 %70, 0
br i1 %126, label %148, label %127
127: ; preds = %124
%128 = getelementptr inbounds double, double* %1, i64 %125
%129 = bitcast double* %128 to <2 x double>*
%130 = load <2 x double>, <2 x double>* %129
%131 = getelementptr inbounds double, double* %128, i64 2
%132 = bitcast double* %131 to <2 x double>*
%133 = load <2 x double>, <2 x double>* %132
%134 = getelementptr inbounds double, double* %30, i64 %125
%135 = bitcast double* %134 to <2 x double>*
store <2 x double> %130, <2 x double>* %135
%136 = getelementptr inbounds double, double* %134, i64 2
%137 = bitcast double* %136 to <2 x double>*
store <2 x double> %133, <2 x double>* %137
%138 = getelementptr inbounds double, double* %2, i64 %125
%139 = bitcast double* %138 to <2 x double>*
%140 = load <2 x double>, <2 x double>* %139
%141 = getelementptr inbounds double, double* %138, i64 2
%142 = bitcast double* %141 to <2 x double>*
%143 = load <2 x double>, <2 x double>* %142
%144 = getelementptr inbounds double, double* %31, i64 %125
%145 = bitcast double* %144 to <2 x double>*
store <2 x double> %140, <2 x double>* %145
%146 = getelementptr inbounds double, double* %144, i64 2
%147 = bitcast double* %146 to <2 x double>*
store <2 x double> %143, <2 x double>* %147
br label %148
148: ; preds = %124, %127
%149 = icmp eq i64 %34, %65
br i1 %149, label %184, label %150
150: ; preds = %36, %29, %148
%151 = phi i64 [ 1, %36 ], [ 1, %29 ], [ %66, %148 ]
%152 = xor i64 %151, -1
%153 = and i64 %33, 1
%154 = icmp eq i64 %153, 0
br i1 %154, label %155, label %163
155: ; preds = %150
%156 = getelementptr inbounds double, double* %1, i64 %151
%157 = load double, double* %156
%158 = getelementptr inbounds double, double* %30, i64 %151
store double %157, double* %158
%159 = getelementptr inbounds double, double* %2, i64 %151
%160 = load double, double* %159
%161 = getelementptr inbounds double, double* %31, i64 %151
store double %160, double* %161
%162 = add nuw nsw i64 %151, 1
br label %163
163: ; preds = %155, %150
%164 = phi i64 [ %151, %150 ], [ %162, %155 ]
%165 = sub nsw i64 0, %33
%166 = icmp eq i64 %152, %165
br i1 %166, label %184, label %167
167: ; preds = %163, %167
%168 = phi i64 [ %182, %167 ], [ %164, %163 ]
%169 = getelementptr inbounds double, double* %1, i64 %168
%170 = load double, double* %169
%171 = getelementptr inbounds double, double* %30, i64 %168
store double %170, double* %171
%172 = getelementptr inbounds double, double* %2, i64 %168
%173 = load double, double* %172
%174 = getelementptr inbounds double, double* %31, i64 %168
store double %173, double* %174
%175 = add nuw nsw i64 %168, 1
%176 = getelementptr inbounds double, double* %1, i64 %175
%177 = load double, double* %176
%178 = getelementptr inbounds double, double* %30, i64 %175
store double %177, double* %178
%179 = getelementptr inbounds double, double* %2, i64 %175
%180 = load double, double* %179
%181 = getelementptr inbounds double, double* %31, i64 %175
store double %180, double* %181
%182 = add nuw nsw i64 %168, 2
%183 = icmp eq i64 %182, %33
br i1 %183, label %184, label %167
184: ; preds = %163, %167, %148
%185 = fcmp ult double %3, 0.000000e+00
br i1 %185, label %188, label %189
186: ; preds = %5
%187 = fcmp ult double %3, 0.000000e+00
br i1 %187, label %250, label %189
188: ; preds = %184
br i1 %28, label %250, label %193
189: ; preds = %186, %184
%190 = tail call double @romberg(double (double)* @grh, double -6.000000e+00, double 6.000000e+00, double %4)
br label %250
191: ; preds = %193
%192 = icmp slt i32 %204, 1
br i1 %192, label %250, label %207
193: ; preds = %188, %193
%194 = phi i64 [ %203, %193 ], [ 1, %188 ]
%195 = getelementptr inbounds double, double* %2, i64 %194
%196 = load double, double* %195
%197 = tail call double @pnorms(double %196)
%198 = getelementptr inbounds double, double* %1, i64 %194
%199 = load double, double* %198
%200 = tail call double @pnorms(double %199)
%201 = fsub double %197, %200
%202 = getelementptr inbounds double, double* %26, i64 %194
store double %201, double* %202
%203 = add nuw nsw i64 %194, 1
%204 = load i32, i32* @mm
%205 = sext i32 %204 to i64
%206 = icmp slt i64 %194, %205
br i1 %206, label %193, label %191
207: ; preds = %191, %241
%208 = phi i32 [ %242, %241 ], [ %204, %191 ]
%209 = phi i64 [ %245, %241 ], [ 1, %191 ]
%210 = phi double [ %244, %241 ], [ 0.000000e+00, %191 ]
%211 = icmp slt i32 %208, 1
br i1 %211, label %241, label %212
212: ; preds = %207
%213 = getelementptr inbounds double, double* %2, i64 %209
%214 = getelementptr inbounds double, double* %1, i64 %209
br label %215
215: ; preds = %212, %233
%216 = phi i32 [ %208, %212 ], [ %234, %233 ]
%217 = phi i32 [ %208, %212 ], [ %235, %233 ]
%218 = phi i64 [ 1, %212 ], [ %238, %233 ]
%219 = phi double [ 1.000000e+00, %212 ], [ %237, %233 ]
%220 = icmp eq i64 %218, %209
br i1 %220, label %224, label %221
221: ; preds = %215
%222 = getelementptr inbounds double, double* %26, i64 %218
%223 = load double, double* %222
br label %233
224: ; preds = %215
%225 = load double, double* %213
%226 = tail call double @phi(double %225)
%227 = load double, double* %214
%228 = tail call double @phi(double %227)
%229 = fneg double %227
%230 = fmul double %228, %229
%231 = tail call double @llvm.fmuladd.f64(double %225, double %226, double %230)
%232 = load i32, i32* @mm
br label %233
233: ; preds = %221, %224
%234 = phi i32 [ %216, %221 ], [ %232, %224 ]
%235 = phi i32 [ %217, %221 ], [ %232, %224 ]
%236 = phi double [ %223, %221 ], [ %231, %224 ]
%237 = fmul double %219, %236
%238 = add nuw nsw i64 %218, 1
%239 = sext i32 %235 to i64
%240 = icmp slt i64 %218, %239
br i1 %240, label %215, label %241
241: ; preds = %233, %207
%242 = phi i32 [ %208, %207 ], [ %234, %233 ]
%243 = phi double [ 1.000000e+00, %207 ], [ %237, %233 ]
%244 = fadd double %210, %243
%245 = add nuw nsw i64 %209, 1
%246 = sext i32 %242 to i64
%247 = icmp slt i64 %209, %246
br i1 %247, label %207, label %248
248: ; preds = %241
%249 = fmul double %244, 5.000000e-01
br label %250
250: ; preds = %186, %188, %191, %248, %189
%251 = phi double [ %190, %189 ], [ 0.000000e+00, %191 ], [ %249, %248 ], [ 0.000000e+00, %188 ], [ 0.000000e+00, %186 ]
%252 = load double*, double** @xx
%253 = tail call i32 @free(double* %252)
%254 = load double*, double** @ww
%255 = tail call i32 @free(double* %254)
%256 = tail call i32 @free(double* %26)
ret double %251
}