#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 pow(double, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, double *, double *, double *);
double sqrt(double);
int main() {
  double a, b, c, d, x, y;
  scanf("%lf %lf %lf", &a, &b, &c);
  d = (pow(b, 2) - (4 * a * c));
  x = ((-b) + sqrt(d)) / (2 * a);
  y = ((-b) - sqrt(d)) / (2 * a);
  if (a != 0 && d > 0) {
    printf("R1 = %0.5lf\nR2 = %0.5lf\n", x, y);
  } else {
    printf("Impossivel calcular\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
call   1040 <scanf@plt>
movsd  -0x18(%rbp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
cvtsi2sd %eax,%xmm1
movsd  0xe86(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
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,-0x48(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1060 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  0xe11(%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   1060 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  0xdc4(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1267 <main+0x127>
jp     1267 <main+0x127>
jmp    1296 <main+0x156>
movsd  -0x28(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1296 <main+0x156>
movsd  -0x30(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
lea    0xd92(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
jmp    12a4 <main+0x164>
lea    0xd98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x58,%rsp
lea    0xec5(%rip),%rdi
lea    0x18(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0x38(%rsp),%rcx
call   1050 <scanf@plt>
movsd  0x10(%rsp),%xmm0
mov    $0x2,%edi
call   1060 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x18(%rsp),%xmm4
mulsd  0xe6c(%rip),%xmm4
mulsd  0x38(%rsp),%xmm4
addsd  %xmm0,%xmm4
movsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x30(%rsp)
sqrtsd %xmm4,%xmm5
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm4
movapd %xmm5,%xmm2
movsd  %xmm4,0x20(%rsp)
jae    11e5 <main+0x95>
movapd %xmm4,%xmm0
movsd  %xmm5,0x8(%rsp)
call   1070 <sqrt@plt>
movsd  0x8(%rsp),%xmm5
movsd  0x20(%rsp),%xmm4
movapd %xmm0,%xmm2
xorpd  %xmm0,%xmm0
movsd  0x18(%rsp),%xmm6
movsd  0x10(%rsp),%xmm1
ucomisd %xmm0,%xmm4
jae    122e <main+0xde>
movapd %xmm4,%xmm0
movsd  %xmm2,0x8(%rsp)
movapd %xmm1,0x40(%rsp)
movsd  %xmm6,0x28(%rsp)
call   1070 <sqrt@plt>
movsd  0x28(%rsp),%xmm6
movsd  0x20(%rsp),%xmm4
movapd 0x40(%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
movapd %xmm0,%xmm5
xorpd  %xmm3,%xmm3
ucomisd %xmm3,%xmm4
jbe    127c <main+0x12c>
movsd  0x18(%rsp),%xmm0
ucomisd %xmm3,%xmm0
jne    1246 <main+0xf6>
jnp    127c <main+0x12c>
xorpd  0xdc2(%rip),%xmm1
subsd  %xmm5,%xmm1
addsd  %xmm0,%xmm0
divsd  %xmm0,%xmm1
subsd  0x30(%rsp),%xmm2
addsd  %xmm6,%xmm6
divsd  %xmm6,%xmm2
lea    0xdbd(%rip),%rdi
movapd %xmm2,%xmm0
mov    $0x2,%al
call   1040 <printf@plt>
jmp    1288 <main+0x138>
lea    0xdc2(%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 = [25 x i8] c"R1 = %0.5lf\0AR2 = %0.5lf\0A\00"
@.str.2 = [21 x i8] c"Impossivel calcular\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 = call i32 @pow(double %9, i32 2)
%11 = sitofp i32 %10 to double
%12 = load double, double* %2
%13 = fmul double 4.000000e+00, %12
%14 = load double, double* %4
%15 = fneg double %13
%16 = call double @llvm.fmuladd.f64(double %15, double %14, double %11)
store double %16, double* %5
%17 = load double, double* %3
%18 = fneg double %17
%19 = load double, double* %5
%20 = call double @sqrt(double %19)
%21 = fadd double %18, %20
%22 = load double, double* %2
%23 = fmul double 2.000000e+00, %22
%24 = fdiv double %21, %23
store double %24, double* %6
%25 = load double, double* %3
%26 = fneg double %25
%27 = load double, double* %5
%28 = call double @sqrt(double %27)
%29 = fsub double %26, %28
%30 = load double, double* %2
%31 = fmul double 2.000000e+00, %30
%32 = fdiv double %29, %31
store double %32, double* %7
%33 = load double, double* %2
%34 = fcmp une double %33, 0.000000e+00
br i1 %34, label %35, label %42
35: ; preds = %0
%36 = load double, double* %5
%37 = fcmp ogt double %36, 0.000000e+00
br i1 %37, label %38, label %42
38: ; preds = %35
%39 = load double, double* %6
%40 = load double, double* %7
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), double %39, double %40)
br label %44
42: ; preds = %35, %0
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
br label %44
44: ; preds = %42, %38
ret i32 0
}

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