#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 */
int /*<<< orphan*/ __emit_expression_range(int /*<<< orphan*/, double);
double sqrt(double);
void test_quadratic(double a, double b, double c) {
  __emit_expression_range(0, b * b - 4 * a * c);
  __emit_expression_range(0, (-b + sqrt(b * b - 4 * a * c)) / (2 * a));
}


x86 assembly (clang, -O0):
<test_quadratic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  0xebf(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
xor    %edi,%edi
call   1030 <__emit_expression_range@plt>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  0xe5c(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  0xe12(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
xor    %edi,%edi
call   1030 <__emit_expression_range@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_quadratic>:
sub    $0x18,%rsp
movsd  0xed4(%rip),%xmm3
movsd  %xmm0,0x10(%rsp)
mulsd  %xmm0,%xmm3
mulsd  %xmm2,%xmm3
movsd  %xmm1,0x8(%rsp)
movapd %xmm1,%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm3,%xmm0
movsd  %xmm0,(%rsp)
xor    %edi,%edi
call   1030 <__emit_expression_range@plt>
xorpd  %xmm0,%xmm0
movsd  (%rsp),%xmm1
ucomisd %xmm0,%xmm1
movapd %xmm1,%xmm0
jb     1171 <test_quadratic+0x51>
sqrtsd %xmm0,%xmm0
jmp    1176 <test_quadratic+0x56>
call   1040 <sqrt@plt>
subsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
addsd  %xmm1,%xmm1
divsd  %xmm1,%xmm0
xor    %edi,%edi
add    $0x18,%rsp
jmp    1030 <__emit_expression_range@plt>

LLVM IR (-O0):
define void @test_quadratic(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %5
%8 = load double, double* %5
%9 = load double, double* %4
%10 = fmul double 4.000000e+00, %9
%11 = load double, double* %6
%12 = fmul double %10, %11
%13 = fneg double %12
%14 = call double @llvm.fmuladd.f64(double %7, double %8, double %13)
%15 = call i32 @__emit_expression_range(i32 0, double %14)
%16 = load double, double* %5
%17 = fneg double %16
%18 = load double, double* %5
%19 = load double, double* %5
%20 = load double, double* %4
%21 = fmul double 4.000000e+00, %20
%22 = load double, double* %6
%23 = fmul double %21, %22
%24 = fneg double %23
%25 = call double @llvm.fmuladd.f64(double %18, double %19, double %24)
%26 = call double @sqrt(double %25)
%27 = fadd double %17, %26
%28 = load double, double* %4
%29 = fmul double 2.000000e+00, %28
%30 = fdiv double %27, %29
%31 = call i32 @__emit_expression_range(i32 0, double %30)
ret void
}

LLVM IR (-O2):
define void @test_quadratic(double %0, double %1, double %2) {
%4 = fmul double %0, -4.000000e+00
%5 = fmul double %4, %2
%6 = tail call double @llvm.fmuladd.f64(double %1, double %1, double %5)
%7 = tail call i32 @__emit_expression_range(i32 0, double %6)
%8 = tail call double @sqrt(double %6)
%9 = fsub double %8, %1
%10 = fmul double %0, 2.000000e+00
%11 = fdiv double %9, %10
%12 = tail call i32 @__emit_expression_range(i32 0, double %11)
ret void
}