#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 M_PI;
double fabs(double);
double pow(double, double);
double sqrt(int);
double bondi_newt_solve(double Mdot, double GM, double r, double gam,
                        double rho0, double a0, double K) {
  double u0, u, umin, umax, u1, du, f, df;
  double TOL = 1.0e-6;
  int MAX_ITER = 100;
  double rhoFac = -Mdot / (4 * M_PI * r * r);
  double a2Fac = gam * K;
  double Vr = -GM / r;
  double C = a0 * a0 / (gam - 1.0);
  double rs = (5 - 3 * gam) * GM / (4 * a0 * a0);
  double as = a0 * sqrt(2 / (5 - 3 * gam));
  if (r > rs) {
    umin = -as;
    umax = 0.0;
    u0 = -Mdot / (4 * M_PI * r * r *
                  pow((gam - 1) * (C - Vr) / (K * gam), 1.0 / (gam - 1.0)));
  } else {
    umin = -1e100;
    umax = -as;
    u0 = -sqrt(2 * (C - Vr));
  }
  u1 = u0;
  int i = 0;
  do {
    u = u1;
    double rho = rhoFac / u;
    double drho = -rho / u;
    double a2 = a2Fac * pow(rho, gam - 1.0);
    double da2 = (gam - 1.0) * a2 / rho * drho;
    f = 0.5 * u * u + a2 / (gam - 1.0) + Vr - C;
    df = u + da2 / (gam - 1.0);
    du = -f / df;
    u1 = u + du;
    if (u1 < umin)
      u1 = 0.5 * (umin + u);
    else if (u1 > umax)
      u1 = 0.5 * (umax + u);
    i++;
  } while (fabs(du) > TOL && i < MAX_ITER);
  return u1;
}


