int quadraticRoots(a, b, c, roots)
double a, b, c, *roots;
{
  double d, q;
  int count = 0;
  d = (b * b) - (4 * a * c);
  if (d < 0.0) {
    *roots = *(roots + 1) = 0.0;
    return (0);
  }
  q = -0.5 * (b + ((((b) < 0) ? -1 : 1) * sqrt(d)));
  if (a != 0.0) {
    *roots++ = q / a;
    count++;
  }
  if (q != 0.0) {
    *roots++ = c / q;
    count++;
  }
  return (count);
}


x86 assembly (clang, -O0):
<quadraticRoots>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
mov    %rdi,-0x28(%rbp)
movl   $0x0,-0x3c(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  0xebc(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x30(%rbp),%xmm0
jbe    11a3 <quadraticRoots+0x93>
mov    -0x28(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x28(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    128b <quadraticRoots+0x17b>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x18(%rbp),%xmm1
xorps  %xmm0,%xmm0
mov    $0x1,%eax
mov    $0xffffffff,%ecx
ucomisd %xmm1,%xmm0
cmova  %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1030 <sqrt@plt>
movsd  -0x50(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x48(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xe12(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    121c <quadraticRoots+0x10c>
jp     121c <quadraticRoots+0x10c>
jmp    1242 <quadraticRoots+0x132>
movsd  -0x38(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x28(%rbp)
movsd  %xmm0,(%rax)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
movsd  -0x38(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    125f <quadraticRoots+0x14f>
jp     125f <quadraticRoots+0x14f>
jmp    1285 <quadraticRoots+0x175>
movsd  -0x20(%rbp),%xmm0
divsd  -0x38(%rbp),%xmm0
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x28(%rbp)
movsd  %xmm0,(%rax)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quadraticRoots>:
push   %rbx
sub    $0x20,%rsp
mov    %rdi,%rbx
movapd %xmm0,%xmm3
movsd  0xedc(%rip),%xmm4
mulsd  %xmm0,%xmm4
mulsd  %xmm2,%xmm4
movapd %xmm1,%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm4,%xmm0
xorpd  %xmm5,%xmm5
ucomisd %xmm0,%xmm5
jbe    1151 <quadraticRoots+0x41>
xorpd  %xmm0,%xmm0
movupd %xmm0,(%rbx)
xor    %eax,%eax
jmp    11ed <quadraticRoots+0xdd>
xor    %eax,%eax
ucomisd %xmm1,%xmm5
seta   %al
lea    0xeaf(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm4
ucomisd %xmm5,%xmm0
jb     1172 <quadraticRoots+0x62>
sqrtsd %xmm0,%xmm0
jmp    11a5 <quadraticRoots+0x95>
movsd  %xmm2,0x18(%rsp)
movsd  %xmm3,0x10(%rsp)
movsd  %xmm4,0x8(%rsp)
movsd  %xmm1,(%rsp)
call   1030 <sqrt@plt>
movsd  (%rsp),%xmm1
movsd  0x8(%rsp),%xmm4
movsd  0x10(%rsp),%xmm3
movsd  0x18(%rsp),%xmm2
mulsd  %xmm0,%xmm4
addsd  %xmm1,%xmm4
mulsd  0xe53(%rip),%xmm4
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm3
jne    11c1 <quadraticRoots+0xb1>
jnp    11d8 <quadraticRoots+0xc8>
movapd %xmm4,%xmm1
divsd  %xmm3,%xmm1
movsd  %xmm1,(%rbx)
add    $0x8,%rbx
mov    $0x1,%eax
jmp    11da <quadraticRoots+0xca>
xor    %eax,%eax
ucomisd %xmm0,%xmm4
jne    11e2 <quadraticRoots+0xd2>
jnp    11ed <quadraticRoots+0xdd>
divsd  %xmm4,%xmm2
movsd  %xmm2,(%rbx)
add    $0x1,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @quadraticRoots(double %0, double %1, double %2, double* %3) {
%5 = alloca i32
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double*
%10 = alloca double
%11 = alloca double
%12 = alloca i32
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double* %3, double** %9
store i32 0, i32* %12
%13 = load double, double* %7
%14 = load double, double* %7
%15 = load double, double* %6
%16 = fmul double 4.000000e+00, %15
%17 = load double, double* %8
%18 = fmul double %16, %17
%19 = fneg double %18
%20 = call double @llvm.fmuladd.f64(double %13, double %14, double %19)
store double %20, double* %10
%21 = load double, double* %10
%22 = fcmp olt double %21, 0.000000e+00
br i1 %22, label %23, label %27
23: ; preds = %4
%24 = load double*, double** %9
%25 = getelementptr inbounds double, double* %24, i64 1
store double 0.000000e+00, double* %25
%26 = load double*, double** %9
store double 0.000000e+00, double* %26
store i32 0, i32* %5
br label %61
27: ; preds = %4
%28 = load double, double* %7
%29 = load double, double* %7
%30 = fcmp olt double %29, 0.000000e+00
%31 = zext i1 %30 to i64
%32 = select i1 %30, i32 -1, i32 1
%33 = sitofp i32 %32 to double
%34 = load double, double* %10
%35 = call double @sqrt(double %34)
%36 = call double @llvm.fmuladd.f64(double %33, double %35, double %28)
%37 = fmul double -5.000000e-01, %36
store double %37, double* %11
%38 = load double, double* %6
%39 = fcmp une double %38, 0.000000e+00
br i1 %39, label %40, label %48
40: ; preds = %27
%41 = load double, double* %11
%42 = load double, double* %6
%43 = fdiv double %41, %42
%44 = load double*, double** %9
%45 = getelementptr inbounds double, double* %44, i32 1
store double* %45, double** %9
store double %43, double* %44
%46 = load i32, i32* %12
%47 = add nsw i32 %46, 1
store i32 %47, i32* %12
br label %48
48: ; preds = %40, %27
%49 = load double, double* %11
%50 = fcmp une double %49, 0.000000e+00
br i1 %50, label %51, label %59
51: ; preds = %48
%52 = load double, double* %8
%53 = load double, double* %11
%54 = fdiv double %52, %53
%55 = load double*, double** %9
%56 = getelementptr inbounds double, double* %55, i32 1
store double* %56, double** %9
store double %54, double* %55
%57 = load i32, i32* %12
%58 = add nsw i32 %57, 1
store i32 %58, i32* %12
br label %59
59: ; preds = %51, %48
%60 = load i32, i32* %12
store i32 %60, i32* %5
br label %61
61: ; preds = %59, %23
%62 = load i32, i32* %5
ret i32 %62
}

LLVM IR (-O2):
define i32 @quadraticRoots(double %0, double %1, double %2, double* nocapture writeonly %3) {
%5 = fmul double %0, -4.000000e+00
%6 = fmul double %5, %2
%7 = tail call double @llvm.fmuladd.f64(double %1, double %1, double %6)
%8 = fcmp olt double %7, 0.000000e+00
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = bitcast double* %3 to i8*
br label %28
11: ; preds = %4
%12 = fcmp olt double %1, 0.000000e+00
%13 = select i1 %12, double -1.000000e+00, double 1.000000e+00
%14 = tail call double @sqrt(double %7)
%15 = tail call double @llvm.fmuladd.f64(double %13, double %14, double %1)
%16 = fmul double %15, -5.000000e-01
%17 = fcmp une double %0, 0.000000e+00
br i1 %17, label %18, label %21
18: ; preds = %11
%19 = fdiv double %16, %0
%20 = getelementptr inbounds double, double* %3, i64 1
store double %19, double* %3
br label %21
21: ; preds = %18, %11
%22 = phi double* [ %20, %18 ], [ %3, %11 ]
%23 = phi i32 [ 1, %18 ], [ 0, %11 ]
%24 = fcmp une double %16, 0.000000e+00
br i1 %24, label %25, label %28
25: ; preds = %21
%26 = fdiv double %2, %16
store double %26, double* %22
%27 = add nuw nsw i32 %23, 1
br label %28
28: ; preds = %21, %25, %9
%29 = phi i32 [ 0, %9 ], [ %27, %25 ], [ %23, %21 ]
ret i32 %29
}