#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*/ printf(char *);
int /*<<< orphan*/ scanf(char *, double *, double *, double *);
int /*<<< orphan*/ solveQuadraticEquation(double, double, double);
int main(void) {
  double a, b, c;
  do {
    printf("Enter coeficients a, b, and c: ");
    scanf(" %lf %lf %lf", &a, &b, &c);
    solveQuadraticEquation(a, b, c);
  } while (a != 0 && b != 0 && c != 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
call   1050 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
call   1040 <solveQuadraticEquation@plt>
movsd  -0x10(%rbp),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x21(%rbp)
jne    1199 <main+0x69>
jp     1199 <main+0x69>
jmp    11d2 <main+0xa2>
movsd  -0x18(%rbp),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x21(%rbp)
jne    11bb <main+0x8b>
jp     11bb <main+0x8b>
jmp    11d2 <main+0xa2>
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
setne  %al
setp   %cl
or     %cl,%al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    113f <main+0xf>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x20,%rsp
lea    0xebc(%rip),%r14
lea    0xed5(%rip),%r15
lea    0x18(%rsp),%r12
lea    0x10(%rsp),%r13
lea    0x8(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
mov    %rbx,%rcx
call   1050 <scanf@plt>
movsd  0x18(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
call   1040 <solveQuadraticEquation@plt>
xorpd  %xmm1,%xmm1
movsd  0x18(%rsp),%xmm0
ucomisd %xmm1,%xmm0
jne    11a2 <main+0x72>
jnp    11be <main+0x8e>
movsd  0x10(%rsp),%xmm0
ucomisd %xmm1,%xmm0
jne    11b0 <main+0x80>
jnp    11be <main+0x8e>
movsd  0x8(%rsp),%xmm0
ucomisd %xmm1,%xmm0
jne    1160 <main+0x30>
jp     1160 <main+0x30>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Enter coeficients a, b, and c: \00"
@.str.1 = [13 x i8] c" %lf %lf %lf\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
br label %5
5: ; preds = %21, %0
%6 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double* %2, double* %3, double* %4)
%8 = load double, double* %2
%9 = load double, double* %3
%10 = load double, double* %4
%11 = call i32 @solveQuadraticEquation(double %8, double %9, double %10)
br label %12
12: ; preds = %5
%13 = load double, double* %2
%14 = fcmp une double %13, 0.000000e+00
br i1 %14, label %15, label %21
15: ; preds = %12
%16 = load double, double* %3
%17 = fcmp une double %16, 0.000000e+00
br i1 %17, label %18, label %21
18: ; preds = %15
%19 = load double, double* %4
%20 = fcmp une double %19, 0.000000e+00
br label %21
21: ; preds = %18, %15, %12
%22 = phi i1 [ false, %15 ], [ false, %12 ], [ %20, %18 ]
br i1 %22, label %5, label %23
23: ; preds = %21
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"Enter coeficients a, b, and c: \00"
@.str.1 = [13 x i8] c" %lf %lf %lf\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = bitcast double* %1 to i8*
%5 = bitcast double* %2 to i8*
%6 = bitcast double* %3 to i8*
br label %7
7: ; preds = %7, %0
%8 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double* %1, double* %2, double* %3)
%10 = load double, double* %1
%11 = load double, double* %2
%12 = load double, double* %3
%13 = call i32 @solveQuadraticEquation(double %10, double %11, double %12)
%14 = load double, double* %1
%15 = fcmp une double %14, 0.000000e+00
%16 = load double, double* %2
%17 = fcmp une double %16, 0.000000e+00
%18 = select i1 %15, i1 %17, i1 false
%19 = load double, double* %3
%20 = fcmp une double %19, 0.000000e+00
%21 = select i1 %18, i1 %20, i1 false
br i1 %21, label %7, label %22
22: ; preds = %7
ret i32 0
}