#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 *, double *, double *, double *);
int sqrt(double);
int main(int argc, char const *argv[]) {
  double a, b, c, discr, root1, root2, realPart, imPart;
  printf("Введите коэффициенты a, b, c: ");
  scanf("%lf %lf %lf", &a, &b, &c);
  discr = b * b - 4 * a * c;
  if (discr > 0) {
    root1 = (-b + sqrt(discr)) / (2 * a);
    root2 = (-b - sqrt(discr)) / (2 * a);
    printf("Корень 1 = %.2lf и корень 2 = %.2lf\n", root1, root2);
  } else if (discr == 0) {
    root1 = root2 = -b / (2 * a);
    printf("Единственный корень = %.2lf\n", root1);
  } else {
    realPart = -b / (2 * a);
    imPart = sqrt(-discr) / (2 * a);
    printf("Корень 1 = %.2lf+%.2lfi и корень 2 = %.2lf-%.2lfi\n", realPart,
           imPart, realPart, imPart);
  }
  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    0xee7(%rip),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
lea    -0x28(%rbp),%rcx
call   1040 <scanf@plt>
movsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  0xe82(%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
jbe    1277 <main+0x147>
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1050 <sqrt@plt>
movsd  -0x60(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
addsd  %xmm1,%xmm0
movsd  0xe0a(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1050 <sqrt@plt>
movsd  -0x58(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
subsd  %xmm1,%xmm0
movsd  0xdbc(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
lea    0xde3(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
jmp    1372 <main+0x242>
movsd  -0x30(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    12de <main+0x1ae>
jp     12de <main+0x1ae>
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xd55(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
lea    0xdae(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    136d <main+0x23d>
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xd06(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%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>
cvtsi2sd %eax,%xmm0
movsd  0xccb(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm2
movsd  -0x50(%rbp),%xmm3
lea    0xd49(%rip),%rdi
mov    $0x4,%al
call   1030 <printf@plt>
jmp    1372 <main+0x242>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x58,%rsp
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf09(%rip),%rdi
lea    0x8(%rsp),%rsi
lea    0x20(%rsp),%rdx
lea    0x28(%rsp),%rcx
call   1040 <scanf@plt>
movsd  0x20(%rsp),%xmm2
movsd  0x8(%rsp),%xmm3
movsd  0xe8f(%rip),%xmm1
mulsd  %xmm3,%xmm1
mulsd  0x28(%rsp),%xmm1
movapd %xmm2,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1218 <main+0xe8>
movapd %xmm2,0x10(%rsp)
movapd %xmm0,0x40(%rsp)
call   1050 <sqrt@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
subsd  0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm0
addsd  %xmm0,%xmm0
divsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
movsd  0x20(%rsp),%xmm0
xorps  0xe3c(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0x40(%rsp),%xmm0
call   1050 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movapd 0x30(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  0x8(%rsp),%xmm0
addsd  %xmm0,%xmm0
divsd  %xmm0,%xmm1
lea    0xe55(%rip),%rdi
movsd  0x10(%rsp),%xmm0
mov    $0x2,%al
call   1030 <printf@plt>
jmp    1284 <main+0x154>
xorpd  0xdf0(%rip),%xmm2
addsd  %xmm3,%xmm3
divsd  %xmm3,%xmm2
jne    1240 <main+0x110>
jp     1240 <main+0x110>
lea    0xe5d(%rip),%rdi
movapd %xmm2,%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1284 <main+0x154>
xorpd  0xdc8(%rip),%xmm0
movapd %xmm2,0x10(%rsp)
call   1050 <sqrt@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  0x8(%rsp),%xmm0
addsd  %xmm0,%xmm0
divsd  %xmm0,%xmm1
lea    0xe50(%rip),%rdi
movapd 0x10(%rsp),%xmm0
movapd %xmm0,%xmm2
movapd %xmm1,%xmm3
mov    $0x4,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x58,%rsp
ret

LLVM IR (-O0):
@.str = [50 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: \00"
@.str.1 = [12 x i8] c"%lf %lf %lf\00"
@.str.2 = [50 x i8] c"\D0\9A\D0\BE\D1\80\D0\B5\D0\BD\D1\8C 1 = %.2lf \D0\B8 \D0\BA\D0\BE\D1\80\D0\B5\D0\BD\D1\8C 2 = %.2lf\0A\00"
@.str.3 = [47 x i8] c"\D0\95\D0\B4\D0\B8\D0\BD\D1\81\D1\82\D0\B2\D0\B5\D0\BD\D0\BD\D1\8B\D0\B9 \D0\BA\D0\BE\D1\80\D0\B5\D0\BD\D1\8C = %.2lf\0A\00"
@.str.4 = [64 x i8] c"\D0\9A\D0\BE\D1\80\D0\B5\D0\BD\D1\8C 1 = %.2lf+%.2lfi \D0\B8 \D0\BA\D0\BE\D1\80\D0\B5\D0\BD\D1\8C 2 = %.2lf-%.2lfi\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 ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), double* %6, double* %7, double* %8)
%16 = load double, double* %7
%17 = load double, double* %7
%18 = load double, double* %6
%19 = fmul double 4.000000e+00, %18
%20 = load double, double* %8
%21 = fmul double %19, %20
%22 = fneg double %21
%23 = call double @llvm.fmuladd.f64(double %16, double %17, double %22)
store double %23, double* %9
%24 = load double, double* %9
%25 = fcmp ogt double %24, 0.000000e+00
br i1 %25, label %26, label %48
26: ; preds = %2
%27 = load double, double* %7
%28 = fneg double %27
%29 = load double, double* %9
%30 = call i32 @sqrt(double %29)
%31 = sitofp i32 %30 to double
%32 = fadd double %28, %31
%33 = load double, double* %6
%34 = fmul double 2.000000e+00, %33
%35 = fdiv double %32, %34
store double %35, double* %10
%36 = load double, double* %7
%37 = fneg double %36
%38 = load double, double* %9
%39 = call i32 @sqrt(double %38)
%40 = sitofp i32 %39 to double
%41 = fsub double %37, %40
%42 = load double, double* %6
%43 = fmul double 2.000000e+00, %42
%44 = fdiv double %41, %43
store double %44, double* %11
%45 = load double, double* %10
%46 = load double, double* %11
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0), double %45, double %46)
br label %78
48: ; preds = %2
%49 = load double, double* %9
%50 = fcmp oeq double %49, 0.000000e+00
br i1 %50, label %51, label %59
51: ; preds = %48
%52 = load double, double* %7
%53 = fneg double %52
%54 = load double, double* %6
%55 = fmul double 2.000000e+00, %54
%56 = fdiv double %53, %55
store double %56, double* %11
store double %56, double* %10
%57 = load double, double* %10
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0), double %57)
br label %77
59: ; preds = %48
%60 = load double, double* %7
%61 = fneg double %60
%62 = load double, double* %6
%63 = fmul double 2.000000e+00, %62
%64 = fdiv double %61, %63
store double %64, double* %12
%65 = load double, double* %9
%66 = fneg double %65
%67 = call i32 @sqrt(double %66)
%68 = sitofp i32 %67 to double
%69 = load double, double* %6
%70 = fmul double 2.000000e+00, %69
%71 = fdiv double %68, %70
store double %71, double* %13
%72 = load double, double* %12
%73 = load double, double* %13
%74 = load double, double* %12
%75 = load double, double* %13
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.4, i64 0, i64 0), double %72, double %73, double %74, double %75)
br label %77
77: ; preds = %59, %51
br label %78
78: ; preds = %77, %26
ret i32 0
}

LLVM IR (-O2):
@.str = [50 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: \00"
@.str.1 = [12 x i8] c"%lf %lf %lf\00"
@.str.2 = [50 x i8] c"\D0\9A\D0\BE\D1\80\D0\B5\D0\BD\D1\8C 1 = %.2lf \D0\B8 \D0\BA\D0\BE\D1\80\D0\B5\D0\BD\D1\8C 2 = %.2lf\0A\00"
@.str.3 = [47 x i8] c"\D0\95\D0\B4\D0\B8\D0\BD\D1\81\D1\82\D0\B2\D0\B5\D0\BD\D0\BD\D1\8B\D0\B9 \D0\BA\D0\BE\D1\80\D0\B5\D0\BD\D1\8C = %.2lf\0A\00"
@.str.4 = [64 x i8] c"\D0\9A\D0\BE\D1\80\D0\B5\D0\BD\D1\8C 1 = %.2lf+%.2lfi \D0\B8 \D0\BA\D0\BE\D1\80\D0\B5\D0\BD\D1\8C 2 = %.2lf-%.2lfi\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = bitcast double* %3 to i8*
%7 = bitcast double* %4 to i8*
%8 = bitcast double* %5 to i8*
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), double* %3, double* %4, double* %5)
%11 = load double, double* %4
%12 = load double, double* %3
%13 = load double, double* %5
%14 = fmul double %12, -4.000000e+00
%15 = fmul double %14, %13
%16 = call double @llvm.fmuladd.f64(double %11, double %11, double %15)
%17 = fcmp ogt double %16, 0.000000e+00
br i1 %17, label %18, label %34
18: ; preds = %2
%19 = call i32 @sqrt(double %16)
%20 = sitofp i32 %19 to double
%21 = fsub double %20, %11
%22 = load double, double* %3
%23 = fmul double %22, 2.000000e+00
%24 = fdiv double %21, %23
%25 = load double, double* %4
%26 = fneg double %25
%27 = call i32 @sqrt(double %16)
%28 = sitofp i32 %27 to double
%29 = fsub double %26, %28
%30 = load double, double* %3
%31 = fmul double %30, 2.000000e+00
%32 = fdiv double %29, %31
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0), double %24, double %32)
br label %49
34: ; preds = %2
%35 = fcmp oeq double %16, 0.000000e+00
%36 = fneg double %11
%37 = fmul double %12, 2.000000e+00
%38 = fdiv double %36, %37
br i1 %35, label %39, label %41
39: ; preds = %34
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0), double %38)
br label %49
41: ; preds = %34
%42 = fneg double %16
%43 = call i32 @sqrt(double %42)
%44 = sitofp i32 %43 to double
%45 = load double, double* %3
%46 = fmul double %45, 2.000000e+00
%47 = fdiv double %44, %46
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @.str.4, i64 0, i64 0), double %38, double %47, double %38, double %47)
br label %49
49: ; preds = %39, %41, %18
ret i32 0
}