void extremum(double x[], double eps, int k, int js[], void (*f)()) {
  int i, j, done = 0;
  double t, h1, h2, dx, y[10], b[10], z[2];
  js[0] = 0;
  h2 = 0.0;
  while (!done && js[0] < k) {
    for (j = 0; j <= 7; j++) {
      if (j <= 2)
        t = x[0] + 0.01 * j;
      else
        t = h2;
      (*f)(t, z);
      if (fabs(z[1]) < eps) {
        done = 1;
        break;
      } else {
        h1 = z[1];
        h2 = t;
        if (j == 0) {
          y[0] = h1;
          b[0] = h2;
        } else {
          y[j] = h1;
          for (i = 0; i < j; i++) {
            if (fabs(h2 - b[i]) < eps) {
              b[j] = 1.0e+35;
              break;
            }
            b[j] = h2 = (h1 - y[i]) / (h2 - b[i]);
          }
          h2 = 0.0;
          for (i = j - 1; i >= 0; i--)
            h2 = -y[i] / (b[i + 1] + h2);
          h2 = h2 + b[0];
        }
      }
    }
    x[0] = h2;
    js[0]++;
  }
  t = x[0];
  (*f)(t, z);
  x[1] = z[0];
  if (fabs(x[0]) <= 1.0)
    dx = 1.0e-05;
  else
    dx = fabs(x[0] * 1.0e-05);
  t = x[0] - dx;
  (*f)(t, z);
  h1 = z[0];
  t = x[0] + dx;
  (*f)(t, z);
  h2 = z[0];
  if ((h1 + h2 - 2.0 * x[1]) <= 0.0)
    js[1] = 1;
  else
    js[1] = -1;
}


