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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
call   1050 <scanf@plt>
movsd  -0x18(%rbp),%xmm0
mov    $0x2,%edi
call   1060 <pow@plt>
cvtsi2sd %eax,%xmm1
movsd  0xe76(%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,-0x38(%rbp)
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x38(%rbp),%xmm0
call   1070 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  0xe01(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
call   1070 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  0xdb4(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1277 <main+0x127>
jp     1277 <main+0x127>
jmp    12c8 <main+0x178>
movsd  -0x18(%rbp),%xmm0
mov    $0x2,%edi
call   1060 <pow@plt>
cvtsi2sd %eax,%xmm0
movsd  0xd76(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    12db <main+0x18b>
lea    0xd4d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1301 <main+0x1b1>
movsd  -0x28(%rbp),%xmm0
lea    0xd4a(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  -0x30(%rbp),%xmm0
lea    0xd43(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xd41(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x58,%rsp
lea    0xeb5(%rip),%rdi
lea    0x8(%rsp),%rsi
mov    %rsp,%rdx
lea    0x38(%rsp),%rcx
call   1060 <scanf@plt>
movsd  (%rsp),%xmm0
mov    $0x2,%edi
call   1070 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  0xe5f(%rip),%xmm1
mulsd  0x38(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  (%rsp),%xmm0
movsd  %xmm0,0x50(%rsp)
xorps  %xmm0,%xmm0
sqrtsd %xmm1,%xmm0
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm1
movsd  %xmm0,0x28(%rsp)
movsd  %xmm0,0x30(%rsp)
jae    11f2 <main+0x92>
movapd %xmm1,%xmm0
movsd  %xmm1,0x10(%rsp)
call   1080 <sqrt@plt>
xorpd  %xmm2,%xmm2
movsd  0x10(%rsp),%xmm1
movsd  %xmm0,0x30(%rsp)
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x48(%rsp)
movsd  (%rsp),%xmm0
movapd %xmm0,0x10(%rsp)
ucomisd %xmm2,%xmm1
jae    121e <main+0xbe>
movapd %xmm1,%xmm0
call   1080 <sqrt@plt>
movsd  %xmm0,0x28(%rsp)
movsd  0x8(%rsp),%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jne    1230 <main+0xd0>
jnp    1274 <main+0x114>
movsd  (%rsp),%xmm0
mov    $0x2,%edi
movsd  %xmm1,0x40(%rsp)
call   1070 <pow@plt>
movsd  0x40(%rsp),%xmm2
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  0xda0(%rip),%xmm1
mulsd  0x38(%rsp),%xmm1
addsd  %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    1282 <main+0x122>
lea    0xdcf(%rip),%rdi
call   1030 <puts@plt>
jmp    12e0 <main+0x180>
movapd 0x10(%rsp),%xmm3
xorpd  0xd80(%rip),%xmm3
movsd  0x30(%rsp),%xmm0
subsd  0x50(%rsp),%xmm0
movsd  0x48(%rsp),%xmm1
addsd  %xmm1,%xmm1
divsd  %xmm1,%xmm0
subsd  0x28(%rsp),%xmm3
addsd  %xmm2,%xmm2
divsd  %xmm2,%xmm3
movapd %xmm3,0x10(%rsp)
lea    0xd67(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xd65(%rip),%rdi
movapd 0x10(%rsp),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xd5d(%rip),%rdi
call   1040 <system@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 = [12 x i8] c"R1 = %.5lf\0A\00"
@.str.3 = [12 x i8] c"R2 = %.5lf\0A\00"
@.str.4 = [6 x i8] c"pause\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* %7
%17 = load double, double* %3
%18 = fneg double %17
%19 = load double, double* %7
%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* %5
%25 = load double, double* %3
%26 = fneg double %25
%27 = load double, double* %7
%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* %6
%33 = load double, double* %2
%34 = fcmp oeq double %33, 0.000000e+00
br i1 %34, label %45, label %35
35: ; preds = %0
%36 = load double, double* %3
%37 = call i32 @pow(double %36, i32 2)
%38 = sitofp i32 %37 to double
%39 = load double, double* %2
%40 = fmul double 4.000000e+00, %39
%41 = load double, double* %4
%42 = fneg double %40
%43 = call double @llvm.fmuladd.f64(double %42, double %41, double %38)
%44 = fcmp olt double %43, 0.000000e+00
br i1 %44, label %45, label %47
45: ; preds = %35, %0
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
br label %52
47: ; preds = %35
%48 = load double, double* %5
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), double %48)
%50 = load double, double* %6
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), double %50)
br label %52
52: ; preds = %47, %45
%53 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
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.4 = [6 x i8] c"pause\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 = fsub double %16, %15
%18 = load double, double* %1
%19 = fmul double %18, 2.000000e+00
%20 = fdiv double %17, %19
%21 = load double, double* %2
%22 = fneg double %21
%23 = call double @sqrt(double %14)
%24 = fsub double %22, %23
%25 = load double, double* %1
%26 = fmul double %25, 2.000000e+00
%27 = fdiv double %24, %26
%28 = fcmp oeq double %25, 0.000000e+00
br i1 %28, label %38, label %29
29: ; preds = %0
%30 = load double, double* %2
%31 = call i32 @pow(double %30, i32 2)
%32 = sitofp i32 %31 to double
%33 = load double, double* %1
%34 = load double, double* %3
%35 = fmul double %33, -4.000000e+00
%36 = call double @llvm.fmuladd.f64(double %35, double %34, double %32)
%37 = fcmp olt double %36, 0.000000e+00
br i1 %37, label %38, label %40
38: ; preds = %29, %0
%39 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
br label %43
40: ; preds = %29
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), double %20)
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), double %27)
br label %43
43: ; preds = %40, %38
%44 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}