#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, disc, x1, x2, p, q;
  scanf("%lf%lf%lf", &a, &b, &c);
  disc = b * b - 4 * a * c;
  if (disc < 0)
    printf("This equation hasn't real roots\n");
  else {
    p = -b / (2.0 * a);
    q = sqrt(disc) / (2.0 * a);
    x1 = p + q;
    x2 = p - q;
    printf("real roots:\nx1=%7.2f\nx2=%7.2f\n", x1, 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
jbe    11b8 <main+0x88>
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1240 <main+0x110>
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xe2c(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1050 <sqrt@plt>
movsd  0xe0c(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x40(%rbp),%xmm0
addsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x40(%rbp),%xmm0
subsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
lea    0xe02(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
lea    0xed5(%rip),%rdi
lea    0x8(%rsp),%rsi
lea    0x18(%rsp),%rdx
lea    0x10(%rsp),%rcx
call   1050 <scanf@plt>
movsd  0x18(%rsp),%xmm1
movsd  0x8(%rsp),%xmm3
movsd  0xe8d(%rip),%xmm2
mulsd  %xmm3,%xmm2
mulsd  0x10(%rsp),%xmm2
movapd %xmm1,%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
xorpd  %xmm2,%xmm2
ucomisd %xmm0,%xmm2
jbe    11a1 <main+0x61>
lea    0xeaf(%rip),%rdi
call   1030 <puts@plt>
jmp    1206 <main+0xc6>
xorpd  0xe67(%rip),%xmm1
ucomisd %xmm2,%xmm0
jb     11b5 <main+0x75>
sqrtsd %xmm0,%xmm0
jmp    11d2 <main+0x92>
movapd %xmm1,0x30(%rsp)
movapd %xmm3,0x20(%rsp)
call   1060 <sqrt@plt>
movapd 0x20(%rsp),%xmm3
movapd 0x30(%rsp),%xmm1
movhpd 0x8(%rsp),%xmm3
addpd  %xmm3,%xmm3
unpcklpd %xmm0,%xmm1
divpd  %xmm3,%xmm1
movapd %xmm1,%xmm2
unpckhpd %xmm1,%xmm2
movapd %xmm1,%xmm0
addsd  %xmm2,%xmm0
subsd  %xmm2,%xmm1
lea    0xe2b(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%lf%lf%lf\00"
@.str.1 = [33 x i8] c"This equation hasn't real roots\0A\00"
@.str.2 = [31 x i8] c"real roots:\0Ax1=%7.2f\0Ax2=%7.2f\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
%9 = alloca double
store i32 0, i32* %1
%10 = call i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double* %2, double* %3, double* %4)
%11 = load double, double* %3
%12 = load double, double* %3
%13 = load double, double* %2
%14 = fmul double 4.000000e+00, %13
%15 = load double, double* %4
%16 = fmul double %14, %15
%17 = fneg double %16
%18 = call double @llvm.fmuladd.f64(double %11, double %12, double %17)
store double %18, double* %5
%19 = load double, double* %5
%20 = fcmp olt double %19, 0.000000e+00
br i1 %20, label %21, label %23
21: ; preds = %0
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
br label %43
23: ; preds = %0
%24 = load double, double* %3
%25 = fneg double %24
%26 = load double, double* %2
%27 = fmul double 2.000000e+00, %26
%28 = fdiv double %25, %27
store double %28, double* %8
%29 = load double, double* %5
%30 = call double @sqrt(double %29)
%31 = load double, double* %2
%32 = fmul double 2.000000e+00, %31
%33 = fdiv double %30, %32
store double %33, double* %9
%34 = load double, double* %8
%35 = load double, double* %9
%36 = fadd double %34, %35
store double %36, double* %6
%37 = load double, double* %8
%38 = load double, double* %9
%39 = fsub double %37, %38
store double %39, double* %7
%40 = load double, double* %6
%41 = load double, double* %7
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), double %40, double %41)
br label %43
43: ; preds = %23, %21
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"%lf%lf%lf\00"
@.str.2 = [31 x i8] c"real roots:\0Ax1=%7.2f\0Ax2=%7.2f\0A\00"
@str = [32 x i8] c"This equation hasn't real roots\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 ([10 x i8], [10 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
br i1 %14, label %15, label %17
15: ; preds = %0
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
br label %32
17: ; preds = %0
%18 = fneg double %8
%19 = call double @sqrt(double %13)
%20 = load double, double* %1
%21 = insertelement <2 x double> poison, double %9, i64 0
%22 = insertelement <2 x double> %21, double %20, i64 1
%23 = fmul <2 x double> %22, <double 2.000000e+00, double 2.000000e+00>
%24 = insertelement <2 x double> poison, double %18, i64 0
%25 = insertelement <2 x double> %24, double %19, i64 1
%26 = fdiv <2 x double> %25, %23
%27 = extractelement <2 x double> %26, i64 0
%28 = extractelement <2 x double> %26, i64 1
%29 = fadd double %27, %28
%30 = fsub double %27, %28
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), double %29, double %30)
br label %32
32: ; preds = %17, %15
ret i32 0
}