#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 */
double calcAngularCoeff(double *, double *, double *, double *);
double calcIntercetta(double *, double *, double *, double *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double x1, y1, x2, y2, m = 0, q = 0;
  printf("Enter the value of x1:\n");
  scanf("%lf", &x1);
  printf("Enter the value of y1:\n");
  scanf("%lf", &y1);
  printf("Enter the value of x2:\n");
  scanf("%lf", &x2);
  printf("Enter the value of y2:\n");
  scanf("%lf", &y2);
  m = calcAngularCoeff(&x1, &y1, &x2, &y2);
  q = calcIntercetta(&x1, &y1, &x2, &y2);
  if (x1 == x2 == y1 == y2) {
    printf("The given points are equals.\n");
    return 0;
  } else if ((x1 - x2) == 0) {
    printf("The line is vertical.\n");
    return 0;
  } else if ((m == 1) && (q == 0)) {
    printf("The equation of the line goes through the origin: y = 1.000 * x\n");
    return 0;
  } else if ((m == 0) && (q == 1)) {
    printf("The equation of the line is constant: y = 1.000\n");
    return 0;
  } else {
    printf("y = %lf x + %lf\n", m, q);
    return 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeac(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1060 <scanf@plt>
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe8e(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1060 <scanf@plt>
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe70(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1060 <scanf@plt>
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe52(%rip),%rdi
lea    -0x28(%rbp),%rsi
call   1060 <scanf@plt>
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
lea    -0x28(%rbp),%rcx
call   1050 <calcAngularCoeff@plt>
movsd  %xmm0,-0x30(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
lea    -0x28(%rbp),%rcx
call   1040 <calcIntercetta@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
ucomisd -0x18(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
ucomisd -0x28(%rbp),%xmm0
jne    1267 <main+0x127>
jp     1267 <main+0x127>
lea    0xe18(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    135b <main+0x21b>
movsd  -0x10(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    129e <main+0x15e>
jp     129e <main+0x15e>
lea    0xdff(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    135b <main+0x21b>
movsd  -0x30(%rbp),%xmm0
movsd  0xd55(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    12ed <main+0x1ad>
jp     12ed <main+0x1ad>
movsd  -0x38(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    12ed <main+0x1ad>
jp     12ed <main+0x1ad>
lea    0xdc7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    135b <main+0x21b>
movsd  -0x30(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    133c <main+0x1fc>
jp     133c <main+0x1fc>
movsd  -0x38(%rbp),%xmm0
movsd  0xcee(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    133c <main+0x1fc>
jp     133c <main+0x1fc>
lea    0xdb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    135b <main+0x21b>
movsd  -0x30(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
lea    0xdc6(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x30,%rsp
lea    0xeb9(%rip),%rdi
call   1030 <puts@plt>
lea    0xe98(%rip),%r13
lea    0x28(%rsp),%r14
mov    %r13,%rdi
mov    %r14,%rsi
call   1070 <scanf@plt>
lea    0xead(%rip),%rdi
call   1030 <puts@plt>
lea    0x20(%rsp),%r15
mov    %r13,%rdi
mov    %r15,%rsi
call   1070 <scanf@plt>
lea    0xea8(%rip),%rdi
call   1030 <puts@plt>
lea    0x18(%rsp),%r12
mov    %r13,%rdi
mov    %r12,%rsi
call   1070 <scanf@plt>
lea    0xea3(%rip),%rdi
call   1030 <puts@plt>
lea    0x10(%rsp),%rbx
mov    %r13,%rdi
mov    %rbx,%rsi
call   1070 <scanf@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %rbx,%rcx
call   1060 <calcAngularCoeff@plt>
movsd  %xmm0,0x8(%rsp)
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %rbx,%rcx
call   1050 <calcIntercetta@plt>
movapd %xmm0,%xmm1
movsd  0x28(%rsp),%xmm0
movsd  0x18(%rsp),%xmm2
movapd %xmm0,%xmm3
cmpeqsd %xmm2,%xmm3
movsd  0xde3(%rip),%xmm4
andpd  %xmm4,%xmm3
cmpeqsd 0x20(%rsp),%xmm3
andpd  %xmm4,%xmm3
movsd  0x10(%rsp),%xmm4
ucomisd %xmm3,%xmm4
jne    124b <main+0xfb>
jp     124b <main+0xfb>
lea    0xebe(%rip),%rdi
call   1030 <puts@plt>
jmp    12cd <main+0x17d>
movsd  0x8(%rsp),%xmm3
subsd  %xmm2,%xmm0
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
jne    126f <main+0x11f>
jp     126f <main+0x11f>
lea    0xe81(%rip),%rdi
call   1030 <puts@plt>
jmp    12cd <main+0x17d>
movapd %xmm3,%xmm0
ucomisd 0xd85(%rip),%xmm3
jne    1299 <main+0x149>
jp     1299 <main+0x149>
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm1
jne    1299 <main+0x149>
jp     1299 <main+0x149>
lea    0xe17(%rip),%rdi
call   1030 <puts@plt>
jmp    12cd <main+0x17d>
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
jne    12bf <main+0x16f>
jp     12bf <main+0x16f>
ucomisd 0xd53(%rip),%xmm1
jne    12bf <main+0x16f>
jp     12bf <main+0x16f>
lea    0xdc1(%rip),%rdi
call   1030 <puts@plt>
jmp    12cd <main+0x17d>
lea    0xd46(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Enter the value of x1:\0A\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [24 x i8] c"Enter the value of y1:\0A\00"
@.str.3 = [24 x i8] c"Enter the value of x2:\0A\00"
@.str.4 = [24 x i8] c"Enter the value of y2:\0A\00"
@.str.5 = [30 x i8] c"The given points are equals.\0A\00"
@.str.6 = [23 x i8] c"The line is vertical.\0A\00"
@.str.7 = [65 x i8] c"The equation of the line goes through the origin: y = 1.000 * x\0A\00"
@.str.8 = [49 x i8] c"The equation of the line is constant: y = 1.000\0A\00"
@.str.9 = [17 x i8] c"y = %lf x + %lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store i32 0, i32* %1
store double 0.000000e+00, double* %6
store double 0.000000e+00, double* %7
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %3)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %4)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %5)
%16 = call double @calcAngularCoeff(double* %2, double* %3, double* %4, double* %5)
store double %16, double* %6
%17 = call double @calcIntercetta(double* %2, double* %3, double* %4, double* %5)
store double %17, double* %7
%18 = load double, double* %2
%19 = load double, double* %4
%20 = fcmp oeq double %18, %19
%21 = zext i1 %20 to i32
%22 = sitofp i32 %21 to double
%23 = load double, double* %3
%24 = fcmp oeq double %22, %23
%25 = zext i1 %24 to i32
%26 = sitofp i32 %25 to double
%27 = load double, double* %5
%28 = fcmp oeq double %26, %27
br i1 %28, label %29, label %31
29: ; preds = %0
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %1
br label %58
31: ; preds = %0
%32 = load double, double* %2
%33 = load double, double* %4
%34 = fsub double %32, %33
%35 = fcmp oeq double %34, 0.000000e+00
br i1 %35, label %36, label %38
36: ; preds = %31
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %1
br label %58
38: ; preds = %31
%39 = load double, double* %6
%40 = fcmp oeq double %39, 1.000000e+00
br i1 %40, label %41, label %46
41: ; preds = %38
%42 = load double, double* %7
%43 = fcmp oeq double %42, 0.000000e+00
br i1 %43, label %44, label %46
44: ; preds = %41
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.7, i64 0, i64 0))
store i32 0, i32* %1
br label %58
46: ; preds = %41, %38
%47 = load double, double* %6
%48 = fcmp oeq double %47, 0.000000e+00
br i1 %48, label %49, label %54
49: ; preds = %46
%50 = load double, double* %7
%51 = fcmp oeq double %50, 1.000000e+00
br i1 %51, label %52, label %54
52: ; preds = %49
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.8, i64 0, i64 0))
store i32 0, i32* %1
br label %58
54: ; preds = %49, %46
%55 = load double, double* %6
%56 = load double, double* %7
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0), double %55, double %56)
store i32 0, i32* %1
br label %58
58: ; preds = %54, %52, %44, %36, %29
%59 = load i32, i32* %1
ret i32 %59
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%lf\00"
@.str.9 = [17 x i8] c"y = %lf x + %lf\0A\00"
@str = [23 x i8] c"Enter the value of x1:\00"
@str.10 = [23 x i8] c"Enter the value of y1:\00"
@str.11 = [23 x i8] c"Enter the value of x2:\00"
@str.12 = [23 x i8] c"Enter the value of y2:\00"
@str.13 = [48 x i8] c"The equation of the line is constant: y = 1.000\00"
@str.14 = [64 x i8] c"The equation of the line goes through the origin: y = 1.000 * x\00"
@str.15 = [22 x i8] c"The line is vertical.\00"
@str.16 = [29 x i8] c"The given points are equals.\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = bitcast double* %1 to i8*
%6 = bitcast double* %2 to i8*
%7 = bitcast double* %3 to i8*
%8 = bitcast double* %4 to i8*
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.10, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.11, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %3)
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.12, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %4)
%17 = call double @calcAngularCoeff(double* %1, double* %2, double* %3, double* %4)
%18 = call double @calcIntercetta(double* %1, double* %2, double* %3, double* %4)
%19 = load double, double* %1
%20 = load double, double* %3
%21 = fcmp oeq double %19, %20
%22 = uitofp i1 %21 to double
%23 = load double, double* %2
%24 = fcmp oeq double %23, %22
%25 = uitofp i1 %24 to double
%26 = load double, double* %4
%27 = fcmp oeq double %26, %25
br i1 %27, label %28, label %30
28: ; preds = %0
%29 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.16, i64 0, i64 0))
br label %49
30: ; preds = %0
%31 = fsub double %19, %20
%32 = fcmp oeq double %31, 0.000000e+00
br i1 %32, label %33, label %35
33: ; preds = %30
%34 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.15, i64 0, i64 0))
br label %49
35: ; preds = %30
%36 = fcmp oeq double %17, 1.000000e+00
%37 = fcmp oeq double %18, 0.000000e+00
%38 = select i1 %36, i1 %37, i1 false
br i1 %38, label %39, label %41
39: ; preds = %35
%40 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str.14, i64 0, i64 0))
br label %49
41: ; preds = %35
%42 = fcmp oeq double %17, 0.000000e+00
%43 = fcmp oeq double %18, 1.000000e+00
%44 = select i1 %42, i1 %43, i1 false
br i1 %44, label %45, label %47
45: ; preds = %41
%46 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.13, i64 0, i64 0))
br label %49
47: ; preds = %41
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0), double %17, double %18)
br label %49
49: ; preds = %47, %45, %39, %33, %28
ret i32 0
}