#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 */
float fabs(float);
float sqrtf(float);
int SolveQuadratic(float a, float b, float c, float *Rmin, float *Rmax) {
  float root;
  float divisor;
  float b2;
  b2 = b * b;
  root = b2 - 4.0 * a * c;
  if (root < 0) {
    return (0);
  }
  divisor = (2.0 * a);
  if (fabs(divisor) == 0.0f) {
    return (0);
  }
  root = sqrtf(root);
  Rmin[0] = (float)((-b - root) / divisor);
  Rmax[0] = (float)((-b + root) / divisor);
  return (1);
}


x86 assembly (clang, -O0):
<SolveQuadratic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movss  -0xc(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm2
movsd  0xe98(%rip),%xmm0
mulsd  %xmm2,%xmm0
movss  -0x10(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x24(%rbp),%xmm0
jbe    11b6 <SolveQuadratic+0x96>
movl   $0x0,-0x4(%rbp)
jmp    125a <SolveQuadratic+0x13a>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe41(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x28(%rbp),%xmm0
call   1030 <fabs@plt>
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    11fc <SolveQuadratic+0xdc>
jp     11fc <SolveQuadratic+0xdc>
movl   $0x0,-0x4(%rbp)
jmp    125a <SolveQuadratic+0x13a>
movss  -0x24(%rbp),%xmm0
call   1040 <sqrtf@plt>
movss  %xmm0,-0x24(%rbp)
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
subss  -0x24(%rbp),%xmm0
divss  -0x28(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
addss  -0x24(%rbp),%xmm0
divss  -0x28(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movss  %xmm0,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SolveQuadratic>:
push   %r14
push   %rbx
sub    $0x28,%rsp
movaps %xmm0,%xmm3
movaps %xmm1,%xmm0
mulss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm3,%xmm4
cvtss2sd %xmm2,%xmm2
mulsd  0xecb(%rip),%xmm4
mulsd  %xmm2,%xmm4
addsd  %xmm0,%xmm4
xorps  %xmm0,%xmm0
cvtsd2ss %xmm4,%xmm0
xor    %eax,%eax
xorps  %xmm2,%xmm2
ucomiss %xmm0,%xmm2
ja     11b0 <SolveQuadratic+0xa0>
addss  %xmm3,%xmm3
ucomiss %xmm2,%xmm3
jne    1159 <SolveQuadratic+0x49>
jnp    11b0 <SolveQuadratic+0xa0>
mov    %rsi,%r14
mov    %rdi,%rbx
xorps  %xmm2,%xmm2
ucomiss %xmm2,%xmm0
jb     116d <SolveQuadratic+0x5d>
sqrtss %xmm0,%xmm0
jmp    1188 <SolveQuadratic+0x78>
movss  %xmm3,0xc(%rsp)
movaps %xmm1,0x10(%rsp)
call   1030 <sqrtf@plt>
movaps 0x10(%rsp),%xmm1
movss  0xc(%rsp),%xmm3
movaps 0xe81(%rip),%xmm2
xorps  %xmm1,%xmm2
subss  %xmm0,%xmm2
divss  %xmm3,%xmm2
movss  %xmm2,(%rbx)
subss  %xmm1,%xmm0
divss  %xmm3,%xmm0
movss  %xmm0,(%r14)
mov    $0x1,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @SolveQuadratic(float %0, float %1, float %2, float* nocapture writeonly %3, float* nocapture writeonly %4) {
%6 = fmul float %1, %1
%7 = fpext float %6 to double
%8 = fpext float %0 to double
%9 = fpext float %2 to double
%10 = fmul double %8, -4.000000e+00
%11 = tail call double @llvm.fmuladd.f64(double %10, double %9, double %7)
%12 = fptrunc double %11 to float
%13 = fcmp olt float %12, 0.000000e+00
br i1 %13, label %24, label %14
14: ; preds = %5
%15 = fmul float %0, 2.000000e+00
%16 = fcmp oeq float %15, 0.000000e+00
br i1 %16, label %24, label %17
17: ; preds = %14
%18 = tail call float @sqrtf(float %12)
%19 = fneg float %1
%20 = fsub float %19, %18
%21 = fdiv float %20, %15
store float %21, float* %3
%22 = fsub float %18, %1
%23 = fdiv float %22, %15
store float %23, float* %4
br label %24
24: ; preds = %14, %5, %17
%25 = phi i32 [ 1, %17 ], [ 0, %5 ], [ 0, %14 ]
ret i32 %25
}