double erd__dsqmin_line_segments(double xp0, double yp0, double zp0, double xp1,
                                 double yp1, double zp1, double xq0, double yq0,
                                 double zq0, double xq1, double yq1,
                                 double zq1) {
  const double xu = xp1 - xp0;
  const double yu = yp1 - yp0;
  const double zu = zp1 - zp0;
  const double xv = xq1 - xq0;
  const double yv = yq1 - yq0;
  const double zv = zq1 - zq0;
  const double xw = xp0 - xq0;
  const double yw = yp0 - yq0;
  const double zw = zp0 - zq0;
  const double udotu = xu * xu + yu * yu + zu * zu;
  const double vdotv = xv * xv + yv * yv + zv * zv;
  double xc, yc, zc;
  if (udotu < 1.0e-12 && vdotv < 1.0e-12) {
    return xw * xw + yw * yw + zw * zw;
  } else if (udotu < 1.0e-12) {
    const double vdotw = xv * xw + yv * yw + zv * zw;
    if (vdotw < 0.0) {
      return xw * xw + yw * yw + zw * zw;
    } else if (vdotw > vdotv) {
      xc = xw - xv;
      yc = yw - yv;
      zc = zw - zv;
    } else {
      const double tc = vdotw / vdotv;
      xc = xw - tc * xv;
      yc = yw - tc * yv;
      zc = zw - tc * zv;
    }
  } else if (vdotv < 1.0e-12) {
    const double udotw = -(xu * xw + yu * yw + zu * zw);
    if (udotw < 0.0) {
      return xw * xw + yw * yw + zw * zw;
    } else if (udotw > udotu) {
      xc = xw + xu;
      yc = yw + yu;
      zc = zw + zu;
    } else {
      const double sc = udotw / udotu;
      xc = xw + sc * xu;
      yc = yw + sc * yu;
      zc = zw + sc * zu;
    }
  } else {
    const double udotv = xu * xv + yu * yv + zu * zv;
    const double udotw = xu * xw + yu * yw + zu * zw;
    const double vdotw = xv * xw + yv * yw + zv * zw;
    const double denom = udotu * vdotv - udotv * udotv;
    double sn, sd, tn, td;
    if (denom < 1.0e-12) {
      sn = 0.0;
      sd = 1.0;
      tn = vdotw;
      td = vdotv;
    } else {
      sn = udotv * vdotw - vdotv * udotw;
      sd = denom;
      if (sn < 0.0) {
        sn = 0.0;
        tn = vdotw;
        td = denom;
      } else if (sn > denom) {
        sn = denom;
        sd = denom;
        tn = vdotw + udotv;
        td = vdotv;
      } else {
        tn = udotu * vdotw - udotv * udotw;
        td = denom;
      }
    }
    if (tn < 0.0) {
      tn = 0.0;
      sn = -udotw;
      if (sn < 0.0) {
        sn = 0.0;
      } else if (sn > udotu) {
        sn = sd;
      } else {
        sn = -udotw;
        sd = udotu;
      }
    } else if (tn > td) {
      tn = td;
      sn = udotv - udotw;
      if (sn < 0.0) {
        sn = 0.0;
      } else if (sn > udotu) {
        sn = sd;
      } else {
        sd = udotu;
      }
    }
    const double sc = sn / sd;
    const double tc = tn / td;
    xc = xw + sc * xu - tc * xv;
    yc = yw + sc * yu - tc * yv;
    zc = zw + sc * zu - tc * zv;
  }
  return xc * xc + yc * yc + zc * zc;
}


