double solve_secant(f, c, xlo, xhi, tol, bd_flag, err) double (*f)(), c, xhi,
    xlo, tol;
int bd_flag, *err;
{
  double ylo, yhi, x1, x2, x, y1, y2, y;
  *err = 0;
  ylo = f(xlo) - c;
  yhi = f(xhi) - c;
  switch (bd_flag) {
  case 2:
    while (yhi * ylo > 0) {
      xhi += xhi - xlo;
      yhi = f(xhi) - c;
    }
    break;
  case 1:
    while (yhi * ylo > 0) {
      xlo -= xhi - xlo;
      ylo = f(xlo) - c;
    }
    break;
  case 0:
  default:
    if (yhi * ylo > 0) {
      *err = 1;
      return ((xlo + xhi) / 2);
    }
    break;
  }
  x1 = xlo;
  y1 = ylo;
  x2 = xhi;
  y2 = yhi;
  while (1) {
    x = x2 + (x1 - x2) * y2 / (y2 - y1);
    if ((x <= xlo) | (x >= xhi))
      x = (xlo + xhi) / 2;
    y = f(x) - c;
    if (fabs(y) < tol)
      return (x);
    if (y * ylo > 0) {
      xlo = x;
      ylo = y;
    } else {
      xhi = x;
      yhi = y;
    }
    if (y2 == y) {
      printf("secant: y2 %12.9f\n", y2);
      return (x);
    }
    x1 = x2;
    y1 = y2;
    x2 = x;
    y2 = y;
  }
}


