#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 *, double);
double sign(double);
double sqrt(double);
int main() {
  double a = 1.0;
  double b = -100000.0;
  double c = 1.0;
  double x1 = (-b - sqrt(b * b - 4 * a * c)) / (2 * a);
  double x2 = (-b + sqrt(b * b - 4 * a * c)) / (2 * a);
  printf(" a = %27.20e\n", a);
  printf(" b = %27.20e\n", b);
  printf(" c = %27.20e\n", c);
  printf("x1 = %27.20e\n", x1);
  printf("x2 = %27.20e\n", x2);
  printf("e1 = %27.20e\n", a * x1 * x1 + b * x1 + c);
  printf("e2 = %27.20e\n", a * x2 * x2 + b * x2 + c);
  double x1_ = (-b - sign(b) * sqrt(b * b - 4 * a * c)) / (2 * a);
  double x2_ = c / (a * x1_);
  printf("x1'= %27.20e\n", x1_);
  printf("x2'= %27.20e\n", x2_);
  printf("e1'= %27.20e\n", a * x1_ * x1_ + b * x1_ + c);
  printf("e2'= %27.20e\n", a * x2_ * x2_ + b * x2_ + c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movsd  0xed0(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xecb(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xeb6(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  0xe76(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x58(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  0xe2c(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  0xdf3(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  0xda9(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    0xdaf(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
lea    0xdac(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
lea    0xda9(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm0
lea    0xda6(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x28(%rbp),%xmm0
lea    0xda3(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x18(%rbp),%xmm0
lea    0xd7f(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x18(%rbp),%xmm0
lea    0xd5b(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <sign@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  0xca8(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1050 <sqrt@plt>
movsd  -0x48(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x40(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xc3e(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  -0x30(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
lea    0xc8e(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x38(%rbp),%xmm0
lea    0xc8b(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x30(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x18(%rbp),%xmm0
lea    0xc67(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x38(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  -0x18(%rbp),%xmm0
lea    0xc43(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xf1d(%rip),%rdi
movsd  0xecd(%rip),%xmm0
call   1030 <printf@plt>
lea    0xf17(%rip),%rdi
movsd  0xec1(%rip),%xmm0
call   1030 <printf@plt>
lea    0xf11(%rip),%rdi
movsd  0xea5(%rip),%xmm0
call   1030 <printf@plt>
lea    0xf0b(%rip),%rdi
movsd  0xea1(%rip),%xmm0
call   1030 <printf@plt>
lea    0xf05(%rip),%rdi
movsd  0xe95(%rip),%xmm0
call   1030 <printf@plt>
lea    0xeff(%rip),%rdi
movsd  0xe89(%rip),%xmm0
call   1030 <printf@plt>
lea    0xef9(%rip),%rdi
movsd  0xe7d(%rip),%xmm0
call   1030 <printf@plt>
movsd  0xe50(%rip),%xmm0
call   1040 <sign@plt>
movapd %xmm0,%xmm1
mulsd  0xe67(%rip),%xmm1
addsd  0xe67(%rip),%xmm1
mulsd  0xe67(%rip),%xmm1
movsd  %xmm1,0x10(%rsp)
movsd  0xe19(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
lea    0xeb2(%rip),%rdi
movapd %xmm1,%xmm0
call   1030 <printf@plt>
lea    0xeb0(%rip),%rdi
movsd  0x8(%rsp),%xmm0
call   1030 <printf@plt>
movsd  0x10(%rsp),%xmm1
movapd %xmm1,%xmm0
mulsd  0xde3(%rip),%xmm0
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
addsd  0xdcb(%rip),%xmm1
movapd %xmm1,%xmm0
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
movsd  0xdbb(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
addsd  0xd99(%rip),%xmm1
movapd %xmm1,%xmm0
lea    0xe62(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [14 x i8] c" a = %27.20e\0A\00"
@.str.1 = [14 x i8] c" b = %27.20e\0A\00"
@.str.2 = [14 x i8] c" c = %27.20e\0A\00"
@.str.3 = [14 x i8] c"x1 = %27.20e\0A\00"
@.str.4 = [14 x i8] c"x2 = %27.20e\0A\00"
@.str.5 = [14 x i8] c"e1 = %27.20e\0A\00"
@.str.6 = [14 x i8] c"e2 = %27.20e\0A\00"
@.str.7 = [14 x i8] c"x1'= %27.20e\0A\00"
@.str.8 = [14 x i8] c"x2'= %27.20e\0A\00"
@.str.9 = [14 x i8] c"e1'= %27.20e\0A\00"
@.str.10 = [14 x i8] c"e2'= %27.20e\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double 1.000000e+00, double* %1
store double -1.000000e+05, double* %2
store double 1.000000e+00, double* %3
%8 = load double, double* %2
%9 = fneg double %8
%10 = load double, double* %2
%11 = load double, double* %2
%12 = load double, double* %1
%13 = fmul double 4.000000e+00, %12
%14 = load double, double* %3
%15 = fmul double %13, %14
%16 = fneg double %15
%17 = call double @llvm.fmuladd.f64(double %10, double %11, double %16)
%18 = call double @sqrt(double %17)
%19 = fsub double %9, %18
%20 = load double, double* %1
%21 = fmul double 2.000000e+00, %20
%22 = fdiv double %19, %21
store double %22, double* %4
%23 = load double, double* %2
%24 = fneg double %23
%25 = load double, double* %2
%26 = load double, double* %2
%27 = load double, double* %1
%28 = fmul double 4.000000e+00, %27
%29 = load double, double* %3
%30 = fmul double %28, %29
%31 = fneg double %30
%32 = call double @llvm.fmuladd.f64(double %25, double %26, double %31)
%33 = call double @sqrt(double %32)
%34 = fadd double %24, %33
%35 = load double, double* %1
%36 = fmul double 2.000000e+00, %35
%37 = fdiv double %34, %36
store double %37, double* %5
%38 = load double, double* %1
%39 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), double %38)
%40 = load double, double* %2
%41 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double %40)
%42 = load double, double* %3
%43 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), double %42)
%44 = load double, double* %4
%45 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), double %44)
%46 = load double, double* %5
%47 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), double %46)
%48 = load double, double* %1
%49 = load double, double* %4
%50 = fmul double %48, %49
%51 = load double, double* %4
%52 = load double, double* %2
%53 = load double, double* %4
%54 = fmul double %52, %53
%55 = call double @llvm.fmuladd.f64(double %50, double %51, double %54)
%56 = load double, double* %3
%57 = fadd double %55, %56
%58 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), double %57)
%59 = load double, double* %1
%60 = load double, double* %5
%61 = fmul double %59, %60
%62 = load double, double* %5
%63 = load double, double* %2
%64 = load double, double* %5
%65 = fmul double %63, %64
%66 = call double @llvm.fmuladd.f64(double %61, double %62, double %65)
%67 = load double, double* %3
%68 = fadd double %66, %67
%69 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), double %68)
%70 = load double, double* %2
%71 = fneg double %70
%72 = load double, double* %2
%73 = call double @sign(double %72)
%74 = load double, double* %2
%75 = load double, double* %2
%76 = load double, double* %1
%77 = fmul double 4.000000e+00, %76
%78 = load double, double* %3
%79 = fmul double %77, %78
%80 = fneg double %79
%81 = call double @llvm.fmuladd.f64(double %74, double %75, double %80)
%82 = call double @sqrt(double %81)
%83 = fneg double %73
%84 = call double @llvm.fmuladd.f64(double %83, double %82, double %71)
%85 = load double, double* %1
%86 = fmul double 2.000000e+00, %85
%87 = fdiv double %84, %86
store double %87, double* %6
%88 = load double, double* %3
%89 = load double, double* %1
%90 = load double, double* %6
%91 = fmul double %89, %90
%92 = fdiv double %88, %91
store double %92, double* %7
%93 = load double, double* %6
%94 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), double %93)
%95 = load double, double* %7
%96 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), double %95)
%97 = load double, double* %1
%98 = load double, double* %6
%99 = fmul double %97, %98
%100 = load double, double* %6
%101 = load double, double* %2
%102 = load double, double* %6
%103 = fmul double %101, %102
%104 = call double @llvm.fmuladd.f64(double %99, double %100, double %103)
%105 = load double, double* %3
%106 = fadd double %104, %105
%107 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0), double %106)
%108 = load double, double* %1
%109 = load double, double* %7
%110 = fmul double %108, %109
%111 = load double, double* %7
%112 = load double, double* %2
%113 = load double, double* %7
%114 = fmul double %112, %113
%115 = call double @llvm.fmuladd.f64(double %110, double %111, double %114)
%116 = load double, double* %3
%117 = fadd double %115, %116
%118 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0), double %117)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c" a = %27.20e\0A\00"
@.str.1 = [14 x i8] c" b = %27.20e\0A\00"
@.str.2 = [14 x i8] c" c = %27.20e\0A\00"
@.str.3 = [14 x i8] c"x1 = %27.20e\0A\00"
@.str.4 = [14 x i8] c"x2 = %27.20e\0A\00"
@.str.5 = [14 x i8] c"e1 = %27.20e\0A\00"
@.str.6 = [14 x i8] c"e2 = %27.20e\0A\00"
@.str.7 = [14 x i8] c"x1'= %27.20e\0A\00"
@.str.8 = [14 x i8] c"x2'= %27.20e\0A\00"
@.str.9 = [14 x i8] c"e1'= %27.20e\0A\00"
@.str.10 = [14 x i8] c"e2'= %27.20e\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), double 1.000000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double -1.000000e+05)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), double 1.000000e+00)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), double 0x3EE4F8B600000000)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), double 0x40F869FFFFF583A5)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), double 0xBE96B64832000000)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), double 0xBEA6B72419000000)
%8 = tail call double @sign(double -1.000000e+05)
%9 = fneg double %8
%10 = tail call double @llvm.fmuladd.f64(double %9, double 0x40F869FFFFEB074A, double 1.000000e+05)
%11 = fmul double %10, 5.000000e-01
%12 = fdiv double 1.000000e+00, %11
%13 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), double %11)
%14 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), double %12)
%15 = fmul double %11, -1.000000e+05
%16 = tail call double @llvm.fmuladd.f64(double %11, double %11, double %15)
%17 = fadd double %16, 1.000000e+00
%18 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0), double %17)
%19 = fmul double %12, -1.000000e+05
%20 = tail call double @llvm.fmuladd.f64(double %12, double %12, double %19)
%21 = fadd double %20, 1.000000e+00
%22 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0), double %21)
ret i32 0
}