#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*/ fabs(double);
double sqrt(int /*<<< orphan*/);
int qurt(double a[], double x1[], double x2[]) {
  double d, w1, w2;
  if (a[0] == 0.0)
    return (999);
  d = a[1] * a[1] - 4 * a[0] * a[2];
  w1 = 2.0 * a[0];
  w2 = sqrt(fabs(d));
  if (d > 0.0) {
    x1[0] = (-a[1] + w2) / w1;
    x1[1] = 0.0;
    x2[0] = (-a[1] - w2) / w1;
    x2[1] = 0.0;
    return (0);
  } else if (d == 0.0) {
    x1[0] = -a[1] / w1;
    x1[1] = 0.0;
    x2[0] = x1[0];
    x2[1] = 0.0;
    return (0);
  } else {
    w2 /= w1;
    x1[0] = -a[1] / w1;
    x1[1] = w2;
    x2[0] = x1[0];
    x2[1] = -w2;
    return (0);
  }
}


x86 assembly (clang, -O0):
<qurt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    115b <qurt+0x3b>
jp     115b <qurt+0x3b>
movl   $0x3e7,-0x4(%rbp)
jmp    1372 <qurt+0x252>
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm2
mov    -0x10(%rbp),%rax
movsd  0xe8f(%rip),%xmm1
mulsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
mulsd  0x10(%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movsd  0xe4a(%rip),%xmm0
mulsd  (%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1030 <fabs@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x28(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    126f <qurt+0x14f>
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
addsd  -0x38(%rbp),%xmm0
divsd  -0x30(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
subsd  -0x38(%rbp),%xmm0
divsd  -0x30(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x8(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1372 <qurt+0x252>
movsd  -0x28(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    12e8 <qurt+0x1c8>
jp     12e8 <qurt+0x1c8>
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
divsd  -0x30(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x8(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1372 <qurt+0x252>
movsd  -0x30(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
divsd  -0x30(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x38(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x38(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qurt>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
movsd  (%rdi),%xmm1
mov    $0x3e7,%eax
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jne    1142 <qurt+0x22>
jnp    1247 <qurt+0x127>
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
movsd  0xead(%rip),%xmm2
mulsd  %xmm1,%xmm2
mulsd  0x10(%rdi),%xmm2
movsd  0x8(%rdi),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm2,%xmm0
movsd  %xmm0,0x8(%rsp)
addsd  %xmm1,%xmm1
movapd %xmm1,0x10(%rsp)
call   1030 <fabs@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
movsd  0x8(%rsp),%xmm2
ucomisd 0xe75(%rip),%xmm2
jbe    11d9 <qurt+0xb9>
movsd  0x8(%rbx),%xmm1
movapd %xmm0,%xmm2
subsd  %xmm1,%xmm2
movapd 0x10(%rsp),%xmm3
divsd  %xmm3,%xmm2
movsd  %xmm2,(%r15)
movq   $0x0,0x8(%r15)
movsd  0x8(%rbx),%xmm1
xorpd  0xe4a(%rip),%xmm1
subsd  %xmm0,%xmm1
divsd  %xmm3,%xmm1
movsd  %xmm1,(%r14)
xorpd  %xmm1,%xmm1
jmp    123f <qurt+0x11f>
movapd 0x10(%rsp),%xmm3
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm2
jne    1210 <qurt+0xf0>
jp     1210 <qurt+0xf0>
movsd  0x8(%rbx),%xmm0
xorpd  0xe18(%rip),%xmm0
divsd  %xmm3,%xmm0
movsd  %xmm0,(%r15)
movq   $0x0,0x8(%r15)
movsd  %xmm0,(%r14)
jmp    123f <qurt+0x11f>
movsd  0x8(%rbx),%xmm1
movapd 0xdf3(%rip),%xmm2
xorpd  %xmm2,%xmm1
unpcklpd %xmm0,%xmm1
unpcklpd %xmm3,%xmm3
divpd  %xmm3,%xmm1
movupd %xmm1,(%r15)
movlpd %xmm1,(%r14)
unpckhpd %xmm1,%xmm1
xorpd  %xmm2,%xmm1
movsd  %xmm1,0x8(%r14)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @qurt(double* %0, double* %1, double* %2) {
%4 = alloca i32
%5 = alloca double*
%6 = alloca double*
%7 = alloca double*
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double* %0, double** %5
store double* %1, double** %6
store double* %2, double** %7
%11 = load double*, double** %5
%12 = getelementptr inbounds double, double* %11, i64 0
%13 = load double, double* %12
%14 = fcmp oeq double %13, 0.000000e+00
br i1 %14, label %15, label %16
15: ; preds = %3
store i32 999, i32* %4
br label %112
16: ; preds = %3
%17 = load double*, double** %5
%18 = getelementptr inbounds double, double* %17, i64 1
%19 = load double, double* %18
%20 = load double*, double** %5
%21 = getelementptr inbounds double, double* %20, i64 1
%22 = load double, double* %21
%23 = load double*, double** %5
%24 = getelementptr inbounds double, double* %23, i64 0
%25 = load double, double* %24
%26 = fmul double 4.000000e+00, %25
%27 = load double*, double** %5
%28 = getelementptr inbounds double, double* %27, i64 2
%29 = load double, double* %28
%30 = fmul double %26, %29
%31 = fneg double %30
%32 = call double @llvm.fmuladd.f64(double %19, double %22, double %31)
store double %32, double* %8
%33 = load double*, double** %5
%34 = getelementptr inbounds double, double* %33, i64 0
%35 = load double, double* %34
%36 = fmul double 2.000000e+00, %35
store double %36, double* %9
%37 = load double, double* %8
%38 = call i32 @fabs(double %37)
%39 = call double @sqrt(i32 %38)
store double %39, double* %10
%40 = load double, double* %8
%41 = fcmp ogt double %40, 0.000000e+00
br i1 %41, label %42, label %67
42: ; preds = %16
%43 = load double*, double** %5
%44 = getelementptr inbounds double, double* %43, i64 1
%45 = load double, double* %44
%46 = fneg double %45
%47 = load double, double* %10
%48 = fadd double %46, %47
%49 = load double, double* %9
%50 = fdiv double %48, %49
%51 = load double*, double** %6
%52 = getelementptr inbounds double, double* %51, i64 0
store double %50, double* %52
%53 = load double*, double** %6
%54 = getelementptr inbounds double, double* %53, i64 1
store double 0.000000e+00, double* %54
%55 = load double*, double** %5
%56 = getelementptr inbounds double, double* %55, i64 1
%57 = load double, double* %56
%58 = fneg double %57
%59 = load double, double* %10
%60 = fsub double %58, %59
%61 = load double, double* %9
%62 = fdiv double %60, %61
%63 = load double*, double** %7
%64 = getelementptr inbounds double, double* %63, i64 0
store double %62, double* %64
%65 = load double*, double** %7
%66 = getelementptr inbounds double, double* %65, i64 1
store double 0.000000e+00, double* %66
store i32 0, i32* %4
br label %112
67: ; preds = %16
%68 = load double, double* %8
%69 = fcmp oeq double %68, 0.000000e+00
br i1 %69, label %70, label %88
70: ; preds = %67
%71 = load double*, double** %5
%72 = getelementptr inbounds double, double* %71, i64 1
%73 = load double, double* %72
%74 = fneg double %73
%75 = load double, double* %9
%76 = fdiv double %74, %75
%77 = load double*, double** %6
%78 = getelementptr inbounds double, double* %77, i64 0
store double %76, double* %78
%79 = load double*, double** %6
%80 = getelementptr inbounds double, double* %79, i64 1
store double 0.000000e+00, double* %80
%81 = load double*, double** %6
%82 = getelementptr inbounds double, double* %81, i64 0
%83 = load double, double* %82
%84 = load double*, double** %7
%85 = getelementptr inbounds double, double* %84, i64 0
store double %83, double* %85
%86 = load double*, double** %7
%87 = getelementptr inbounds double, double* %86, i64 1
store double 0.000000e+00, double* %87
store i32 0, i32* %4
br label %112
88: ; preds = %67
%89 = load double, double* %9
%90 = load double, double* %10
%91 = fdiv double %90, %89
store double %91, double* %10
%92 = load double*, double** %5
%93 = getelementptr inbounds double, double* %92, i64 1
%94 = load double, double* %93
%95 = fneg double %94
%96 = load double, double* %9
%97 = fdiv double %95, %96
%98 = load double*, double** %6
%99 = getelementptr inbounds double, double* %98, i64 0
store double %97, double* %99
%100 = load double, double* %10
%101 = load double*, double** %6
%102 = getelementptr inbounds double, double* %101, i64 1
store double %100, double* %102
%103 = load double*, double** %6
%104 = getelementptr inbounds double, double* %103, i64 0
%105 = load double, double* %104
%106 = load double*, double** %7
%107 = getelementptr inbounds double, double* %106, i64 0
store double %105, double* %107
%108 = load double, double* %10
%109 = fneg double %108
%110 = load double*, double** %7
%111 = getelementptr inbounds double, double* %110, i64 1
store double %109, double* %111
store i32 0, i32* %4
br label %112
112: ; preds = %88, %70, %42, %15
%113 = load i32, i32* %4
ret i32 %113
}

LLVM IR (-O2):
define i32 @qurt(double* nocapture %0, double* nocapture writeonly %1, double* nocapture writeonly %2) {
%4 = load double, double* %0
%5 = fcmp oeq double %4, 0.000000e+00
br i1 %5, label %49, label %6
6: ; preds = %3
%7 = getelementptr inbounds double, double* %0, i64 1
%8 = load double, double* %7
%9 = getelementptr inbounds double, double* %0, i64 2
%10 = load double, double* %9
%11 = fmul double %4, -4.000000e+00
%12 = fmul double %11, %10
%13 = tail call double @llvm.fmuladd.f64(double %8, double %8, double %12)
%14 = fmul double %4, 2.000000e+00
%15 = tail call i32 @fabs(double %13)
%16 = tail call double @sqrt(i32 %15)
%17 = fcmp ogt double %13, 0.000000e+00
br i1 %17, label %18, label %27
18: ; preds = %6
%19 = load double, double* %7
%20 = fsub double %16, %19
%21 = fdiv double %20, %14
store double %21, double* %1
%22 = getelementptr inbounds double, double* %1, i64 1
store double 0.000000e+00, double* %22
%23 = load double, double* %7
%24 = fneg double %23
%25 = fsub double %24, %16
%26 = fdiv double %25, %14
store double %26, double* %2
br label %46
27: ; preds = %6
%28 = fcmp oeq double %13, 0.000000e+00
br i1 %28, label %29, label %34
29: ; preds = %27
%30 = load double, double* %7
%31 = fneg double %30
%32 = fdiv double %31, %14
store double %32, double* %1
%33 = getelementptr inbounds double, double* %1, i64 1
store double 0.000000e+00, double* %33
store double %32, double* %2
br label %46
34: ; preds = %27
%35 = load double, double* %7
%36 = fneg double %35
%37 = insertelement <2 x double> poison, double %36, i64 0
%38 = insertelement <2 x double> %37, double %16, i64 1
%39 = insertelement <2 x double> poison, double %14, i64 0
%40 = shufflevector <2 x double> %39, <2 x double> poison, <2 x i32> zeroinitializer
%41 = fdiv <2 x double> %38, %40
%42 = bitcast double* %1 to <2 x double>*
store <2 x double> %41, <2 x double>* %42
%43 = extractelement <2 x double> %41, i64 0
store double %43, double* %2
%44 = extractelement <2 x double> %41, i64 1
%45 = fneg double %44
br label %46
46: ; preds = %18, %29, %34
%47 = phi double [ %45, %34 ], [ 0.000000e+00, %29 ], [ 0.000000e+00, %18 ]
%48 = getelementptr inbounds double, double* %2, i64 1
store double %47, double* %48
br label %49
49: ; preds = %46, %3
%50 = phi i32 [ 999, %3 ], [ 0, %46 ]
ret i32 %50
}