#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 *, float *);
float sqrt(float);
int /*<<< orphan*/ system(char *);
main() {
  system("title 14_CalcularEcuaciónDeSegundoGrado_Cascallar_Autrán_Manuel");
  printf("ECUACION DE SEGUNDO GRADO");
  printf("=========================");
  float a, b, c, r1, r2;
  printf("ax^2 + bx + c = 0\n");
  printf("Introducir el valor de a\n");
  scanf("%d", &a);
  printf("Introducir el valor de b\n");
  scanf("%d", &b);
  printf("Introducir el valor de c\n");
  scanf("%d", &c);
  if ((b * b) - (4 * a * c) < 0) {
    printf("Esta ecuaci\242n non ten soluci\242n\n");
  } else {
    r1 = (b + sqrt((b * b) - (4 * a * c))) / (2 * a);
    r2 = (-b + sqrt((b * b) - (4 * a * c))) / (2 * a);
    printf("\nO resultado da ecuaci\242n \202: %.2f e %.2f\n", r1, r2);
  }
  system("pause");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb2(%rip),%rdi
call   1030 <system@plt>
lea    0xee8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xef4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf00(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf05(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf11(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xf04(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xef3(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xf00(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xed5(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
movss  -0xc(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
movss  0xe0f(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomiss %xmm1,%xmm0
jbe    122f <main+0xef>
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1320 <main+0x1e0>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0xc(%rbp),%xmm0
movss  -0xc(%rbp),%xmm2
movss  0xdb5(%rip),%xmm1
mulss  -0x8(%rbp),%xmm1
mulss  -0x10(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1060 <sqrt@plt>
movaps %xmm0,%xmm1
movss  -0x20(%rbp),%xmm0
addss  %xmm1,%xmm0
movss  0xd81(%rip),%xmm1
mulss  -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0xc(%rbp),%xmm0
movss  -0xc(%rbp),%xmm2
movss  0xd46(%rip),%xmm1
mulss  -0x8(%rbp),%xmm1
mulss  -0x10(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1060 <sqrt@plt>
movaps %xmm0,%xmm1
movss  -0x1c(%rbp),%xmm0
addss  %xmm1,%xmm0
movss  0xd12(%rip),%xmm1
mulss  -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x18(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xde9(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
lea    0xe04(%rip),%rdi
call   1030 <system@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xea8(%rip),%rdi
call   1040 <system@plt>
lea    0xede(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xeea(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xf28(%rip),%rdi
call   1030 <puts@plt>
lea    0xf2e(%rip),%rdi
call   1030 <puts@plt>
lea    0xede(%rip),%rbx
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xf27(%rip),%rdi
call   1030 <puts@plt>
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xf27(%rip),%rdi
call   1030 <puts@plt>
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
movss  0x10(%rsp),%xmm1
mulss  0xe17(%rip),%xmm1
movss  0x18(%rsp),%xmm2
mulss  0x14(%rsp),%xmm1
movaps %xmm2,%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
jbe    1219 <main+0xc9>
lea    0xefa(%rip),%rdi
call   1030 <puts@plt>
jmp    12c2 <main+0x172>
ucomiss %xmm1,%xmm0
jb     1224 <main+0xd4>
sqrtss %xmm0,%xmm0
jmp    1235 <main+0xe5>
movss  %xmm2,0xc(%rsp)
call   1070 <sqrt@plt>
movss  0xc(%rsp),%xmm2
addss  %xmm0,%xmm2
movss  0x10(%rsp),%xmm1
movaps %xmm1,%xmm0
addss  %xmm1,%xmm0
divss  %xmm0,%xmm2
mulss  0xdae(%rip),%xmm1
movss  0x18(%rsp),%xmm3
mulss  0x14(%rsp),%xmm1
movaps %xmm3,%xmm0
mulss  %xmm3,%xmm0
addss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1277 <main+0x127>
sqrtss %xmm0,%xmm0
jmp    1294 <main+0x144>
movss  %xmm2,0xc(%rsp)
movss  %xmm3,0x1c(%rsp)
call   1070 <sqrt@plt>
movss  0x1c(%rsp),%xmm3
movss  0xc(%rsp),%xmm2
subss  %xmm3,%xmm0
movss  0x10(%rsp),%xmm1
addss  %xmm1,%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm2,%xmm2
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
lea    0xdc5(%rip),%rdi
movaps %xmm2,%xmm0
mov    $0x2,%al
call   1050 <printf@plt>
lea    0xddd(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [66 x i8] c"title 14_CalcularEcuaci\C3\B3nDeSegundoGrado_Cascallar_Autr\C3\A1n_Manuel\00"
@.str.1 = [26 x i8] c"ECUACION DE SEGUNDO GRADO\00"
@.str.2 = [26 x i8] c"=========================\00"
@.str.3 = [19 x i8] c"ax^2 + bx + c = 0\0A\00"
@.str.4 = [26 x i8] c"Introducir el valor de a\0A\00"
@.str.5 = [3 x i8] c"%d\00"
@.str.6 = [26 x i8] c"Introducir el valor de b\0A\00"
@.str.7 = [26 x i8] c"Introducir el valor de c\0A\00"
@.str.8 = [32 x i8] c"Esta ecuaci\A2n non ten soluci\A2n\0A\00"
@.str.9 = [41 x i8] c"\0AO resultado da ecuaci\A2n \82: %.2f e %.2f\0A\00"
@.str.10 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
store i32 0, i32* %1
%7 = call i32 @system(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), float* %2)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), float* %3)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), float* %4)
%17 = load float, float* %3
%18 = load float, float* %3
%19 = load float, float* %2
%20 = fmul float 4.000000e+00, %19
%21 = load float, float* %4
%22 = fmul float %20, %21
%23 = fneg float %22
%24 = call float @llvm.fmuladd.f32(float %17, float %18, float %23)
%25 = fcmp olt float %24, 0.000000e+00
br i1 %25, label %26, label %28
26: ; preds = %0
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.8, i64 0, i64 0))
br label %63
28: ; preds = %0
%29 = load float, float* %3
%30 = load float, float* %3
%31 = load float, float* %3
%32 = load float, float* %2
%33 = fmul float 4.000000e+00, %32
%34 = load float, float* %4
%35 = fmul float %33, %34
%36 = fneg float %35
%37 = call float @llvm.fmuladd.f32(float %30, float %31, float %36)
%38 = call float @sqrt(float %37)
%39 = fadd float %29, %38
%40 = load float, float* %2
%41 = fmul float 2.000000e+00, %40
%42 = fdiv float %39, %41
store float %42, float* %5
%43 = load float, float* %3
%44 = fneg float %43
%45 = load float, float* %3
%46 = load float, float* %3
%47 = load float, float* %2
%48 = fmul float 4.000000e+00, %47
%49 = load float, float* %4
%50 = fmul float %48, %49
%51 = fneg float %50
%52 = call float @llvm.fmuladd.f32(float %45, float %46, float %51)
%53 = call float @sqrt(float %52)
%54 = fadd float %44, %53
%55 = load float, float* %2
%56 = fmul float 2.000000e+00, %55
%57 = fdiv float %54, %56
store float %57, float* %6
%58 = load float, float* %5
%59 = fpext float %58 to double
%60 = load float, float* %6
%61 = fpext float %60 to double
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.9, i64 0, i64 0), double %59, double %61)
br label %63
63: ; preds = %28, %26
%64 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
%65 = load i32, i32* %1
ret i32 %65
}

LLVM IR (-O2):
@.str = [66 x i8] c"title 14_CalcularEcuaci\C3\B3nDeSegundoGrado_Cascallar_Autr\C3\A1n_Manuel\00"
@.str.1 = [26 x i8] c"ECUACION DE SEGUNDO GRADO\00"
@.str.2 = [26 x i8] c"=========================\00"
@.str.5 = [3 x i8] c"%d\00"
@.str.9 = [41 x i8] c"\0AO resultado da ecuaci\A2n \82: %.2f e %.2f\0A\00"
@.str.10 = [6 x i8] c"pause\00"
@str = [18 x i8] c"ax^2 + bx + c = 0\00"
@str.11 = [25 x i8] c"Introducir el valor de a\00"
@str.12 = [25 x i8] c"Introducir el valor de b\00"
@str.13 = [25 x i8] c"Introducir el valor de c\00"
@str.14 = [31 x i8] c"Esta ecuaci\A2n non ten soluci\A2n\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = tail call i32 @system(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%7 = bitcast float* %1 to i8*
%8 = bitcast float* %2 to i8*
%9 = bitcast float* %3 to i8*
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.11, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), float* %1)
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.12, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), float* %2)
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.13, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), float* %3)
%17 = load float, float* %2
%18 = load float, float* %1
%19 = load float, float* %3
%20 = fmul float %18, -4.000000e+00
%21 = fmul float %20, %19
%22 = call float @llvm.fmuladd.f32(float %17, float %17, float %21)
%23 = fcmp olt float %22, 0.000000e+00
br i1 %23, label %24, label %26
24: ; preds = %0
%25 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.14, i64 0, i64 0))
br label %45
26: ; preds = %0
%27 = call float @sqrt(float %22)
%28 = fadd float %17, %27
%29 = load float, float* %1
%30 = fmul float %29, 2.000000e+00
%31 = fdiv float %28, %30
%32 = load float, float* %2
%33 = load float, float* %3
%34 = fmul float %29, -4.000000e+00
%35 = fmul float %34, %33
%36 = call float @llvm.fmuladd.f32(float %32, float %32, float %35)
%37 = call float @sqrt(float %36)
%38 = fsub float %37, %32
%39 = load float, float* %1
%40 = fmul float %39, 2.000000e+00
%41 = fdiv float %38, %40
%42 = fpext float %31 to double
%43 = fpext float %41 to double
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.9, i64 0, i64 0), double %42, double %43)
br label %45
45: ; preds = %26, %24
%46 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
ret i32 0
}