#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*/ exit(int);
double fabs(double);
int /*<<< orphan*/ printf(char *, int);
double stub1(double, double *);
double stub2(double, double *);
double stub3(double, double *);
double stub4(double, double *);
double stub5(double, double *);
double integrate(double (*f)(double x, double *p), double *p, double lower,
                 double upper, double tolerance) {
  double app, s1, s2, fd, fe, v[9], fa[100], fb[100], fc[100], h[100], s[100],
      a[100], tol[100], l[100];
  int i;
  app = 0.0;
  i = 1;
  tol[i] = 10.0 * tolerance;
  a[i] = lower;
  h[i] = (upper - lower) / 2.0;
  fa[i] = (*f)(lower, p);
  fc[i] = (*f)(lower + h[i], p);
  fb[i] = (*f)(upper, p);
  s[i] = h[i] * (fa[i] + 4.0 * fc[i] + fb[i]) / 3.0;
  l[i] = 1;
  while (i > 0) {
    fd = (*f)(a[i] + h[i] / 2.0, p);
    fe = (*f)(a[i] + 3.0 * h[i] / 2.0, p);
    s1 = h[i] * (fa[i] + 4.0 * fd + fc[i]) / 6.0;
    s2 = h[i] * (fc[i] + 4.0 * fe + fb[i]) / 6.0;
    v[1] = a[i];
    v[2] = fa[i];
    v[3] = fc[i];
    v[4] = fb[i];
    v[5] = h[i];
    v[6] = tol[i];
    v[7] = s[i];
    v[8] = l[i];
    i--;
    if (fabs(s1 + s2 - v[7]) < v[6])
      app = app + s1 + s2;
    else {
      if (v[8] >= 100) {
        printf("\n\tToo many steps (%d) in integrate\n", 100);
        exit(1);
      } else {
        i++;
        a[i] = v[1] + v[5];
        fa[i] = v[3];
        fc[i] = fe;
        fb[i] = v[4];
        h[i] = v[5] / 2.0;
        tol[i] = v[6] / 2.0;
        s[i] = s2;
        l[i] = v[8] + 1.0;
        i++;
        a[i] = v[1];
        fa[i] = v[2];
        fc[i] = fd;
        fb[i] = v[3];
        h[i] = h[i - 1];
        tol[i] = tol[i - 1];
        s[i] = s1;
        l[i] = l[i - 1];
      }
    }
  }
  return app;
}


