#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 scanf(char *, double *, double *, double *);
double sqrt(double);
int main(int argc, const char *const argv[]) {
  printf("Введите коэффициенты a, b, c уравнения ax^2 + bx + c\n");
  double a, b, c;
  if (scanf("%lf%lf%lf", &a, &b, &c) == 2) {
    printf("Ошибка при вводе\n");
    return 1;
  }
  double d = b * b - 4.0 * a * c;
  if (d >= 0) {
    double x1 = -b / 2.0 / a + sqrt(d);
    double x2 = -b / 2.0 / a - sqrt(d);
    printf("\nУравнение имеет два действительных корня: {%lf, %lf}\n", x1, x2);
  } else {
    double real = -b / 2.0 / a;
    double imagine_delta = sqrt(-d) / 2.0 / a;
    printf("\nУравнение имеет два комплексных корня: {%lf+%lfi, %lf-%lfi}\n",
           real, imagine_delta, real, imagine_delta);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf07(%rip),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
lea    -0x28(%rbp),%rcx
call   1040 <scanf@plt>
cmp    $0x2,%eax
jne    118f <main+0x5f>
lea    0xef0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    132a <main+0x1fa>
movsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  0xe5f(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1298 <main+0x168>
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xe03(%rip),%xmm1
divsd  %xmm1,%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x60(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xdb6(%rip),%xmm1
divsd  %xmm1,%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x58(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
lea    0xe00(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
jmp    1323 <main+0x1f3>
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xd4c(%rip),%xmm1
divsd  %xmm1,%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x30(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1050 <sqrt@plt>
movsd  0xd15(%rip),%xmm1
divsd  %xmm1,%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm2
movsd  -0x50(%rbp),%xmm3
lea    0xdcb(%rip),%rdi
mov    $0x4,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
lea    0xfa9(%rip),%rdi
call   1030 <puts@plt>
lea    0xed9(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x18(%rsp),%rdx
lea    0x40(%rsp),%rcx
call   1050 <scanf@plt>
cmp    $0x2,%eax
jne    1186 <main+0x46>
lea    0xfce(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
add    $0x48,%rsp
ret
movsd  0x18(%rsp),%xmm2
movsd  0x10(%rsp),%xmm0
movsd  0xe66(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  0x40(%rsp),%xmm1
movapd %xmm2,%xmm3
mulsd  %xmm2,%xmm3
addsd  %xmm1,%xmm3
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm3
jae    11f0 <main+0xb0>
mulsd  0xe4e(%rip),%xmm2
divsd  %xmm0,%xmm2
movapd 0xe52(%rip),%xmm0
xorpd  %xmm3,%xmm0
movsd  0xe3e(%rip),%xmm1
ucomisd %xmm3,%xmm1
jb     129a <main+0x15a>
xorps  %xmm1,%xmm1
sqrtsd %xmm0,%xmm1
jmp    12af <main+0x16f>
mulsd  0xe10(%rip),%xmm2
divsd  %xmm0,%xmm2
sqrtsd %xmm3,%xmm4
ucomisd %xmm1,%xmm3
movapd %xmm4,%xmm5
jae    123b <main+0xfb>
movapd %xmm3,%xmm0
movsd  %xmm2,0x8(%rsp)
movapd %xmm3,0x20(%rsp)
movsd  %xmm4,0x38(%rsp)
call   1060 <sqrt@plt>
movsd  0x38(%rsp),%xmm4
movapd 0x20(%rsp),%xmm3
movsd  0x8(%rsp),%xmm2
movapd %xmm0,%xmm5
movsd  0x18(%rsp),%xmm1
mulsd  0xdc7(%rip),%xmm1
divsd  0x10(%rsp),%xmm1
subsd  %xmm2,%xmm5
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm3
jae    1282 <main+0x142>
movapd %xmm3,%xmm0
movsd  %xmm5,0x8(%rsp)
movsd  %xmm1,0x20(%rsp)
call   1060 <sqrt@plt>
movsd  0x20(%rsp),%xmm1
movsd  0x8(%rsp),%xmm5
movapd %xmm0,%xmm4
subsd  %xmm4,%xmm1
lea    0xdad(%rip),%rdi
movapd %xmm5,%xmm0
mov    $0x2,%al
call   1040 <printf@plt>
jmp    12d3 <main+0x193>
movsd  %xmm2,0x8(%rsp)
call   1060 <sqrt@plt>
movsd  0x8(%rsp),%xmm2
movapd %xmm0,%xmm1
mulsd  0xd51(%rip),%xmm1
divsd  0x10(%rsp),%xmm1
lea    0xdd1(%rip),%rdi
movapd %xmm2,%xmm0
movapd %xmm1,%xmm3
mov    $0x4,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@.str = [82 x i8] c"\D0\92\D0\B2\D0\B5\D0\B4\D0\B8\D1\82\D0\B5 \D0\BA\D0\BE\D1\8D\D1\84\D1\84\D0\B8\D1\86\D0\B8\D0\B5\D0\BD\D1\82\D1\8B a, b, c \D1\83\D1\80\D0\B0\D0\B2\D0\BD\D0\B5\D0\BD\D0\B8\D1\8F ax^2 + bx + c\0A\00"
@.str.1 = [10 x i8] c"%lf%lf%lf\00"
@.str.2 = [32 x i8] c"\D0\9E\D1\88\D0\B8\D0\B1\D0\BA\D0\B0 \D0\BF\D1\80\D0\B8 \D0\B2\D0\B2\D0\BE\D0\B4\D0\B5\0A\00"
@.str.3 = [91 x i8] c"\0A\D0\A3\D1\80\D0\B0\D0\B2\D0\BD\D0\B5\D0\BD\D0\B8\D0\B5 \D0\B8\D0\BC\D0\B5\D0\B5\D1\82 \D0\B4\D0\B2\D0\B0 \D0\B4\D0\B5\D0\B9\D1\81\D1\82\D0\B2\D0\B8\D1\82\D0\B5\D0\BB\D1\8C\D0\BD\D1\8B\D1\85 \D0\BA\D0\BE\D1\80\D0\BD\D1\8F: {%lf, %lf}\0A\00"
@.str.4 = [95 x i8] c"\0A\D0\A3\D1\80\D0\B0\D0\B2\D0\BD\D0\B5\D0\BD\D0\B8\D0\B5 \D0\B8\D0\BC\D0\B5\D0\B5\D1\82 \D0\B4\D0\B2\D0\B0 \D0\BA\D0\BE\D0\BC\D0\BF\D0\BB\D0\B5\D0\BA\D1\81\D0\BD\D1\8B\D1\85 \D0\BA\D0\BE\D1\80\D0\BD\D1\8F: {%lf+%lfi, %lf-%lfi}\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double* %6, double* %7, double* %8)
%16 = icmp eq i32 %15, 2
br i1 %16, label %17, label %19
17: ; preds = %2
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %3
br label %68
19: ; preds = %2
%20 = load double, double* %7
%21 = load double, double* %7
%22 = load double, double* %6
%23 = fmul double 4.000000e+00, %22
%24 = load double, double* %8
%25 = fmul double %23, %24
%26 = fneg double %25
%27 = call double @llvm.fmuladd.f64(double %20, double %21, double %26)
store double %27, double* %9
%28 = load double, double* %9
%29 = fcmp oge double %28, 0.000000e+00
br i1 %29, label %30, label %50
30: ; preds = %19
%31 = load double, double* %7
%32 = fneg double %31
%33 = fdiv double %32, 2.000000e+00
%34 = load double, double* %6
%35 = fdiv double %33, %34
%36 = load double, double* %9
%37 = call double @sqrt(double %36)
%38 = fadd double %35, %37
store double %38, double* %10
%39 = load double, double* %7
%40 = fneg double %39
%41 = fdiv double %40, 2.000000e+00
%42 = load double, double* %6
%43 = fdiv double %41, %42
%44 = load double, double* %9
%45 = call double @sqrt(double %44)
%46 = fsub double %43, %45
store double %46, double* %11
%47 = load double, double* %10
%48 = load double, double* %11
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str.3, i64 0, i64 0), double %47, double %48)
br label %67
50: ; preds = %19
%51 = load double, double* %7
%52 = fneg double %51
%53 = fdiv double %52, 2.000000e+00
%54 = load double, double* %6
%55 = fdiv double %53, %54
store double %55, double* %12
%56 = load double, double* %9
%57 = fneg double %56
%58 = call double @sqrt(double %57)
%59 = fdiv double %58, 2.000000e+00
%60 = load double, double* %6
%61 = fdiv double %59, %60
store double %61, double* %13
%62 = load double, double* %12
%63 = load double, double* %13
%64 = load double, double* %12
%65 = load double, double* %13
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([95 x i8], [95 x i8]* @.str.4, i64 0, i64 0), double %62, double %63, double %64, double %65)
br label %67
67: ; preds = %50, %30
store i32 0, i32* %3
br label %68
68: ; preds = %67, %17
%69 = load i32, i32* %3
ret i32 %69
}

LLVM IR (-O2):
@.str.1 = [10 x i8] c"%lf%lf%lf\00"
@.str.3 = [91 x i8] c"\0A\D0\A3\D1\80\D0\B0\D0\B2\D0\BD\D0\B5\D0\BD\D0\B8\D0\B5 \D0\B8\D0\BC\D0\B5\D0\B5\D1\82 \D0\B4\D0\B2\D0\B0 \D0\B4\D0\B5\D0\B9\D1\81\D1\82\D0\B2\D0\B8\D1\82\D0\B5\D0\BB\D1\8C\D0\BD\D1\8B\D1\85 \D0\BA\D0\BE\D1\80\D0\BD\D1\8F: {%lf, %lf}\0A\00"
@.str.4 = [95 x i8] c"\0A\D0\A3\D1\80\D0\B0\D0\B2\D0\BD\D0\B5\D0\BD\D0\B8\D0\B5 \D0\B8\D0\BC\D0\B5\D0\B5\D1\82 \D0\B4\D0\B2\D0\B0 \D0\BA\D0\BE\D0\BC\D0\BF\D0\BB\D0\B5\D0\BA\D1\81\D0\BD\D1\8B\D1\85 \D0\BA\D0\BE\D1\80\D0\BD\D1\8F: {%lf+%lfi, %lf-%lfi}\0A\00"
@str = [81 x i8] c"\D0\92\D0\B2\D0\B5\D0\B4\D0\B8\D1\82\D0\B5 \D0\BA\D0\BE\D1\8D\D1\84\D1\84\D0\B8\D1\86\D0\B8\D0\B5\D0\BD\D1\82\D1\8B a, b, c \D1\83\D1\80\D0\B0\D0\B2\D0\BD\D0\B5\D0\BD\D0\B8\D1\8F ax^2 + bx + c\00"
@str.5 = [31 x i8] c"\D0\9E\D1\88\D0\B8\D0\B1\D0\BA\D0\B0 \D0\BF\D1\80\D0\B8 \D0\B2\D0\B2\D0\BE\D0\B4\D0\B5\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([81 x i8], [81 x i8]* @str, i64 0, i64 0))
%7 = bitcast double* %3 to i8*
%8 = bitcast double* %4 to i8*
%9 = bitcast double* %5 to i8*
%10 = call i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double* %3, double* %4, double* %5)
%11 = icmp eq i32 %10, 2
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.5, i64 0, i64 0))
br label %43
14: ; preds = %2
%15 = load double, double* %4
%16 = load double, double* %3
%17 = load double, double* %5
%18 = fmul double %16, -4.000000e+00
%19 = fmul double %18, %17
%20 = call double @llvm.fmuladd.f64(double %15, double %15, double %19)
%21 = fcmp ult double %20, 0.000000e+00
br i1 %21, label %34, label %22
22: ; preds = %14
%23 = fmul double %15, 5.000000e-01
%24 = fdiv double %23, %16
%25 = call double @sqrt(double %20)
%26 = fsub double %25, %24
%27 = load double, double* %4
%28 = fmul double %27, -5.000000e-01
%29 = load double, double* %3
%30 = fdiv double %28, %29
%31 = call double @sqrt(double %20)
%32 = fsub double %30, %31
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([91 x i8], [91 x i8]* @.str.3, i64 0, i64 0), double %26, double %32)
br label %43
34: ; preds = %14
%35 = fmul double %15, -5.000000e-01
%36 = fdiv double %35, %16
%37 = fneg double %20
%38 = call double @sqrt(double %37)
%39 = fmul double %38, 5.000000e-01
%40 = load double, double* %3
%41 = fdiv double %39, %40
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([95 x i8], [95 x i8]* @.str.4, i64 0, i64 0), double %36, double %41, double %36, double %41)
br label %43
43: ; preds = %22, %34, %12
%44 = phi i32 [ 1, %12 ], [ 0, %34 ], [ 0, %22 ]
ret i32 %44
}