#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 *, int *, int *, int *);
int main(void) {
  int a, b, c;
  float x_1, x_2, sqrt;
  float squareRoot(float x);
  printf("ÇëÒÀ´ÎÊäÈë¶þ´Î·½³ÌµÄa¡¢b¡¢cÏµÊý:\n");
  scanf("%i %i %i", &a, &b, &c);
  sqrt = (float)(b * b - 4 * a * c);
  if (sqrt < 0) {
    printf("¸Ã·½³ÌµÄ¸ùÎª¸´Êý¡£");
    return 0;
  } else {
    x_1 = (-b + squareRoot(sqrt)) / (2 * a);
    x_2 = (-b - squareRoot(sqrt)) / (2 * a);
    printf("¸Ã·½³ÌµÄ¸ùÎª:%fºÍ%f\n", x_1, x_2);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeea(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x2,%ecx
imul   -0x10(%rbp),%ecx
sub    %ecx,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x1c(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x1c(%rbp),%xmm0
jbe    11a8 <main+0x78>
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    123d <main+0x10d>
xor    %eax,%eax
sub    -0xc(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x1c(%rbp),%xmm0
call   1050 <squareRoot@plt>
movaps %xmm0,%xmm1
movss  -0x24(%rbp),%xmm0
addss  %xmm1,%xmm0
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
cvtsi2ss %eax,%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
xor    %eax,%eax
sub    -0xc(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x1c(%rbp),%xmm0
call   1050 <squareRoot@plt>
movaps %xmm0,%xmm1
movss  -0x20(%rbp),%xmm0
subss  %xmm1,%xmm0
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
cvtsi2ss %eax,%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x18(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe3d(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xf06(%rip),%rdi
call   1030 <puts@plt>
lea    0xea9(%rip),%rdi
lea    0x4(%rsp),%rsi
lea    0x8(%rsp),%rdx
lea    0x14(%rsp),%rcx
call   1050 <scanf@plt>
mov    0x8(%rsp),%eax
mov    %eax,%ecx
imul   %eax,%ecx
mov    0x4(%rsp),%edx
imul   0x14(%rsp),%edx
shl    $0x2,%edx
sub    %edx,%ecx
js     1216 <main+0xd6>
cvtsi2ss %ecx,%xmm0
movss  %xmm0,0x10(%rsp)
neg    %eax
cvtsi2ss %eax,%xmm1
movss  %xmm1,(%rsp)
call   1060 <squareRoot@plt>
mov    0x4(%rsp),%eax
add    %eax,%eax
xorps  %xmm1,%xmm1
cvtsi2ss %eax,%xmm1
addss  (%rsp),%xmm0
xor    %eax,%eax
sub    0x8(%rsp),%eax
divss  %xmm1,%xmm0
movss  %xmm0,(%rsp)
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  %xmm0,0xc(%rsp)
movss  0x10(%rsp),%xmm0
call   1060 <squareRoot@plt>
mov    0x4(%rsp),%eax
add    %eax,%eax
xorps  %xmm1,%xmm1
cvtsi2ss %eax,%xmm1
movss  0xc(%rsp),%xmm2
subss  %xmm0,%xmm2
divss  %xmm1,%xmm2
movss  (%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm2,%xmm1
lea    0xe21(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
jmp    1224 <main+0xe4>
lea    0xdec(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [62 x i8] c"\C3\87\C3\AB\C3\92\C3\80\C2\B4\C3\8E\C3\8A\C3\A4\C3\88\C3\AB\C2\B6\C3\BE\C2\B4\C3\8E\C2\B7\C2\BD\C2\B3\C3\8C\C2\B5\C3\84a\C2\A1\C2\A2b\C2\A1\C2\A2c\C3\8F\C2\B5\C3\8A\C3\BD:\0A\00"
@.str.1 = [9 x i8] c"%i %i %i\00"
@.str.2 = [37 x i8] c"\C2\B8\C3\83\C2\B7\C2\BD\C2\B3\C3\8C\C2\B5\C3\84\C2\B8\C3\B9\C3\8E\C2\AA\C2\B8\C2\B4\C3\8A\C3\BD\C2\A1\C2\A3\00"
@.str.3 = [35 x i8] c"\C2\B8\C3\83\C2\B7\C2\BD\C2\B3\C3\8C\C2\B5\C3\84\C2\B8\C3\B9\C3\8E\C2\AA:%f\C2\BA\C3\8D%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
%6 = alloca float
%7 = alloca float
store i32 0, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%10 = load i32, i32* %3
%11 = load i32, i32* %3
%12 = mul nsw i32 %10, %11
%13 = load i32, i32* %2
%14 = mul nsw i32 4, %13
%15 = load i32, i32* %4
%16 = mul nsw i32 %14, %15
%17 = sub nsw i32 %12, %16
%18 = sitofp i32 %17 to float
store float %18, float* %7
%19 = load float, float* %7
%20 = fcmp olt float %19, 0.000000e+00
br i1 %20, label %21, label %23
21: ; preds = %0
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %1
br label %50
23: ; preds = %0
%24 = load i32, i32* %3
%25 = sub nsw i32 0, %24
%26 = sitofp i32 %25 to float
%27 = load float, float* %7
%28 = call float @squareRoot(float %27)
%29 = fadd float %26, %28
%30 = load i32, i32* %2
%31 = mul nsw i32 2, %30
%32 = sitofp i32 %31 to float
%33 = fdiv float %29, %32
store float %33, float* %5
%34 = load i32, i32* %3
%35 = sub nsw i32 0, %34
%36 = sitofp i32 %35 to float
%37 = load float, float* %7
%38 = call float @squareRoot(float %37)
%39 = fsub float %36, %38
%40 = load i32, i32* %2
%41 = mul nsw i32 2, %40
%42 = sitofp i32 %41 to float
%43 = fdiv float %39, %42
store float %43, float* %6
%44 = load float, float* %5
%45 = fpext float %44 to double
%46 = load float, float* %6
%47 = fpext float %46 to double
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), double %45, double %47)
br label %49
49: ; preds = %23
store i32 0, i32* %1
br label %50
50: ; preds = %49, %21
%51 = load i32, i32* %1
ret i32 %51
}

LLVM IR (-O2):
@.str.1 = [9 x i8] c"%i %i %i\00"
@.str.2 = [37 x i8] c"\C2\B8\C3\83\C2\B7\C2\BD\C2\B3\C3\8C\C2\B5\C3\84\C2\B8\C3\B9\C3\8E\C2\AA\C2\B8\C2\B4\C3\8A\C3\BD\C2\A1\C2\A3\00"
@.str.3 = [35 x i8] c"\C2\B8\C3\83\C2\B7\C2\BD\C2\B3\C3\8C\C2\B5\C3\84\C2\B8\C3\B9\C3\8E\C2\AA:%f\C2\BA\C3\8D%f\0A\00"
@str = [61 x i8] c"\C3\87\C3\AB\C3\92\C3\80\C2\B4\C3\8E\C3\8A\C3\A4\C3\88\C3\AB\C2\B6\C3\BE\C2\B4\C3\8E\C2\B7\C2\BD\C2\B3\C3\8C\C2\B5\C3\84a\C2\A1\C2\A2b\C2\A1\C2\A2c\C3\8F\C2\B5\C3\8A\C3\BD:\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%9 = load i32, i32* %2
%10 = mul nsw i32 %9, %9
%11 = load i32, i32* %1
%12 = mul i32 %11, -4
%13 = load i32, i32* %3
%14 = mul i32 %12, %13
%15 = add i32 %14, %10
%16 = sitofp i32 %15 to float
%17 = icmp slt i32 %15, 0
br i1 %17, label %18, label %20
18: ; preds = %0
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
br label %41
20: ; preds = %0
%21 = sub nsw i32 0, %9
%22 = sitofp i32 %21 to float
%23 = call float @squareRoot(float %16)
%24 = fadd float %23, %22
%25 = load i32, i32* %1
%26 = shl nsw i32 %25, 1
%27 = sitofp i32 %26 to float
%28 = fdiv float %24, %27
%29 = load i32, i32* %2
%30 = sub nsw i32 0, %29
%31 = sitofp i32 %30 to float
%32 = call float @squareRoot(float %16)
%33 = fsub float %31, %32
%34 = load i32, i32* %1
%35 = shl nsw i32 %34, 1
%36 = sitofp i32 %35 to float
%37 = fdiv float %33, %36
%38 = fpext float %28 to double
%39 = fpext float %37 to double
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), double %38, double %39)
br label %41
41: ; preds = %20, %18
ret i32 0
}