x86 assembly (clang, -O0):
<erd__dsqmin_line_segments>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa8,%rsp
movsd  0x28(%rbp),%xmm8
movsd  0x20(%rbp),%xmm8
movsd  0x18(%rbp),%xmm8
movsd  0x10(%rbp),%xmm8
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  %xmm4,-0x30(%rbp)
movsd  %xmm5,-0x38(%rbp)
movsd  %xmm6,-0x40(%rbp)
movsd  %xmm7,-0x48(%rbp)
movsd  -0x28(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x30(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x38(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0x18(%rbp),%xmm0
subsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0x20(%rbp),%xmm0
subsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  0x28(%rbp),%xmm0
subsd  0x10(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
subsd  0x10(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x50(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm0
mulsd  -0x58(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x60(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x68(%rbp),%xmm1
movsd  -0x68(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm0
mulsd  -0x70(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x78(%rbp),%xmm0
movsd  -0x78(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  0xdb4(%rip),%xmm0
ucomisd -0x98(%rbp),%xmm0
ff
jbe    12b4 <erd__dsqmin_line_segments+0x1b4>
movsd  0xd9e(%rip),%xmm0
ucomisd -0xa0(%rbp),%xmm0
ff
jbe    12b4 <erd__dsqmin_line_segments+0x1b4>
movsd  -0x80(%rbp),%xmm1
movsd  -0x80(%rbp),%xmm2
movsd  -0x88(%rbp),%xmm0
ff
mulsd  -0x88(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x90(%rbp),%xmm0
ff
movsd  -0x90(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1bb7 <erd__dsqmin_line_segments+0xab7>
movsd  0xd44(%rip),%xmm0
ucomisd -0x98(%rbp),%xmm0
ff
jbe    1485 <erd__dsqmin_line_segments+0x385>
movsd  -0x68(%rbp),%xmm1
movsd  -0x80(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm0
mulsd  -0x88(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x78(%rbp),%xmm0
movsd  -0x90(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
xorps  %xmm0,%xmm0
ucomisd -0xc0(%rbp),%xmm0
ff
jbe    135b <erd__dsqmin_line_segments+0x25b>
movsd  -0x80(%rbp),%xmm1
movsd  -0x80(%rbp),%xmm2
movsd  -0x88(%rbp),%xmm0
ff
mulsd  -0x88(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x90(%rbp),%xmm0
ff
movsd  -0x90(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1bb7 <erd__dsqmin_line_segments+0xab7>
movsd  -0xc0(%rbp),%xmm0
ff
ucomisd -0xa0(%rbp),%xmm0
ff
jbe    13b2 <erd__dsqmin_line_segments+0x2b2>
movsd  -0x80(%rbp),%xmm0
subsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
subsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
subsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
jmp    147b <erd__dsqmin_line_segments+0x37b>
movsd  -0xc0(%rbp),%xmm0
ff
divsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x80(%rbp),%xmm1
movsd  -0xc8(%rbp),%xmm0
ff
movsd  -0x68(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x88(%rbp),%xmm1
ff
movsd  -0xc8(%rbp),%xmm0
ff
movsd  -0x70(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x90(%rbp),%xmm1
ff
movsd  -0xc8(%rbp),%xmm0
ff
movsd  -0x78(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
jmp    1480 <erd__dsqmin_line_segments+0x380>
jmp    1b6d <erd__dsqmin_line_segments+0xa6d>
movsd  0xb73(%rip),%xmm0
ucomisd -0xa0(%rbp),%xmm0
ff
jbe    1628 <erd__dsqmin_line_segments+0x528>
movsd  -0x50(%rbp),%xmm1
movsd  -0x80(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm0
mulsd  -0x88(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x60(%rbp),%xmm0
movsd  -0x90(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
xorps  %xmm0,%xmm0
ucomisd -0xd0(%rbp),%xmm0
ff
jbe    1543 <erd__dsqmin_line_segments+0x443>
movsd  -0x80(%rbp),%xmm1
movsd  -0x80(%rbp),%xmm2
movsd  -0x88(%rbp),%xmm0
ff
mulsd  -0x88(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x90(%rbp),%xmm0
ff
movsd  -0x90(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1bb7 <erd__dsqmin_line_segments+0xab7>
movsd  -0xd0(%rbp),%xmm0
ff
ucomisd -0x98(%rbp),%xmm0
ff
jbe    159a <erd__dsqmin_line_segments+0x49a>
movsd  -0x80(%rbp),%xmm0
addsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
addsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
addsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
jmp    161e <erd__dsqmin_line_segments+0x51e>
movsd  -0xd0(%rbp),%xmm0
ff
divsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0x80(%rbp),%xmm1
movsd  -0xd8(%rbp),%xmm0
ff
movsd  -0x50(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x88(%rbp),%xmm1
ff
movsd  -0xd8(%rbp),%xmm0
ff
movsd  -0x58(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x90(%rbp),%xmm1
movsd  -0xd8(%rbp),%xmm0
ff
movsd  -0x60(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
jmp    1623 <erd__dsqmin_line_segments+0x523>
jmp    1b68 <erd__dsqmin_line_segments+0xa68>
movsd  -0x50(%rbp),%xmm1
movsd  -0x68(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm0
mulsd  -0x70(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x60(%rbp),%xmm0
movsd  -0x78(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0x50(%rbp),%xmm1
movsd  -0x80(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm0
mulsd  -0x88(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x60(%rbp),%xmm0
movsd  -0x90(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0x68(%rbp),%xmm1
movsd  -0x80(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm0
mulsd  -0x88(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x78(%rbp),%xmm0
movsd  -0x90(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
movsd  -0xa0(%rbp),%xmm2
ff
movsd  -0xe0(%rbp),%xmm1
ff
mulsd  -0xe0(%rbp),%xmm1
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xf8(%rbp)
ff
movsd  0x8db(%rip),%xmm0
ucomisd -0xf8(%rbp),%xmm0
ff
jbe    1773 <erd__dsqmin_line_segments+0x673>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x100(%rbp)
ff
movsd  0x8c2(%rip),%xmm0
movsd  %xmm0,-0x108(%rbp)
ff
movsd  -0xf0(%rbp),%xmm0
ff
movsd  %xmm0,-0x110(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0x118(%rbp)
ff
jmp    18cf <erd__dsqmin_line_segments+0x7cf>
movsd  -0xe0(%rbp),%xmm0
ff
movsd  -0xf0(%rbp),%xmm2
ff
movsd  -0xa0(%rbp),%xmm1
ff
mulsd  -0xe8(%rbp),%xmm1
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x100(%rbp)
ff
movsd  -0xf8(%rbp),%xmm0
ff
movsd  %xmm0,-0x108(%rbp)
ff
xorps  %xmm0,%xmm0
ucomisd -0x100(%rbp),%xmm0
ff
jbe    180b <erd__dsqmin_line_segments+0x70b>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x100(%rbp)
ff
movsd  -0xf0(%rbp),%xmm0
ff
movsd  %xmm0,-0x110(%rbp)
ff
movsd  -0xf8(%rbp),%xmm0
ff
movsd  %xmm0,-0x118(%rbp)
ff
jmp    18ca <erd__dsqmin_line_segments+0x7ca>
movsd  -0x100(%rbp),%xmm0
ff
ucomisd -0xf8(%rbp),%xmm0
ff
jbe    186e <erd__dsqmin_line_segments+0x76e>
movsd  -0xf8(%rbp),%xmm0
ff
movsd  %xmm0,-0x100(%rbp)
ff
movsd  -0xf8(%rbp),%xmm0
ff
movsd  %xmm0,-0x108(%rbp)
ff
movsd  -0xf0(%rbp),%xmm0
ff
addsd  -0xe0(%rbp),%xmm0
ff
movsd  %xmm0,-0x110(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0x118(%rbp)
ff
jmp    18c5 <erd__dsqmin_line_segments+0x7c5>
movsd  -0x98(%rbp),%xmm0
ff
movsd  -0xf0(%rbp),%xmm2
ff
movsd  -0xe0(%rbp),%xmm1
ff
mulsd  -0xe8(%rbp),%xmm1
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x110(%rbp)
ff
movsd  -0xf8(%rbp),%xmm0
ff
movsd  %xmm0,-0x118(%rbp)
ff
jmp    18ca <erd__dsqmin_line_segments+0x7ca>
jmp    18cf <erd__dsqmin_line_segments+0x7cf>
xorps  %xmm0,%xmm0
ucomisd -0x110(%rbp),%xmm0
ff
jbe    199f <erd__dsqmin_line_segments+0x89f>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x110(%rbp)
ff
movsd  -0xe8(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x100(%rbp)
ff
xorps  %xmm0,%xmm0
ucomisd -0x100(%rbp),%xmm0
ff
jbe    1933 <erd__dsqmin_line_segments+0x833>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x100(%rbp)
ff
jmp    199a <erd__dsqmin_line_segments+0x89a>
movsd  -0x100(%rbp),%xmm0
ff
ucomisd -0x98(%rbp),%xmm0
ff
jbe    195e <erd__dsqmin_line_segments+0x85e>
movsd  -0x108(%rbp),%xmm0
ff
movsd  %xmm0,-0x100(%rbp)
ff
jmp    1995 <erd__dsqmin_line_segments+0x895>
movsd  -0xe8(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x100(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0x108(%rbp)
ff
jmp    199a <erd__dsqmin_line_segments+0x89a>
jmp    1a48 <erd__dsqmin_line_segments+0x948>
movsd  -0x110(%rbp),%xmm0
ff
ucomisd -0x118(%rbp),%xmm0
ff
jbe    1a43 <erd__dsqmin_line_segments+0x943>
movsd  -0x118(%rbp),%xmm0
ff
movsd  %xmm0,-0x110(%rbp)
ff
movsd  -0xe0(%rbp),%xmm0
ff
subsd  -0xe8(%rbp),%xmm0
ff
movsd  %xmm0,-0x100(%rbp)
ff
xorps  %xmm0,%xmm0
ucomisd -0x100(%rbp),%xmm0
ff
jbe    19fe <erd__dsqmin_line_segments+0x8fe>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x100(%rbp)
ff
jmp    1a3e <erd__dsqmin_line_segments+0x93e>
movsd  -0x100(%rbp),%xmm0
ff
ucomisd -0x98(%rbp),%xmm0
ff
jbe    1a29 <erd__dsqmin_line_segments+0x929>
movsd  -0x108(%rbp),%xmm0
ff
movsd  %xmm0,-0x100(%rbp)
ff
jmp    1a39 <erd__dsqmin_line_segments+0x939>
movsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0x108(%rbp)
ff
jmp    1a3e <erd__dsqmin_line_segments+0x93e>
jmp    1a43 <erd__dsqmin_line_segments+0x943>
jmp    1a48 <erd__dsqmin_line_segments+0x948>
movsd  -0x100(%rbp),%xmm0
ff
divsd  -0x108(%rbp),%xmm0
ff
movsd  %xmm0,-0x120(%rbp)
ff
movsd  -0x110(%rbp),%xmm0
ff
divsd  -0x118(%rbp),%xmm0
ff
movsd  %xmm0,-0x128(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
movsd  -0x120(%rbp),%xmm1
ff
movsd  -0x50(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x128(%rbp),%xmm0
ff
movsd  -0x68(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
movsd  -0x120(%rbp),%xmm1
ff
movsd  -0x58(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x128(%rbp),%xmm0
ff
movsd  -0x70(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
movsd  -0x120(%rbp),%xmm1
ff
movsd  -0x60(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x128(%rbp),%xmm0
ff
movsd  -0x78(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
jmp    1b6d <erd__dsqmin_line_segments+0xa6d>
jmp    1b72 <erd__dsqmin_line_segments+0xa72>
movsd  -0xa8(%rbp),%xmm1
ff
movsd  -0xa8(%rbp),%xmm2
ff
movsd  -0xb0(%rbp),%xmm0
ff
mulsd  -0xb0(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0xb8(%rbp),%xmm0
ff
movsd  -0xb8(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0xa8,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<erd__dsqmin_line_segments>:
unpcklpd %xmm4,%xmm5
unpcklpd %xmm1,%xmm2
subpd  %xmm2,%xmm5
movsd  0x10(%rsp),%xmm14
unpcklpd %xmm3,%xmm14
movapd %xmm6,%xmm1
unpcklpd %xmm0,%xmm1
subpd  %xmm1,%xmm14
movsd  0x20(%rsp),%xmm3
movhpd 0x18(%rsp),%xmm3
movsd  0x8(%rsp),%xmm1
unpcklpd %xmm7,%xmm1
subpd  %xmm1,%xmm3
subsd  %xmm6,%xmm0
subpd  %xmm1,%xmm2
movapd %xmm3,%xmm1
unpckhpd %xmm5,%xmm1
mulpd  %xmm1,%xmm1
movapd %xmm14,%xmm7
mulpd  %xmm14,%xmm7
addpd  %xmm1,%xmm7
movapd %xmm3,%xmm6
unpcklpd %xmm5,%xmm6
mulpd  %xmm6,%xmm6
addpd  %xmm7,%xmm6
movapd %xmm6,%xmm1
cmpltpd 0xe82(%rip),%xmm1
movmskpd %xmm1,%eax
cmp    $0x3,%al
jne    119f <erd__dsqmin_line_segments+0x9f>
movapd %xmm2,%xmm1
mulpd  %xmm2,%xmm1
unpckhpd %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
jmp    123a <erd__dsqmin_line_segments+0x13a>
movapd %xmm3,%xmm1
unpckhpd %xmm3,%xmm1
mov    %eax,%ecx
shr    %cl
je     11ea <erd__dsqmin_line_segments+0xea>
movapd %xmm2,%xmm5
unpckhpd %xmm2,%xmm5
mulsd  %xmm5,%xmm1
movapd %xmm14,%xmm7
mulsd  %xmm0,%xmm7
addsd  %xmm1,%xmm7
movapd %xmm3,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm7,%xmm1
xorpd  %xmm7,%xmm7
ucomisd %xmm1,%xmm7
jbe    1247 <erd__dsqmin_line_segments+0x147>
mulsd  %xmm5,%xmm5
mulsd  %xmm0,%xmm0
addsd  %xmm5,%xmm0
jmp    123a <erd__dsqmin_line_segments+0x13a>
movapd %xmm5,%xmm7
unpckhpd %xmm5,%xmm7
test   $0x1,%al
je     1268 <erd__dsqmin_line_segments+0x168>
movapd %xmm2,%xmm3
unpckhpd %xmm2,%xmm3
mulsd  %xmm3,%xmm7
unpckhpd %xmm14,%xmm14
movapd %xmm14,%xmm4
mulsd  %xmm0,%xmm4
addsd  %xmm7,%xmm4
movapd %xmm5,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm4,%xmm1
xorpd  %xmm4,%xmm4
ucomisd %xmm4,%xmm1
jbe    132d <erd__dsqmin_line_segments+0x22d>
mulsd  %xmm3,%xmm3
mulsd  %xmm0,%xmm0
addsd  %xmm3,%xmm0
mulsd  %xmm2,%xmm2
addsd  %xmm0,%xmm2
movapd %xmm2,%xmm0
ret
ucomisd %xmm6,%xmm1
jbe    1351 <erd__dsqmin_line_segments+0x251>
subsd  %xmm14,%xmm0
subpd  %xmm3,%xmm2
movapd %xmm0,%xmm14
movapd %xmm2,%xmm1
jmp    14bc <erd__dsqmin_line_segments+0x3bc>
movapd %xmm7,%xmm9
mulsd  %xmm1,%xmm9
movapd %xmm14,%xmm8
unpckhpd %xmm14,%xmm8
movapd %xmm8,%xmm4
mulsd  %xmm14,%xmm4
addsd  %xmm9,%xmm4
movapd %xmm5,%xmm10
mulsd  %xmm3,%xmm10
addsd  %xmm4,%xmm10
movapd %xmm2,%xmm9
unpckhpd %xmm2,%xmm9
mulsd  %xmm9,%xmm7
movapd %xmm8,%xmm4
mulsd  %xmm0,%xmm4
addsd  %xmm7,%xmm4
movapd %xmm5,%xmm12
mulsd  %xmm2,%xmm12
addsd  %xmm4,%xmm12
mulsd  %xmm1,%xmm9
movapd %xmm14,%xmm4
mulsd  %xmm0,%xmm4
addsd  %xmm9,%xmm4
movapd %xmm3,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm4,%xmm1
movapd %xmm10,%xmm4
mulsd  %xmm10,%xmm4
movapd %xmm6,%xmm11
unpckhpd %xmm6,%xmm11
movapd %xmm11,%xmm9
mulsd  %xmm6,%xmm9
subsd  %xmm4,%xmm9
xorpd  %xmm13,%xmm13
movsd  0xd14(%rip),%xmm4
ucomisd %xmm9,%xmm4
jbe    1378 <erd__dsqmin_line_segments+0x278>
movsd  0xcfc(%rip),%xmm9
xorpd  %xmm7,%xmm7
jmp    13f0 <erd__dsqmin_line_segments+0x2f0>
xorpd  0xcdb(%rip),%xmm1
unpckhpd %xmm6,%xmm6
ucomisd %xmm6,%xmm1
jbe    139e <erd__dsqmin_line_segments+0x29e>
addsd  %xmm0,%xmm14
addpd  %xmm2,%xmm5
movapd %xmm5,%xmm1
jmp    14bc <erd__dsqmin_line_segments+0x3bc>
xorpd  0xcb7(%rip),%xmm1
divsd  %xmm6,%xmm1
mulsd  %xmm1,%xmm14
addsd  %xmm0,%xmm14
unpcklpd %xmm1,%xmm1
mulpd  %xmm3,%xmm1
addpd  %xmm2,%xmm1
jmp    14bc <erd__dsqmin_line_segments+0x3bc>
movapd %xmm12,%xmm4
mulsd  %xmm6,%xmm4
movapd %xmm10,%xmm7
mulsd  %xmm1,%xmm7
subsd  %xmm4,%xmm7
xorpd  %xmm4,%xmm4
ucomisd %xmm7,%xmm4
jbe    13bd <erd__dsqmin_line_segments+0x2bd>
xorpd  %xmm7,%xmm7
jmp    13eb <erd__dsqmin_line_segments+0x2eb>
divsd  %xmm6,%xmm1
mulsd  %xmm1,%xmm14
addsd  %xmm0,%xmm14
unpcklpd %xmm1,%xmm1
mulpd  %xmm5,%xmm1
addpd  %xmm2,%xmm1
jmp    14bc <erd__dsqmin_line_segments+0x3bc>
ucomisd %xmm9,%xmm7
jbe    13d0 <erd__dsqmin_line_segments+0x2d0>
addsd  %xmm10,%xmm1
movapd %xmm9,%xmm7
jmp    13f0 <erd__dsqmin_line_segments+0x2f0>
movapd 0xc38(%rip),%xmm4
xorpd  %xmm10,%xmm4
mulsd  %xmm12,%xmm4
mulsd  %xmm11,%xmm1
addsd  %xmm4,%xmm1
movapd %xmm9,%xmm6
ucomisd %xmm1,%xmm13
jbe    1408 <erd__dsqmin_line_segments+0x308>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm12
jbe    144d <erd__dsqmin_line_segments+0x34d>
xorpd  %xmm7,%xmm7
jmp    147f <erd__dsqmin_line_segments+0x37f>
ucomisd %xmm6,%xmm1
jbe    147f <erd__dsqmin_line_segments+0x37f>
subsd  %xmm12,%xmm10
xorpd  %xmm7,%xmm7
ucomisd %xmm10,%xmm7
ja     1447 <erd__dsqmin_line_segments+0x347>
ucomisd %xmm11,%xmm10
movapd %xmm11,%xmm7
cmpltsd %xmm10,%xmm7
movapd %xmm7,%xmm1
andpd  %xmm9,%xmm1
andnpd %xmm10,%xmm7
orpd   %xmm1,%xmm7
ja     1447 <erd__dsqmin_line_segments+0x347>
movapd %xmm11,%xmm9
movapd %xmm6,%xmm1
jmp    147f <erd__dsqmin_line_segments+0x37f>
xorpd  0xbba(%rip),%xmm12
ucomisd %xmm11,%xmm12
movapd %xmm11,%xmm7
cmpltsd %xmm12,%xmm7
movapd %xmm7,%xmm4
andpd  %xmm9,%xmm4
andnpd %xmm12,%xmm7
orpd   %xmm4,%xmm7
ja     147f <erd__dsqmin_line_segments+0x37f>
movapd %xmm11,%xmm9
divsd  %xmm9,%xmm7
mulsd  %xmm7,%xmm8
addsd  %xmm0,%xmm8
xorpd  0xb7a(%rip),%xmm1
divsd  %xmm6,%xmm1
mulsd  %xmm1,%xmm14
addsd  %xmm8,%xmm14
unpcklpd %xmm7,%xmm7
mulpd  %xmm5,%xmm7
addpd  %xmm2,%xmm7
unpcklpd %xmm1,%xmm1
mulpd  %xmm3,%xmm1
addpd  %xmm7,%xmm1
movapd %xmm1,%xmm0
mulpd  %xmm1,%xmm0
unpckhpd %xmm0,%xmm0
mulsd  %xmm14,%xmm14
addsd  %xmm0,%xmm14
mulsd  %xmm1,%xmm1
addsd  %xmm14,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @erd__dsqmin_line_segments(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, double %8, double %9, double %10, double %11) {
%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 double
%25 = alloca double
%26 = alloca double
%27 = alloca double
%28 = alloca double
%29 = alloca double
%30 = alloca double
%31 = alloca double
%32 = alloca double
%33 = alloca double
%34 = alloca double
%35 = alloca double
%36 = alloca double
%37 = alloca double
%38 = alloca double
%39 = alloca double
%40 = alloca double
%41 = alloca double
%42 = alloca double
%43 = alloca double
%44 = alloca double
%45 = alloca double
%46 = alloca double
%47 = alloca double
%48 = alloca double
%49 = alloca double
%50 = alloca double
%51 = alloca double
%52 = alloca double
%53 = alloca double
store double %0, double* %14
store double %1, double* %15
store double %2, double* %16
store double %3, double* %17
store double %4, double* %18
store double %5, double* %19
store double %6, double* %20
store double %7, double* %21
store double %8, double* %22
store double %9, double* %23
store double %10, double* %24
store double %11, double* %25
%54 = load double, double* %17
%55 = load double, double* %14
%56 = fsub double %54, %55
store double %56, double* %26
%57 = load double, double* %18
%58 = load double, double* %15
%59 = fsub double %57, %58
store double %59, double* %27
%60 = load double, double* %19
%61 = load double, double* %16
%62 = fsub double %60, %61
store double %62, double* %28
%63 = load double, double* %23
%64 = load double, double* %20
%65 = fsub double %63, %64
store double %65, double* %29
%66 = load double, double* %24
%67 = load double, double* %21
%68 = fsub double %66, %67
store double %68, double* %30
%69 = load double, double* %25
%70 = load double, double* %22
%71 = fsub double %69, %70
store double %71, double* %31
%72 = load double, double* %14
%73 = load double, double* %20
%74 = fsub double %72, %73
store double %74, double* %32
%75 = load double, double* %15
%76 = load double, double* %21
%77 = fsub double %75, %76
store double %77, double* %33
%78 = load double, double* %16
%79 = load double, double* %22
%80 = fsub double %78, %79
store double %80, double* %34
%81 = load double, double* %26
%82 = load double, double* %26
%83 = load double, double* %27
%84 = load double, double* %27
%85 = fmul double %83, %84
%86 = call double @llvm.fmuladd.f64(double %81, double %82, double %85)
%87 = load double, double* %28
%88 = load double, double* %28
%89 = call double @llvm.fmuladd.f64(double %87, double %88, double %86)
store double %89, double* %35
%90 = load double, double* %29
%91 = load double, double* %29
%92 = load double, double* %30
%93 = load double, double* %30
%94 = fmul double %92, %93
%95 = call double @llvm.fmuladd.f64(double %90, double %91, double %94)
%96 = load double, double* %31
%97 = load double, double* %31
%98 = call double @llvm.fmuladd.f64(double %96, double %97, double %95)
store double %98, double* %36
%99 = load double, double* %35
%100 = fcmp olt double %99, 0x3D719799812DEA11
br i1 %100, label %101, label %114
101: ; preds = %12
%102 = load double, double* %36
%103 = fcmp olt double %102, 0x3D719799812DEA11
br i1 %103, label %104, label %114
104: ; preds = %101
%105 = load double, double* %32
%106 = load double, double* %32
%107 = load double, double* %33
%108 = load double, double* %33
%109 = fmul double %107, %108
%110 = call double @llvm.fmuladd.f64(double %105, double %106, double %109)
%111 = load double, double* %34
%112 = load double, double* %34
%113 = call double @llvm.fmuladd.f64(double %111, double %112, double %110)
store double %113, double* %13
br label %395
114: ; preds = %101, %12
%115 = load double, double* %35
%116 = fcmp olt double %115, 0x3D719799812DEA11
br i1 %116, label %117, label %174
117: ; preds = %114
%118 = load double, double* %29
%119 = load double, double* %32
%120 = load double, double* %30
%121 = load double, double* %33
%122 = fmul double %120, %121
%123 = call double @llvm.fmuladd.f64(double %118, double %119, double %122)
%124 = load double, double* %31
%125 = load double, double* %34
%126 = call double @llvm.fmuladd.f64(double %124, double %125, double %123)
store double %126, double* %40
%127 = load double, double* %40
%128 = fcmp olt double %127, 0.000000e+00
br i1 %128, label %129, label %139
129: ; preds = %117
%130 = load double, double* %32
%131 = load double, double* %32
%132 = load double, double* %33
%133 = load double, double* %33
%134 = fmul double %132, %133
%135 = call double @llvm.fmuladd.f64(double %130, double %131, double %134)
%136 = load double, double* %34
%137 = load double, double* %34
%138 = call double @llvm.fmuladd.f64(double %136, double %137, double %135)
store double %138, double* %13
br label %395
139: ; preds = %117
%140 = load double, double* %40
%141 = load double, double* %36
%142 = fcmp ogt double %140, %141
br i1 %142, label %143, label %153
143: ; preds = %139
%144 = load double, double* %32
%145 = load double, double* %29
%146 = fsub double %144, %145
store double %146, double* %37
%147 = load double, double* %33
%148 = load double, double* %30
%149 = fsub double %147, %148
store double %149, double* %38
%150 = load double, double* %34
%151 = load double, double* %31
%152 = fsub double %150, %151
store double %152, double* %39
br label %172
153: ; preds = %139
%154 = load double, double* %40
%155 = load double, double* %36
%156 = fdiv double %154, %155
store double %156, double* %41
%157 = load double, double* %32
%158 = load double, double* %41
%159 = load double, double* %29
%160 = fneg double %158
%161 = call double @llvm.fmuladd.f64(double %160, double %159, double %157)
store double %161, double* %37
%162 = load double, double* %33
%163 = load double, double* %41
%164 = load double, double* %30
%165 = fneg double %163
%166 = call double @llvm.fmuladd.f64(double %165, double %164, double %162)
store double %166, double* %38
%167 = load double, double* %34
%168 = load double, double* %41
%169 = load double, double* %31
%170 = fneg double %168
%171 = call double @llvm.fmuladd.f64(double %170, double %169, double %167)
store double %171, double* %39
br label %172
172: ; preds = %153, %143
br label %173
173: ; preds = %172
br label %384
174: ; preds = %114
%175 = load double, double* %36
%176 = fcmp olt double %175, 0x3D719799812DEA11
br i1 %176, label %177, label %232
177: ; preds = %174
%178 = load double, double* %26
%179 = load double, double* %32
%180 = load double, double* %27
%181 = load double, double* %33
%182 = fmul double %180, %181
%183 = call double @llvm.fmuladd.f64(double %178, double %179, double %182)
%184 = load double, double* %28
%185 = load double, double* %34
%186 = call double @llvm.fmuladd.f64(double %184, double %185, double %183)
%187 = fneg double %186
store double %187, double* %42
%188 = load double, double* %42
%189 = fcmp olt double %188, 0.000000e+00
br i1 %189, label %190, label %200
190: ; preds = %177
%191 = load double, double* %32
%192 = load double, double* %32
%193 = load double, double* %33
%194 = load double, double* %33
%195 = fmul double %193, %194
%196 = call double @llvm.fmuladd.f64(double %191, double %192, double %195)
%197 = load double, double* %34
%198 = load double, double* %34
%199 = call double @llvm.fmuladd.f64(double %197, double %198, double %196)
store double %199, double* %13
br label %395
200: ; preds = %177
%201 = load double, double* %42
%202 = load double, double* %35
%203 = fcmp ogt double %201, %202
br i1 %203, label %204, label %214
204: ; preds = %200
%205 = load double, double* %32
%206 = load double, double* %26
%207 = fadd double %205, %206
store double %207, double* %37
%208 = load double, double* %33
%209 = load double, double* %27
%210 = fadd double %208, %209
store double %210, double* %38
%211 = load double, double* %34
%212 = load double, double* %28
%213 = fadd double %211, %212
store double %213, double* %39
br label %230
214: ; preds = %200
%215 = load double, double* %42
%216 = load double, double* %35
%217 = fdiv double %215, %216
store double %217, double* %43
%218 = load double, double* %32
%219 = load double, double* %43
%220 = load double, double* %26
%221 = call double @llvm.fmuladd.f64(double %219, double %220, double %218)
store double %221, double* %37
%222 = load double, double* %33
%223 = load double, double* %43
%224 = load double, double* %27
%225 = call double @llvm.fmuladd.f64(double %223, double %224, double %222)
store double %225, double* %38
%226 = load double, double* %34
%227 = load double, double* %43
%228 = load double, double* %28
%229 = call double @llvm.fmuladd.f64(double %227, double %228, double %226)
store double %229, double* %39
br label %230
230: ; preds = %214, %204
br label %231
231: ; preds = %230
br label %383
232: ; preds = %174
%233 = load double, double* %26
%234 = load double, double* %29
%235 = load double, double* %27
%236 = load double, double* %30
%237 = fmul double %235, %236
%238 = call double @llvm.fmuladd.f64(double %233, double %234, double %237)
%239 = load double, double* %28
%240 = load double, double* %31
%241 = call double @llvm.fmuladd.f64(double %239, double %240, double %238)
store double %241, double* %44
%242 = load double, double* %26
%243 = load double, double* %32
%244 = load double, double* %27
%245 = load double, double* %33
%246 = fmul double %244, %245
%247 = call double @llvm.fmuladd.f64(double %242, double %243, double %246)
%248 = load double, double* %28
%249 = load double, double* %34
%250 = call double @llvm.fmuladd.f64(double %248, double %249, double %247)
store double %250, double* %45
%251 = load double, double* %29
%252 = load double, double* %32
%253 = load double, double* %30
%254 = load double, double* %33
%255 = fmul double %253, %254
%256 = call double @llvm.fmuladd.f64(double %251, double %252, double %255)
%257 = load double, double* %31
%258 = load double, double* %34
%259 = call double @llvm.fmuladd.f64(double %257, double %258, double %256)
store double %259, double* %46
%260 = load double, double* %35
%261 = load double, double* %36
%262 = load double, double* %44
%263 = load double, double* %44
%264 = fmul double %262, %263
%265 = fneg double %264
%266 = call double @llvm.fmuladd.f64(double %260, double %261, double %265)
store double %266, double* %47
%267 = load double, double* %47
%268 = fcmp olt double %267, 0x3D719799812DEA11
br i1 %268, label %269, label %272
269: ; preds = %232
store double 0.000000e+00, double* %48
store double 1.000000e+00, double* %49
%270 = load double, double* %46
store double %270, double* %50
%271 = load double, double* %36
store double %271, double* %51
br label %308
272: ; preds = %232
%273 = load double, double* %44
%274 = load double, double* %46
%275 = load double, double* %36
%276 = load double, double* %45
%277 = fmul double %275, %276
%278 = fneg double %277
%279 = call double @llvm.fmuladd.f64(double %273, double %274, double %278)
store double %279, double* %48
%280 = load double, double* %47
store double %280, double* %49
%281 = load double, double* %48
%282 = fcmp olt double %281, 0.000000e+00
br i1 %282, label %283, label %286
283: ; preds = %272
store double 0.000000e+00, double* %48
%284 = load double, double* %46
store double %284, double* %50
%285 = load double, double* %47
store double %285, double* %51
br label %307
286: ; preds = %272
%287 = load double, double* %48
%288 = load double, double* %47
%289 = fcmp ogt double %287, %288
br i1 %289, label %290, label %297
290: ; preds = %286
%291 = load double, double* %47
store double %291, double* %48
%292 = load double, double* %47
store double %292, double* %49
%293 = load double, double* %46
%294 = load double, double* %44
%295 = fadd double %293, %294
store double %295, double* %50
%296 = load double, double* %36
store double %296, double* %51
br label %306
297: ; preds = %286
%298 = load double, double* %35
%299 = load double, double* %46
%300 = load double, double* %44
%301 = load double, double* %45
%302 = fmul double %300, %301
%303 = fneg double %302
%304 = call double @llvm.fmuladd.f64(double %298, double %299, double %303)
store double %304, double* %50
%305 = load double, double* %47
store double %305, double* %51
br label %306
306: ; preds = %297, %290
br label %307
307: ; preds = %306, %283
br label %308
308: ; preds = %307, %269
%309 = load double, double* %50
%310 = fcmp olt double %309, 0.000000e+00
br i1 %310, label %311, label %329
311: ; preds = %308
store double 0.000000e+00, double* %50
%312 = load double, double* %45
%313 = fneg double %312
store double %313, double* %48
%314 = load double, double* %48
%315 = fcmp olt double %314, 0.000000e+00
br i1 %315, label %316, label %317
316: ; preds = %311
store double 0.000000e+00, double* %48
br label %328
317: ; preds = %311
%318 = load double, double* %48
%319 = load double, double* %35
%320 = fcmp ogt double %318, %319
br i1 %320, label %321, label %323
321: ; preds = %317
%322 = load double, double* %49
store double %322, double* %48
br label %327
323: ; preds = %317
%324 = load double, double* %45
%325 = fneg double %324
store double %325, double* %48
%326 = load double, double* %35
store double %326, double* %49
br label %327
327: ; preds = %323, %321
br label %328
328: ; preds = %327, %316
br label %352
329: ; preds = %308
%330 = load double, double* %50
%331 = load double, double* %51
%332 = fcmp ogt double %330, %331
br i1 %332, label %333, label %351
333: ; preds = %329
%334 = load double, double* %51
store double %334, double* %50
%335 = load double, double* %44
%336 = load double, double* %45
%337 = fsub double %335, %336
store double %337, double* %48
%338 = load double, double* %48
%339 = fcmp olt double %338, 0.000000e+00
br i1 %339, label %340, label %341
340: ; preds = %333
store double 0.000000e+00, double* %48
br label %350
341: ; preds = %333
%342 = load double, double* %48
%343 = load double, double* %35
%344 = fcmp ogt double %342, %343
br i1 %344, label %345, label %347
345: ; preds = %341
%346 = load double, double* %49
store double %346, double* %48
br label %349
347: ; preds = %341
%348 = load double, double* %35
store double %348, double* %49
br label %349
349: ; preds = %347, %345
br label %350
350: ; preds = %349, %340
br label %351
351: ; preds = %350, %329
br label %352
352: ; preds = %351, %328
%353 = load double, double* %48
%354 = load double, double* %49
%355 = fdiv double %353, %354
store double %355, double* %52
%356 = load double, double* %50
%357 = load double, double* %51
%358 = fdiv double %356, %357
store double %358, double* %53
%359 = load double, double* %32
%360 = load double, double* %52
%361 = load double, double* %26
%362 = call double @llvm.fmuladd.f64(double %360, double %361, double %359)
%363 = load double, double* %53
%364 = load double, double* %29
%365 = fneg double %363
%366 = call double @llvm.fmuladd.f64(double %365, double %364, double %362)
store double %366, double* %37
%367 = load double, double* %33
%368 = load double, double* %52
%369 = load double, double* %27
%370 = call double @llvm.fmuladd.f64(double %368, double %369, double %367)
%371 = load double, double* %53
%372 = load double, double* %30
%373 = fneg double %371
%374 = call double @llvm.fmuladd.f64(double %373, double %372, double %370)
store double %374, double* %38
%375 = load double, double* %34
%376 = load double, double* %52
%377 = load double, double* %28
%378 = call double @llvm.fmuladd.f64(double %376, double %377, double %375)
%379 = load double, double* %53
%380 = load double, double* %31
%381 = fneg double %379
%382 = call double @llvm.fmuladd.f64(double %381, double %380, double %378)
store double %382, double* %39
br label %383
383: ; preds = %352, %231
br label %384
384: ; preds = %383, %173
br label %385
385: ; preds = %384
%386 = load double, double* %37
%387 = load double, double* %37
%388 = load double, double* %38
%389 = load double, double* %38
%390 = fmul double %388, %389
%391 = call double @llvm.fmuladd.f64(double %386, double %387, double %390)
%392 = load double, double* %39
%393 = load double, double* %39
%394 = call double @llvm.fmuladd.f64(double %392, double %393, double %391)
store double %394, double* %13
br label %395
395: ; preds = %385, %190, %129, %104
%396 = load double, double* %13
ret double %396
}

LLVM IR (-O2):
define double @erd__dsqmin_line_segments(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, double %8, double %9, double %10, double %11) {
%13 = insertelement <2 x double> poison, double %5, i64 0
%14 = insertelement <2 x double> %13, double %4, i64 1
%15 = insertelement <2 x double> poison, double %2, i64 0
%16 = insertelement <2 x double> %15, double %1, i64 1
%17 = fsub <2 x double> %14, %16
%18 = insertelement <2 x double> poison, double %9, i64 0
%19 = insertelement <2 x double> %18, double %3, i64 1
%20 = insertelement <2 x double> poison, double %6, i64 0
%21 = insertelement <2 x double> %20, double %0, i64 1
%22 = fsub <2 x double> %19, %21
%23 = insertelement <2 x double> poison, double %11, i64 0
%24 = insertelement <2 x double> %23, double %10, i64 1
%25 = insertelement <2 x double> poison, double %8, i64 0
%26 = insertelement <2 x double> %25, double %7, i64 1
%27 = fsub <2 x double> %24, %26
%28 = fsub double %0, %6
%29 = fsub <2 x double> %16, %26
%30 = extractelement <2 x double> %17, i64 1
%31 = extractelement <2 x double> %17, i64 0
%32 = extractelement <2 x double> %27, i64 1
%33 = shufflevector <2 x double> %27, <2 x double> %17, <2 x i32> <i32 1, i32 3>
%34 = fmul <2 x double> %33, %33
%35 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %22, <2 x double> %22, <2 x double> %34)
%36 = extractelement <2 x double> %27, i64 0
%37 = shufflevector <2 x double> %27, <2 x double> %17, <2 x i32> <i32 0, i32 2>
%38 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %37, <2 x double> %37, <2 x double> %35)
%39 = fcmp olt <2 x double> %38, <double 0x3D719799812DEA11, double 0x3D719799812DEA11>
%40 = extractelement <2 x i1> %39, i64 0
%41 = extractelement <2 x i1> %39, i64 1
%42 = select i1 %41, i1 %40, i1 false
br i1 %42, label %43, label %49
43: ; preds = %12
%44 = fmul <2 x double> %29, %29
%45 = extractelement <2 x double> %44, i64 1
%46 = tail call double @llvm.fmuladd.f64(double %28, double %28, double %45)
%47 = extractelement <2 x double> %29, i64 0
%48 = tail call double @llvm.fmuladd.f64(double %47, double %47, double %46)
br label %178
49: ; preds = %12
br i1 %41, label %50, label %75
50: ; preds = %49
%51 = extractelement <2 x double> %29, i64 1
%52 = fmul double %51, %32
%53 = extractelement <2 x double> %22, i64 0
%54 = tail call double @llvm.fmuladd.f64(double %53, double %28, double %52)
%55 = extractelement <2 x double> %29, i64 0
%56 = tail call double @llvm.fmuladd.f64(double %36, double %55, double %54)
%57 = fcmp olt double %56, 0.000000e+00
br i1 %57, label %71, label %58
58: ; preds = %50
%59 = extractelement <2 x double> %38, i64 0
%60 = fcmp ogt double %56, %59
br i1 %60, label %61, label %64
61: ; preds = %58
%62 = fsub double %28, %53
%63 = fsub <2 x double> %29, %27
br label %170
64: ; preds = %58
%65 = fneg double %56
%66 = fdiv double %65, %59
%67 = tail call double @llvm.fmuladd.f64(double %66, double %53, double %28)
%68 = insertelement <2 x double> poison, double %66, i64 0
%69 = shufflevector <2 x double> %68, <2 x double> poison, <2 x i32> zeroinitializer
%70 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %69, <2 x double> %27, <2 x double> %29)
br label %170
71: ; preds = %50
%72 = fmul double %51, %51
%73 = tail call double @llvm.fmuladd.f64(double %28, double %28, double %72)
%74 = tail call double @llvm.fmuladd.f64(double %55, double %55, double %73)
br label %178
75: ; preds = %49
br i1 %40, label %76, label %101
76: ; preds = %75
%77 = extractelement <2 x double> %29, i64 1
%78 = fmul double %30, %77
%79 = extractelement <2 x double> %22, i64 1
%80 = tail call double @llvm.fmuladd.f64(double %79, double %28, double %78)
%81 = extractelement <2 x double> %29, i64 0
%82 = tail call double @llvm.fmuladd.f64(double %31, double %81, double %80)
%83 = fneg double %82
%84 = fcmp ogt double %82, 0.000000e+00
br i1 %84, label %97, label %85
85: ; preds = %76
%86 = extractelement <2 x double> %38, i64 1
%87 = fcmp olt double %86, %83
br i1 %87, label %88, label %91
88: ; preds = %85
%89 = fadd double %79, %28
%90 = fadd <2 x double> %17, %29
br label %170
91: ; preds = %85
%92 = fdiv double %83, %86
%93 = tail call double @llvm.fmuladd.f64(double %92, double %79, double %28)
%94 = insertelement <2 x double> poison, double %92, i64 0
%95 = shufflevector <2 x double> %94, <2 x double> poison, <2 x i32> zeroinitializer
%96 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %95, <2 x double> %17, <2 x double> %29)
br label %170
97: ; preds = %76
%98 = fmul double %77, %77
%99 = tail call double @llvm.fmuladd.f64(double %28, double %28, double %98)
%100 = tail call double @llvm.fmuladd.f64(double %81, double %81, double %99)
br label %178
101: ; preds = %75
%102 = fmul double %30, %32
%103 = extractelement <2 x double> %22, i64 0
%104 = extractelement <2 x double> %22, i64 1
%105 = tail call double @llvm.fmuladd.f64(double %104, double %103, double %102)
%106 = tail call double @llvm.fmuladd.f64(double %31, double %36, double %105)
%107 = extractelement <2 x double> %29, i64 1
%108 = fmul double %30, %107
%109 = tail call double @llvm.fmuladd.f64(double %104, double %28, double %108)
%110 = extractelement <2 x double> %29, i64 0
%111 = tail call double @llvm.fmuladd.f64(double %31, double %110, double %109)
%112 = fmul double %107, %32
%113 = tail call double @llvm.fmuladd.f64(double %103, double %28, double %112)
%114 = tail call double @llvm.fmuladd.f64(double %36, double %110, double %113)
%115 = fneg double %106
%116 = fmul double %106, %115
%117 = extractelement <2 x double> %38, i64 0
%118 = extractelement <2 x double> %38, i64 1
%119 = tail call double @llvm.fmuladd.f64(double %118, double %117, double %116)
%120 = fcmp olt double %119, 0x3D719799812DEA11
br i1 %120, label %133, label %121
121: ; preds = %101
%122 = fneg double %117
%123 = fmul double %111, %122
%124 = tail call double @llvm.fmuladd.f64(double %106, double %114, double %123)
%125 = fcmp olt double %124, 0.000000e+00
br i1 %125, label %133, label %126
126: ; preds = %121
%127 = fcmp ogt double %124, %119
br i1 %127, label %128, label %130
128: ; preds = %126
%129 = fadd double %114, %106
br label %133
130: ; preds = %126
%131 = fmul double %111, %115
%132 = tail call double @llvm.fmuladd.f64(double %118, double %114, double %131)
br label %133
133: ; preds = %121, %101, %130, %128
%134 = phi double [ %119, %128 ], [ %124, %130 ], [ 0.000000e+00, %101 ], [ 0.000000e+00, %121 ]
%135 = phi double [ %119, %128 ], [ %119, %130 ], [ 1.000000e+00, %101 ], [ %119, %121 ]
%136 = phi double [ %129, %128 ], [ %132, %130 ], [ %114, %101 ], [ %114, %121 ]
%137 = phi double [ %117, %128 ], [ %119, %130 ], [ %117, %101 ], [ %119, %121 ]
%138 = fcmp olt double %136, 0.000000e+00
br i1 %138, label %139, label %146
139: ; preds = %133
%140 = fneg double %111
%141 = fcmp ogt double %111, 0.000000e+00
br i1 %141, label %155, label %142
142: ; preds = %139
%143 = fcmp olt double %118, %140
%144 = select i1 %143, double %135, double %140
%145 = select i1 %143, double %135, double %118
br label %155
146: ; preds = %133
%147 = fcmp ogt double %136, %137
br i1 %147, label %148, label %155
148: ; preds = %146
%149 = fsub double %106, %111
%150 = fcmp olt double %149, 0.000000e+00
br i1 %150, label %155, label %151
151: ; preds = %148
%152 = fcmp ogt double %149, %118
%153 = select i1 %152, double %135, double %149
%154 = select i1 %152, double %135, double %118
br label %155
155: ; preds = %151, %148, %142, %139, %146
%156 = phi double [ %134, %146 ], [ 0.000000e+00, %139 ], [ %144, %142 ], [ 0.000000e+00, %148 ], [ %153, %151 ]
%157 = phi double [ %135, %146 ], [ %135, %139 ], [ %145, %142 ], [ %135, %148 ], [ %154, %151 ]
%158 = phi double [ %136, %146 ], [ 0.000000e+00, %139 ], [ 0.000000e+00, %142 ], [ %137, %148 ], [ %137, %151 ]
%159 = fdiv double %156, %157
%160 = tail call double @llvm.fmuladd.f64(double %159, double %104, double %28)
%161 = fneg double %158
%162 = fdiv double %161, %137
%163 = tail call double @llvm.fmuladd.f64(double %162, double %103, double %160)
%164 = insertelement <2 x double> poison, double %159, i64 0
%165 = shufflevector <2 x double> %164, <2 x double> poison, <2 x i32> zeroinitializer
%166 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %165, <2 x double> %17, <2 x double> %29)
%167 = insertelement <2 x double> poison, double %162, i64 0
%168 = shufflevector <2 x double> %167, <2 x double> poison, <2 x i32> zeroinitializer
%169 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %168, <2 x double> %27, <2 x double> %166)
br label %170
170: ; preds = %88, %91, %61, %64, %155
%171 = phi double [ %163, %155 ], [ %67, %64 ], [ %62, %61 ], [ %93, %91 ], [ %89, %88 ]
%172 = phi <2 x double> [ %169, %155 ], [ %70, %64 ], [ %63, %61 ], [ %96, %91 ], [ %90, %88 ]
%173 = fmul <2 x double> %172, %172
%174 = extractelement <2 x double> %173, i64 1
%175 = tail call double @llvm.fmuladd.f64(double %171, double %171, double %174)
%176 = extractelement <2 x double> %172, i64 0
%177 = tail call double @llvm.fmuladd.f64(double %176, double %176, double %175)
br label %178
178: ; preds = %97, %71, %170, %43
%179 = phi double [ %48, %43 ], [ %177, %170 ], [ %74, %71 ], [ %100, %97 ]
ret double %179
}