#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);
  *t1 = (-b + root) / (2.0 * a);
  *t2 = (-b - root) / (2.0 * a);
  return true;
}


x86 assembly (clang, -O0):
<solve_quadratic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%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    1213 <solve_quadratic+0x103>
movsd  -0x38(%rbp),%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
addsd  -0x40(%rbp),%xmm0
movsd  0xe47(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
subsd  -0x40(%rbp),%xmm0
movsd  0xe0d(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solve_quadratic>:
push   %r14
push   %rbx
sub    $0x28,%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     11a0 <solve_quadratic+0x90>
mov    %rsi,%r14
mov    %rdi,%rbx
ucomisd %xmm2,%xmm0
jb     1155 <solve_quadratic+0x45>
sqrtsd %xmm0,%xmm0
jmp    1172 <solve_quadratic+0x62>
movapd %xmm1,0x10(%rsp)
movsd  %xmm4,0x8(%rsp)
call   1030 <sqrt@plt>
movsd  0x8(%rsp),%xmm4
movapd 0x10(%rsp),%xmm1
movapd %xmm0,%xmm2
subsd  %xmm1,%xmm2
xorpd  0xe8e(%rip),%xmm1
addsd  %xmm4,%xmm4
divsd  %xmm4,%xmm2
movsd  %xmm2,(%rbx)
subsd  %xmm0,%xmm1
divsd  %xmm4,%xmm1
movsd  %xmm1,(%r14)
mov    $0x1,%eax
add    $0x28,%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
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
%14 = load double, double* %8
%15 = load double, double* %8
%16 = load double, double* %7
%17 = fmul double 4.000000e+00, %16
%18 = load double, double* %9
%19 = fmul double %17, %18
%20 = fneg double %19
%21 = call double @llvm.fmuladd.f64(double %14, double %15, double %20)
store double %21, double* %12
%22 = load double, double* %12
%23 = fcmp olt double %22, 0.000000e+00
br i1 %23, label %24, label %25
24: ; preds = %5
store i32 0, i32* %6
br label %44
25: ; preds = %5
%26 = load double, double* %12
%27 = call double @sqrt(double %26)
store double %27, double* %13
%28 = load double, double* %8
%29 = fneg double %28
%30 = load double, double* %13
%31 = fadd double %29, %30
%32 = load double, double* %7
%33 = fmul double 2.000000e+00, %32
%34 = fdiv double %31, %33
%35 = load double*, double** %10
store double %34, double* %35
%36 = load double, double* %8
%37 = fneg double %36
%38 = load double, double* %13
%39 = fsub double %37, %38
%40 = load double, double* %7
%41 = fmul double 2.000000e+00, %40
%42 = fdiv double %39, %41
%43 = load double*, double** %11
store double %42, double* %43
store i32 1, i32* %6
br label %44
44: ; preds = %25, %24
%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 = fneg double %1
%13 = fsub double %11, %1
%14 = fmul double %0, 2.000000e+00
%15 = fdiv double %13, %14
store double %15, double* %3
%16 = fsub double %12, %11
%17 = fdiv double %16, %14
store double %17, double* %4
br label %18
18: ; preds = %5, %10
%19 = phi i32 [ 1, %10 ], [ 0, %5 ]
ret i32 %19
}