#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*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, double *, double *, double *);
double sqrt(double);
int /*<<< orphan*/ system(char *);
main() {
  double a, b, c, d, x1, x2;
  system("cls");
  printf("Introducir los coeficientes a b c: ");
  scanf("%lf %lf %lf", &a, &b, &c);
  d = b * b - 4 * a * c;
  (d < 0)     ? printf("Las raíces son complejas\n"),
      exit(0) : printf("Las raíces reales son:\n");
  d = sqrt(d);
  x1 = (-b + d) / (2 * a);
  x2 = (-b - d) / (2 * a);
  printf("x1 = %g\nx2 = %g\n", x1, x2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1030 <system@plt>
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeb8(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
call   1050 <scanf@plt>
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  0xe5d(%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    11f4 <main+0xa4>
lea    0xe5e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %edi,%edi
call   1070 <exit@plt>
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsd  -0x28(%rbp),%xmm0
call   1060 <sqrt@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  0xdce(%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
subsd  -0x28(%rbp),%xmm0
movsd  0xd97(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
lea    0xde8(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
lea    0xeb5(%rip),%rdi
call   1040 <system@plt>
lea    0xead(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xec3(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
lea    0x20(%rsp),%rcx
call   1060 <scanf@plt>
movsd  0x10(%rsp),%xmm0
mulsd  0xe59(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  0x20(%rsp),%xmm0
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
xorpd  %xmm0,%xmm0
movsd  %xmm1,0x18(%rsp)
ucomisd %xmm1,%xmm0
ja     1233 <main+0xd3>
lea    0xe93(%rip),%rdi
call   1030 <puts@plt>
movsd  0x18(%rsp),%xmm0
ucomisd 0xe23(%rip),%xmm0
jb     11ed <main+0x8d>
sqrtsd %xmm0,%xmm0
jmp    11f2 <main+0x92>
call   1070 <sqrt@plt>
movsd  0x8(%rsp),%xmm2
movapd 0xe10(%rip),%xmm1
xorpd  %xmm2,%xmm1
subsd  %xmm0,%xmm1
subsd  %xmm2,%xmm0
movsd  0x10(%rsp),%xmm2
addsd  %xmm2,%xmm2
divsd  %xmm2,%xmm0
divsd  %xmm2,%xmm1
lea    0xe2f(%rip),%rdi
mov    $0x2,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret
lea    0xe43(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"cls\00"
@.str.1 = [36 x i8] c"Introducir los coeficientes a b c: \00"
@.str.2 = [12 x i8] c"%lf %lf %lf\00"
@.str.3 = [27 x i8] c"Las ra\C3\ADces son complejas\0A\00"
@.str.4 = [25 x i8] c"Las ra\C3\ADces reales son:\0A\00"
@.str.5 = [17 x i8] c"x1 = %g\0Ax2 = %g\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 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, 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 %25
21: ; preds = %0
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
%23 = call i32 @exit(i32 0)
unreachable
24: ; No predecessors!
br label %27
25: ; preds = %0
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
br label %27
27: ; preds = %25, %24
%28 = phi i32 [ undef, %24 ], [ %26, %25 ]
%29 = load double, double* %5
%30 = call double @sqrt(double %29)
store double %30, double* %5
%31 = load double, double* %3
%32 = fneg double %31
%33 = load double, double* %5
%34 = fadd double %32, %33
%35 = load double, double* %2
%36 = fmul double 2.000000e+00, %35
%37 = fdiv double %34, %36
store double %37, double* %6
%38 = load double, double* %3
%39 = fneg double %38
%40 = load double, double* %5
%41 = fsub double %39, %40
%42 = load double, double* %2
%43 = fmul double 2.000000e+00, %42
%44 = fdiv double %41, %43
store double %44, double* %7
%45 = load double, double* %6
%46 = load double, double* %7
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), double %45, double %46)
%48 = load i32, i32* %1
ret i32 %48
}

LLVM IR (-O2):
@.str = [4 x i8] c"cls\00"
@.str.1 = [36 x i8] c"Introducir los coeficientes a b c: \00"
@.str.2 = [12 x i8] c"%lf %lf %lf\00"
@.str.5 = [17 x i8] c"x1 = %g\0Ax2 = %g\0A\00"
@str = [24 x i8] c"Las ra\C3\ADces reales son:\00"
@str.6 = [26 x i8] c"Las ra\C3\ADces son complejas\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 = tail call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), double* %1, double* %2, double* %3)
%10 = load double, double* %2
%11 = load double, double* %1
%12 = load double, double* %3
%13 = fmul double %11, -4.000000e+00
%14 = fmul double %13, %12
%15 = call double @llvm.fmuladd.f64(double %10, double %10, double %14)
%16 = fcmp olt double %15, 0.000000e+00
br i1 %16, label %17, label %20
17: ; preds = %0
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.6, i64 0, i64 0))
%19 = call i32 @exit(i32 0)
unreachable
20: ; preds = %0
%21 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%22 = call double @sqrt(double %15)
%23 = load double, double* %2
%24 = fneg double %23
%25 = fsub double %22, %23
%26 = load double, double* %1
%27 = fmul double %26, 2.000000e+00
%28 = fdiv double %25, %27
%29 = fsub double %24, %22
%30 = fdiv double %29, %27
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), double %28, double %30)
ret i32 0
}