#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;
  while (1) {
    printf("Enter coeficients a, b, and c: ");
    scanf("%lf %lf %lf", &a, &b, &c);
    if (a == 0 && b == 0 && c == 0) {
      break;
    }
    solveQuadraticEquation(a, b, c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%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
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11b0 <main+0x80>
jp     11b0 <main+0x80>
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11b0 <main+0x80>
jp     11b0 <main+0x80>
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11b0 <main+0x80>
jp     11b0 <main+0x80>
jmp    11c9 <main+0x99>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
call   1040 <solveQuadraticEquation@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x20,%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),%rdi
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
lea    0x18(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0x8(%rsp),%rcx
call   1050 <scanf@plt>
movsd  0x18(%rsp),%xmm0
xorpd  %xmm3,%xmm3
ucomisd %xmm3,%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
jne    1196 <main+0x66>
jp     1196 <main+0x66>
ucomisd %xmm3,%xmm1
jne    1196 <main+0x66>
jp     1196 <main+0x66>
xorpd  %xmm3,%xmm3
ucomisd %xmm3,%xmm2
jne    1196 <main+0x66>
jnp    120c <main+0xdc>
lea    0xe63(%rip),%r14
lea    0xe7c(%rip),%r15
lea    0x18(%rsp),%r12
lea    0x10(%rsp),%r13
lea    0x8(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
call   1040 <solveQuadraticEquation@plt>
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
mov    %rbx,%rcx
call   1050 <scanf@plt>
xorpd  %xmm3,%xmm3
movsd  0x18(%rsp),%xmm0
ucomisd %xmm3,%xmm0
movsd  0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
jne    11c0 <main+0x90>
jp     11c0 <main+0x90>
ucomisd %xmm3,%xmm1
jne    11c0 <main+0x90>
jp     11c0 <main+0x90>
ucomisd %xmm3,%xmm2
jne    11c0 <main+0x90>
jp     11c0 <main+0x90>
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 = [12 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 = %0, %17
%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 ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), double* %2, double* %3, double* %4)
%8 = load double, double* %2
%9 = fcmp oeq double %8, 0.000000e+00
br i1 %9, label %10, label %17
10: ; preds = %5
%11 = load double, double* %3
%12 = fcmp oeq double %11, 0.000000e+00
br i1 %12, label %13, label %17
13: ; preds = %10
%14 = load double, double* %4
%15 = fcmp oeq double %14, 0.000000e+00
br i1 %15, label %16, label %17
16: ; preds = %13
br label %22
17: ; preds = %13, %10, %5
%18 = load double, double* %2
%19 = load double, double* %3
%20 = load double, double* %4
%21 = call i32 @solveQuadraticEquation(double %18, double %19, double %20)
br label %5
22: ; preds = %16
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"Enter coeficients a, b, and c: \00"
@.str.1 = [12 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*
%7 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), double* %1, double* %2, double* %3)
%9 = load double, double* %1
%10 = fcmp oeq double %9, 0.000000e+00
%11 = load double, double* %2
%12 = fcmp oeq double %11, 0.000000e+00
%13 = select i1 %10, i1 %12, i1 false
%14 = load double, double* %3
%15 = fcmp oeq double %14, 0.000000e+00
%16 = select i1 %13, i1 %15, i1 false
br i1 %16, label %32, label %17
17: ; preds = %0, %17
%18 = phi double [ %29, %17 ], [ %14, %0 ]
%19 = phi double [ %26, %17 ], [ %11, %0 ]
%20 = phi double [ %24, %17 ], [ %9, %0 ]
%21 = call i32 @solveQuadraticEquation(double %20, double %19, double %18)
%22 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%23 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), double* %1, double* %2, double* %3)
%24 = load double, double* %1
%25 = fcmp oeq double %24, 0.000000e+00
%26 = load double, double* %2
%27 = fcmp oeq double %26, 0.000000e+00
%28 = select i1 %25, i1 %27, i1 false
%29 = load double, double* %3
%30 = fcmp oeq double %29, 0.000000e+00
%31 = select i1 %28, i1 %30, i1 false
br i1 %31, label %32, label %17
32: ; preds = %17, %0
ret i32 0
}