#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*/ line_eqn_from_two_points(double, double, double, double,
                                            double *, double *, double *);
void perpendicular_line_from_two_points(double x1, double y1, double x2,
                                        double y2, double *A, double *B,
                                        double *C) {
  double dx, dy, mx, my, px, py;
  dx = (x2 - x1);
  dy = (y2 - y1);
  mx = x1 + dx / 2.0;
  my = y1 + dy / 2.0;
  px = mx + dy;
  py = my + dx;
  line_eqn_from_two_points(mx, my, px, py, A, B, C);
}


x86 assembly (clang, -O0):
<perpendicular_line_from_two_points>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
mov    %rdi,-0x28(%rbp)
mov    %rsi,-0x30(%rbp)
mov    %rdx,-0x38(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
movsd  0xe98(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
movsd  0xe79(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x50(%rbp),%xmm0
addsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x58(%rbp),%xmm0
addsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm2
movsd  -0x68(%rbp),%xmm3
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%rdx
call   1030 <line_eqn_from_two_points@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<perpendicular_line_from_two_points>:
movapd %xmm2,%xmm4
subsd  %xmm0,%xmm4
subsd  %xmm1,%xmm3
movsd  0xedc(%rip),%xmm2
movapd %xmm4,%xmm5
mulsd  %xmm2,%xmm5
addsd  %xmm5,%xmm0
mulsd  %xmm3,%xmm2
addsd  %xmm2,%xmm1
addsd  %xmm0,%xmm3
addsd  %xmm1,%xmm4
movapd %xmm3,%xmm2
movapd %xmm4,%xmm3
jmp    1030 <line_eqn_from_two_points@plt>

LLVM IR (-O0):
define void @perpendicular_line_from_two_points(double %0, double %1, double %2, double %3, double* %4, double* %5, double* %6) {
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double*
%13 = alloca double*
%14 = alloca double*
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
store double %0, double* %8
store double %1, double* %9
store double %2, double* %10
store double %3, double* %11
store double* %4, double** %12
store double* %5, double** %13
store double* %6, double** %14
%21 = load double, double* %10
%22 = load double, double* %8
%23 = fsub double %21, %22
store double %23, double* %15
%24 = load double, double* %11
%25 = load double, double* %9
%26 = fsub double %24, %25
store double %26, double* %16
%27 = load double, double* %8
%28 = load double, double* %15
%29 = fdiv double %28, 2.000000e+00
%30 = fadd double %27, %29
store double %30, double* %17
%31 = load double, double* %9
%32 = load double, double* %16
%33 = fdiv double %32, 2.000000e+00
%34 = fadd double %31, %33
store double %34, double* %18
%35 = load double, double* %17
%36 = load double, double* %16
%37 = fadd double %35, %36
store double %37, double* %19
%38 = load double, double* %18
%39 = load double, double* %15
%40 = fadd double %38, %39
store double %40, double* %20
%41 = load double, double* %17
%42 = load double, double* %18
%43 = load double, double* %19
%44 = load double, double* %20
%45 = load double*, double** %12
%46 = load double*, double** %13
%47 = load double*, double** %14
%48 = call i32 @line_eqn_from_two_points(double %41, double %42, double %43, double %44, double* %45, double* %46, double* %47)
ret void
}

LLVM IR (-O2):
define void @perpendicular_line_from_two_points(double %0, double %1, double %2, double %3, double* %4, double* %5, double* %6) {
%8 = fsub double %2, %0
%9 = fsub double %3, %1
%10 = fmul double %8, 5.000000e-01
%11 = fadd double %10, %0
%12 = fmul double %9, 5.000000e-01
%13 = fadd double %12, %1
%14 = fadd double %9, %11
%15 = fadd double %8, %13
%16 = tail call i32 @line_eqn_from_two_points(double %11, double %13, double %14, double %15, double* %4, double* %5, double* %6)
ret void
}