x86 assembly (clang, -O0):
<extremum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x34(%rbp)
mov    %al,-0x111(%rbp)
jne    115c <extremum+0x5c>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
cmp    -0x14(%rbp),%eax
setl   %al
mov    %al,-0x111(%rbp)
mov    -0x111(%rbp),%al
test   $0x1,%al
jne    116f <extremum+0x6f>
jmp    13a3 <extremum+0x2a3>
movl   $0x0,-0x30(%rbp)
cmpl   $0x7,-0x30(%rbp)
jg     1386 <extremum+0x286>
cmpl   $0x2,-0x30(%rbp)
jg     11b1 <extremum+0xb1>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
cvtsi2sdl -0x30(%rbp),%xmm0
movsd  0xe71(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    11bb <extremum+0xbb>
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x28(%rbp),%rcx
movsd  -0x40(%rbp),%xmm0
lea    -0x110(%rbp),%rdi
mov    $0x1,%al
call   *%rcx
movsd  -0x108(%rbp),%xmm1
ff
movaps 0xe42(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    11fd <extremum+0xfd>
movl   $0x1,-0x34(%rbp)
jmp    1386 <extremum+0x286>
movsd  -0x108(%rbp),%xmm0
ff
movsd  %xmm0,-0x48(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
cmpl   $0x0,-0x30(%rbp)
jne    123d <extremum+0x13d>
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x100(%rbp)
ff
jmp    136e <extremum+0x26e>
movsd  -0x48(%rbp),%xmm0
movslq -0x30(%rbp),%rax
movsd  %xmm0,-0xb0(%rbp,%rax,8)
ff ff
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x30(%rbp),%eax
jge    12f0 <extremum+0x1f0>
movsd  -0x50(%rbp),%xmm1
movslq -0x2c(%rbp),%rax
subsd  -0x100(%rbp,%rax,8),%xmm1
ff ff
movaps 0xda5(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    12a8 <extremum+0x1a8>
movslq -0x30(%rbp),%rax
movsd  0xd7e(%rip),%xmm0
movsd  %xmm0,-0x100(%rbp,%rax,8)
ff ff
jmp    12f0 <extremum+0x1f0>
movsd  -0x48(%rbp),%xmm0
movslq -0x2c(%rbp),%rax
subsd  -0xb0(%rbp,%rax,8),%xmm0
ff ff
movsd  -0x50(%rbp),%xmm1
movslq -0x2c(%rbp),%rax
subsd  -0x100(%rbp,%rax,8),%xmm1
ff ff
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movslq -0x30(%rbp),%rax
movsd  %xmm0,-0x100(%rbp,%rax,8)
ff ff
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1256 <extremum+0x156>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x30(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jl     135c <extremum+0x25c>
movslq -0x2c(%rbp),%rax
movsd  -0xb0(%rbp,%rax,8),%xmm0
ff ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
cltq
movsd  -0x100(%rbp,%rax,8),%xmm1
ff ff
addsd  -0x50(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x2c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x2c(%rbp)
jmp    1301 <extremum+0x201>
movsd  -0x50(%rbp),%xmm0
addsd  -0x100(%rbp),%xmm0
ff
movsd  %xmm0,-0x50(%rbp)
jmp    1373 <extremum+0x273>
jmp    1378 <extremum+0x278>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1176 <extremum+0x76>
movsd  -0x50(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
jmp    1138 <extremum+0x38>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x28(%rbp),%rcx
movsd  -0x40(%rbp),%xmm0
lea    -0x110(%rbp),%rdi
mov    $0x1,%al
call   *%rcx
movsd  -0x110(%rbp),%xmm0
ff
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
movaps 0xc3c(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xc10(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     140c <extremum+0x30c>
movsd  0xc06(%rip),%xmm0
movsd  %xmm0,-0x58(%rbp)
jmp    142c <extremum+0x32c>
mov    -0x8(%rbp),%rax
movsd  0xbf0(%rip),%xmm0
mulsd  (%rax),%xmm0
movaps 0xbfd(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
subsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x28(%rbp),%rcx
movsd  -0x40(%rbp),%xmm0
lea    -0x110(%rbp),%rdi
mov    $0x1,%al
call   *%rcx
movsd  -0x110(%rbp),%xmm0
ff
movsd  %xmm0,-0x48(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
addsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x28(%rbp),%rcx
movsd  -0x40(%rbp),%xmm0
lea    -0x110(%rbp),%rdi
mov    $0x1,%al
call   *%rcx
movsd  -0x110(%rbp),%xmm0
ff
movsd  %xmm0,-0x50(%rbp)
movsd  -0x48(%rbp),%xmm1
addsd  -0x50(%rbp),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
addsd  %xmm0,%xmm0
subsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jb     14ca <extremum+0x3ca>
mov    -0x20(%rbp),%rax
movl   $0x1,0x4(%rax)
jmp    14d5 <extremum+0x3d5>
mov    -0x20(%rbp),%rax
movl   $0xffffffff,0x4(%rax)
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extremum>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xf8,%rsp
mov    %rcx,%r15
mov    %rdx,%rbx
mov    %rdi,%r14
movl   $0x0,(%rdx)
test   %esi,%esi
jle    12e1 <extremum+0x1e1>
mov    %esi,%ebp
xor    %r13d,%r13d
mov    %rsp,%r12
xorpd  %xmm2,%xmm2
movsd  %xmm0,0x48(%rsp)
nopw   0x0(%rax,%rax,1)
movsd  %xmm2,0x30(%rsp)
movapd %xmm2,%xmm0
cmp    $0x2,%r13
ja     1165 <extremum+0x65>
xorps  %xmm0,%xmm0
cvtsi2sd %r13d,%xmm0
mulsd  0xea0(%rip),%xmm0
addsd  (%r14),%xmm0
movapd %xmm0,0x20(%rsp)
mov    %r12,%rdi
mov    $0x1,%al
call   *%r15
movsd  0x8(%rsp),%xmm1
movapd %xmm1,%xmm4
movapd 0xeab(%rip),%xmm5
andpd  %xmm5,%xmm4
movsd  0x48(%rsp),%xmm0
ucomisd %xmm4,%xmm0
jbe    11a0 <extremum+0xa0>
movsd  0x30(%rsp),%xmm2
jmp    12bf <extremum+0x1bf>
test   %r13,%r13
je     128a <extremum+0x18a>
movsd  %xmm1,0xa0(%rsp,%r13,8)
movapd 0x20(%rsp),%xmm3
subsd  0x18(%rsp),%xmm3
movapd %xmm3,%xmm2
andpd  %xmm5,%xmm2
ucomisd %xmm2,%xmm0
ja     1219 <extremum+0x119>
lea    -0x1(%r13),%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movapd %xmm1,%xmm2
subsd  0xa0(%rsp,%rcx,8),%xmm2
divsd  %xmm3,%xmm2
movsd  %xmm2,0x50(%rsp,%r13,8)
cmp    %rcx,%rax
je     1230 <extremum+0x130>
subsd  0x58(%rsp,%rcx,8),%xmm2
movapd %xmm2,%xmm3
andpd  %xmm5,%xmm3
add    $0x1,%rcx
ucomisd %xmm3,%xmm0
movapd %xmm2,%xmm3
jbe    11e0 <extremum+0xe0>
movabs $0x4733426172c74d82,%rax
42 33 47
mov    %rax,0x50(%rsp,%r13,8)
movsd  0xdd8(%rip),%xmm2
movapd 0xe08(%rip),%xmm3
lea    -0x1(%r13),%eax
movsd  0xa0(%rsp,%rax,8),%xmm1
xorpd  %xmm3,%xmm1
addsd  0xdcf(%rip),%xmm2
divsd  %xmm2,%xmm1
cmp    $0x2,%r13
jb     12a7 <extremum+0x1a7>
mov    %r13,%rax
xchg   %ax,%ax
lea    -0x2(%rax),%ecx
movsd  0xa0(%rsp,%rcx,8),%xmm2
addsd  0x48(%rsp,%rax,8),%xmm1
xorpd  %xmm3,%xmm2
divsd  %xmm1,%xmm2
add    $0xffffffffffffffff,%rax
movapd %xmm2,%xmm1
cmp    $0x1,%rax
jg     1260 <extremum+0x160>
jmp    12ab <extremum+0x1ab>
movsd  %xmm1,0xa0(%rsp)
movapd 0x20(%rsp),%xmm2
movsd  %xmm2,0x50(%rsp)
movsd  %xmm2,0x18(%rsp)
jmp    12b1 <extremum+0x1b1>
movapd %xmm1,%xmm2
addsd  0x18(%rsp),%xmm2
add    $0x1,%r13
cmp    $0x8,%r13
jne    1140 <extremum+0x40>
movsd  %xmm2,(%r14)
mov    (%rbx),%eax
add    $0x1,%eax
mov    %eax,(%rbx)
ucomisd %xmm4,%xmm0
ja     12e6 <extremum+0x1e6>
mov    $0x0,%r13d
cmp    %ebp,%eax
jl     1140 <extremum+0x40>
jmp    12e6 <extremum+0x1e6>
movsd  (%r14),%xmm2
mov    %rsp,%rbp
movapd %xmm2,%xmm0
mov    %rbp,%rdi
mov    $0x1,%al
call   *%r15
movsd  (%rsp),%xmm0
movsd  %xmm0,0x8(%r14)
movsd  (%r14),%xmm0
movapd 0xd23(%rip),%xmm1
movapd %xmm0,%xmm4
andpd  %xmm1,%xmm4
movsd  0xcf3(%rip),%xmm2
movapd %xmm0,%xmm3
mulsd  %xmm2,%xmm3
andpd  %xmm1,%xmm3
cmpnlesd 0xce6(%rip),%xmm4
andpd  %xmm4,%xmm3
andnpd %xmm2,%xmm4
orpd   %xmm3,%xmm4
movapd %xmm4,0x30(%rsp)
subsd  %xmm4,%xmm0
mov    %rbp,%rdi
mov    $0x1,%al
call   *%r15
movsd  (%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  (%r14),%xmm0
addsd  0x30(%rsp),%xmm0
mov    %rbp,%rdi
mov    $0x1,%al
call   *%r15
movsd  0x20(%rsp),%xmm1
addsd  (%rsp),%xmm1
movsd  0x8(%r14),%xmm0
addsd  %xmm0,%xmm0
subsd  %xmm0,%xmm1
xorpd  %xmm0,%xmm0
xor    %eax,%eax
ucomisd %xmm1,%xmm0
setae  %al
add    %eax,%eax
add    $0xffffffff,%eax
mov    %eax,0x4(%rbx)
add    $0xf8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @extremum(double* %0, double %1, i32 %2, i32* %3, void (...)* %4) {
%6 = alloca double*
%7 = alloca double
%8 = alloca i32
%9 = alloca i32*
%10 = alloca void (...)*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca [10 x double]
%19 = alloca [10 x double]
%20 = alloca [2 x double]
store double* %0, double** %6
store double %1, double* %7
store i32 %2, i32* %8
store i32* %3, i32** %9
store void (...)* %4, void (...)** %10
store i32 0, i32* %13
%21 = load i32*, i32** %9
%22 = getelementptr inbounds i32, i32* %21, i64 0
store i32 0, i32* %22
store double 0.000000e+00, double* %16
br label %23
23: ; preds = %148, %5
%24 = load i32, i32* %13
%25 = icmp ne i32 %24, 0
br i1 %25, label %32, label %26
26: ; preds = %23
%27 = load i32*, i32** %9
%28 = getelementptr inbounds i32, i32* %27, i64 0
%29 = load i32, i32* %28
%30 = load i32, i32* %8
%31 = icmp slt i32 %29, %30
br label %32
32: ; preds = %26, %23
%33 = phi i1 [ false, %23 ], [ %31, %26 ]
br i1 %33, label %34, label %156
34: ; preds = %32
store i32 0, i32* %12
br label %35
35: ; preds = %145, %34
%36 = load i32, i32* %12
%37 = icmp sle i32 %36, 7
br i1 %37, label %38, label %148
38: ; preds = %35
%39 = load i32, i32* %12
%40 = icmp sle i32 %39, 2
br i1 %40, label %41, label %48
41: ; preds = %38
%42 = load double*, double** %6
%43 = getelementptr inbounds double, double* %42, i64 0
%44 = load double, double* %43
%45 = load i32, i32* %12
%46 = sitofp i32 %45 to double
%47 = call double @llvm.fmuladd.f64(double 1.000000e-02, double %46, double %44)
store double %47, double* %14
br label %50
48: ; preds = %38
%49 = load double, double* %16
store double %49, double* %14
br label %50
50: ; preds = %48, %41
%51 = load void (...)*, void (...)** %10
%52 = load double, double* %14
%53 = getelementptr inbounds [2 x double], [2 x double]* %20, i64 0, i64 0
%54 = bitcast void (...)* %51 to void (double, double*, ...)*
%55 = getelementptr inbounds [2 x double], [2 x double]* %20, i64 0, i64 1
%56 = load double, double* %55
%57 = call double @llvm.fabs.f64(double %56)
%58 = load double, double* %7
%59 = fcmp olt double %57, %58
br i1 %59, label %60, label %61
60: ; preds = %50
store i32 1, i32* %13
br label %148
61: ; preds = %50
%62 = getelementptr inbounds [2 x double], [2 x double]* %20, i64 0, i64 1
%63 = load double, double* %62
store double %63, double* %15
%64 = load double, double* %14
store double %64, double* %16
%65 = load i32, i32* %12
%66 = icmp eq i32 %65, 0
br i1 %66, label %67, label %72
67: ; preds = %61
%68 = load double, double* %15
%69 = getelementptr inbounds [10 x double], [10 x double]* %18, i64 0, i64 0
store double %68, double* %69
%70 = load double, double* %16
%71 = getelementptr inbounds [10 x double], [10 x double]* %19, i64 0, i64 0
store double %70, double* %71
br label %143
72: ; preds = %61
%73 = load double, double* %15
%74 = load i32, i32* %12
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds [10 x double], [10 x double]* %18, i64 0, i64 %75
store double %73, double* %76
store i32 0, i32* %11
br label %77
77: ; preds = %112, %72
%78 = load i32, i32* %11
%79 = load i32, i32* %12
%80 = icmp slt i32 %78, %79
br i1 %80, label %81, label %115
81: ; preds = %77
%82 = load double, double* %16
%83 = load i32, i32* %11
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds [10 x double], [10 x double]* %19, i64 0, i64 %84
%86 = load double, double* %85
%87 = fsub double %82, %86
%88 = call double @llvm.fabs.f64(double %87)
%89 = load double, double* %7
%90 = fcmp olt double %88, %89
br i1 %90, label %91, label %95
91: ; preds = %81
%92 = load i32, i32* %12
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds [10 x double], [10 x double]* %19, i64 0, i64 %93
store double 0x4733426172C74D82, double* %94
br label %115
95: ; preds = %81
%96 = load double, double* %15
%97 = load i32, i32* %11
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds [10 x double], [10 x double]* %18, i64 0, i64 %98
%100 = load double, double* %99
%101 = fsub double %96, %100
%102 = load double, double* %16
%103 = load i32, i32* %11
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds [10 x double], [10 x double]* %19, i64 0, i64 %104
%106 = load double, double* %105
%107 = fsub double %102, %106
%108 = fdiv double %101, %107
store double %108, double* %16
%109 = load i32, i32* %12
%110 = sext i32 %109 to i64
%111 = getelementptr inbounds [10 x double], [10 x double]* %19, i64 0, i64 %110
store double %108, double* %111
br label %112
112: ; preds = %95
%113 = load i32, i32* %11
%114 = add nsw i32 %113, 1
store i32 %114, i32* %11
br label %77
115: ; preds = %91, %77
store double 0.000000e+00, double* %16
%116 = load i32, i32* %12
%117 = sub nsw i32 %116, 1
store i32 %117, i32* %11
br label %118
118: ; preds = %135, %115
%119 = load i32, i32* %11
%120 = icmp sge i32 %119, 0
br i1 %120, label %121, label %138
121: ; preds = %118
%122 = load i32, i32* %11
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds [10 x double], [10 x double]* %18, i64 0, i64 %123
%125 = load double, double* %124
%126 = fneg double %125
%127 = load i32, i32* %11
%128 = add nsw i32 %127, 1
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds [10 x double], [10 x double]* %19, i64 0, i64 %129
%131 = load double, double* %130
%132 = load double, double* %16
%133 = fadd double %131, %132
%134 = fdiv double %126, %133
store double %134, double* %16
br label %135
135: ; preds = %121
%136 = load i32, i32* %11
%137 = add nsw i32 %136, -1
store i32 %137, i32* %11
br label %118
138: ; preds = %118
%139 = load double, double* %16
%140 = getelementptr inbounds [10 x double], [10 x double]* %19, i64 0, i64 0
%141 = load double, double* %140
%142 = fadd double %139, %141
store double %142, double* %16
br label %143
143: ; preds = %138, %67
br label %144
144: ; preds = %143
br label %145
145: ; preds = %144
%146 = load i32, i32* %12
%147 = add nsw i32 %146, 1
store i32 %147, i32* %12
br label %35
148: ; preds = %60, %35
%149 = load double, double* %16
%150 = load double*, double** %6
%151 = getelementptr inbounds double, double* %150, i64 0
store double %149, double* %151
%152 = load i32*, i32** %9
%153 = getelementptr inbounds i32, i32* %152, i64 0
%154 = load i32, i32* %153
%155 = add nsw i32 %154, 1
store i32 %155, i32* %153
br label %23
156: ; preds = %32
%157 = load double*, double** %6
%158 = getelementptr inbounds double, double* %157, i64 0
%159 = load double, double* %158
store double %159, double* %14
%160 = load void (...)*, void (...)** %10
%161 = load double, double* %14
%162 = getelementptr inbounds [2 x double], [2 x double]* %20, i64 0, i64 0
%163 = bitcast void (...)* %160 to void (double, double*, ...)*
%164 = getelementptr inbounds [2 x double], [2 x double]* %20, i64 0, i64 0
%165 = load double, double* %164
%166 = load double*, double** %6
%167 = getelementptr inbounds double, double* %166, i64 1
store double %165, double* %167
%168 = load double*, double** %6
%169 = getelementptr inbounds double, double* %168, i64 0
%170 = load double, double* %169
%171 = call double @llvm.fabs.f64(double %170)
%172 = fcmp ole double %171, 1.000000e+00
br i1 %172, label %173, label %174
173: ; preds = %156
store double 1.000000e-05, double* %17
br label %180
174: ; preds = %156
%175 = load double*, double** %6
%176 = getelementptr inbounds double, double* %175, i64 0
%177 = load double, double* %176
%178 = fmul double %177, 1.000000e-05
%179 = call double @llvm.fabs.f64(double %178)
store double %179, double* %17
br label %180
180: ; preds = %174, %173
%181 = load double*, double** %6
%182 = getelementptr inbounds double, double* %181, i64 0
%183 = load double, double* %182
%184 = load double, double* %17
%185 = fsub double %183, %184
store double %185, double* %14
%186 = load void (...)*, void (...)** %10
%187 = load double, double* %14
%188 = getelementptr inbounds [2 x double], [2 x double]* %20, i64 0, i64 0
%189 = bitcast void (...)* %186 to void (double, double*, ...)*
%190 = getelementptr inbounds [2 x double], [2 x double]* %20, i64 0, i64 0
%191 = load double, double* %190
store double %191, double* %15
%192 = load double*, double** %6
%193 = getelementptr inbounds double, double* %192, i64 0
%194 = load double, double* %193
%195 = load double, double* %17
%196 = fadd double %194, %195
store double %196, double* %14
%197 = load void (...)*, void (...)** %10
%198 = load double, double* %14
%199 = getelementptr inbounds [2 x double], [2 x double]* %20, i64 0, i64 0
%200 = bitcast void (...)* %197 to void (double, double*, ...)*
%201 = getelementptr inbounds [2 x double], [2 x double]* %20, i64 0, i64 0
%202 = load double, double* %201
store double %202, double* %16
%203 = load double, double* %15
%204 = load double, double* %16
%205 = fadd double %203, %204
%206 = load double*, double** %6
%207 = getelementptr inbounds double, double* %206, i64 1
%208 = load double, double* %207
%209 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %208, double %205)
%210 = fcmp ole double %209, 0.000000e+00
br i1 %210, label %211, label %214
211: ; preds = %180
%212 = load i32*, i32** %9
%213 = getelementptr inbounds i32, i32* %212, i64 1
store i32 1, i32* %213
br label %217
214: ; preds = %180
%215 = load i32*, i32** %9
%216 = getelementptr inbounds i32, i32* %215, i64 1
store i32 -1, i32* %216
br label %217
217: ; preds = %214, %211
ret void
}

LLVM IR (-O2):
define void @extremum(double* nocapture %0, double %1, i32 %2, i32* nocapture %3, void (...)* nocapture %4) {
%6 = alloca [10 x double]
%7 = alloca [10 x double]
%8 = alloca [2 x double]
%9 = bitcast [10 x double]* %6 to i8*
%10 = bitcast [10 x double]* %7 to i8*
%11 = bitcast [2 x double]* %8 to i8*
store i32 0, i32* %3
%12 = icmp sgt i32 %2, 0
br i1 %12, label %15, label %13
13: ; preds = %5
%14 = load double, double* %0
br label %107
15: ; preds = %5
%16 = getelementptr inbounds [2 x double], [2 x double]* %8, i64 0, i64 0
%17 = bitcast void (...)* %4 to void (double, double*, ...)*
%18 = getelementptr inbounds [2 x double], [2 x double]* %8, i64 0, i64 1
%19 = getelementptr inbounds [10 x double], [10 x double]* %7, i64 0, i64 0
%20 = getelementptr inbounds [10 x double], [10 x double]* %6, i64 0, i64 0
br label %21
21: ; preds = %93, %15
%22 = phi double [ undef, %15 ], [ %94, %93 ]
%23 = phi double [ undef, %15 ], [ %95, %93 ]
%24 = phi i64 [ 0, %15 ], [ %96, %93 ]
%25 = phi double [ 0.000000e+00, %15 ], [ %97, %93 ]
%26 = icmp ult i64 %24, 3
br i1 %26, label %27, label %32
27: ; preds = %21
%28 = load double, double* %0
%29 = trunc i64 %24 to i32
%30 = sitofp i32 %29 to double
%31 = call double @llvm.fmuladd.f64(double %30, double 1.000000e-02, double %28)
br label %32
32: ; preds = %21, %27
%33 = phi double [ %31, %27 ], [ %25, %21 ]
%34 = load double, double* %18
%35 = call double @llvm.fabs.f64(double %34)
%36 = fcmp olt double %35, %1
br i1 %36, label %98, label %37
37: ; preds = %32
%38 = icmp eq i64 %24, 0
br i1 %38, label %39, label %40
39: ; preds = %37
store double %34, double* %20
store double %33, double* %19
br label %88
40: ; preds = %37
%41 = getelementptr inbounds [10 x double], [10 x double]* %6, i64 0, i64 %24
store double %34, double* %41
%42 = getelementptr inbounds [10 x double], [10 x double]* %7, i64 0, i64 %24
%43 = fsub double %33, %23
%44 = call double @llvm.fabs.f64(double %43)
%45 = fcmp olt double %44, %1
br i1 %45, label %46, label %47
46: ; preds = %56, %40
store double 0x4733426172C74D82, double* %42
br label %62
47: ; preds = %40, %56
%48 = phi double [ %59, %56 ], [ %43, %40 ]
%49 = phi i64 [ %54, %56 ], [ 0, %40 ]
%50 = getelementptr inbounds [10 x double], [10 x double]* %6, i64 0, i64 %49
%51 = load double, double* %50
%52 = fsub double %34, %51
%53 = fdiv double %52, %48
store double %53, double* %42
%54 = add nuw nsw i64 %49, 1
%55 = icmp eq i64 %54, %24
br i1 %55, label %62, label %56
56: ; preds = %47
%57 = getelementptr inbounds [10 x double], [10 x double]* %7, i64 0, i64 %54
%58 = load double, double* %57
%59 = fsub double %53, %58
%60 = call double @llvm.fabs.f64(double %59)
%61 = fcmp olt double %60, %1
br i1 %61, label %46, label %47
62: ; preds = %47, %46
%63 = phi double [ 0x4733426172C74D82, %46 ], [ %53, %47 ]
%64 = add nsw i64 %24, -1
%65 = and i64 %64, 4294967295
%66 = getelementptr inbounds [10 x double], [10 x double]* %6, i64 0, i64 %65
%67 = load double, double* %66
%68 = fneg double %67
%69 = fadd double %63, 0.000000e+00
%70 = fdiv double %68, %69
%71 = icmp ugt i64 %24, 1
br i1 %71, label %72, label %85
72: ; preds = %62, %72
%73 = phi double [ %83, %72 ], [ %70, %62 ]
%74 = phi i64 [ %77, %72 ], [ %64, %62 ]
%75 = getelementptr inbounds [10 x double], [10 x double]* %7, i64 0, i64 %74
%76 = load double, double* %75
%77 = add nsw i64 %74, -1
%78 = and i64 %77, 4294967295
%79 = getelementptr inbounds [10 x double], [10 x double]* %6, i64 0, i64 %78
%80 = load double, double* %79
%81 = fneg double %80
%82 = fadd double %73, %76
%83 = fdiv double %81, %82
%84 = icmp sgt i64 %74, 1
br i1 %84, label %72, label %85
85: ; preds = %72, %62
%86 = phi double [ %70, %62 ], [ %83, %72 ]
%87 = fadd double %86, %22
br label %88
88: ; preds = %85, %39
%89 = phi double [ %33, %39 ], [ %22, %85 ]
%90 = phi double [ %33, %39 ], [ %87, %85 ]
%91 = add nuw nsw i64 %24, 1
%92 = icmp eq i64 %91, 8
br i1 %92, label %98, label %93
93: ; preds = %88, %98
%94 = phi double [ %89, %88 ], [ %99, %98 ]
%95 = phi double [ %89, %88 ], [ %100, %98 ]
%96 = phi i64 [ %91, %88 ], [ 0, %98 ]
%97 = phi double [ %90, %88 ], [ %101, %98 ]
br label %21
98: ; preds = %32, %88
%99 = phi double [ %22, %32 ], [ %89, %88 ]
%100 = phi double [ %23, %32 ], [ %89, %88 ]
%101 = phi double [ %25, %32 ], [ %90, %88 ]
%102 = xor i1 %36, true
store double %101, double* %0
%103 = load i32, i32* %3
%104 = add nsw i32 %103, 1
store i32 %104, i32* %3
%105 = icmp slt i32 %104, %2
%106 = select i1 %102, i1 %105, i1 false
br i1 %106, label %93, label %107
107: ; preds = %98, %13
%108 = phi double [ %14, %13 ], [ %101, %98 ]
%109 = bitcast void (...)* %4 to void (double, double*, ...)*
%110 = getelementptr inbounds [2 x double], [2 x double]* %8, i64 0, i64 0
%111 = load double, double* %110
%112 = getelementptr inbounds double, double* %0, i64 1
store double %111, double* %112
%113 = load double, double* %0
%114 = call double @llvm.fabs.f64(double %113)
%115 = fcmp ugt double %114, 1.000000e+00
%116 = fmul double %113, 1.000000e-05
%117 = call double @llvm.fabs.f64(double %116)
%118 = select i1 %115, double %117, double 1.000000e-05
%119 = fsub double %113, %118
%120 = load double, double* %110
%121 = load double, double* %0
%122 = fadd double %121, %118
%123 = load double, double* %110
%124 = fadd double %120, %123
%125 = load double, double* %112
%126 = call double @llvm.fmuladd.f64(double %125, double -2.000000e+00, double %124)
%127 = fcmp ugt double %126, 0.000000e+00
%128 = select i1 %127, i32 -1, i32 1
%129 = getelementptr inbounds i32, i32* %3, i64 1
store i32 %128, i32* %129
ret void
}