x86 assembly (clang, -O0):
<integrate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x19b0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
movsd  %xmm2,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
movl   $0x1,-0x19a4(%rbp)
movsd  0xec4(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
movslq -0x19a4(%rbp),%rax
movsd  %xmm0,-0x1680(%rbp,%rax,8)
ff ff
movsd  -0x18(%rbp),%xmm0
movslq -0x19a4(%rbp),%rax
movsd  %xmm0,-0x1360(%rbp,%rax,8)
ff ff
movsd  -0x20(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  0xe80(%rip),%xmm1
divsd  %xmm1,%xmm0
movslq -0x19a4(%rbp),%rax
movsd  %xmm0,-0xd20(%rbp,%rax,8)
ff ff
mov    -0x8(%rbp),%rax
movsd  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%rdi
call   *%rax
movslq -0x19a4(%rbp),%rax
movsd  %xmm0,-0x3c0(%rbp,%rax,8)
ff ff
mov    -0x8(%rbp),%rax
movsd  -0x18(%rbp),%xmm0
movslq -0x19a4(%rbp),%rcx
addsd  -0xd20(%rbp,%rcx,8),%xmm0
ff ff
mov    -0x10(%rbp),%rdi
call   *%rax
movslq -0x19a4(%rbp),%rax
movsd  %xmm0,-0xa00(%rbp,%rax,8)
ff ff
mov    -0x8(%rbp),%rax
movsd  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rdi
call   *%rax
movslq -0x19a4(%rbp),%rax
movsd  %xmm0,-0x6e0(%rbp,%rax,8)
ff ff
movslq -0x19a4(%rbp),%rax
movsd  -0xd20(%rbp,%rax,8),%xmm0
ff ff
movslq -0x19a4(%rbp),%rax
movsd  -0x3c0(%rbp,%rax,8),%xmm2
ff ff
movslq -0x19a4(%rbp),%rax
movsd  -0xa00(%rbp,%rax,8),%xmm1
ff ff
movsd  0xdbf(%rip),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movslq -0x19a4(%rbp),%rax
addsd  -0x6e0(%rbp,%rax,8),%xmm1
ff ff
mulsd  %xmm1,%xmm0
movsd  0xd93(%rip),%xmm1
divsd  %xmm1,%xmm0
movslq -0x19a4(%rbp),%rax
movsd  %xmm0,-0x1040(%rbp,%rax,8)
ff ff
movslq -0x19a4(%rbp),%rax
movsd  0xd68(%rip),%xmm0
movsd  %xmm0,-0x19a0(%rbp,%rax,8)
ff ff
cmpl   $0x0,-0x19a4(%rbp)
jle    16f5 <integrate+0x5d5>
mov    -0x8(%rbp),%rax
movslq -0x19a4(%rbp),%rcx
movsd  -0x1360(%rbp,%rcx,8),%xmm0
ff ff
movslq -0x19a4(%rbp),%rcx
movsd  -0xd20(%rbp,%rcx,8),%xmm1
ff ff
movsd  0xd3e(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rdi
call   *%rax
movsd  %xmm0,-0x48(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x19a4(%rbp),%rcx
movsd  -0x1360(%rbp,%rcx,8),%xmm0
ff ff
movslq -0x19a4(%rbp),%rcx
movsd  0xcf8(%rip),%xmm1
mulsd  -0xd20(%rbp,%rcx,8),%xmm1
ff ff
movsd  0xcf7(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rdi
call   *%rax
movsd  %xmm0,-0x50(%rbp)
movslq -0x19a4(%rbp),%rax
movsd  -0xd20(%rbp,%rax,8),%xmm0
ff ff
movslq -0x19a4(%rbp),%rax
movsd  -0x3c0(%rbp,%rax,8),%xmm2
ff ff
movsd  -0x48(%rbp),%xmm1
movsd  0xcaf(%rip),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movslq -0x19a4(%rbp),%rax
addsd  -0xa00(%rbp,%rax,8),%xmm1
ff ff
mulsd  %xmm1,%xmm0
movsd  0xca3(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movslq -0x19a4(%rbp),%rax
movsd  -0xd20(%rbp,%rax,8),%xmm0
ff ff
movslq -0x19a4(%rbp),%rax
movsd  -0xa00(%rbp,%rax,8),%xmm2
ff ff
movsd  -0x50(%rbp),%xmm1
movsd  0xc55(%rip),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movslq -0x19a4(%rbp),%rax
addsd  -0x6e0(%rbp,%rax,8),%xmm1
ff ff
mulsd  %xmm1,%xmm0
movsd  0xc49(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movslq -0x19a4(%rbp),%rax
movsd  -0x1360(%rbp,%rax,8),%xmm0
ff ff
movsd  %xmm0,-0x98(%rbp)
ff
movslq -0x19a4(%rbp),%rax
movsd  -0x3c0(%rbp,%rax,8),%xmm0
ff ff
movsd  %xmm0,-0x90(%rbp)
ff
movslq -0x19a4(%rbp),%rax
movsd  -0xa00(%rbp,%rax,8),%xmm0
ff ff
movsd  %xmm0,-0x88(%rbp)
ff
movslq -0x19a4(%rbp),%rax
movsd  -0x6e0(%rbp,%rax,8),%xmm0
ff ff
movsd  %xmm0,-0x80(%rbp)
movslq -0x19a4(%rbp),%rax
movsd  -0xd20(%rbp,%rax,8),%xmm0
ff ff
movsd  %xmm0,-0x78(%rbp)
movslq -0x19a4(%rbp),%rax
movsd  -0x1680(%rbp,%rax,8),%xmm0
ff ff
movsd  %xmm0,-0x70(%rbp)
movslq -0x19a4(%rbp),%rax
movsd  -0x1040(%rbp,%rax,8),%xmm0
ff ff
movsd  %xmm0,-0x68(%rbp)
movslq -0x19a4(%rbp),%rax
movsd  -0x19a0(%rbp,%rax,8),%xmm0
ff ff
movsd  %xmm0,-0x60(%rbp)
mov    -0x19a4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x19a4(%rbp)
movsd  -0x38(%rbp),%xmm1
addsd  -0x40(%rbp),%xmm1
subsd  -0x68(%rbp),%xmm1
movaps 0xb82(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  -0x70(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    14ea <integrate+0x3ca>
movsd  -0x30(%rbp),%xmm0
addsd  -0x38(%rbp),%xmm0
addsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    16f0 <integrate+0x5d0>
movsd  -0x60(%rbp),%xmm0
movsd  0xb39(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     151c <integrate+0x3fc>
lea    0xb48(%rip),%rdi
mov    $0x64,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x19a4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x19a4(%rbp)
movsd  -0x98(%rbp),%xmm0
ff
addsd  -0x78(%rbp),%xmm0
movslq -0x19a4(%rbp),%rax
movsd  %xmm0,-0x1360(%rbp,%rax,8)
ff ff
movsd  -0x88(%rbp),%xmm0
ff
movslq -0x19a4(%rbp),%rax
movsd  %xmm0,-0x3c0(%rbp,%rax,8)
ff ff
movsd  -0x50(%rbp),%xmm0
movslq -0x19a4(%rbp),%rax
movsd  %xmm0,-0xa00(%rbp,%rax,8)
ff ff
movsd  -0x80(%rbp),%xmm0
movslq -0x19a4(%rbp),%rax
movsd  %xmm0,-0x6e0(%rbp,%rax,8)
ff ff
movsd  -0x78(%rbp),%xmm0
movsd  0xa81(%rip),%xmm1
divsd  %xmm1,%xmm0
movslq -0x19a4(%rbp),%rax
movsd  %xmm0,-0xd20(%rbp,%rax,8)
ff ff
movsd  -0x70(%rbp),%xmm0
movsd  0xa60(%rip),%xmm1
divsd  %xmm1,%xmm0
movslq -0x19a4(%rbp),%rax
movsd  %xmm0,-0x1680(%rbp,%rax,8)
ff ff
movsd  -0x40(%rbp),%xmm0
movslq -0x19a4(%rbp),%rax
movsd  %xmm0,-0x1040(%rbp,%rax,8)
ff ff
movsd  0xa17(%rip),%xmm0
addsd  -0x60(%rbp),%xmm0
movslq -0x19a4(%rbp),%rax
movsd  %xmm0,-0x19a0(%rbp,%rax,8)
ff ff
mov    -0x19a4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x19a4(%rbp)
movsd  -0x98(%rbp),%xmm0
ff
movslq -0x19a4(%rbp),%rax
movsd  %xmm0,-0x1360(%rbp,%rax,8)
ff ff
movsd  -0x90(%rbp),%xmm0
ff
movslq -0x19a4(%rbp),%rax
movsd  %xmm0,-0x3c0(%rbp,%rax,8)
ff ff
movsd  -0x48(%rbp),%xmm0
movslq -0x19a4(%rbp),%rax
movsd  %xmm0,-0xa00(%rbp,%rax,8)
ff ff
movsd  -0x88(%rbp),%xmm0
ff
movslq -0x19a4(%rbp),%rax
movsd  %xmm0,-0x6e0(%rbp,%rax,8)
ff ff
mov    -0x19a4(%rbp),%eax
sub    $0x1,%eax
cltq
movsd  -0xd20(%rbp,%rax,8),%xmm0
ff ff
movslq -0x19a4(%rbp),%rax
movsd  %xmm0,-0xd20(%rbp,%rax,8)
ff ff
mov    -0x19a4(%rbp),%eax
sub    $0x1,%eax
cltq
movsd  -0x1680(%rbp,%rax,8),%xmm0
ff ff
movslq -0x19a4(%rbp),%rax
movsd  %xmm0,-0x1680(%rbp,%rax,8)
ff ff
movsd  -0x38(%rbp),%xmm0
movslq -0x19a4(%rbp),%rax
movsd  %xmm0,-0x1040(%rbp,%rax,8)
ff ff
mov    -0x19a4(%rbp),%eax
sub    $0x1,%eax
cltq
movsd  -0x19a0(%rbp,%rax,8),%xmm0
ff ff
movslq -0x19a4(%rbp),%rax
movsd  %xmm0,-0x19a0(%rbp,%rax,8)
ff ff
jmp    16f0 <integrate+0x5d0>
jmp    12a1 <integrate+0x181>
movsd  -0x30(%rbp),%xmm0
add    $0x19b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<integrate>:
push   %r15
push   %r14
push   %rbx
sub    $0x1940,%rsp
movsd  %xmm1,0x30(%rsp)
mov    %rsi,%r14
mov    %rdi,%r15
mulsd  0xec0(%rip),%xmm2
movsd  %xmm2,0x368(%rsp)
movsd  %xmm0,(%rsp)
movsd  %xmm0,0x688(%rsp)
subsd  %xmm0,%xmm1
mulsd  0xea5(%rip),%xmm1
movapd %xmm1,0x10(%rsp)
movsd  %xmm1,0xcc8(%rsp)
mov    %rsi,%rdi
call   *%r15
movsd  %xmm0,0x20(%rsp)
movsd  %xmm0,0x1308(%rsp)
movapd 0x10(%rsp),%xmm0
addsd  (%rsp),%xmm0
mov    %r14,%rdi
call   *%r15
movsd  %xmm0,0x8(%rsp)
movsd  %xmm0,0xfe8(%rsp)
movsd  0x30(%rsp),%xmm0
mov    %r14,%rdi
call   *%r15
movapd 0x10(%rsp),%xmm2
movsd  %xmm0,0x1628(%rsp)
movsd  0x8(%rsp),%xmm1
mulsd  0xe40(%rip),%xmm1
addsd  0x20(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  (%rsp),%xmm0
mulsd  %xmm2,%xmm1
divsd  0xe2d(%rip),%xmm1
movsd  %xmm1,0x9a8(%rsp)
movabs $0x3ff0000000000000,%rax
mov    %rax,0x48(%rsp)
xorpd  %xmm1,%xmm1
movsd  %xmm1,0x8(%rsp)
mov    $0x1,%ebx
jmp    1234 <integrate+0x114>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ebx,%eax
movsd  0x680(%rsp,%rax,8),%xmm0
movsd  0xcc0(%rsp,%rax,8),%xmm2
movapd %xmm2,0x10(%rsp)
mov    %ebx,%ebx
movsd  0xdc4(%rip),%xmm1
mulsd  %xmm1,%xmm2
movsd  %xmm0,(%rsp)
movapd %xmm2,0x20(%rsp)
addsd  %xmm2,%xmm0
mov    %r14,%rdi
call   *%r15
movapd %xmm0,0x30(%rsp)
movapd 0x10(%rsp),%xmm0
mulsd  0xda7(%rip),%xmm0
mulsd  0xd8f(%rip),%xmm0
addsd  (%rsp),%xmm0
mov    %r14,%rdi
call   *%r15
movapd 0x30(%rsp),%xmm9
movapd 0x10(%rsp),%xmm2
movsd  0x1300(%rsp,%rbx,8),%xmm8
movsd  0xfe0(%rsp,%rbx,8),%xmm1
movapd %xmm9,%xmm3
unpcklpd %xmm0,%xmm3
movapd %xmm8,%xmm4
unpcklpd %xmm1,%xmm4
mulpd  0xd72(%rip),%xmm3
addpd  %xmm4,%xmm3
movapd %xmm1,%xmm4
movhpd 0x1620(%rsp,%rbx,8),%xmm4
addpd  %xmm3,%xmm4
movapd %xmm2,%xmm3
unpcklpd %xmm2,%xmm3
mulpd  %xmm4,%xmm3
divpd  0xd59(%rip),%xmm3
movapd %xmm3,%xmm4
unpckhpd %xmm3,%xmm4
movapd %xmm4,%xmm6
addsd  %xmm3,%xmm6
subsd  0x9a0(%rsp,%rbx,8),%xmm6
movsd  0x360(%rsp,%rbx,8),%xmm5
andpd  0xd3f(%rip),%xmm6
ucomisd %xmm6,%xmm5
jbe    1340 <integrate+0x220>
movsd  0x8(%rsp),%xmm0
addsd  %xmm3,%xmm0
addsd  %xmm4,%xmm0
add    $0xffffffff,%ebx
je     1400 <integrate+0x2e0>
movsd  %xmm0,0x8(%rsp)
jmp    1220 <integrate+0x100>
nopl   0x0(%rax)
movsd  0x40(%rsp,%rbx,8),%xmm6
ucomisd 0xcd2(%rip),%xmm6
jae    140d <integrate+0x2ed>
movsd  (%rsp),%xmm7
addsd  %xmm7,%xmm2
movsd  %xmm2,0x680(%rsp,%rbx,8)
movsd  %xmm1,0x1300(%rsp,%rbx,8)
movsd  %xmm0,0xfe0(%rsp,%rbx,8)
movapd 0x20(%rsp),%xmm0
movsd  %xmm0,0xcc0(%rsp,%rbx,8)
mulsd  0xc79(%rip),%xmm5
movsd  %xmm5,0x360(%rsp,%rbx,8)
movsd  %xmm4,0x9a0(%rsp,%rbx,8)
addsd  0xc7f(%rip),%xmm6
movsd  %xmm6,0x40(%rsp,%rbx,8)
movsd  %xmm7,0x688(%rsp,%rbx,8)
movsd  %xmm8,0x1308(%rsp,%rbx,8)
movsd  %xmm9,0xfe8(%rsp,%rbx,8)
movsd  %xmm1,0x1628(%rsp,%rbx,8)
movsd  %xmm0,0xcc8(%rsp,%rbx,8)
movsd  %xmm5,0x368(%rsp,%rbx,8)
movsd  %xmm3,0x9a8(%rsp,%rbx,8)
movsd  %xmm6,0x48(%rsp,%rbx,8)
lea    0x1(%rbx),%eax
mov    %eax,%ebx
jmp    1220 <integrate+0x100>
add    $0x1940,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
lea    0xc4c(%rip),%rdi
mov    $0x64,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"\0A\09Too many steps (%d) in integrate\0A\00"
define double @integrate(double (double, double*)* %0, double* %1, double %2, double %3, double %4) {
%6 = alloca double (double, double*)*
%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 double
%16 = alloca [9 x double]
%17 = alloca [100 x double]
%18 = alloca [100 x double]
%19 = alloca [100 x double]
%20 = alloca [100 x double]
%21 = alloca [100 x double]
%22 = alloca [100 x double]
%23 = alloca [100 x double]
%24 = alloca [100 x double]
%25 = alloca i32
store double (double, double*)* %0, double (double, double*)** %6
store double* %1, double** %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
store double 0.000000e+00, double* %11
store i32 1, i32* %25
%26 = load double, double* %10
%27 = fmul double 1.000000e+01, %26
%28 = load i32, i32* %25
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [100 x double], [100 x double]* %23, i64 0, i64 %29
store double %27, double* %30
%31 = load double, double* %8
%32 = load i32, i32* %25
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [100 x double], [100 x double]* %22, i64 0, i64 %33
store double %31, double* %34
%35 = load double, double* %9
%36 = load double, double* %8
%37 = fsub double %35, %36
%38 = fdiv double %37, 2.000000e+00
%39 = load i32, i32* %25
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [100 x double], [100 x double]* %20, i64 0, i64 %40
store double %38, double* %41
%42 = load double (double, double*)*, double (double, double*)** %6
%43 = load double, double* %8
%44 = load double*, double** %7
%45 = call double %42(double %43, double* %44)
%46 = load i32, i32* %25
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [100 x double], [100 x double]* %17, i64 0, i64 %47
store double %45, double* %48
%49 = load double (double, double*)*, double (double, double*)** %6
%50 = load double, double* %8
%51 = load i32, i32* %25
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds [100 x double], [100 x double]* %20, i64 0, i64 %52
%54 = load double, double* %53
%55 = fadd double %50, %54
%56 = load double*, double** %7
%57 = call double %49(double %55, double* %56)
%58 = load i32, i32* %25
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [100 x double], [100 x double]* %19, i64 0, i64 %59
store double %57, double* %60
%61 = load double (double, double*)*, double (double, double*)** %6
%62 = load double, double* %9
%63 = load double*, double** %7
%64 = call double %61(double %62, double* %63)
%65 = load i32, i32* %25
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds [100 x double], [100 x double]* %18, i64 0, i64 %66
store double %64, double* %67
%68 = load i32, i32* %25
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds [100 x double], [100 x double]* %20, i64 0, i64 %69
%71 = load double, double* %70
%72 = load i32, i32* %25
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds [100 x double], [100 x double]* %17, i64 0, i64 %73
%75 = load double, double* %74
%76 = load i32, i32* %25
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds [100 x double], [100 x double]* %19, i64 0, i64 %77
%79 = load double, double* %78
%80 = call double @llvm.fmuladd.f64(double 4.000000e+00, double %79, double %75)
%81 = load i32, i32* %25
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds [100 x double], [100 x double]* %18, i64 0, i64 %82
%84 = load double, double* %83
%85 = fadd double %80, %84
%86 = fmul double %71, %85
%87 = fdiv double %86, 3.000000e+00
%88 = load i32, i32* %25
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds [100 x double], [100 x double]* %21, i64 0, i64 %89
store double %87, double* %90
%91 = load i32, i32* %25
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds [100 x double], [100 x double]* %24, i64 0, i64 %92
store double 1.000000e+00, double* %93
br label %94
94: ; preds = %321, %5
%95 = load i32, i32* %25
%96 = icmp sgt i32 %95, 0
br i1 %96, label %97, label %322
97: ; preds = %94
%98 = load double (double, double*)*, double (double, double*)** %6
%99 = load i32, i32* %25
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds [100 x double], [100 x double]* %22, i64 0, i64 %100
%102 = load double, double* %101
%103 = load i32, i32* %25
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds [100 x double], [100 x double]* %20, i64 0, i64 %104
%106 = load double, double* %105
%107 = fdiv double %106, 2.000000e+00
%108 = fadd double %102, %107
%109 = load double*, double** %7
%110 = call double %98(double %108, double* %109)
store double %110, double* %14
%111 = load double (double, double*)*, double (double, double*)** %6
%112 = load i32, i32* %25
%113 = sext i32 %112 to i64
%114 = getelementptr inbounds [100 x double], [100 x double]* %22, i64 0, i64 %113
%115 = load double, double* %114
%116 = load i32, i32* %25
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds [100 x double], [100 x double]* %20, i64 0, i64 %117
%119 = load double, double* %118
%120 = fmul double 3.000000e+00, %119
%121 = fdiv double %120, 2.000000e+00
%122 = fadd double %115, %121
%123 = load double*, double** %7
%124 = call double %111(double %122, double* %123)
store double %124, double* %15
%125 = load i32, i32* %25
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds [100 x double], [100 x double]* %20, i64 0, i64 %126
%128 = load double, double* %127
%129 = load i32, i32* %25
%130 = sext i32 %129 to i64
%131 = getelementptr inbounds [100 x double], [100 x double]* %17, i64 0, i64 %130
%132 = load double, double* %131
%133 = load double, double* %14
%134 = call double @llvm.fmuladd.f64(double 4.000000e+00, double %133, double %132)
%135 = load i32, i32* %25
%136 = sext i32 %135 to i64
%137 = getelementptr inbounds [100 x double], [100 x double]* %19, i64 0, i64 %136
%138 = load double, double* %137
%139 = fadd double %134, %138
%140 = fmul double %128, %139
%141 = fdiv double %140, 6.000000e+00
store double %141, double* %12
%142 = load i32, i32* %25
%143 = sext i32 %142 to i64
%144 = getelementptr inbounds [100 x double], [100 x double]* %20, i64 0, i64 %143
%145 = load double, double* %144
%146 = load i32, i32* %25
%147 = sext i32 %146 to i64
%148 = getelementptr inbounds [100 x double], [100 x double]* %19, i64 0, i64 %147
%149 = load double, double* %148
%150 = load double, double* %15
%151 = call double @llvm.fmuladd.f64(double 4.000000e+00, double %150, double %149)
%152 = load i32, i32* %25
%153 = sext i32 %152 to i64
%154 = getelementptr inbounds [100 x double], [100 x double]* %18, i64 0, i64 %153
%155 = load double, double* %154
%156 = fadd double %151, %155
%157 = fmul double %145, %156
%158 = fdiv double %157, 6.000000e+00
store double %158, double* %13
%159 = load i32, i32* %25
%160 = sext i32 %159 to i64
%161 = getelementptr inbounds [100 x double], [100 x double]* %22, i64 0, i64 %160
%162 = load double, double* %161
%163 = getelementptr inbounds [9 x double], [9 x double]* %16, i64 0, i64 1
store double %162, double* %163
%164 = load i32, i32* %25
%165 = sext i32 %164 to i64
%166 = getelementptr inbounds [100 x double], [100 x double]* %17, i64 0, i64 %165
%167 = load double, double* %166
%168 = getelementptr inbounds [9 x double], [9 x double]* %16, i64 0, i64 2
store double %167, double* %168
%169 = load i32, i32* %25
%170 = sext i32 %169 to i64
%171 = getelementptr inbounds [100 x double], [100 x double]* %19, i64 0, i64 %170
%172 = load double, double* %171
%173 = getelementptr inbounds [9 x double], [9 x double]* %16, i64 0, i64 3
store double %172, double* %173
%174 = load i32, i32* %25
%175 = sext i32 %174 to i64
%176 = getelementptr inbounds [100 x double], [100 x double]* %18, i64 0, i64 %175
%177 = load double, double* %176
%178 = getelementptr inbounds [9 x double], [9 x double]* %16, i64 0, i64 4
store double %177, double* %178
%179 = load i32, i32* %25
%180 = sext i32 %179 to i64
%181 = getelementptr inbounds [100 x double], [100 x double]* %20, i64 0, i64 %180
%182 = load double, double* %181
%183 = getelementptr inbounds [9 x double], [9 x double]* %16, i64 0, i64 5
store double %182, double* %183
%184 = load i32, i32* %25
%185 = sext i32 %184 to i64
%186 = getelementptr inbounds [100 x double], [100 x double]* %23, i64 0, i64 %185
%187 = load double, double* %186
%188 = getelementptr inbounds [9 x double], [9 x double]* %16, i64 0, i64 6
store double %187, double* %188
%189 = load i32, i32* %25
%190 = sext i32 %189 to i64
%191 = getelementptr inbounds [100 x double], [100 x double]* %21, i64 0, i64 %190
%192 = load double, double* %191
%193 = getelementptr inbounds [9 x double], [9 x double]* %16, i64 0, i64 7
store double %192, double* %193
%194 = load i32, i32* %25
%195 = sext i32 %194 to i64
%196 = getelementptr inbounds [100 x double], [100 x double]* %24, i64 0, i64 %195
%197 = load double, double* %196
%198 = getelementptr inbounds [9 x double], [9 x double]* %16, i64 0, i64 8
store double %197, double* %198
%199 = load i32, i32* %25
%200 = add nsw i32 %199, -1
store i32 %200, i32* %25
%201 = load double, double* %12
%202 = load double, double* %13
%203 = fadd double %201, %202
%204 = getelementptr inbounds [9 x double], [9 x double]* %16, i64 0, i64 7
%205 = load double, double* %204
%206 = fsub double %203, %205
%207 = call double @llvm.fabs.f64(double %206)
%208 = getelementptr inbounds [9 x double], [9 x double]* %16, i64 0, i64 6
%209 = load double, double* %208
%210 = fcmp olt double %207, %209
br i1 %210, label %211, label %217
211: ; preds = %97
%212 = load double, double* %11
%213 = load double, double* %12
%214 = fadd double %212, %213
%215 = load double, double* %13
%216 = fadd double %214, %215
store double %216, double* %11
br label %321
217: ; preds = %97
%218 = getelementptr inbounds [9 x double], [9 x double]* %16, i64 0, i64 8
%219 = load double, double* %218
%220 = fcmp oge double %219, 1.000000e+02
br i1 %220, label %221, label %224
221: ; preds = %217
%222 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 100)
%223 = call i32 @exit(i32 1)
unreachable
224: ; preds = %217
%225 = load i32, i32* %25
%226 = add nsw i32 %225, 1
store i32 %226, i32* %25
%227 = getelementptr inbounds [9 x double], [9 x double]* %16, i64 0, i64 1
%228 = load double, double* %227
%229 = getelementptr inbounds [9 x double], [9 x double]* %16, i64 0, i64 5
%230 = load double, double* %229
%231 = fadd double %228, %230
%232 = load i32, i32* %25
%233 = sext i32 %232 to i64
%234 = getelementptr inbounds [100 x double], [100 x double]* %22, i64 0, i64 %233
store double %231, double* %234
%235 = getelementptr inbounds [9 x double], [9 x double]* %16, i64 0, i64 3
%236 = load double, double* %235
%237 = load i32, i32* %25
%238 = sext i32 %237 to i64
%239 = getelementptr inbounds [100 x double], [100 x double]* %17, i64 0, i64 %238
store double %236, double* %239
%240 = load double, double* %15
%241 = load i32, i32* %25
%242 = sext i32 %241 to i64
%243 = getelementptr inbounds [100 x double], [100 x double]* %19, i64 0, i64 %242
store double %240, double* %243
%244 = getelementptr inbounds [9 x double], [9 x double]* %16, i64 0, i64 4
%245 = load double, double* %244
%246 = load i32, i32* %25
%247 = sext i32 %246 to i64
%248 = getelementptr inbounds [100 x double], [100 x double]* %18, i64 0, i64 %247
store double %245, double* %248
%249 = getelementptr inbounds [9 x double], [9 x double]* %16, i64 0, i64 5
%250 = load double, double* %249
%251 = fdiv double %250, 2.000000e+00
%252 = load i32, i32* %25
%253 = sext i32 %252 to i64
%254 = getelementptr inbounds [100 x double], [100 x double]* %20, i64 0, i64 %253
store double %251, double* %254
%255 = getelementptr inbounds [9 x double], [9 x double]* %16, i64 0, i64 6
%256 = load double, double* %255
%257 = fdiv double %256, 2.000000e+00
%258 = load i32, i32* %25
%259 = sext i32 %258 to i64
%260 = getelementptr inbounds [100 x double], [100 x double]* %23, i64 0, i64 %259
store double %257, double* %260
%261 = load double, double* %13
%262 = load i32, i32* %25
%263 = sext i32 %262 to i64
%264 = getelementptr inbounds [100 x double], [100 x double]* %21, i64 0, i64 %263
store double %261, double* %264
%265 = getelementptr inbounds [9 x double], [9 x double]* %16, i64 0, i64 8
%266 = load double, double* %265
%267 = fadd double %266, 1.000000e+00
%268 = load i32, i32* %25
%269 = sext i32 %268 to i64
%270 = getelementptr inbounds [100 x double], [100 x double]* %24, i64 0, i64 %269
store double %267, double* %270
%271 = load i32, i32* %25
%272 = add nsw i32 %271, 1
store i32 %272, i32* %25
%273 = getelementptr inbounds [9 x double], [9 x double]* %16, i64 0, i64 1
%274 = load double, double* %273
%275 = load i32, i32* %25
%276 = sext i32 %275 to i64
%277 = getelementptr inbounds [100 x double], [100 x double]* %22, i64 0, i64 %276
store double %274, double* %277
%278 = getelementptr inbounds [9 x double], [9 x double]* %16, i64 0, i64 2
%279 = load double, double* %278
%280 = load i32, i32* %25
%281 = sext i32 %280 to i64
%282 = getelementptr inbounds [100 x double], [100 x double]* %17, i64 0, i64 %281
store double %279, double* %282
%283 = load double, double* %14
%284 = load i32, i32* %25
%285 = sext i32 %284 to i64
%286 = getelementptr inbounds [100 x double], [100 x double]* %19, i64 0, i64 %285
store double %283, double* %286
%287 = getelementptr inbounds [9 x double], [9 x double]* %16, i64 0, i64 3
%288 = load double, double* %287
%289 = load i32, i32* %25
%290 = sext i32 %289 to i64
%291 = getelementptr inbounds [100 x double], [100 x double]* %18, i64 0, i64 %290
store double %288, double* %291
%292 = load i32, i32* %25
%293 = sub nsw i32 %292, 1
%294 = sext i32 %293 to i64
%295 = getelementptr inbounds [100 x double], [100 x double]* %20, i64 0, i64 %294
%296 = load double, double* %295
%297 = load i32, i32* %25
%298 = sext i32 %297 to i64
%299 = getelementptr inbounds [100 x double], [100 x double]* %20, i64 0, i64 %298
store double %296, double* %299
%300 = load i32, i32* %25
%301 = sub nsw i32 %300, 1
%302 = sext i32 %301 to i64
%303 = getelementptr inbounds [100 x double], [100 x double]* %23, i64 0, i64 %302
%304 = load double, double* %303
%305 = load i32, i32* %25
%306 = sext i32 %305 to i64
%307 = getelementptr inbounds [100 x double], [100 x double]* %23, i64 0, i64 %306
store double %304, double* %307
%308 = load double, double* %12
%309 = load i32, i32* %25
%310 = sext i32 %309 to i64
%311 = getelementptr inbounds [100 x double], [100 x double]* %21, i64 0, i64 %310
store double %308, double* %311
%312 = load i32, i32* %25
%313 = sub nsw i32 %312, 1
%314 = sext i32 %313 to i64
%315 = getelementptr inbounds [100 x double], [100 x double]* %24, i64 0, i64 %314
%316 = load double, double* %315
%317 = load i32, i32* %25
%318 = sext i32 %317 to i64
%319 = getelementptr inbounds [100 x double], [100 x double]* %24, i64 0, i64 %318
store double %316, double* %319
br label %320
320: ; preds = %224
br label %321
321: ; preds = %320, %211
br label %94
322: ; preds = %94
%323 = load double, double* %11
ret double %323
}

LLVM IR (-O2):
@.str = [36 x i8] c"\0A\09Too many steps (%d) in integrate\0A\00"
define double @integrate(double (double, double*)* nocapture %0, double* %1, double %2, double %3, double %4) {
%6 = alloca [100 x double]
%7 = alloca [100 x double]
%8 = alloca [100 x double]
%9 = alloca [100 x double]
%10 = alloca [100 x double]
%11 = alloca [100 x double]
%12 = alloca [100 x double]
%13 = alloca [100 x double]
%14 = bitcast [100 x double]* %6 to i8*
%15 = bitcast [100 x double]* %7 to i8*
%16 = bitcast [100 x double]* %8 to i8*
%17 = bitcast [100 x double]* %9 to i8*
%18 = bitcast [100 x double]* %10 to i8*
%19 = bitcast [100 x double]* %11 to i8*
%20 = bitcast [100 x double]* %12 to i8*
%21 = bitcast [100 x double]* %13 to i8*
%22 = fmul double %4, 1.000000e+01
%23 = getelementptr inbounds [100 x double], [100 x double]* %12, i64 0, i64 1
store double %22, double* %23
%24 = getelementptr inbounds [100 x double], [100 x double]* %11, i64 0, i64 1
store double %2, double* %24
%25 = fsub double %3, %2
%26 = fmul double %25, 5.000000e-01
%27 = getelementptr inbounds [100 x double], [100 x double]* %9, i64 0, i64 1
store double %26, double* %27
%28 = tail call double %0(double %2, double* %1)
%29 = getelementptr inbounds [100 x double], [100 x double]* %6, i64 0, i64 1
store double %28, double* %29
%30 = fadd double %26, %2
%31 = tail call double %0(double %30, double* %1)
%32 = getelementptr inbounds [100 x double], [100 x double]* %8, i64 0, i64 1
store double %31, double* %32
%33 = tail call double %0(double %3, double* %1)
%34 = getelementptr inbounds [100 x double], [100 x double]* %7, i64 0, i64 1
store double %33, double* %34
%35 = tail call double @llvm.fmuladd.f64(double %31, double 4.000000e+00, double %28)
%36 = fadd double %35, %33
%37 = fmul double %26, %36
%38 = fdiv double %37, 3.000000e+00
%39 = getelementptr inbounds [100 x double], [100 x double]* %10, i64 0, i64 1
store double %38, double* %39
%40 = getelementptr inbounds [100 x double], [100 x double]* %13, i64 0, i64 1
store double 1.000000e+00, double* %40
br label %41
41: ; preds = %110, %5
%42 = phi double [ %26, %5 ], [ %117, %110 ]
%43 = phi double [ %2, %5 ], [ %115, %110 ]
%44 = phi i32 [ 1, %5 ], [ %111, %110 ]
%45 = phi double [ 0.000000e+00, %5 ], [ %112, %110 ]
%46 = zext i32 %44 to i64
%47 = getelementptr inbounds [100 x double], [100 x double]* %11, i64 0, i64 %46
%48 = getelementptr inbounds [100 x double], [100 x double]* %9, i64 0, i64 %46
%49 = fmul double %42, 5.000000e-01
%50 = fadd double %43, %49
%51 = tail call double %0(double %50, double* %1)
%52 = fmul double %42, 3.000000e+00
%53 = fmul double %52, 5.000000e-01
%54 = fadd double %43, %53
%55 = tail call double %0(double %54, double* %1)
%56 = getelementptr inbounds [100 x double], [100 x double]* %6, i64 0, i64 %46
%57 = load double, double* %56
%58 = getelementptr inbounds [100 x double], [100 x double]* %8, i64 0, i64 %46
%59 = load double, double* %58
%60 = insertelement <2 x double> poison, double %51, i64 0
%61 = insertelement <2 x double> %60, double %55, i64 1
%62 = insertelement <2 x double> poison, double %57, i64 0
%63 = insertelement <2 x double> %62, double %59, i64 1
%64 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %61, <2 x double> <double 4.000000e+00, double 4.000000e+00>, <2 x double> %63)
%65 = getelementptr inbounds [100 x double], [100 x double]* %7, i64 0, i64 %46
%66 = load double, double* %65
%67 = insertelement <2 x double> poison, double %59, i64 0
%68 = insertelement <2 x double> %67, double %66, i64 1
%69 = fadd <2 x double> %64, %68
%70 = insertelement <2 x double> poison, double %42, i64 0
%71 = shufflevector <2 x double> %70, <2 x double> poison, <2 x i32> zeroinitializer
%72 = fmul <2 x double> %71, %69
%73 = fdiv <2 x double> %72, <double 6.000000e+00, double 6.000000e+00>
%74 = getelementptr inbounds [100 x double], [100 x double]* %12, i64 0, i64 %46
%75 = load double, double* %74
%76 = getelementptr inbounds [100 x double], [100 x double]* %10, i64 0, i64 %46
%77 = load double, double* %76
%78 = getelementptr inbounds [100 x double], [100 x double]* %13, i64 0, i64 %46
%79 = load double, double* %78
%80 = extractelement <2 x double> %73, i64 0
%81 = extractelement <2 x double> %73, i64 1
%82 = fadd double %80, %81
%83 = fsub double %82, %77
%84 = tail call double @llvm.fabs.f64(double %83)
%85 = fcmp olt double %84, %75
br i1 %85, label %105, label %86
86: ; preds = %41
%87 = fcmp ult double %79, 1.000000e+02
br i1 %87, label %91, label %88
88: ; preds = %86
%89 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 100)
%90 = tail call i32 @exit(i32 1)
unreachable
91: ; preds = %86
%92 = fadd double %43, %42
store double %92, double* %47
store double %59, double* %56
store double %55, double* %58
store double %49, double* %48
%93 = fmul double %75, 5.000000e-01
store double %93, double* %74
store double %81, double* %76
%94 = fadd double %79, 1.000000e+00
store double %94, double* %78
%95 = add nuw nsw i32 %44, 1
%96 = zext i32 %95 to i64
%97 = getelementptr inbounds [100 x double], [100 x double]* %11, i64 0, i64 %96
store double %43, double* %97
%98 = getelementptr inbounds [100 x double], [100 x double]* %6, i64 0, i64 %96
store double %57, double* %98
%99 = getelementptr inbounds [100 x double], [100 x double]* %8, i64 0, i64 %96
store double %51, double* %99
%100 = getelementptr inbounds [100 x double], [100 x double]* %7, i64 0, i64 %96
store double %59, double* %100
%101 = getelementptr inbounds [100 x double], [100 x double]* %9, i64 0, i64 %96
store double %49, double* %101
%102 = getelementptr inbounds [100 x double], [100 x double]* %12, i64 0, i64 %96
store double %93, double* %102
%103 = getelementptr inbounds [100 x double], [100 x double]* %10, i64 0, i64 %96
store double %80, double* %103
%104 = getelementptr inbounds [100 x double], [100 x double]* %13, i64 0, i64 %96
store double %94, double* %104
br label %110
105: ; preds = %41
%106 = add nsw i32 %44, -1
%107 = fadd double %45, %80
%108 = fadd double %107, %81
%109 = icmp eq i32 %106, 0
br i1 %109, label %118, label %110
110: ; preds = %91, %105
%111 = phi i32 [ %95, %91 ], [ %106, %105 ]
%112 = phi double [ %45, %91 ], [ %108, %105 ]
%113 = zext i32 %111 to i64
%114 = getelementptr inbounds [100 x double], [100 x double]* %11, i64 0, i64 %113
%115 = load double, double* %114
%116 = getelementptr inbounds [100 x double], [100 x double]* %9, i64 0, i64 %113
%117 = load double, double* %116
br label %41
118: ; preds = %105
ret double %108
}