#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 EOF;
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
scalar_t__ sqrt(float);
int main(void) {
  int a, b, c;
  float d, x_1, x_2;
  float total;
  printf("\t\t ax'2 + bx + c\n\n");
  printf("\nEnter a: ");
  scanf("%d", &a);
  printf("Enter b: ");
  scanf("%d", &b);
  printf("Enter c: ");
  scanf("%d", &c);
  printf("The Equation = (%d.x'2) + (%d.x) + (%d)\n\n", a, b, c);
  while (a != EOF) {
    d = (b * b) - (4 * a * c);
    x_1 = (float)(0 - b - sqrt(d)) / (2 * a);
    x_2 = (float)(0 - b + sqrt(d)) / (2 * a);
    if (d < 0) {
      printf("\nDelta is smaller than 0\nNo radical\n");
    }
    if (d == 0) {
      printf("\nX1 = X2\nThe commonal radical is: %.2f\n", x_1);
    }
    if (d > 0) {
      printf("X1 = %.2f\n", x_1);
      printf("X2 = %.2f\n", x_2);
    }
    printf("Enter a: ");
    scanf("%d", &a);
    printf("\nEnter b: ");
    scanf("%d", &b);
    printf("\nEnter c: ");
    scanf("%d", &c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xf3d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe9e(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xf2a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe80(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    0x2e20(%rip),%rcx
cmp    (%rcx),%eax
je     1341 <main+0x211>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x2,%ecx
imul   -0x10(%rbp),%ecx
sub    %ecx,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x14(%rbp)
xor    %eax,%eax
sub    -0xc(%rbp),%eax
cltq
mov    %rax,-0x30(%rbp)
movss  -0x14(%rbp),%xmm0
call   1050 <sqrt@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
sub    %rcx,%rax
cvtsi2ss %rax,%xmm0
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
cvtsi2ss %eax,%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
xor    %eax,%eax
sub    -0xc(%rbp),%eax
cltq
mov    %rax,-0x28(%rbp)
movss  -0x14(%rbp),%xmm0
call   1050 <sqrt@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
add    %rcx,%rax
cvtsi2ss %rax,%xmm0
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
cvtsi2ss %eax,%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x14(%rbp),%xmm0
jbe    1275 <main+0x145>
lea    0xddd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x14(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    12a3 <main+0x173>
jp     12a3 <main+0x173>
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdd4(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x14(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    12e2 <main+0x1b2>
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdd4(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdc8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xd2b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd27(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xda7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd09(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xd94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xceb(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
jmp    11be <main+0x8e>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xf37(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9f(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe9c(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xef4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xee4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0x8(%rsp),%esi
mov    0xc(%rsp),%edx
mov    0x14(%rsp),%ecx
lea    0xe49(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%eax
mov    0x2e11(%rip),%rcx
cmp    (%rcx),%eax
jne    11ec <main+0xac>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe18(%rip),%rbx
jmp    1270 <main+0x130>
cs nopw 0x0(%rax,%rax,1)
nop
lea    0xe97(%rip),%rdi
call   1030 <puts@plt>
lea    0xdee(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
lea    0x8(%rsp),%rsi
call   1050 <scanf@plt>
lea    0xe48(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
lea    0xe38(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
lea    0x14(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x8(%rsp),%eax
mov    0x2d80(%rip),%rcx
cmp    (%rcx),%eax
je     11db <main+0x9b>
movslq 0xc(%rsp),%r13
mov    %r13d,%ebp
imul   %r13d,%ebp
imul   0x14(%rsp),%eax
shl    $0x2,%eax
sub    %eax,%ebp
xorps  %xmm0,%xmm0
cvtsi2ss %ebp,%xmm0
movss  %xmm0,0x10(%rsp)
call   1060 <sqrt@plt>
mov    %rax,%r12
mov    0x8(%rsp),%r15d
movslq 0xc(%rsp),%r14
movss  0x10(%rsp),%xmm0
call   1060 <sqrt@plt>
test   %ebp,%ebp
js     1200 <main+0xc0>
add    %r12,%r13
neg    %r13
xorps  %xmm0,%xmm0
cvtsi2ss %r13,%xmm0
add    %r15d,%r15d
xorps  %xmm1,%xmm1
cvtsi2ss %r15d,%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
test   %ebp,%ebp
je     1320 <main+0x1e0>
sub    %r14,%rax
xorps  %xmm2,%xmm2
cvtsi2ss %rax,%xmm2
mov    0x8(%rsp),%eax
add    %eax,%eax
xorps  %xmm1,%xmm1
cvtsi2ss %eax,%xmm1
divss  %xmm1,%xmm2
movss  %xmm2,0x10(%rsp)
lea    0xd5a(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd4d(%rip),%rdi
jmp    1327 <main+0x1e7>
lea    0xd11(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
jmp    120c <main+0xcc>

LLVM IR (-O0):
@.str = [19 x i8] c"\09\09 ax'2 + bx + c\0A\0A\00"
@.str.1 = [11 x i8] c"\0AEnter a: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [10 x i8] c"Enter b: \00"
@.str.4 = [10 x i8] c"Enter c: \00"
@.str.5 = [42 x i8] c"The Equation = (%d.x'2) + (%d.x) + (%d)\0A\0A\00"
@EOF = global i32 0
@.str.6 = [37 x i8] c"\0ADelta is smaller than 0\0ANo radical\0A\00"
@.str.7 = [40 x i8] c"\0AX1 = X2\0AThe commonal radical is: %.2f\0A\00"
@.str.8 = [11 x i8] c"X1 = %.2f\0A\00"
@.str.9 = [11 x i8] c"X2 = %.2f\0A\00"
@.str.10 = [10 x i8] c"Enter a: \00"
@.str.11 = [11 x i8] c"\0AEnter b: \00"
@.str.12 = [11 x i8] c"\0AEnter c: \00"
define i32 @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
store i32 0, i32* %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %4)
%16 = load i32, i32* %2
%17 = load i32, i32* %3
%18 = load i32, i32* %4
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0), i32 %16, i32 %17, i32 %18)
br label %20
20: ; preds = %77, %0
%21 = load i32, i32* %2
%22 = load i32, i32* @EOF
%23 = icmp ne i32 %21, %22
br i1 %23, label %24, label %84
24: ; preds = %20
%25 = load i32, i32* %3
%26 = load i32, i32* %3
%27 = mul nsw i32 %25, %26
%28 = load i32, i32* %2
%29 = mul nsw i32 4, %28
%30 = load i32, i32* %4
%31 = mul nsw i32 %29, %30
%32 = sub nsw i32 %27, %31
%33 = sitofp i32 %32 to float
store float %33, float* %5
%34 = load i32, i32* %3
%35 = sub nsw i32 0, %34
%36 = sext i32 %35 to i64
%37 = load float, float* %5
%38 = call i64 @sqrt(float %37)
%39 = sub nsw i64 %36, %38
%40 = sitofp i64 %39 to float
%41 = load i32, i32* %2
%42 = mul nsw i32 2, %41
%43 = sitofp i32 %42 to float
%44 = fdiv float %40, %43
store float %44, float* %6
%45 = load i32, i32* %3
%46 = sub nsw i32 0, %45
%47 = sext i32 %46 to i64
%48 = load float, float* %5
%49 = call i64 @sqrt(float %48)
%50 = add nsw i64 %47, %49
%51 = sitofp i64 %50 to float
%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* %7
%56 = load float, float* %5
%57 = fcmp olt float %56, 0.000000e+00
br i1 %57, label %58, label %60
58: ; preds = %24
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.6, i64 0, i64 0))
br label %60
60: ; preds = %58, %24
%61 = load float, float* %5
%62 = fcmp oeq float %61, 0.000000e+00
br i1 %62, label %63, label %67
63: ; preds = %60
%64 = load float, float* %6
%65 = fpext float %64 to double
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.7, i64 0, i64 0), double %65)
br label %67
67: ; preds = %63, %60
%68 = load float, float* %5
%69 = fcmp ogt float %68, 0.000000e+00
br i1 %69, label %70, label %77
70: ; preds = %67
%71 = load float, float* %6
%72 = fpext float %71 to double
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), double %72)
%74 = load float, float* %7
%75 = fpext float %74 to double
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0), double %75)
br label %77
77: ; preds = %70, %67
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0))
%79 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.11, i64 0, i64 0))
%81 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.12, i64 0, i64 0))
%83 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %4)
br label %20
84: ; preds = %20
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [11 x i8] c"\0AEnter a: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [10 x i8] c"Enter b: \00"
@.str.4 = [10 x i8] c"Enter c: \00"
@.str.5 = [42 x i8] c"The Equation = (%d.x'2) + (%d.x) + (%d)\0A\0A\00"
@EOF = global i32 0
@.str.7 = [40 x i8] c"\0AX1 = X2\0AThe commonal radical is: %.2f\0A\00"
@.str.8 = [11 x i8] c"X1 = %.2f\0A\00"
@.str.9 = [11 x i8] c"X2 = %.2f\0A\00"
@.str.10 = [10 x i8] c"Enter a: \00"
@.str.11 = [11 x i8] c"\0AEnter b: \00"
@.str.12 = [11 x i8] c"\0AEnter c: \00"
@str = [18 x i8] c"\09\09 ax'2 + bx + c\0A\00"
@str.13 = [36 x i8] c"\0ADelta is smaller than 0\0ANo radical\00"
define i32 @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 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%14 = load i32, i32* %1
%15 = load i32, i32* %2
%16 = load i32, i32* %3
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0), i32 %14, i32 %15, i32 %16)
%18 = load i32, i32* %1
%19 = load i32, i32* @EOF
%20 = icmp eq i32 %18, %19
br i1 %20, label %71, label %21
21: ; preds = %0, %61
%22 = phi i32 [ %68, %61 ], [ %18, %0 ]
%23 = load i32, i32* %2
%24 = mul nsw i32 %23, %23
%25 = mul i32 %22, -4
%26 = load i32, i32* %3
%27 = mul i32 %25, %26
%28 = add i32 %27, %24
%29 = sitofp i32 %28 to float
%30 = call i64 @sqrt(float %29)
%31 = load i32, i32* %1
%32 = load i32, i32* %2
%33 = sub nsw i32 0, %32
%34 = sext i32 %33 to i64
%35 = call i64 @sqrt(float %29)
%36 = add nsw i64 %35, %34
%37 = sitofp i64 %36 to float
%38 = load i32, i32* %1
%39 = shl nsw i32 %38, 1
%40 = sitofp i32 %39 to float
%41 = fdiv float %37, %40
%42 = icmp slt i32 %28, 0
br i1 %42, label %43, label %45
43: ; preds = %21
%44 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.13, i64 0, i64 0))
br label %61
45: ; preds = %21
%46 = sub nsw i32 0, %23
%47 = sext i32 %46 to i64
%48 = sub nsw i64 %47, %30
%49 = sitofp i64 %48 to float
%50 = shl nsw i32 %31, 1
%51 = sitofp i32 %50 to float
%52 = fdiv float %49, %51
%53 = icmp eq i32 %28, 0
%54 = fpext float %52 to double
br i1 %53, label %55, label %57
55: ; preds = %45
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.7, i64 0, i64 0), double %54)
br label %61
57: ; preds = %45
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), double %54)
%59 = fpext float %41 to double
%60 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0), double %59)
br label %61
61: ; preds = %55, %43, %57
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0))
%63 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%64 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.11, i64 0, i64 0))
%65 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%66 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.12, i64 0, i64 0))
%67 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%68 = load i32, i32* %1
%69 = load i32, i32* @EOF
%70 = icmp eq i32 %68, %69
br i1 %70, label %71, label %21
71: ; preds = %61, %0
ret i32 0
}