x86 assembly (clang, -O0):
<bondi_newt_solve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  %xmm6,-0x38(%rbp)
movsd  0xed2(%rip),%xmm0
movsd  %xmm0,-0x80(%rbp)
movl   $0x64,-0x84(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    0x2e60(%rip),%rax
mov    (%rax),%eax
shl    $0x2,%eax
cvtsi2sd %eax,%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  0xe27(%rip),%xmm2
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
movsd  0xdf2(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdee(%rip),%xmm1
addsd  %xmm1,%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xde5(%rip),%xmm1
mulsd  -0x30(%rbp),%xmm1
mulsd  -0x30(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0x20(%rbp),%xmm1
movsd  0xda5(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xda1(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xd85(%rip),%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0xe8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
ucomisd -0xb0(%rbp),%xmm0
ff
jbe    139e <bondi_newt_solve+0x27e>
movsd  -0xb8(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x50(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0xf0(%rbp)
ff
mov    0x2cdf(%rip),%rax
mov    (%rax),%eax
shl    $0x2,%eax
cvtsi2sd %eax,%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0xf8(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
movsd  0xcef(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  -0xa8(%rbp),%xmm1
ff
subsd  -0xa0(%rbp),%xmm1
ff
mulsd  %xmm1,%xmm0
movsd  -0x38(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  0xcbc(%rip),%xmm1
subsd  %xmm1,%xmm2
movsd  0xcb0(%rip),%xmm1
divsd  %xmm2,%xmm1
call   1030 <pow@plt>
movsd  -0xf8(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0xf0(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    1410 <bondi_newt_solve+0x2f0>
movsd  0xc8a(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0xb8(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0xa8(%rbp),%xmm1
ff
subsd  -0xa0(%rbp),%xmm1
ff
movsd  0xc19(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <sqrt@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movl   $0x0,-0xbc(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x90(%rbp),%xmm0
ff
divsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0xc8(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
divsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0x100(%rbp)
ff
movsd  -0xc8(%rbp),%xmm0
ff
movsd  -0x20(%rbp),%xmm1
movsd  0xb8c(%rip),%xmm2
subsd  %xmm2,%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x100(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
movsd  0xb5f(%rip),%xmm1
subsd  %xmm1,%xmm0
mulsd  -0xd8(%rbp),%xmm0
ff
divsd  -0xc8(%rbp),%xmm0
ff
mulsd  -0xd0(%rbp),%xmm0
ff
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  0xb4b(%rip),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0xd8(%rbp),%xmm1
ff
movsd  -0x20(%rbp),%xmm3
movsd  0xb14(%rip),%xmm4
subsd  %xmm4,%xmm3
divsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0xa0(%rbp),%xmm0
ff
subsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0x70(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  -0xe0(%rbp),%xmm1
ff
movsd  -0x20(%rbp),%xmm2
movsd  0xad5(%rip),%xmm3
subsd  %xmm3,%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x70(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
divsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x48(%rbp),%xmm0
addsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    15c5 <bondi_newt_solve+0x4a5>
movsd  -0x50(%rbp),%xmm1
addsd  -0x48(%rbp),%xmm1
movsd  0xa81(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
jmp    15f5 <bondi_newt_solve+0x4d5>
movsd  -0x60(%rbp),%xmm0
ucomisd -0x58(%rbp),%xmm0
jbe    15f0 <bondi_newt_solve+0x4d0>
movsd  -0x58(%rbp),%xmm1
addsd  -0x48(%rbp),%xmm1
movsd  0xa51(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
jmp    15f5 <bondi_newt_solve+0x4d5>
mov    -0xbc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xbc(%rbp)
movsd  -0x68(%rbp),%xmm0
movaps 0xa30(%rip),%xmm1
pand   %xmm1,%xmm0
xor    %eax,%eax
ucomisd -0x80(%rbp),%xmm0
mov    %al,-0x101(%rbp)
jbe    163c <bondi_newt_solve+0x51c>
mov    -0xbc(%rbp),%eax
cmp    -0x84(%rbp),%eax
setl   %al
mov    %al,-0x101(%rbp)
mov    -0x101(%rbp),%al
test   $0x1,%al
jne    1424 <bondi_newt_solve+0x304>
movsd  -0x60(%rbp),%xmm0
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bondi_newt_solve>:
push   %rbx
sub    $0x90,%rsp
movsd  %xmm2,0x10(%rsp)
movapd 0xeca(%rip),%xmm4
xorpd  %xmm4,%xmm0
movapd %xmm0,0x30(%rsp)
mov    0x2ea1(%rip),%rbx
mov    (%rbx),%eax
shl    $0x2,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  %xmm2,%xmm0
mulsd  %xmm2,%xmm0
movsd  %xmm0,0x70(%rsp)
mulsd  %xmm3,%xmm6
movsd  %xmm6,0x28(%rsp)
movapd %xmm1,%xmm0
xorpd  %xmm4,%xmm0
divsd  %xmm2,%xmm0
movapd %xmm0,0x80(%rsp)
movsd  %xmm5,0x60(%rsp)
movapd %xmm5,%xmm0
mulsd  %xmm5,%xmm0
movsd  0xe8a(%rip),%xmm2
addsd  %xmm3,%xmm2
movsd  %xmm2,0x8(%rsp)
mulsd  0xe80(%rip),%xmm3
divsd  %xmm2,%xmm0
movsd  %xmm0,0x20(%rsp)
addsd  0xe76(%rip),%xmm3
mulsd  %xmm3,%xmm1
movsd  0xe72(%rip),%xmm0
mulsd  %xmm5,%xmm0
mulsd  %xmm5,%xmm0
divsd  %xmm0,%xmm1
movapd %xmm1,0x50(%rsp)
movsd  0xe60(%rip),%xmm0
divsd  %xmm3,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <sqrt@plt>
movsd  0x8(%rsp),%xmm4
movapd 0x80(%rsp),%xmm3
movsd  0x10(%rsp),%xmm2
movsd  0x28(%rsp),%xmm1
movsd  0x20(%rsp),%xmm5
ucomisd 0x50(%rsp),%xmm2
xorpd  0xde4(%rip),%xmm0
mulsd  0x60(%rsp),%xmm0
movapd %xmm0,0x40(%rsp)
jbe    1284 <bondi_newt_solve+0x164>
mov    (%rbx),%eax
shl    $0x2,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  %xmm2,%xmm0
mulsd  %xmm2,%xmm0
movsd  %xmm0,0x10(%rsp)
movapd %xmm5,%xmm0
subsd  %xmm3,%xmm0
mulsd  %xmm4,%xmm0
divsd  %xmm1,%xmm0
movsd  0xdf4(%rip),%xmm1
divsd  %xmm4,%xmm1
call   1030 <pow@plt>
mulsd  0x10(%rsp),%xmm0
movapd 0x30(%rsp),%xmm3
movapd %xmm3,%xmm2
divsd  %xmm0,%xmm2
xorpd  %xmm0,%xmm0
movsd  %xmm0,(%rsp)
jmp    12c3 <bondi_newt_solve+0x1a3>
movapd %xmm5,%xmm1
subsd  %xmm3,%xmm1
addsd  %xmm1,%xmm1
cvttsd2si %xmm1,%edi
call   1040 <sqrt@plt>
movapd %xmm0,%xmm2
xorpd  0xd5b(%rip),%xmm2
movaps 0x40(%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0xd91(%rip),%xmm0
movapd %xmm0,0x40(%rsp)
movapd 0x30(%rsp),%xmm3
divsd  0x70(%rsp),%xmm3
xor    %ebx,%ebx
movapd %xmm2,%xmm6
movsd  0x8(%rsp),%xmm1
movapd %xmm3,0x30(%rsp)
nopl   0x0(%rax,%rax,1)
movapd %xmm6,0x10(%rsp)
movapd %xmm2,0x70(%rsp)
divsd  %xmm2,%xmm3
movapd %xmm3,0x60(%rsp)
movapd %xmm3,%xmm2
movapd 0xcfe(%rip),%xmm0
xorpd  %xmm0,%xmm2
movapd %xmm2,0x50(%rsp)
movapd %xmm3,%xmm0
call   1030 <pow@plt>
movapd 0x10(%rsp),%xmm6
movsd  0xd35(%rip),%xmm5
movapd 0x70(%rsp),%xmm4
movsd  0x8(%rsp),%xmm1
mulsd  0x28(%rsp),%xmm0
movapd %xmm1,%xmm2
mulsd  %xmm0,%xmm2
movapd 0x50(%rsp),%xmm3
unpcklpd %xmm2,%xmm3
movapd %xmm4,%xmm2
unpcklpd 0x60(%rsp),%xmm2
divpd  %xmm2,%xmm3
movapd %xmm3,%xmm2
unpckhpd %xmm3,%xmm2
mulsd  %xmm3,%xmm2
movapd %xmm4,%xmm3
mulsd  %xmm5,%xmm3
divsd  %xmm1,%xmm0
mulsd  %xmm4,%xmm3
addsd  %xmm0,%xmm3
addsd  0x80(%rsp),%xmm3
subsd  0x20(%rsp),%xmm3
divsd  %xmm1,%xmm2
addsd  %xmm4,%xmm2
xorpd  0xc6c(%rip),%xmm3
divsd  %xmm2,%xmm3
addsd  %xmm3,%xmm6
movapd 0x40(%rsp),%xmm0
ucomisd %xmm6,%xmm0
jbe    13b0 <bondi_newt_solve+0x290>
addsd  %xmm0,%xmm4
jmp    13bc <bondi_newt_solve+0x29c>
xchg   %ax,%ax
ucomisd (%rsp),%xmm6
jbe    13c4 <bondi_newt_solve+0x2a4>
addsd  (%rsp),%xmm4
mulsd  %xmm5,%xmm4
movapd %xmm4,%xmm6
andpd  0xc44(%rip),%xmm3
ucomisd 0xc8c(%rip),%xmm3
movapd 0x30(%rsp),%xmm3
jbe    13ee <bondi_newt_solve+0x2ce>
lea    0x1(%rbx),%eax
movapd %xmm6,%xmm2
cmp    $0x63,%ebx
mov    %eax,%ebx
jb     12e0 <bondi_newt_solve+0x1c0>
movapd %xmm6,%xmm0
add    $0x90,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@M_PI = global i32 0
define double @bondi_newt_solve(double %0, double %1, double %2, double %3, double %4, double %5, double %6) {
%8 = fneg double %0
%9 = load i32, i32* @M_PI
%10 = shl nsw i32 %9, 2
%11 = sitofp i32 %10 to double
%12 = fmul double %11, %2
%13 = fmul double %12, %2
%14 = fdiv double %8, %13
%15 = fmul double %3, %6
%16 = fneg double %1
%17 = fdiv double %16, %2
%18 = fmul double %5, %5
%19 = fadd double %3, -1.000000e+00
%20 = fdiv double %18, %19
%21 = tail call double @llvm.fmuladd.f64(double %3, double -3.000000e+00, double 5.000000e+00)
%22 = fmul double %21, %1
%23 = fmul double %5, 4.000000e+00
%24 = fmul double %23, %5
%25 = fdiv double %22, %24
%26 = fdiv double 2.000000e+00, %21
%27 = fptosi double %26 to i32
%28 = tail call double @sqrt(i32 %27)
%29 = fcmp olt double %25, %2
%30 = fneg double %28
%31 = fmul double %30, %5
br i1 %29, label %32, label %45
32: ; preds = %7
%33 = load i32, i32* @M_PI
%34 = shl nsw i32 %33, 2
%35 = sitofp i32 %34 to double
%36 = fmul double %35, %2
%37 = fmul double %36, %2
%38 = fsub double %20, %17
%39 = fmul double %19, %38
%40 = fdiv double %39, %15
%41 = fdiv double 1.000000e+00, %19
%42 = tail call double @pow(double %40, double %41)
%43 = fmul double %42, %37
%44 = fdiv double %8, %43
br label %51
45: ; preds = %7
%46 = fsub double %20, %17
%47 = fmul double %46, 2.000000e+00
%48 = fptosi double %47 to i32
%49 = tail call double @sqrt(i32 %48)
%50 = fneg double %49
br label %51
51: ; preds = %45, %32
%52 = phi double [ 0.000000e+00, %32 ], [ %31, %45 ]
%53 = phi double [ %31, %32 ], [ -1.000000e+100, %45 ]
%54 = phi double [ %44, %32 ], [ %50, %45 ]
br label %55
55: ; preds = %90, %51
%56 = phi i32 [ 0, %51 ], [ %92, %90 ]
%57 = phi double [ %54, %51 ], [ %91, %90 ]
%58 = fdiv double %14, %57
%59 = fneg double %58
%60 = tail call double @pow(double %58, double %19)
%61 = fmul double %15, %60
%62 = fmul double %19, %61
%63 = insertelement <2 x double> poison, double %59, i64 0
%64 = insertelement <2 x double> %63, double %62, i64 1
%65 = insertelement <2 x double> poison, double %57, i64 0
%66 = insertelement <2 x double> %65, double %58, i64 1
%67 = fdiv <2 x double> %64, %66
%68 = shufflevector <2 x double> %67, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%69 = fmul <2 x double> %67, %68
%70 = extractelement <2 x double> %69, i64 0
%71 = fmul double %57, 5.000000e-01
%72 = fdiv double %61, %19
%73 = tail call double @llvm.fmuladd.f64(double %71, double %57, double %72)
%74 = fadd double %17, %73
%75 = fsub double %74, %20
%76 = fdiv double %70, %19
%77 = fadd double %57, %76
%78 = fneg double %75
%79 = fdiv double %78, %77
%80 = fadd double %57, %79
%81 = fcmp olt double %80, %53
br i1 %81, label %82, label %85
82: ; preds = %55
%83 = fadd double %53, %57
%84 = fmul double %83, 5.000000e-01
br label %90
85: ; preds = %55
%86 = fcmp ogt double %80, %52
br i1 %86, label %87, label %90
87: ; preds = %85
%88 = fadd double %52, %57
%89 = fmul double %88, 5.000000e-01
br label %90
90: ; preds = %85, %87, %82
%91 = phi double [ %84, %82 ], [ %89, %87 ], [ %80, %85 ]
%92 = add nuw nsw i32 %56, 1
%93 = tail call double @llvm.fabs.f64(double %79)
%94 = fcmp ogt double %93, 0x3EB0C6F7A0B5ED8D
%95 = icmp ult i32 %56, 99
%96 = select i1 %94, i1 %95, i1 false
br i1 %96, label %55, label %97
97: ; preds = %90
ret double %91
}