#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 *);
double sqrt(double);
int main() {
  double a, b, c;
  scanf("%lf %lf %lf", &a, &b, &c);
  double delta = b * b - 4 * a * c;
  if (delta < 0 || a == 0) {
    printf("Impossivel calcular\n");
  } else {
    double x1, x2;
    x1 = (-b + sqrt(delta)) / (2 * a);
    x2 = (-b - sqrt(delta)) / (2 * a);
    printf("R1 = %.5lf\n", x1);
    printf("R2 = %.5lf\n", x2);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
call   1040 <scanf@plt>
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  0xe97(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x28(%rbp),%xmm0
ja     11bd <main+0x8d>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11d0 <main+0xa0>
jp     11d0 <main+0xa0>
lea    0xe58(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1290 <main+0x160>
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  0xdf9(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  0xdac(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
lea    0xdbb(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x38(%rbp),%xmm0
lea    0xdb4(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
lea    0xed5(%rip),%rdi
lea    0x8(%rsp),%rsi
lea    0x20(%rsp),%rdx
lea    0x30(%rsp),%rcx
call   1050 <scanf@plt>
movsd  0x20(%rsp),%xmm3
movsd  0x8(%rsp),%xmm0
movsd  0xe8d(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  0x30(%rsp),%xmm1
movapd %xmm3,%xmm2
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
xorpd  %xmm1,%xmm1
ucomisd %xmm2,%xmm1
ja     1271 <main+0x131>
ucomisd %xmm1,%xmm0
jne    11a3 <main+0x63>
jnp    1271 <main+0x131>
sqrtsd %xmm2,%xmm4
xorpd  %xmm5,%xmm5
ucomisd %xmm5,%xmm2
movapd %xmm4,%xmm1
jae    11e8 <main+0xa8>
movapd %xmm2,%xmm0
movsd  %xmm2,0x10(%rsp)
movsd  %xmm3,(%rsp)
movsd  %xmm4,0x28(%rsp)
call   1060 <sqrt@plt>
xorpd  %xmm5,%xmm5
movsd  0x28(%rsp),%xmm4
movsd  (%rsp),%xmm3
movsd  0x10(%rsp),%xmm2
movapd %xmm0,%xmm1
subsd  %xmm3,%xmm1
movsd  0x8(%rsp),%xmm0
addsd  %xmm0,%xmm0
divsd  %xmm0,%xmm1
movsd  0x20(%rsp),%xmm0
xorpd  0xe08(%rip),%xmm0
movapd %xmm0,0x10(%rsp)
ucomisd %xmm5,%xmm2
jae    122b <main+0xeb>
movapd %xmm2,%xmm0
movsd  %xmm1,(%rsp)
call   1060 <sqrt@plt>
movsd  (%rsp),%xmm1
movapd %xmm0,%xmm4
movapd 0x10(%rsp),%xmm2
subsd  %xmm4,%xmm2
movsd  0x8(%rsp),%xmm0
addsd  %xmm0,%xmm0
divsd  %xmm0,%xmm2
movapd %xmm2,0x10(%rsp)
lea    0xddc(%rip),%rdi
movapd %xmm1,%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xdd6(%rip),%rdi
movapd 0x10(%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
jmp    127d <main+0x13d>
lea    0xdcc(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"%lf %lf %lf\00"
@.str.1 = [21 x i8] c"Impossivel calcular\0A\00"
@.str.2 = [12 x i8] c"R1 = %.5lf\0A\00"
@.str.3 = [12 x i8] c"R2 = %.5lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store i32 0, i32* %1
%8 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double* %2, double* %3, double* %4)
%9 = load double, double* %3
%10 = load double, double* %3
%11 = load double, double* %2
%12 = fmul double 4.000000e+00, %11
%13 = load double, double* %4
%14 = fmul double %12, %13
%15 = fneg double %14
%16 = call double @llvm.fmuladd.f64(double %9, double %10, double %15)
store double %16, double* %5
%17 = load double, double* %5
%18 = fcmp olt double %17, 0.000000e+00
br i1 %18, label %22, label %19
19: ; preds = %0
%20 = load double, double* %2
%21 = fcmp oeq double %20, 0.000000e+00
br i1 %21, label %22, label %24
22: ; preds = %19, %0
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
br label %45
24: ; preds = %19
%25 = load double, double* %3
%26 = fneg double %25
%27 = load double, double* %5
%28 = call double @sqrt(double %27)
%29 = fadd double %26, %28
%30 = load double, double* %2
%31 = fmul double 2.000000e+00, %30
%32 = fdiv double %29, %31
store double %32, double* %6
%33 = load double, double* %3
%34 = fneg double %33
%35 = load double, double* %5
%36 = call double @sqrt(double %35)
%37 = fsub double %34, %36
%38 = load double, double* %2
%39 = fmul double 2.000000e+00, %38
%40 = fdiv double %37, %39
store double %40, double* %7
%41 = load double, double* %6
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), double %41)
%43 = load double, double* %7
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), double %43)
br label %45
45: ; preds = %24, %22
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"%lf %lf %lf\00"
@.str.2 = [12 x i8] c"R1 = %.5lf\0A\00"
@.str.3 = [12 x i8] c"R2 = %.5lf\0A\00"
@str = [20 x i8] c"Impossivel calcular\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 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double* %1, double* %2, double* %3)
%8 = load double, double* %2
%9 = load double, double* %1
%10 = load double, double* %3
%11 = fmul double %9, -4.000000e+00
%12 = fmul double %11, %10
%13 = call double @llvm.fmuladd.f64(double %8, double %8, double %12)
%14 = fcmp olt double %13, 0.000000e+00
%15 = fcmp oeq double %9, 0.000000e+00
%16 = select i1 %14, i1 true, i1 %15
br i1 %16, label %17, label %19
17: ; preds = %0
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
br label %34
19: ; preds = %0
%20 = call double @sqrt(double %13)
%21 = fsub double %20, %8
%22 = load double, double* %1
%23 = fmul double %22, 2.000000e+00
%24 = fdiv double %21, %23
%25 = load double, double* %2
%26 = fneg double %25
%27 = call double @sqrt(double %13)
%28 = fsub double %26, %27
%29 = load double, double* %1
%30 = fmul double %29, 2.000000e+00
%31 = fdiv double %28, %30
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), double %24)
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), double %31)
br label %34
34: ; preds = %19, %17
ret i32 0
}