#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 = 0, B = 0, C = 0, delta = 0, R1 = 0, R2 = 0, i = 1;
  scanf("%lf %lf %lf", &A, &B, &C);
  delta = (B * B) - 4 * A * C;
  R1 = (-B + sqrt(delta)) / (2 * A);
  R2 = (-B - sqrt(delta)) / (2 * A);
  if (delta < 0 || A == 0) {
    printf("Impossivel calcular\n");
  } else {
    printf("R1 = %.5lf\nR2 = %.5lf\n", R1, R2);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe99(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
lea    0xe95(%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  0xe62(%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)
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  0xded(%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,-0x48(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  0xda0(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x28(%rbp),%xmm0
ja     1294 <main+0x164>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    12a7 <main+0x177>
jp     12a7 <main+0x177>
lea    0xd89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12bf <main+0x18f>
movsd  -0x30(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
lea    0xd81(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x58,%rsp
movq   $0x0,0x8(%rsp)
movq   $0x0,0x18(%rsp)
movq   $0x0,0x28(%rsp)
lea    0xeba(%rip),%rdi
lea    0x8(%rsp),%rsi
lea    0x18(%rsp),%rdx
lea    0x28(%rsp),%rcx
call   1050 <scanf@plt>
movsd  0x18(%rsp),%xmm6
movsd  0x8(%rsp),%xmm0
mulsd  0xe72(%rip),%xmm0
mulsd  0x28(%rsp),%xmm0
movsd  %xmm6,0x38(%rsp)
mulsd  %xmm6,%xmm6
addsd  %xmm0,%xmm6
sqrtsd %xmm6,%xmm4
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm6
movapd %xmm4,%xmm2
movsd  %xmm6,0x20(%rsp)
jae    11dd <main+0x9d>
movapd %xmm6,%xmm0
movsd  %xmm4,0x10(%rsp)
call   1060 <sqrt@plt>
movsd  0x20(%rsp),%xmm6
movsd  0x10(%rsp),%xmm4
movapd %xmm0,%xmm2
xorpd  %xmm0,%xmm0
movsd  0x8(%rsp),%xmm5
movsd  0x18(%rsp),%xmm1
ucomisd %xmm0,%xmm6
jae    1226 <main+0xe6>
movapd %xmm6,%xmm0
movsd  %xmm2,0x10(%rsp)
movapd %xmm1,0x40(%rsp)
movsd  %xmm5,0x30(%rsp)
call   1060 <sqrt@plt>
movsd  0x20(%rsp),%xmm6
movsd  0x30(%rsp),%xmm5
movapd 0x40(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
movapd %xmm0,%xmm4
xorpd  %xmm3,%xmm3
ucomisd %xmm6,%xmm3
ja     1274 <main+0x134>
movsd  0x8(%rsp),%xmm0
ucomisd %xmm3,%xmm0
jne    123e <main+0xfe>
jnp    1274 <main+0x134>
xorpd  0xdca(%rip),%xmm1
subsd  %xmm4,%xmm1
addsd  %xmm0,%xmm0
divsd  %xmm0,%xmm1
subsd  0x38(%rsp),%xmm2
addsd  %xmm5,%xmm5
divsd  %xmm5,%xmm2
lea    0xdc5(%rip),%rdi
movapd %xmm2,%xmm0
mov    $0x2,%al
call   1040 <printf@plt>
jmp    1280 <main+0x140>
lea    0xdc8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x58,%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 = [23 x i8] c"R1 = %.5lf\0AR2 = %.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
%8 = alloca double
store i32 0, i32* %1
store double 0.000000e+00, double* %2
store double 0.000000e+00, double* %3
store double 0.000000e+00, double* %4
store double 0.000000e+00, double* %5
store double 0.000000e+00, double* %6
store double 0.000000e+00, double* %7
store double 1.000000e+00, double* %8
%9 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double* %2, double* %3, double* %4)
%10 = load double, double* %3
%11 = load double, double* %3
%12 = load double, double* %2
%13 = fmul double 4.000000e+00, %12
%14 = load double, double* %4
%15 = fmul double %13, %14
%16 = fneg double %15
%17 = call double @llvm.fmuladd.f64(double %10, double %11, double %16)
store double %17, double* %5
%18 = load double, double* %3
%19 = fneg double %18
%20 = load double, double* %5
%21 = call double @sqrt(double %20)
%22 = fadd double %19, %21
%23 = load double, double* %2
%24 = fmul double 2.000000e+00, %23
%25 = fdiv double %22, %24
store double %25, double* %6
%26 = load double, double* %3
%27 = fneg double %26
%28 = load double, double* %5
%29 = call double @sqrt(double %28)
%30 = fsub double %27, %29
%31 = load double, double* %2
%32 = fmul double 2.000000e+00, %31
%33 = fdiv double %30, %32
store double %33, double* %7
%34 = load double, double* %5
%35 = fcmp olt double %34, 0.000000e+00
br i1 %35, label %39, label %36
36: ; preds = %0
%37 = load double, double* %2
%38 = fcmp oeq double %37, 0.000000e+00
br i1 %38, label %39, label %41
39: ; preds = %36, %0
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
br label %45
41: ; preds = %36
%42 = load double, double* %6
%43 = load double, double* %7
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), double %42, double %43)
br label %45
45: ; preds = %41, %39
ret i32 0
}

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