#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 sqrt(double);
int line2d_eqn(float *p_xy1, float *p_xy2, double abc[3]) {
  register double x1, y1, x2, y2, dx, dy, d;
  x1 = p_xy1[0], y1 = p_xy1[1];
  x2 = p_xy2[0], y2 = p_xy2[1];
  dx = x2 - x1, dy = y2 - y1;
  if (dy == 0.0) {
    if (dx == 0.0) {
      abc[0] = abc[1] = abc[2] = 0.0;
      return 0;
    }
    if (dx > 0.0)
      dx = -dx;
  } else if (dy < 0.0) {
    dy = -dy, dx = -dx;
  }
  d = sqrt((dx * dx) + (dy * dy));
  dx /= d, dy /= d;
  abc[0] = dy;
  abc[1] = -dx;
  abc[2] = (y1 * dx) - (x1 * dy);
  return 1;
}


x86 assembly (clang, -O0):
<line2d_eqn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x18(%rbp),%rax
movss  0x4(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x40(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    121f <line2d_eqn+0x10f>
jp     121f <line2d_eqn+0x10f>
movsd  -0x48(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11e7 <line2d_eqn+0xd7>
jp     11e7 <line2d_eqn+0xd7>
mov    -0x20(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x10(%rax)
mov    -0x20(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x20(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1335 <line2d_eqn+0x225>
movsd  -0x48(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    121a <line2d_eqn+0x10a>
movsd  -0x48(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x48(%rbp)
jmp    1274 <line2d_eqn+0x164>
xorps  %xmm0,%xmm0
ucomisd -0x50(%rbp),%xmm0
jbe    126f <line2d_eqn+0x15f>
movsd  -0x50(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x48(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x48(%rbp)
jmp    1274 <line2d_eqn+0x164>
movsd  -0x48(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x50(%rbp),%xmm1
mulsd  -0x50(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x58(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x48(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x30(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm1
mulsd  -0x50(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x10(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<line2d_eqn>:
push   %rbx
sub    $0x30,%rsp
cvtps2pd (%rdi),%xmm2
mov    %rdx,%rbx
cvtps2pd (%rsi),%xmm3
subpd  %xmm2,%xmm3
movapd %xmm3,%xmm0
unpckhpd %xmm3,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1155 <line2d_eqn+0x45>
jp     1155 <line2d_eqn+0x45>
ucomisd %xmm1,%xmm3
jne    1165 <line2d_eqn+0x55>
jp     1165 <line2d_eqn+0x55>
xorpd  %xmm0,%xmm0
movupd %xmm0,(%rbx)
movq   $0x0,0x10(%rbx)
xor    %eax,%eax
jmp    1209 <line2d_eqn+0xf9>
ucomisd %xmm0,%xmm1
jbe    117f <line2d_eqn+0x6f>
xorpd  0xe9d(%rip),%xmm3
jmp    117f <line2d_eqn+0x6f>
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm3
jbe    117f <line2d_eqn+0x6f>
movapd 0xe89(%rip),%xmm0
xorpd  %xmm3,%xmm0
movsd  %xmm0,%xmm3
movapd %xmm3,%xmm4
unpckhpd %xmm3,%xmm4
movapd %xmm4,%xmm1
mulsd  %xmm4,%xmm1
movapd %xmm3,%xmm0
mulsd  %xmm3,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     11ab <line2d_eqn+0x9b>
sqrtsd %xmm0,%xmm0
jmp    11d2 <line2d_eqn+0xc2>
movapd %xmm2,0x20(%rsp)
movapd %xmm3,0x10(%rsp)
movapd %xmm4,(%rsp)
call   1030 <sqrt@plt>
movapd (%rsp),%xmm4
movapd 0x10(%rsp),%xmm3
movapd 0x20(%rsp),%xmm2
divsd  %xmm0,%xmm3
divsd  %xmm0,%xmm4
movsd  %xmm4,(%rbx)
movapd 0xe1a(%rip),%xmm0
xorpd  %xmm3,%xmm0
movlpd %xmm0,0x8(%rbx)
mulsd  %xmm2,%xmm4
unpckhpd %xmm2,%xmm2
mulsd  %xmm3,%xmm2
subsd  %xmm4,%xmm2
movsd  %xmm2,0x10(%rbx)
mov    $0x1,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @line2d_eqn(float* %0, float* %1, double* %2) {
%4 = alloca i32
%5 = alloca float*
%6 = alloca float*
%7 = alloca double*
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
store float* %0, float** %5
store float* %1, float** %6
store double* %2, double** %7
%15 = load float*, float** %5
%16 = getelementptr inbounds float, float* %15, i64 0
%17 = load float, float* %16
%18 = fpext float %17 to double
store double %18, double* %8
%19 = load float*, float** %5
%20 = getelementptr inbounds float, float* %19, i64 1
%21 = load float, float* %20
%22 = fpext float %21 to double
store double %22, double* %9
%23 = load float*, float** %6
%24 = getelementptr inbounds float, float* %23, i64 0
%25 = load float, float* %24
%26 = fpext float %25 to double
store double %26, double* %10
%27 = load float*, float** %6
%28 = getelementptr inbounds float, float* %27, i64 1
%29 = load float, float* %28
%30 = fpext float %29 to double
store double %30, double* %11
%31 = load double, double* %10
%32 = load double, double* %8
%33 = fsub double %31, %32
store double %33, double* %12
%34 = load double, double* %11
%35 = load double, double* %9
%36 = fsub double %34, %35
store double %36, double* %13
%37 = load double, double* %13
%38 = fcmp oeq double %37, 0.000000e+00
br i1 %38, label %39, label %56
39: ; preds = %3
%40 = load double, double* %12
%41 = fcmp oeq double %40, 0.000000e+00
br i1 %41, label %42, label %49
42: ; preds = %39
%43 = load double*, double** %7
%44 = getelementptr inbounds double, double* %43, i64 2
store double 0.000000e+00, double* %44
%45 = load double*, double** %7
%46 = getelementptr inbounds double, double* %45, i64 1
store double 0.000000e+00, double* %46
%47 = load double*, double** %7
%48 = getelementptr inbounds double, double* %47, i64 0
store double 0.000000e+00, double* %48
store i32 0, i32* %4
br label %95
49: ; preds = %39
%50 = load double, double* %12
%51 = fcmp ogt double %50, 0.000000e+00
br i1 %51, label %52, label %55
52: ; preds = %49
%53 = load double, double* %12
%54 = fneg double %53
store double %54, double* %12
br label %55
55: ; preds = %52, %49
br label %65
56: ; preds = %3
%57 = load double, double* %13
%58 = fcmp olt double %57, 0.000000e+00
br i1 %58, label %59, label %64
59: ; preds = %56
%60 = load double, double* %13
%61 = fneg double %60
store double %61, double* %13
%62 = load double, double* %12
%63 = fneg double %62
store double %63, double* %12
br label %64
64: ; preds = %59, %56
br label %65
65: ; preds = %64, %55
%66 = load double, double* %12
%67 = load double, double* %12
%68 = load double, double* %13
%69 = load double, double* %13
%70 = fmul double %68, %69
%71 = call double @llvm.fmuladd.f64(double %66, double %67, double %70)
%72 = call double @sqrt(double %71)
store double %72, double* %14
%73 = load double, double* %14
%74 = load double, double* %12
%75 = fdiv double %74, %73
store double %75, double* %12
%76 = load double, double* %14
%77 = load double, double* %13
%78 = fdiv double %77, %76
store double %78, double* %13
%79 = load double, double* %13
%80 = load double*, double** %7
%81 = getelementptr inbounds double, double* %80, i64 0
store double %79, double* %81
%82 = load double, double* %12
%83 = fneg double %82
%84 = load double*, double** %7
%85 = getelementptr inbounds double, double* %84, i64 1
store double %83, double* %85
%86 = load double, double* %9
%87 = load double, double* %12
%88 = load double, double* %8
%89 = load double, double* %13
%90 = fmul double %88, %89
%91 = fneg double %90
%92 = call double @llvm.fmuladd.f64(double %86, double %87, double %91)
%93 = load double*, double** %7
%94 = getelementptr inbounds double, double* %93, i64 2
store double %92, double* %94
store i32 1, i32* %4
br label %95
95: ; preds = %65, %42
%96 = load i32, i32* %4
ret i32 %96
}

LLVM IR (-O2):
define i32 @line2d_eqn(float* nocapture %0, float* nocapture %1, double* nocapture writeonly %2) {
%4 = bitcast float* %0 to <2 x float>*
%5 = load <2 x float>, <2 x float>* %4
%6 = fpext <2 x float> %5 to <2 x double>
%7 = bitcast float* %1 to <2 x float>*
%8 = load <2 x float>, <2 x float>* %7
%9 = fpext <2 x float> %8 to <2 x double>
%10 = fsub <2 x double> %9, %6
%11 = extractelement <2 x double> %10, i64 1
%12 = fcmp oeq double %11, 0.000000e+00
br i1 %12, label %13, label %23
13: ; preds = %3
%14 = extractelement <2 x double> %10, i64 0
%15 = fcmp oeq double %14, 0.000000e+00
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = bitcast double* %2 to i8*
br label %44
18: ; preds = %13
%19 = fcmp ogt double %14, 0.000000e+00
br i1 %19, label %20, label %27
20: ; preds = %18
%21 = fneg double %14
%22 = insertelement <2 x double> %10, double %21, i64 0
br label %27
23: ; preds = %3
%24 = fcmp olt double %11, 0.000000e+00
br i1 %24, label %25, label %27
25: ; preds = %23
%26 = fneg <2 x double> %10
br label %27
27: ; preds = %23, %25, %18, %20
%28 = phi <2 x double> [ %22, %20 ], [ %10, %18 ], [ %26, %25 ], [ %10, %23 ]
%29 = extractelement <2 x double> %28, i64 1
%30 = fmul double %29, %29
%31 = extractelement <2 x double> %28, i64 0
%32 = tail call double @llvm.fmuladd.f64(double %31, double %31, double %30)
%33 = tail call double @sqrt(double %32)
%34 = fdiv double %31, %33
%35 = fdiv double %29, %33
store double %35, double* %2
%36 = fneg double %34
%37 = getelementptr inbounds double, double* %2, i64 1
store double %36, double* %37
%38 = fneg double %35
%39 = extractelement <2 x double> %6, i64 0
%40 = fmul double %39, %38
%41 = extractelement <2 x double> %6, i64 1
%42 = tail call double @llvm.fmuladd.f64(double %41, double %34, double %40)
%43 = getelementptr inbounds double, double* %2, i64 2
store double %42, double* %43
br label %44
44: ; preds = %27, %16
%45 = phi i32 [ 0, %16 ], [ 1, %27 ]
ret i32 %45
}