#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 *, float, float);
int /*<<< orphan*/ scanf(char *, float *, float *, float *);
int sqrt(float);
void main() {
  float a, b, c, disc, x1, x2, p, q;
  scanf("a=%f,b=%f,c=%f", &a, &b, &c);
  disc = b * b - 4 * a * c;
  p = -b / (2 * a);
  q = sqrt(disc) / (2 * a);
  x1 = p + q;
  x2 = p - q;
  printf("x1=%5.2f\nx2=%5.2f\n", x1, x2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xec9(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
lea    -0xc(%rbp),%rcx
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
movss  -0x8(%rbp),%xmm2
movss  0xea2(%rip),%xmm1
mulss  -0x4(%rbp),%xmm1
mulss  -0xc(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  0xe60(%rip),%xmm1
mulss  -0x4(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x10(%rbp),%xmm0
call   1050 <sqrt@plt>
cvtsi2ss %eax,%xmm0
movss  0xe3c(%rip),%xmm1
mulss  -0x4(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x1c(%rbp),%xmm0
addss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x1c(%rbp),%xmm0
subss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
movss  -0x18(%rbp),%xmm1
lea    0xe16(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
lea    0xee5(%rip),%rdi
lea    0x4(%rsp),%rsi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm2
movss  0x4(%rsp),%xmm0
movaps %xmm0,0x20(%rsp)
movss  0xe98(%rip),%xmm1
mulss  %xmm0,%xmm1
mulss  0x8(%rsp),%xmm1
movaps %xmm2,%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
xorps  0xe8c(%rip),%xmm2
movaps %xmm2,0x10(%rsp)
call   1050 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movaps 0x10(%rsp),%xmm2
unpcklps %xmm0,%xmm2
movss  0x4(%rsp),%xmm0
movaps 0x20(%rsp),%xmm1
unpcklps %xmm0,%xmm1
addps  %xmm1,%xmm1
divps  %xmm1,%xmm2
movaps %xmm2,%xmm1
shufps $0x55,%xmm2,%xmm1
movaps %xmm2,%xmm0
addss  %xmm1,%xmm0
subss  %xmm1,%xmm2
movaps %xmm2,%xmm1
lea    0xe62(%rip),%rdi
call   1030 <printf@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"a=%f,b=%f,c=%f\00"
@.str.1 = [19 x i8] c"x1=%5.2f\0Ax2=%5.2f\0A\00"
define void @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = call i32 @scanf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), float* %1, float* %2, float* %3)
%10 = load float, float* %2
%11 = load float, float* %2
%12 = load float, float* %1
%13 = fmul float 4.000000e+00, %12
%14 = load float, float* %3
%15 = fmul float %13, %14
%16 = fneg float %15
%17 = call float @llvm.fmuladd.f32(float %10, float %11, float %16)
store float %17, float* %4
%18 = load float, float* %2
%19 = fneg float %18
%20 = load float, float* %1
%21 = fmul float 2.000000e+00, %20
%22 = fdiv float %19, %21
store float %22, float* %7
%23 = load float, float* %4
%24 = call i32 @sqrt(float %23)
%25 = sitofp i32 %24 to float
%26 = load float, float* %1
%27 = fmul float 2.000000e+00, %26
%28 = fdiv float %25, %27
store float %28, float* %8
%29 = load float, float* %7
%30 = load float, float* %8
%31 = fadd float %29, %30
store float %31, float* %5
%32 = load float, float* %7
%33 = load float, float* %8
%34 = fsub float %32, %33
store float %34, float* %6
%35 = load float, float* %5
%36 = load float, float* %6
%37 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), float %35, float %36)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"a=%f,b=%f,c=%f\00"
@.str.1 = [19 x i8] c"x1=%5.2f\0Ax2=%5.2f\0A\00"
define void @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = bitcast float* %1 to i8*
%5 = bitcast float* %2 to i8*
%6 = bitcast float* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), float* %1, float* %2, float* %3)
%8 = load float, float* %2
%9 = load float, float* %1
%10 = load float, float* %3
%11 = fmul float %9, -4.000000e+00
%12 = fmul float %11, %10
%13 = call float @llvm.fmuladd.f32(float %8, float %8, float %12)
%14 = fneg float %8
%15 = call i32 @sqrt(float %13)
%16 = sitofp i32 %15 to float
%17 = load float, float* %1
%18 = insertelement <2 x float> poison, float %9, i64 0
%19 = insertelement <2 x float> %18, float %17, i64 1
%20 = fmul <2 x float> %19, <float 2.000000e+00, float 2.000000e+00>
%21 = insertelement <2 x float> poison, float %14, i64 0
%22 = insertelement <2 x float> %21, float %16, i64 1
%23 = fdiv <2 x float> %22, %20
%24 = extractelement <2 x float> %23, i64 0
%25 = extractelement <2 x float> %23, i64 1
%26 = fadd float %24, %25
%27 = fsub float %24, %25
%28 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), float %26, float %27)
ret void
}