#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);
int main(void) {
  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("\nx1=%5.2f\nx2=%5.2f\n", x1, x2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec2(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
movss  -0xc(%rbp),%xmm0
movss  -0xc(%rbp),%xmm2
movss  0xe9b(%rip),%xmm1
mulss  -0x8(%rbp),%xmm1
mulss  -0x10(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  0xe59(%rip),%xmm1
mulss  -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x14(%rbp),%xmm0
call   1050 <sqrt@plt>
cvtsi2ss %eax,%xmm0
movss  0xe35(%rip),%xmm1
mulss  -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x20(%rbp),%xmm0
addss  -0x24(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x20(%rbp),%xmm0
subss  -0x24(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x18(%rbp),%xmm0
movss  -0x1c(%rbp),%xmm1
lea    0xe0f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%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>
xor    %eax,%eax
add    $0x38,%rsp
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"a=%f,b=%f,c=%f\00"
@.str.1 = [20 x i8] c"\0Ax1=%5.2f\0Ax2=%5.2f\0A\00"
define i32 @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 ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), float %26, float %27)
ret i32 0
}