#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 sqrt(double);
int main() {
  double a, b, c;
  a = 2, b = 4, c = -4;
  if (a == 0) {
    printf("这不是一个二次方程！\n");
  }
  double delta = b * b - 4 * a * c;
  if (delta > 0) {
    double x1 = (-b + sqrt(delta)) / (2 * a);
    double x2 = (-b - sqrt(delta)) / (2 * a);
    printf("方程的两个实数解分别是%f,%f\n", x1, x2);
    printf("方程的两个实数解另一种表示是{%f+-sqrt(%f)}/%f\n", -b, delta, 2 * a);
  } else if (delta == 0) {
    double x12 = (-b) / (2 * a);
    printf("方程的一个实数解是%f\n", x12);
  } else {
    printf("方程的两个复数解的表示是{%f+-sqrt(%f)I}/%f\n", -b, -delta, 2 * a);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xec4(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xeaf(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    117c <main+0x5c>
jp     117c <main+0x5c>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  0xe7a(%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)
movsd  -0x28(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    12c1 <main+0x1a1>
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  0xe03(%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
movsd  %xmm0,-0x48(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  0xdb6(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
lea    0xdbf(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  0xd67(%rip),%xmm2
mulsd  -0x10(%rbp),%xmm2
lea    0xdab(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
jmp    137b <main+0x25b>
movsd  -0x28(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1323 <main+0x203>
jp     1323 <main+0x203>
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xd13(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
lea    0xd86(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1376 <main+0x256>
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x28(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xcad(%rip),%xmm2
mulsd  -0x10(%rbp),%xmm2
lea    0xd4d(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
jmp    137b <main+0x25b>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf10(%rip),%rdi
movsd  0xee0(%rip),%xmm0
movsd  0xee0(%rip),%xmm1
mov    $0x2,%al
call   1030 <printf@plt>
lea    0xf1a(%rip),%rdi
movsd  0xed2(%rip),%xmm0
movsd  0xed2(%rip),%xmm1
movsd  0xed2(%rip),%xmm2
mov    $0x3,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"\E8\BF\99\E4\B8\8D\E6\98\AF\E4\B8\80\E4\B8\AA\E4\BA\8C\E6\AC\A1\E6\96\B9\E7\A8\8B\EF\BC\81\0A\00"
@.str.1 = [40 x i8] c"\E6\96\B9\E7\A8\8B\E7\9A\84\E4\B8\A4\E4\B8\AA\E5\AE\9E\E6\95\B0\E8\A7\A3\E5\88\86\E5\88\AB\E6\98\AF%f,%f\0A\00"
@.str.2 = [61 x i8] c"\E6\96\B9\E7\A8\8B\E7\9A\84\E4\B8\A4\E4\B8\AA\E5\AE\9E\E6\95\B0\E8\A7\A3\E5\8F\A6\E4\B8\80\E7\A7\8D\E8\A1\A8\E7\A4\BA\E6\98\AF{%f+-sqrt(%f)}/%f\0A\00"
@.str.3 = [31 x i8] c"\E6\96\B9\E7\A8\8B\E7\9A\84\E4\B8\80\E4\B8\AA\E5\AE\9E\E6\95\B0\E8\A7\A3\E6\98\AF%f\0A\00"
@.str.4 = [56 x i8] c"\E6\96\B9\E7\A8\8B\E7\9A\84\E4\B8\A4\E4\B8\AA\E5\A4\8D\E6\95\B0\E8\A7\A3\E7\9A\84\E8\A1\A8\E7\A4\BA\E6\98\AF{%f+-sqrt(%f)I}/%f\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
store i32 0, i32* %1
store double 2.000000e+00, double* %2
store double 4.000000e+00, double* %3
store double -4.000000e+00, double* %4
%9 = load double, double* %2
%10 = fcmp oeq double %9, 0.000000e+00
br i1 %10, label %11, label %13
11: ; preds = %0
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %0
%14 = load double, double* %3
%15 = load double, double* %3
%16 = load double, double* %2
%17 = fmul double 4.000000e+00, %16
%18 = load double, double* %4
%19 = fmul double %17, %18
%20 = fneg double %19
%21 = call double @llvm.fmuladd.f64(double %14, double %15, double %20)
store double %21, double* %5
%22 = load double, double* %5
%23 = fcmp ogt double %22, 0.000000e+00
br i1 %23, label %24, label %50
24: ; preds = %13
%25 = load double, double* %3
%26 = fneg double %25
%27 = load double, double* %5
%28 = call double @sqrt(double %27)
%29 = fadd 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* %3
%34 = fneg double %33
%35 = load double, double* %5
%36 = call double @sqrt(double %35)
%37 = fsub double %34, %36
%38 = load double, double* %2
%39 = fmul double 2.000000e+00, %38
%40 = fdiv double %37, %39
store double %40, double* %7
%41 = load double, double* %6
%42 = load double, double* %7
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), double %41, double %42)
%44 = load double, double* %3
%45 = fneg double %44
%46 = load double, double* %5
%47 = load double, double* %2
%48 = fmul double 2.000000e+00, %47
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.2, i64 0, i64 0), double %45, double %46, double %48)
br label %70
50: ; preds = %13
%51 = load double, double* %5
%52 = fcmp oeq double %51, 0.000000e+00
br i1 %52, label %53, label %61
53: ; preds = %50
%54 = load double, double* %3
%55 = fneg double %54
%56 = load double, double* %2
%57 = fmul double 2.000000e+00, %56
%58 = fdiv double %55, %57
store double %58, double* %8
%59 = load double, double* %8
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), double %59)
br label %69
61: ; preds = %50
%62 = load double, double* %3
%63 = fneg double %62
%64 = load double, double* %5
%65 = fneg double %64
%66 = load double, double* %2
%67 = fmul double 2.000000e+00, %66
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.4, i64 0, i64 0), double %63, double %65, double %67)
br label %69
69: ; preds = %61, %53
br label %70
70: ; preds = %69, %24
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [40 x i8] c"\E6\96\B9\E7\A8\8B\E7\9A\84\E4\B8\A4\E4\B8\AA\E5\AE\9E\E6\95\B0\E8\A7\A3\E5\88\86\E5\88\AB\E6\98\AF%f,%f\0A\00"
@.str.2 = [61 x i8] c"\E6\96\B9\E7\A8\8B\E7\9A\84\E4\B8\A4\E4\B8\AA\E5\AE\9E\E6\95\B0\E8\A7\A3\E5\8F\A6\E4\B8\80\E7\A7\8D\E8\A1\A8\E7\A4\BA\E6\98\AF{%f+-sqrt(%f)}/%f\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), double 0x3FE76CF5D0B09954, double 0xC005DB3D742C2655)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @.str.2, i64 0, i64 0), double -4.000000e+00, double 4.800000e+01, double 4.000000e+00)
ret i32 0
}