void lenseq_bin(double x1, double x2, double *y1, double *y2, double *p) {
  double d, q;
  double m1, m2;
  double x11, x12, d1, d2;
  double x22, m1d1, m2d2;
  d = p[0];
  q = p[1];
  m1 = 1.0 / (1.0 + q);
  m2 = q * m1;
  x11 = x1 - m2 * d;
  x12 = x1 + m1 * d;
  x22 = x2 * x2;
  d1 = ((x11) * (x11)) + x22;
  d2 = ((x12) * (x12)) + x22;
  if (d1 == 0.0 || d2 == 0.0) {
    *y1 = -1e37;
    *y2 = -1e37;
  } else {
    m1d1 = m1 / d1;
    m2d2 = m2 / d2;
    *y1 = x1 - m1d1 * x11 - m2d2 * x12;
    *y2 = x2 - (m1d1 + m2d2) * x2;
  }
}


x86 assembly (clang, -O0):
<lenseq_bin>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x28(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xec3(%rip),%xmm1
addsd  -0x38(%rbp),%xmm1
movsd  0xeb6(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm2
movsd  -0x70(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x60(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1215 <lenseq_bin+0x115>
jp     1215 <lenseq_bin+0x115>
jmp    122d <lenseq_bin+0x12d>
movsd  -0x68(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1252 <lenseq_bin+0x152>
jp     1252 <lenseq_bin+0x152>
mov    -0x18(%rbp),%rax
movsd  0xdcf(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
movsd  0xdbf(%rip),%xmm0
movsd  %xmm0,(%rax)
jmp    130a <lenseq_bin+0x20a>
movsd  -0x40(%rbp),%xmm0
divsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x48(%rbp),%xmm0
divsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x78(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x80(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x10(%rbp),%xmm1
movsd  -0x78(%rbp),%xmm0
addsd  -0x80(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<lenseq_bin>:
movsd  0x8(%rdx),%xmm2
movsd  0xef3(%rip),%xmm3
movapd %xmm2,%xmm4
addsd  %xmm3,%xmm4
divsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm2
movapd 0xeeb(%rip),%xmm4
xorpd  %xmm2,%xmm4
movapd %xmm3,%xmm5
unpcklpd %xmm4,%xmm5
movsd  (%rdx),%xmm6
unpcklpd %xmm6,%xmm6
mulpd  %xmm5,%xmm6
movapd %xmm0,%xmm4
unpcklpd %xmm0,%xmm4
addpd  %xmm6,%xmm4
movapd %xmm1,%xmm6
mulsd  %xmm1,%xmm6
unpcklpd %xmm6,%xmm6
movapd %xmm4,%xmm5
mulpd  %xmm4,%xmm5
addpd  %xmm6,%xmm5
movapd %xmm5,%xmm7
unpckhpd %xmm5,%xmm7
xorpd  %xmm6,%xmm6
ucomisd %xmm6,%xmm7
jne    1175 <lenseq_bin+0x75>
jnp    11ba <lenseq_bin+0xba>
ucomisd %xmm6,%xmm5
jne    117d <lenseq_bin+0x7d>
jnp    11ba <lenseq_bin+0xba>
unpcklpd %xmm3,%xmm2
divpd  %xmm5,%xmm2
movapd %xmm2,%xmm3
unpckhpd %xmm2,%xmm3
movapd %xmm2,%xmm5
mulsd  %xmm4,%xmm5
unpckhpd %xmm4,%xmm4
mulsd  %xmm3,%xmm4
subsd  %xmm4,%xmm0
subsd  %xmm5,%xmm0
movsd  %xmm0,(%rdi)
addsd  %xmm2,%xmm3
mulsd  %xmm1,%xmm3
subsd  %xmm3,%xmm1
movsd  %xmm1,(%rsi)
ret
movabs $0xc79e17b84357691b,%rax
17 9e c7
mov    %rax,(%rdi)
movsd  0xe39(%rip),%xmm1
movsd  %xmm1,(%rsi)
ret

LLVM IR (-O0):
define void @lenseq_bin(double %0, double %1, double* %2, double* %3, double* %4) {
%6 = alloca double
%7 = alloca double
%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
store double %0, double* %6
store double %1, double* %7
store double* %2, double** %8
store double* %3, double** %9
store double* %4, double** %10
%22 = load double*, double** %10
%23 = getelementptr inbounds double, double* %22, i64 0
%24 = load double, double* %23
store double %24, double* %11
%25 = load double*, double** %10
%26 = getelementptr inbounds double, double* %25, i64 1
%27 = load double, double* %26
store double %27, double* %12
%28 = load double, double* %12
%29 = fadd double 1.000000e+00, %28
%30 = fdiv double 1.000000e+00, %29
store double %30, double* %13
%31 = load double, double* %12
%32 = load double, double* %13
%33 = fmul double %31, %32
store double %33, double* %14
%34 = load double, double* %6
%35 = load double, double* %14
%36 = load double, double* %11
%37 = fneg double %35
%38 = call double @llvm.fmuladd.f64(double %37, double %36, double %34)
store double %38, double* %15
%39 = load double, double* %6
%40 = load double, double* %13
%41 = load double, double* %11
%42 = call double @llvm.fmuladd.f64(double %40, double %41, double %39)
store double %42, double* %16
%43 = load double, double* %7
%44 = load double, double* %7
%45 = fmul double %43, %44
store double %45, double* %19
%46 = load double, double* %15
%47 = load double, double* %15
%48 = load double, double* %19
%49 = call double @llvm.fmuladd.f64(double %46, double %47, double %48)
store double %49, double* %17
%50 = load double, double* %16
%51 = load double, double* %16
%52 = load double, double* %19
%53 = call double @llvm.fmuladd.f64(double %50, double %51, double %52)
store double %53, double* %18
%54 = load double, double* %17
%55 = fcmp oeq double %54, 0.000000e+00
br i1 %55, label %59, label %56
56: ; preds = %5
%57 = load double, double* %18
%58 = fcmp oeq double %57, 0.000000e+00
br i1 %58, label %59, label %62
59: ; preds = %56, %5
%60 = load double*, double** %8
store double 0xC79E17B84357691B, double* %60
%61 = load double*, double** %9
store double 0xC79E17B84357691B, double* %61
br label %87
62: ; preds = %56
%63 = load double, double* %13
%64 = load double, double* %17
%65 = fdiv double %63, %64
store double %65, double* %20
%66 = load double, double* %14
%67 = load double, double* %18
%68 = fdiv double %66, %67
store double %68, double* %21
%69 = load double, double* %6
%70 = load double, double* %20
%71 = load double, double* %15
%72 = fneg double %70
%73 = call double @llvm.fmuladd.f64(double %72, double %71, double %69)
%74 = load double, double* %21
%75 = load double, double* %16
%76 = fneg double %74
%77 = call double @llvm.fmuladd.f64(double %76, double %75, double %73)
%78 = load double*, double** %8
store double %77, double* %78
%79 = load double, double* %7
%80 = load double, double* %20
%81 = load double, double* %21
%82 = fadd double %80, %81
%83 = load double, double* %7
%84 = fneg double %82
%85 = call double @llvm.fmuladd.f64(double %84, double %83, double %79)
%86 = load double*, double** %9
store double %85, double* %86
br label %87
87: ; preds = %62, %59
ret void
}

LLVM IR (-O2):
define void @lenseq_bin(double %0, double %1, double* nocapture writeonly %2, double* nocapture writeonly %3, double* nocapture %4) {
%6 = load double, double* %4
%7 = getelementptr inbounds double, double* %4, i64 1
%8 = load double, double* %7
%9 = fadd double %8, 1.000000e+00
%10 = fdiv double 1.000000e+00, %9
%11 = fmul double %8, %10
%12 = fneg double %11
%13 = insertelement <2 x double> poison, double %10, i64 0
%14 = insertelement <2 x double> %13, double %12, i64 1
%15 = insertelement <2 x double> poison, double %6, i64 0
%16 = shufflevector <2 x double> %15, <2 x double> poison, <2 x i32> zeroinitializer
%17 = insertelement <2 x double> poison, double %0, i64 0
%18 = shufflevector <2 x double> %17, <2 x double> poison, <2 x i32> zeroinitializer
%19 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %14, <2 x double> %16, <2 x double> %18)
%20 = fmul double %1, %1
%21 = insertelement <2 x double> poison, double %20, i64 0
%22 = shufflevector <2 x double> %21, <2 x double> poison, <2 x i32> zeroinitializer
%23 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %19, <2 x double> %19, <2 x double> %22)
%24 = extractelement <2 x double> %23, i64 1
%25 = fcmp oeq double %24, 0.000000e+00
%26 = extractelement <2 x double> %23, i64 0
%27 = fcmp oeq double %26, 0.000000e+00
%28 = select i1 %25, i1 true, i1 %27
br i1 %28, label %29, label %30
29: ; preds = %5
store double 0xC79E17B84357691B, double* %2
br label %45
30: ; preds = %5
%31 = insertelement <2 x double> poison, double %11, i64 0
%32 = insertelement <2 x double> %31, double %10, i64 1
%33 = fdiv <2 x double> %32, %23
%34 = extractelement <2 x double> %33, i64 1
%35 = fneg double %34
%36 = extractelement <2 x double> %19, i64 1
%37 = tail call double @llvm.fmuladd.f64(double %35, double %36, double %0)
%38 = extractelement <2 x double> %33, i64 0
%39 = fneg double %38
%40 = extractelement <2 x double> %19, i64 0
%41 = tail call double @llvm.fmuladd.f64(double %39, double %40, double %37)
store double %41, double* %2
%42 = fadd double %38, %34
%43 = fneg double %42
%44 = tail call double @llvm.fmuladd.f64(double %43, double %1, double %1)
br label %45
45: ; preds = %30, %29
%46 = phi double [ %44, %30 ], [ 0xC79E17B84357691B, %29 ]
store double %46, double* %3
ret void
}