double qromb(func, a, b)
double a, b;
double (*func)();
{
  double ss, dss, trapzd();
  double s[20 + 1 + 1], h[20 + 1 + 1];
  int j;
  void polint(), nrerror();
  h[1] = 1.0;
  for (j = 1; j <= 20; j++) {
    s[j] = trapzd(func, a, b, j);
    if (j >= 5) {
      polint(&h[j - 5], &s[j - 5], 5, 0.0, &ss, &dss);
      if (fabs(dss) < 0.5e-5 * fabs(ss))
        return ss;
    }
    s[j + 1] = s[j];
    h[j + 1] = 0.25 * h[j];
  }
  nrerror("Too many steps in routine QROMB");
}


x86 assembly (clang, -O0):
<qromb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
mov    %rdi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
movsd  0xeaf(%rip),%xmm0
movsd  %xmm0,-0x188(%rbp)
ff
movl   $0x1,-0x194(%rbp)
cmpl   $0x14,-0x194(%rbp)
jg     129f <qromb+0x16f>
mov    -0x10(%rbp),%rdi
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mov    -0x194(%rbp),%esi
mov    $0x2,%al
call   1040 <trapzd@plt>
movslq -0x194(%rbp),%rax
movsd  %xmm0,-0xe0(%rbp,%rax,8)
ff ff
cmpl   $0x5,-0x194(%rbp)
jl     123b <qromb+0x10b>
mov    -0x194(%rbp),%eax
sub    $0x5,%eax
cltq
lea    -0x190(%rbp),%rdi
shl    $0x3,%rax
add    %rax,%rdi
mov    -0x194(%rbp),%eax
sub    $0x5,%eax
cltq
lea    -0xe0(%rbp),%rsi
shl    $0x3,%rax
add    %rax,%rsi
mov    $0x5,%edx
xorps  %xmm0,%xmm0
lea    -0x28(%rbp),%rcx
lea    -0x30(%rbp),%r8
mov    $0x1,%al
call   1050 <polint@plt>
movsd  -0x30(%rbp),%xmm1
movaps 0xe23(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm2
movaps 0xe13(%rip),%xmm0
pand   %xmm0,%xmm2
movsd  0xdef(%rip),%xmm0
mulsd  %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jbe    1236 <qromb+0x106>
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    12ad <qromb+0x17d>
jmp    123b <qromb+0x10b>
movslq -0x194(%rbp),%rax
movsd  -0xe0(%rbp,%rax,8),%xmm0
ff ff
mov    -0x194(%rbp),%eax
add    $0x1,%eax
cltq
movsd  %xmm0,-0xe0(%rbp,%rax,8)
ff ff
movslq -0x194(%rbp),%rax
movsd  0xda2(%rip),%xmm0
mulsd  -0x190(%rbp,%rax,8),%xmm0
ff ff
mov    -0x194(%rbp),%eax
add    $0x1,%eax
cltq
movsd  %xmm0,-0x190(%rbp,%rax,8)
ff ff
mov    -0x194(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x194(%rbp)
jmp    1163 <qromb+0x33>
lea    0xd8a(%rip),%rdi
mov    $0x0,%al
call   1030 <nrerror@plt>
movsd  -0x8(%rbp),%xmm0
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qromb>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x188,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
mov    %rdi,%r15
movabs $0x3ff0000000000000,%rax
mov    %rax,0x28(%rsp)
mov    $0x1,%ebx
mov    $0xfffffffc,%r13d
mov    $0x14,%ebp
lea    0x18(%rsp),%r14
lea    0x10(%rsp),%r12
jmp    11af <qromb+0x7f>
nopw   0x0(%rax,%rax,1)
movsd  %xmm0,0xd8(%rsp,%rbx,8)
movsd  0x20(%rsp,%rbx,8),%xmm0
mulsd  0xe81(%rip),%xmm0
movsd  %xmm0,0x28(%rsp,%rbx,8)
add    $0x1,%rbx
add    $0x1,%r13
add    $0xffffffffffffffff,%rbp
je     123d <qromb+0x10d>
mov    %r15,%rdi
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
mov    %ebx,%esi
mov    $0x2,%al
call   1040 <trapzd@plt>
movsd  %xmm0,0xd0(%rsp,%rbx,8)
cmp    $0x5,%rbx
jb     1180 <qromb+0x50>
mov    %r13d,%eax
shl    $0x3,%rax
lea    (%rsp,%rax,1),%rdi
add    $0x20,%rdi
lea    0xd0(%rsp,%rax,1),%rsi
xorps  %xmm0,%xmm0
mov    $0x5,%edx
mov    %r14,%rcx
mov    %r12,%r8
mov    $0x1,%al
call   1050 <polint@plt>
movsd  0x10(%rsp),%xmm1
movapd 0xdf1(%rip),%xmm3
andpd  %xmm3,%xmm1
movsd  0x18(%rsp),%xmm0
movapd %xmm0,%xmm2
andpd  %xmm3,%xmm2
mulsd  0xde7(%rip),%xmm2
ucomisd %xmm1,%xmm2
ja     124b <qromb+0x11b>
movsd  0xd0(%rsp,%rbx,8),%xmm0
jmp    1180 <qromb+0x50>
lea    0xddc(%rip),%rdi
xor    %eax,%eax
call   1030 <nrerror@plt>
add    $0x188,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Too many steps in routine QROMB\00"
define double @qromb(double (...)* %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double (...)*
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca [22 x double]
%11 = alloca [22 x double]
%12 = alloca i32
store double (...)* %0, double (...)** %5
store double %1, double* %6
store double %2, double* %7
%13 = getelementptr inbounds [22 x double], [22 x double]* %11, i64 0, i64 1
store double 1.000000e+00, double* %13
store i32 1, i32* %12
br label %14
14: ; preds = %64, %3
%15 = load i32, i32* %12
%16 = icmp sle i32 %15, 20
br i1 %16, label %17, label %67
17: ; preds = %14
%18 = load double (...)*, double (...)** %5
%19 = load double, double* %6
%20 = load double, double* %7
%21 = load i32, i32* %12
%22 = call double (double (...)*, double, double, i32, ...) bitcast (double (...)* @trapzd to double (double (...)*, double, double, i32, ...)*)(double (...)* %18, double %19, double %20, i32 %21)
%23 = load i32, i32* %12
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [22 x double], [22 x double]* %10, i64 0, i64 %24
store double %22, double* %25
%26 = load i32, i32* %12
%27 = icmp sge i32 %26, 5
br i1 %27, label %28, label %46
28: ; preds = %17
%29 = load i32, i32* %12
%30 = sub nsw i32 %29, 5
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [22 x double], [22 x double]* %11, i64 0, i64 %31
%33 = load i32, i32* %12
%34 = sub nsw i32 %33, 5
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [22 x double], [22 x double]* %10, i64 0, i64 %35
%37 = load double, double* %9
%38 = call double @llvm.fabs.f64(double %37)
%39 = load double, double* %8
%40 = call double @llvm.fabs.f64(double %39)
%41 = fmul double 5.000000e-06, %40
%42 = fcmp olt double %38, %41
br i1 %42, label %43, label %45
43: ; preds = %28
%44 = load double, double* %8
store double %44, double* %4
br label %68
45: ; preds = %28
br label %46
46: ; preds = %45, %17
%47 = load i32, i32* %12
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [22 x double], [22 x double]* %10, i64 0, i64 %48
%50 = load double, double* %49
%51 = load i32, i32* %12
%52 = add nsw i32 %51, 1
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds [22 x double], [22 x double]* %10, i64 0, i64 %53
store double %50, double* %54
%55 = load i32, i32* %12
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds [22 x double], [22 x double]* %11, i64 0, i64 %56
%58 = load double, double* %57
%59 = fmul double 2.500000e-01, %58
%60 = load i32, i32* %12
%61 = add nsw i32 %60, 1
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds [22 x double], [22 x double]* %11, i64 0, i64 %62
store double %59, double* %63
br label %64
64: ; preds = %46
%65 = load i32, i32* %12
%66 = add nsw i32 %65, 1
store i32 %66, i32* %12
br label %14
67: ; preds = %14
br label %68
68: ; preds = %67, %43
%69 = load double, double* %4
ret double %69
}

LLVM IR (-O2):
@.str = [32 x i8] c"Too many steps in routine QROMB\00"
define double @qromb(double (...)* %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca [22 x double]
%7 = alloca [22 x double]
%8 = bitcast double* %4 to i8*
%9 = bitcast double* %5 to i8*
%10 = bitcast [22 x double]* %6 to i8*
%11 = bitcast [22 x double]* %7 to i8*
%12 = getelementptr inbounds [22 x double], [22 x double]* %7, i64 0, i64 1
store double 1.000000e+00, double* %12
br label %13
13: ; preds = %3, %32
%14 = phi i64 [ 1, %3 ], [ %34, %32 ]
%15 = trunc i64 %14 to i32
%16 = call double (double (...)*, double, double, i32, ...) bitcast (double (...)* @trapzd to double (double (...)*, double, double, i32, ...)*)(double (...)* %0, double %1, double %2, i32 %15)
%17 = getelementptr inbounds [22 x double], [22 x double]* %6, i64 0, i64 %14
store double %16, double* %17
%18 = icmp ugt i64 %14, 4
br i1 %18, label %19, label %32
19: ; preds = %13
%20 = add nuw i64 %14, 4294967291
%21 = and i64 %20, 4294967295
%22 = getelementptr inbounds [22 x double], [22 x double]* %7, i64 0, i64 %21
%23 = getelementptr inbounds [22 x double], [22 x double]* %6, i64 0, i64 %21
%24 = load double, double* %5
%25 = call double @llvm.fabs.f64(double %24)
%26 = load double, double* %4
%27 = call double @llvm.fabs.f64(double %26)
%28 = fmul double %27, 5.000000e-06
%29 = fcmp olt double %25, %28
br i1 %29, label %42, label %30
30: ; preds = %19
%31 = load double, double* %17
br label %32
32: ; preds = %30, %13
%33 = phi double [ %31, %30 ], [ %16, %13 ]
%34 = add nuw nsw i64 %14, 1
%35 = getelementptr inbounds [22 x double], [22 x double]* %6, i64 0, i64 %34
store double %33, double* %35
%36 = getelementptr inbounds [22 x double], [22 x double]* %7, i64 0, i64 %14
%37 = load double, double* %36
%38 = fmul double %37, 2.500000e-01
%39 = getelementptr inbounds [22 x double], [22 x double]* %7, i64 0, i64 %34
store double %38, double* %39
%40 = icmp eq i64 %34, 21
br i1 %40, label %41, label %13
41: ; preds = %32
br label %42
42: ; preds = %19, %41
%43 = phi double [ undef, %41 ], [ %26, %19 ]
ret double %43
}