#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 */
double sqrt(double const);
bool solve_quadratic(double a, double b, double c, double *t1, double *t2) {
  const double discriminant = b * b - 4.0 * a * c;
  if (discriminant < 0.0)
    return false;
  const double root = sqrt(discriminant);
  const double inv = 0.5 / a;
  *t1 = (root - b) * inv;
  *t2 = (-root - b) * inv;
  return true;
}


x86 assembly (clang, -O0):
<solve_quadratic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
mov    %rdi,-0x28(%rbp)
mov    %rsi,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  0xebf(%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,-0x38(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x38(%rbp),%xmm0
jbe    1189 <solve_quadratic+0x79>
movl   $0x0,-0x4(%rbp)
jmp    11f6 <solve_quadratic+0xe6>
movsd  -0x38(%rbp),%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  0xe68(%rip),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x40(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x40(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
subsd  -0x18(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solve_quadratic>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movapd %xmm0,%xmm4
movsd  0xedd(%rip),%xmm3
mulsd  %xmm0,%xmm3
mulsd  %xmm2,%xmm3
movapd %xmm1,%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm3,%xmm0
xor    %eax,%eax
xorpd  %xmm2,%xmm2
ucomisd %xmm0,%xmm2
ja     11a8 <solve_quadratic+0x98>
mov    %rsi,%r14
mov    %rdi,%rbx
ucomisd %xmm2,%xmm0
jb     1155 <solve_quadratic+0x45>
sqrtsd %xmm0,%xmm0
jmp    1172 <solve_quadratic+0x62>
movsd  %xmm1,0x10(%rsp)
movsd  %xmm4,0x8(%rsp)
call   1030 <sqrt@plt>
movsd  0x8(%rsp),%xmm4
movsd  0x10(%rsp),%xmm1
movsd  0xe8e(%rip),%xmm3
divsd  %xmm4,%xmm3
movapd %xmm0,%xmm2
subsd  %xmm1,%xmm2
mulsd  %xmm3,%xmm2
movsd  %xmm2,(%rbx)
xorpd  0xe7a(%rip),%xmm0
subsd  %xmm1,%xmm0
mulsd  %xmm3,%xmm0
movsd  %xmm0,(%r14)
mov    $0x1,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @solve_quadratic(double %0, double %1, double %2, double* %3, double* %4) {
%6 = alloca i32
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double*
%11 = alloca double*
%12 = alloca double
%13 = alloca double
%14 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double* %3, double** %10
store double* %4, double** %11
%15 = load double, double* %8
%16 = load double, double* %8
%17 = load double, double* %7
%18 = fmul double 4.000000e+00, %17
%19 = load double, double* %9
%20 = fmul double %18, %19
%21 = fneg double %20
%22 = call double @llvm.fmuladd.f64(double %15, double %16, double %21)
store double %22, double* %12
%23 = load double, double* %12
%24 = fcmp olt double %23, 0.000000e+00
br i1 %24, label %25, label %26
25: ; preds = %5
store i32 0, i32* %6
br label %44
26: ; preds = %5
%27 = load double, double* %12
%28 = call double @sqrt(double %27)
store double %28, double* %13
%29 = load double, double* %7
%30 = fdiv double 5.000000e-01, %29
store double %30, double* %14
%31 = load double, double* %13
%32 = load double, double* %8
%33 = fsub double %31, %32
%34 = load double, double* %14
%35 = fmul double %33, %34
%36 = load double*, double** %10
store double %35, double* %36
%37 = load double, double* %13
%38 = fneg double %37
%39 = load double, double* %8
%40 = fsub double %38, %39
%41 = load double, double* %14
%42 = fmul double %40, %41
%43 = load double*, double** %11
store double %42, double* %43
store i32 1, i32* %6
br label %44
44: ; preds = %26, %25
%45 = load i32, i32* %6
ret i32 %45
}

LLVM IR (-O2):
define i32 @solve_quadratic(double %0, double %1, double %2, double* nocapture writeonly %3, double* nocapture writeonly %4) {
%6 = fmul double %0, -4.000000e+00
%7 = fmul double %6, %2
%8 = tail call double @llvm.fmuladd.f64(double %1, double %1, double %7)
%9 = fcmp olt double %8, 0.000000e+00
br i1 %9, label %18, label %10
10: ; preds = %5
%11 = tail call double @sqrt(double %8)
%12 = fdiv double 5.000000e-01, %0
%13 = fsub double %11, %1
%14 = fmul double %12, %13
store double %14, double* %3
%15 = fneg double %11
%16 = fsub double %15, %1
%17 = fmul double %12, %16
store double %17, double* %4
br label %18
18: ; preds = %5, %10
%19 = phi i32 [ 1, %10 ], [ 0, %5 ]
ret i32 %19
}