x86 assembly (clang, -O0):
<solve_secant>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
movsd  %xmm2,-0x28(%rbp)
movsd  %xmm3,-0x30(%rbp)
mov    %esi,-0x34(%rbp)
mov    %rdx,-0x40(%rbp)
mov    -0x40(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rcx
movsd  -0x20(%rbp),%xmm0
mov    $0x1,%al
mov    %al,-0x85(%rbp)
call   *%rcx
mov    -0x85(%rbp),%al
movsd  -0x18(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x10(%rbp),%rcx
movsd  -0x28(%rbp),%xmm0
call   *%rcx
movsd  -0x18(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,-0x84(%rbp)
test   %eax,%eax
je     1268 <solve_secant+0x158>
jmp    119a <solve_secant+0x8a>
mov    -0x84(%rbp),%eax
sub    $0x1,%eax
je     1213 <solve_secant+0x103>
jmp    11ae <solve_secant+0x9e>
mov    -0x84(%rbp),%eax
sub    $0x2,%eax
jne    126d <solve_secant+0x15d>
jmp    11c2 <solve_secant+0xb2>
jmp    11c7 <solve_secant+0xb7>
movsd  -0x50(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    120e <solve_secant+0xfe>
movsd  -0x28(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%rcx
movsd  -0x28(%rbp),%xmm0
mov    $0x1,%al
call   *%rcx
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    11c7 <solve_secant+0xb7>
jmp    12b3 <solve_secant+0x1a3>
jmp    1218 <solve_secant+0x108>
movsd  -0x50(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1263 <solve_secant+0x153>
movsd  -0x28(%rbp),%xmm1
subsd  -0x20(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rcx
movsd  -0x20(%rbp),%xmm0
mov    $0x1,%al
call   *%rcx
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
jmp    1218 <solve_secant+0x108>
jmp    12b3 <solve_secant+0x1a3>
jmp    126d <solve_secant+0x15d>
movsd  -0x50(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    12ae <solve_secant+0x19e>
mov    -0x40(%rbp),%rax
movl   $0x1,(%rax)
movsd  -0x20(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  0xd60(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1443 <solve_secant+0x333>
jmp    12b3 <solve_secant+0x1a3>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
subsd  -0x60(%rbp),%xmm1
mulsd  -0x78(%rbp),%xmm1
movsd  -0x78(%rbp),%xmm2
subsd  -0x70(%rbp),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
movsd  -0x68(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
setae  %cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %ecx,%eax
cmp    $0x0,%eax
je     1355 <solve_secant+0x245>
movsd  -0x20(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  0xcb4(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x10(%rbp),%rcx
movsd  -0x68(%rbp),%xmm0
mov    $0x1,%al
call   *%rcx
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x80(%rbp),%xmm1
movaps 0xc98(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    139a <solve_secant+0x28a>
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1443 <solve_secant+0x333>
movsd  -0x80(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    13ca <solve_secant+0x2ba>
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
jmp    13de <solve_secant+0x2ce>
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x78(%rbp),%xmm0
ucomisd -0x80(%rbp),%xmm0
jne    1416 <solve_secant+0x306>
jp     1416 <solve_secant+0x306>
movsd  -0x78(%rbp),%xmm0
lea    0xc20(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1443 <solve_secant+0x333>
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
jmp    12db <solve_secant+0x1cb>
movsd  -0x8(%rbp),%xmm0
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solve_secant>:
push   %rbp
push   %r14
push   %rbx
sub    $0x60,%rsp
mov    %rdx,%r14
mov    %esi,%ebp
movsd  %xmm3,0x48(%rsp)
movsd  %xmm2,0x8(%rsp)
movsd  %xmm0,0x18(%rsp)
mov    %rdi,%rbx
movl   $0x0,(%rdx)
movsd  %xmm1,0x10(%rsp)
movapd %xmm1,%xmm0
mov    $0x1,%al
call   *%rdi
subsd  0x18(%rsp),%xmm0
movapd %xmm0,0x20(%rsp)
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
call   *%rbx
movapd %xmm0,%xmm5
subsd  0x18(%rsp),%xmm5
cmp    $0x2,%ebp
je     11f9 <solve_secant+0xe9>
cmp    $0x1,%ebp
jne    127a <solve_secant+0x16a>
movapd %xmm5,%xmm0
movapd 0x20(%rsp),%xmm2
mulsd  %xmm2,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
movsd  0x8(%rsp),%xmm3
movsd  0x10(%rsp),%xmm4
jbe    12c6 <solve_secant+0x1b6>
movapd %xmm5,0x30(%rsp)
cs nopw 0x0(%rax,%rax,1)
subsd  %xmm4,%xmm3
subsd  %xmm3,%xmm4
movsd  %xmm4,0x10(%rsp)
movapd %xmm4,%xmm0
mov    $0x1,%al
call   *%rbx
xorpd  %xmm1,%xmm1
movapd 0x30(%rsp),%xmm5
movsd  0x10(%rsp),%xmm4
movsd  0x8(%rsp),%xmm3
movapd %xmm0,%xmm2
subsd  0x18(%rsp),%xmm2
movapd %xmm5,%xmm0
mulsd  %xmm2,%xmm0
ucomisd %xmm1,%xmm0
ja     11b0 <solve_secant+0xa0>
jmp    12c6 <solve_secant+0x1b6>
movapd 0x20(%rsp),%xmm2
movapd %xmm2,%xmm0
mulsd  %xmm5,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    12ba <solve_secant+0x1aa>
movsd  0x8(%rsp),%xmm3
movsd  0x10(%rsp),%xmm4
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movapd %xmm3,%xmm0
subsd  %xmm4,%xmm3
addsd  %xmm0,%xmm3
movsd  %xmm3,0x8(%rsp)
movapd %xmm3,%xmm0
mov    $0x1,%al
call   *%rbx
xorpd  %xmm1,%xmm1
movapd 0x20(%rsp),%xmm2
movsd  0x10(%rsp),%xmm4
movsd  0x8(%rsp),%xmm3
movapd %xmm0,%xmm5
subsd  0x18(%rsp),%xmm5
movapd %xmm2,%xmm0
mulsd  %xmm5,%xmm0
ucomisd %xmm1,%xmm0
ja     1230 <solve_secant+0x120>
jmp    12c6 <solve_secant+0x1b6>
movapd 0x20(%rsp),%xmm2
movapd %xmm2,%xmm0
mulsd  %xmm5,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
movsd  0x8(%rsp),%xmm3
movsd  0x10(%rsp),%xmm4
jbe    12c6 <solve_secant+0x1b6>
movl   $0x1,(%r14)
addsd  %xmm3,%xmm4
mulsd  0xd4f(%rip),%xmm4
movapd %xmm4,%xmm0
jmp    1408 <solve_secant+0x2f8>
movsd  0x8(%rsp),%xmm3
movsd  0x10(%rsp),%xmm4
movapd %xmm4,%xmm0
movapd %xmm3,%xmm7
movapd %xmm2,%xmm1
jmp    1319 <solve_secant+0x209>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xorpd  %xmm2,%xmm2
cmpltsd %xmm1,%xmm2
movapd %xmm2,%xmm1
andpd  %xmm5,%xmm1
andnpd %xmm4,%xmm2
orpd   %xmm1,%xmm2
movsd  0x58(%rsp),%xmm6
ucomisd %xmm5,%xmm6
movapd %xmm0,%xmm4
movsd  0x50(%rsp),%xmm0
movapd %xmm6,%xmm1
jne    1319 <solve_secant+0x209>
jnp    13f0 <solve_secant+0x2e0>
movapd %xmm2,0x20(%rsp)
subsd  %xmm7,%xmm0
mulsd  %xmm5,%xmm0
movsd  %xmm5,0x58(%rsp)
subsd  %xmm1,%xmm5
divsd  %xmm5,%xmm0
movsd  %xmm7,0x50(%rsp)
addsd  %xmm7,%xmm0
movapd %xmm3,%xmm1
addsd  %xmm4,%xmm1
mulsd  0xcb1(%rip),%xmm1
movsd  %xmm3,0x8(%rsp)
movapd %xmm3,%xmm2
cmplesd %xmm0,%xmm2
movapd %xmm2,%xmm3
andnpd %xmm0,%xmm3
andpd  %xmm1,%xmm2
orpd   %xmm3,%xmm2
movsd  %xmm4,0x10(%rsp)
cmplesd %xmm4,%xmm0
movapd %xmm0,%xmm3
andnpd %xmm2,%xmm3
andpd  %xmm1,%xmm0
orpd   %xmm3,%xmm0
movsd  %xmm0,0x30(%rsp)
mov    $0x1,%al
call   *%rbx
movapd %xmm0,%xmm5
subsd  0x18(%rsp),%xmm5
movapd %xmm5,%xmm0
andpd  0xc67(%rip),%xmm0
movsd  0x48(%rsp),%xmm1
ucomisd %xmm0,%xmm1
ja     1402 <solve_secant+0x2f2>
movapd 0x20(%rsp),%xmm4
movapd %xmm4,%xmm1
mulsd  %xmm5,%xmm1
ucomisd 0xc3d(%rip),%xmm1
movsd  0x30(%rsp),%xmm7
movapd %xmm7,%xmm0
movsd  0x8(%rsp),%xmm3
ja     12e0 <solve_secant+0x1d0>
movapd %xmm7,%xmm3
movsd  0x10(%rsp),%xmm0
jmp    12e0 <solve_secant+0x1d0>
lea    0xc29(%rip),%rdi
movapd %xmm6,%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0x30(%rsp),%xmm0
add    $0x60,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"secant: y2 %12.9f\0A\00"
define double @solve_secant(double (...)* %0, double %1, double %2, double %3, double %4, i32 %5, i32* %6) {
%8 = alloca double
%9 = alloca double (...)*
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca i32
%15 = alloca i32*
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca double
store double (...)* %0, double (...)** %9
store double %1, double* %10
store double %2, double* %11
store double %3, double* %12
store double %4, double* %13
store i32 %5, i32* %14
store i32* %6, i32** %15
%24 = load i32*, i32** %15
store i32 0, i32* %24
%25 = load double (...)*, double (...)** %9
%26 = load double, double* %11
%27 = bitcast double (...)* %25 to double (double, ...)*
%28 = call double (double, ...) %27(double %26)
%29 = load double, double* %10
%30 = fsub double %28, %29
store double %30, double* %16
%31 = load double (...)*, double (...)** %9
%32 = load double, double* %12
%33 = bitcast double (...)* %31 to double (double, ...)*
%34 = call double (double, ...) %33(double %32)
%35 = load double, double* %10
%36 = fsub double %34, %35
store double %36, double* %17
%37 = load i32, i32* %14
switch i32 %37, label %77 [
i32 2, label %38
i32 1, label %57
i32 0, label %76
]
38: ; preds = %7
br label %39
39: ; preds = %44, %38
%40 = load double, double* %17
%41 = load double, double* %16
%42 = fmul double %40, %41
%43 = fcmp ogt double %42, 0.000000e+00
br i1 %43, label %44, label %56
44: ; preds = %39
%45 = load double, double* %12
%46 = load double, double* %11
%47 = fsub double %45, %46
%48 = load double, double* %12
%49 = fadd double %48, %47
store double %49, double* %12
%50 = load double (...)*, double (...)** %9
%51 = load double, double* %12
%52 = bitcast double (...)* %50 to double (double, ...)*
%53 = call double (double, ...) %52(double %51)
%54 = load double, double* %10
%55 = fsub double %53, %54
store double %55, double* %17
br label %39
56: ; preds = %39
br label %89
57: ; preds = %7
br label %58
58: ; preds = %63, %57
%59 = load double, double* %17
%60 = load double, double* %16
%61 = fmul double %59, %60
%62 = fcmp ogt double %61, 0.000000e+00
br i1 %62, label %63, label %75
63: ; preds = %58
%64 = load double, double* %12
%65 = load double, double* %11
%66 = fsub double %64, %65
%67 = load double, double* %11
%68 = fsub double %67, %66
store double %68, double* %11
%69 = load double (...)*, double (...)** %9
%70 = load double, double* %11
%71 = bitcast double (...)* %69 to double (double, ...)*
%72 = call double (double, ...) %71(double %70)
%73 = load double, double* %10
%74 = fsub double %72, %73
store double %74, double* %16
br label %58
75: ; preds = %58
br label %89
76: ; preds = %7
br label %77
77: ; preds = %7, %76
%78 = load double, double* %17
%79 = load double, double* %16
%80 = fmul double %78, %79
%81 = fcmp ogt double %80, 0.000000e+00
br i1 %81, label %82, label %88
82: ; preds = %77
%83 = load i32*, i32** %15
store i32 1, i32* %83
%84 = load double, double* %11
%85 = load double, double* %12
%86 = fadd double %84, %85
%87 = fdiv double %86, 2.000000e+00
store double %87, double* %8
br label %158
88: ; preds = %77
br label %89
89: ; preds = %88, %75, %56
%90 = load double, double* %11
store double %90, double* %18
%91 = load double, double* %16
store double %91, double* %21
%92 = load double, double* %12
store double %92, double* %19
%93 = load double, double* %17
store double %93, double* %22
br label %94
94: ; preds = %89, %153
%95 = load double, double* %19
%96 = load double, double* %18
%97 = load double, double* %19
%98 = fsub double %96, %97
%99 = load double, double* %22
%100 = fmul double %98, %99
%101 = load double, double* %22
%102 = load double, double* %21
%103 = fsub double %101, %102
%104 = fdiv double %100, %103
%105 = fadd double %95, %104
store double %105, double* %20
%106 = load double, double* %20
%107 = load double, double* %11
%108 = fcmp ole double %106, %107
%109 = zext i1 %108 to i32
%110 = load double, double* %20
%111 = load double, double* %12
%112 = fcmp oge double %110, %111
%113 = zext i1 %112 to i32
%114 = or i32 %109, %113
%115 = icmp ne i32 %114, 0
br i1 %115, label %116, label %121
116: ; preds = %94
%117 = load double, double* %11
%118 = load double, double* %12
%119 = fadd double %117, %118
%120 = fdiv double %119, 2.000000e+00
store double %120, double* %20
br label %121
121: ; preds = %116, %94
%122 = load double (...)*, double (...)** %9
%123 = load double, double* %20
%124 = bitcast double (...)* %122 to double (double, ...)*
%125 = call double (double, ...) %124(double %123)
%126 = load double, double* %10
%127 = fsub double %125, %126
store double %127, double* %23
%128 = load double, double* %23
%129 = call double @llvm.fabs.f64(double %128)
%130 = load double, double* %13
%131 = fcmp olt double %129, %130
br i1 %131, label %132, label %134
132: ; preds = %121
%133 = load double, double* %20
store double %133, double* %8
br label %158
134: ; preds = %121
%135 = load double, double* %23
%136 = load double, double* %16
%137 = fmul double %135, %136
%138 = fcmp ogt double %137, 0.000000e+00
br i1 %138, label %139, label %142
139: ; preds = %134
%140 = load double, double* %20
store double %140, double* %11
%141 = load double, double* %23
store double %141, double* %16
br label %145
142: ; preds = %134
%143 = load double, double* %20
store double %143, double* %12
%144 = load double, double* %23
store double %144, double* %17
br label %145
145: ; preds = %142, %139
%146 = load double, double* %22
%147 = load double, double* %23
%148 = fcmp oeq double %146, %147
br i1 %148, label %149, label %153
149: ; preds = %145
%150 = load double, double* %22
%151 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double %150)
%152 = load double, double* %20
store double %152, double* %8
br label %158
153: ; preds = %145
%154 = load double, double* %19
store double %154, double* %18
%155 = load double, double* %22
store double %155, double* %21
%156 = load double, double* %20
store double %156, double* %19
%157 = load double, double* %23
store double %157, double* %22
br label %94
158: ; preds = %149, %132, %82
%159 = load double, double* %8
ret double %159
}

LLVM IR (-O2):
@.str = [19 x i8] c"secant: y2 %12.9f\0A\00"
define double @solve_secant(double (...)* nocapture %0, double %1, double %2, double %3, double %4, i32 %5, i32* nocapture writeonly %6) {
store i32 0, i32* %6
%8 = bitcast double (...)* %0 to double (double, ...)*
%9 = tail call double (double, ...) %8(double %2)
%10 = fsub double %9, %1
%11 = tail call double (double, ...) %8(double %3)
%12 = fsub double %11, %1
switch i32 %5, label %35 [
i32 2, label %16
i32 1, label %13
]
13: ; preds = %7
%14 = fmul double %12, %10
%15 = fcmp ogt double %14, 0.000000e+00
br i1 %15, label %27, label %38
16: ; preds = %7
%17 = fmul double %10, %12
%18 = fcmp ogt double %17, 0.000000e+00
br i1 %18, label %19, label %38
19: ; preds = %16, %19
%20 = phi double [ %22, %19 ], [ %3, %16 ]
%21 = fsub double %20, %2
%22 = fadd double %20, %21
%23 = tail call double (double, ...) %8(double %22)
%24 = fsub double %23, %1
%25 = fmul double %10, %24
%26 = fcmp ogt double %25, 0.000000e+00
br i1 %26, label %19, label %38
27: ; preds = %13, %27
%28 = phi double [ %30, %27 ], [ %2, %13 ]
%29 = fsub double %3, %28
%30 = fsub double %28, %29
%31 = tail call double (double, ...) %8(double %30)
%32 = fsub double %31, %1
%33 = fmul double %12, %32
%34 = fcmp ogt double %33, 0.000000e+00
br i1 %34, label %27, label %38
35: ; preds = %7
%36 = fmul double %10, %12
%37 = fcmp ogt double %36, 0.000000e+00
br i1 %37, label %43, label %38
38: ; preds = %27, %19, %13, %16, %35
%39 = phi double [ %2, %13 ], [ %2, %16 ], [ %2, %35 ], [ %2, %19 ], [ %30, %27 ]
%40 = phi double [ %3, %13 ], [ %3, %16 ], [ %3, %35 ], [ %22, %19 ], [ %3, %27 ]
%41 = phi double [ %10, %13 ], [ %10, %16 ], [ %10, %35 ], [ %10, %19 ], [ %32, %27 ]
%42 = phi double [ %12, %13 ], [ %12, %16 ], [ %12, %35 ], [ %24, %19 ], [ %12, %27 ]
br label %46
43: ; preds = %35
store i32 1, i32* %6
%44 = fadd double %2, %3
%45 = fmul double %44, 5.000000e-01
br label %78
46: ; preds = %38, %69
%47 = phi double [ %72, %69 ], [ %40, %38 ]
%48 = phi double [ %73, %69 ], [ %39, %38 ]
%49 = phi double [ %74, %69 ], [ %41, %38 ]
%50 = phi double [ %51, %69 ], [ %39, %38 ]
%51 = phi double [ %64, %69 ], [ %40, %38 ]
%52 = phi double [ %53, %69 ], [ %41, %38 ]
%53 = phi double [ %66, %69 ], [ %42, %38 ]
%54 = fsub double %50, %51
%55 = fmul double %54, %53
%56 = fsub double %53, %52
%57 = fdiv double %55, %56
%58 = fadd double %51, %57
%59 = fcmp ole double %58, %48
%60 = fcmp oge double %58, %47
%61 = or i1 %59, %60
%62 = fadd double %47, %48
%63 = fmul double %62, 5.000000e-01
%64 = select i1 %61, double %63, double %58
%65 = tail call double (double, ...) %8(double %64)
%66 = fsub double %65, %1
%67 = tail call double @llvm.fabs.f64(double %66)
%68 = fcmp olt double %67, %4
br i1 %68, label %78, label %69
69: ; preds = %46
%70 = fmul double %49, %66
%71 = fcmp ogt double %70, 0.000000e+00
%72 = select i1 %71, double %47, double %64
%73 = select i1 %71, double %64, double %48
%74 = select i1 %71, double %66, double %49
%75 = fcmp oeq double %53, %66
br i1 %75, label %76, label %46
76: ; preds = %69
%77 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double %53)
br label %78
78: ; preds = %46, %76, %43
%79 = phi double [ %45, %43 ], [ %64, %76 ], [ %64, %46 ]
ret double %79
}