#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*/ clrscr();
int /*<<< orphan*/ fabs(int);
int /*<<< orphan*/ getch();
int pow(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
float sqrt(int /*<<< orphan*/);
void main() {
  int ch, a, b, c;
  float s, ans, ans1, ans2;
  clrscr();
  printf("enter values of a,b,c :\n");
  scanf("%d %d %d", &a, &b, &c);
  ch = pow(b, 2) - (4 * a * c);
  if (ch == 0) {
    ans = (-b) / (2 * a);
    printf("x= %f", ans);
  } else {
    s = sqrt(fabs(ch));
    ans1 = ((-b) + s) / (2 * a);
    printf("x= %f", ans1);
    ans2 = ((-b) - s) / (2 * a);
    printf(" or %f", ans2);
  }
  getch();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1030 <clrscr@plt>
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe85(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1060 <scanf@plt>
mov    -0xc(%rbp),%edi
mov    $0x2,%esi
call   1080 <pow@plt>
mov    -0x8(%rbp),%ecx
shl    $0x2,%ecx
imul   -0x10(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    11fe <main+0x8e>
xor    %eax,%eax
sub    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe30(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
jmp    1282 <main+0x112>
mov    -0x4(%rbp),%edi
call   1050 <fabs@plt>
mov    %eax,%edi
call   1090 <sqrt@plt>
movss  %xmm0,-0x14(%rbp)
xor    %eax,%eax
sub    -0xc(%rbp),%eax
cvtsi2ss %eax,%xmm0
addss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
cvtsi2ss %eax,%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xddf(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
sub    -0xc(%rbp),%eax
cvtsi2ss %eax,%xmm0
subss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
cvtsi2ss %eax,%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdad(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1070 <getch@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <clrscr@plt>
lea    0xe81(%rip),%rdi
call   1040 <puts@plt>
lea    0xe5f(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
lea    0xc(%rsp),%rcx
call   1070 <scanf@plt>
mov    (%rsp),%edi
mov    $0x2,%esi
call   1090 <pow@plt>
mov    0x4(%rsp),%ecx
mov    0xc(%rsp),%edx
imul   %ecx,%edx
shl    $0x2,%edx
sub    %edx,%eax
je     1240 <main+0xc0>
mov    %eax,%edi
call   1060 <fabs@plt>
mov    %eax,%edi
call   10a0 <sqrt@plt>
xor    %eax,%eax
sub    (%rsp),%eax
cvtsi2ss %eax,%xmm1
mov    0x4(%rsp),%eax
add    %eax,%eax
cvtsi2ss %eax,%xmm2
movss  %xmm0,0x8(%rsp)
addss  %xmm0,%xmm1
divss  %xmm2,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
lea    0xdfa(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
sub    (%rsp),%ebx
xorps  %xmm0,%xmm0
cvtsi2ss %ebx,%xmm0
mov    0x4(%rsp),%eax
add    %eax,%eax
xorps  %xmm1,%xmm1
cvtsi2ss %eax,%xmm1
subss  0x8(%rsp),%xmm0
divss  %xmm1,%xmm0
lea    0xdd1(%rip),%rdi
jmp    1255 <main+0xd5>
mov    (%rsp),%eax
add    %ecx,%ecx
cltd
idiv   %ecx
neg    %eax
cvtsi2ss %eax,%xmm0
lea    0xdb4(%rip),%rdi
cvtss2sd %xmm0,%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
xor    %eax,%eax
call   1080 <getch@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"enter values of a,b,c :\0A\00"
@.str.1 = [9 x i8] c"%d %d %d\00"
@.str.2 = [6 x i8] c"x= %f\00"
@.str.3 = [7 x i8] c" or %f\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = call i32 (...) @clrscr()
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%12 = load i32, i32* %3
%13 = call i32 @pow(i32 %12, i32 2)
%14 = load i32, i32* %2
%15 = mul nsw i32 4, %14
%16 = load i32, i32* %4
%17 = mul nsw i32 %15, %16
%18 = sub nsw i32 %13, %17
store i32 %18, i32* %1
%19 = load i32, i32* %1
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %31
21: ; preds = %0
%22 = load i32, i32* %3
%23 = sub nsw i32 0, %22
%24 = load i32, i32* %2
%25 = mul nsw i32 2, %24
%26 = sdiv i32 %23, %25
%27 = sitofp i32 %26 to float
store float %27, float* %6
%28 = load float, float* %6
%29 = fpext float %28 to double
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), double %29)
br label %59
31: ; preds = %0
%32 = load i32, i32* %1
%33 = call i32 @fabs(i32 %32)
%34 = call float @sqrt(i32 %33)
store float %34, float* %5
%35 = load i32, i32* %3
%36 = sub nsw i32 0, %35
%37 = sitofp i32 %36 to float
%38 = load float, float* %5
%39 = fadd float %37, %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* %7
%44 = load float, float* %7
%45 = fpext float %44 to double
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), double %45)
%47 = load i32, i32* %3
%48 = sub nsw i32 0, %47
%49 = sitofp i32 %48 to float
%50 = load float, float* %5
%51 = fsub float %49, %50
%52 = load i32, i32* %2
%53 = mul nsw i32 2, %52
%54 = sitofp i32 %53 to float
%55 = fdiv float %51, %54
store float %55, float* %8
%56 = load float, float* %8
%57 = fpext float %56 to double
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double %57)
br label %59
59: ; preds = %31, %21
%60 = call i32 (...) @getch()
ret void
}

LLVM IR (-O2):
@.str.1 = [9 x i8] c"%d %d %d\00"
@.str.2 = [6 x i8] c"x= %f\00"
@.str.3 = [7 x i8] c" or %f\00"
@str = [24 x i8] c"enter values of a,b,c :\00"
define void @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 (...) @clrscr()
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 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* %1, i32* %2, i32* %3)
%10 = load i32, i32* %2
%11 = call i32 @pow(i32 %10, i32 2)
%12 = load i32, i32* %1
%13 = mul i32 %12, -4
%14 = load i32, i32* %3
%15 = mul i32 %13, %14
%16 = add i32 %15, %11
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %24
18: ; preds = %0
%19 = load i32, i32* %2
%20 = shl nsw i32 %12, 1
%21 = sdiv i32 %19, %20
%22 = sub nsw i32 0, %21
%23 = sitofp i32 %22 to float
br label %45
24: ; preds = %0
%25 = call i32 @fabs(i32 %16)
%26 = call float @sqrt(i32 %25)
%27 = load i32, i32* %2
%28 = sub nsw i32 0, %27
%29 = sitofp i32 %28 to float
%30 = fadd float %26, %29
%31 = load i32, i32* %1
%32 = shl nsw i32 %31, 1
%33 = sitofp i32 %32 to float
%34 = fdiv float %30, %33
%35 = fpext float %34 to double
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), double %35)
%37 = load i32, i32* %2
%38 = sub nsw i32 0, %37
%39 = sitofp i32 %38 to float
%40 = fsub float %39, %26
%41 = load i32, i32* %1
%42 = shl nsw i32 %41, 1
%43 = sitofp i32 %42 to float
%44 = fdiv float %40, %43
br label %45
45: ; preds = %24, %18
%46 = phi float [ %44, %24 ], [ %23, %18 ]
%47 = phi i8* [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), %24 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), %18 ]
%48 = fpext float %46 to double
%49 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %47, double %48)
%50 = call i32 (...) @getch()
ret void
}