#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 INFINITY;
double _slope_math(double x1, double y1, double x2, double y2) {
  if (x1 == x2)
    if (y2 > y1)
      return +INFINITY;
    else
      return -INFINITY;
  else
    return (y2 - y1) / (x2 - x1);
}


x86 assembly (clang, -O0):
<_slope_math>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jne    117f <_slope_math+0x7f>
jp     117f <_slope_math+0x7f>
movsd  -0x28(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1153 <_slope_math+0x53>
mov    0x2ea3(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    119c <_slope_math+0x9c>
mov    0x2e8e(%rip),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    119c <_slope_math+0x9c>
movsd  -0x28(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_slope_math>:
ucomisd %xmm2,%xmm0
jne    1126 <_slope_math+0x26>
jp     1126 <_slope_math+0x26>
ucomisd %xmm1,%xmm3
mov    0x2ed5(%rip),%rax
movsd  (%rax),%xmm3
ja     1132 <_slope_math+0x32>
xorpd  0xedf(%rip),%xmm3
movapd %xmm3,%xmm0
ret
subsd  %xmm1,%xmm3
subsd  %xmm0,%xmm2
divsd  %xmm2,%xmm3
movapd %xmm3,%xmm0
ret

LLVM IR (-O0):
@INFINITY = global double 0.000000e+00
define double @_slope_math(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
%10 = load double, double* %6
%11 = load double, double* %8
%12 = fcmp oeq double %10, %11
br i1 %12, label %13, label %22
13: ; preds = %4
%14 = load double, double* %9
%15 = load double, double* %7
%16 = fcmp ogt double %14, %15
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load double, double* @INFINITY
store double %18, double* %5
br label %30
19: ; preds = %13
%20 = load double, double* @INFINITY
%21 = fneg double %20
store double %21, double* %5
br label %30
22: ; preds = %4
%23 = load double, double* %9
%24 = load double, double* %7
%25 = fsub double %23, %24
%26 = load double, double* %8
%27 = load double, double* %6
%28 = fsub double %26, %27
%29 = fdiv double %25, %28
store double %29, double* %5
br label %30
30: ; preds = %22, %19, %17
%31 = load double, double* %5
ret double %31
}

LLVM IR (-O2):
@INFINITY = global double 0.000000e+00
define double @_slope_math(double %0, double %1, double %2, double %3) {
%5 = fcmp oeq double %0, %2
br i1 %5, label %6, label %11
6: ; preds = %4
%7 = fcmp ogt double %3, %1
%8 = load double, double* @INFINITY
br i1 %7, label %15, label %9
9: ; preds = %6
%10 = fneg double %8
br label %15
11: ; preds = %4
%12 = fsub double %3, %1
%13 = fsub double %2, %0
%14 = fdiv double %12, %13
br label %15
15: ; preds = %6, %11, %9
%16 = phi double [ %10, %9 ], [ %14, %11 ], [ %8, %6 ]
ret double %16
}