#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 pow(float, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
float sqrt(float);
int main() {
  float a, b, c, d, r1, r2, r;
  printf("Enter Co-efficient of a :");
  scanf("%f", &a);
  printf("Enter Co-efficient of b :");
  scanf("%f", &b);
  printf("Enter Co-efficient of c :");
  scanf("%f", &c);
  r = (pow(b, 2) - 4 * a * c);
  if (d >= 0) {
    d = sqrt(r);
    r1 = (-b + d) / (2 * a);
    r2 = (-b - d) / (2 * a);
    printf("Root One : %f \n", r1);
    printf("Root Two : %f", r2);
  } else {
    printf("Root is imaginary");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf0d(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeef(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0xc(%rbp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
cvtsi2ss %eax,%xmm1
movss  0xe3c(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  -0x10(%rbp),%xmm2
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x14(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1295 <main+0x155>
movss  -0x20(%rbp),%xmm0
call   1060 <sqrt@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
addss  -0x14(%rbp),%xmm0
movss  0xddd(%rip),%xmm1
mulss  -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
subss  -0x14(%rbp),%xmm0
movss  0xdb0(%rip),%xmm1
mulss  -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xde4(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xddd(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    12a3 <main+0x163>
lea    0xdd8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed0(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xebf(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xebe(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
lea    0xead(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Enter Co-efficient of a :\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [26 x i8] c"Enter Co-efficient of b :\00"
@.str.3 = [26 x i8] c"Enter Co-efficient of c :\00"
@.str.4 = [16 x i8] c"Root One : %f \0A\00"
@.str.5 = [14 x i8] c"Root Two : %f\00"
@.str.6 = [18 x i8] c"Root is imaginary\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
store i32 0, i32* %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %4)
%15 = load float, float* %3
%16 = call i32 @pow(float %15, i32 2)
%17 = sitofp i32 %16 to float
%18 = load float, float* %2
%19 = fmul float 4.000000e+00, %18
%20 = load float, float* %4
%21 = fneg float %19
%22 = call float @llvm.fmuladd.f32(float %21, float %20, float %17)
store float %22, float* %8
%23 = load float, float* %5
%24 = fcmp oge float %23, 0.000000e+00
br i1 %24, label %25, label %48
25: ; preds = %0
%26 = load float, float* %8
%27 = call float @sqrt(float %26)
store float %27, float* %5
%28 = load float, float* %3
%29 = fneg float %28
%30 = load float, float* %5
%31 = fadd float %29, %30
%32 = load float, float* %2
%33 = fmul float 2.000000e+00, %32
%34 = fdiv float %31, %33
store float %34, float* %6
%35 = load float, float* %3
%36 = fneg float %35
%37 = load float, float* %5
%38 = fsub float %36, %37
%39 = load float, float* %2
%40 = fmul float 2.000000e+00, %39
%41 = fdiv float %38, %40
store float %41, float* %7
%42 = load float, float* %6
%43 = fpext float %42 to double
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), double %43)
%45 = load float, float* %7
%46 = fpext float %45 to double
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), double %46)
br label %50
48: ; preds = %0
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0))
br label %50
50: ; preds = %48, %25
%51 = load i32, i32* %1
ret i32 %51
}

LLVM IR (-O2):
@.str = [26 x i8] c"Enter Co-efficient of a :\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [26 x i8] c"Enter Co-efficient of b :\00"
@.str.3 = [26 x i8] c"Enter Co-efficient of c :\00"
@.str.6 = [18 x i8] c"Root is imaginary\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 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%13 = load float, float* %2
%14 = call i32 @pow(float %13, i32 2)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0))
ret i32 0
}