#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 */
float sqrt(float);
float lsin(float x1, float y1, float x2, float y2) {
  if (x1 == 0 && x2 == 0 && y1 == 0 && y2 == 0)
    return ~0;
  return ((y2 - y1) / sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1)));
}


x86 assembly (clang, -O0):
<lsin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  %xmm3,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    119a <lsin+0x8a>
jp     119a <lsin+0x8a>
movss  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    119a <lsin+0x8a>
jp     119a <lsin+0x8a>
movss  -0xc(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    119a <lsin+0x8a>
jp     119a <lsin+0x8a>
movss  -0x14(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    119a <lsin+0x8a>
jp     119a <lsin+0x8a>
movss  0xe70(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    11f3 <lsin+0xe3>
movss  -0x14(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x10(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
movss  -0x10(%rbp),%xmm2
subss  -0x8(%rbp),%xmm2
movss  -0x14(%rbp),%xmm1
subss  -0xc(%rbp),%xmm1
movss  -0x14(%rbp),%xmm3
subss  -0xc(%rbp),%xmm3
mulss  %xmm3,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movss  -0x18(%rbp),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lsin>:
push   %rax
movaps %xmm3,%xmm5
xorps  %xmm3,%xmm3
ucomiss %xmm3,%xmm5
jne    1140 <lsin+0x30>
jp     1140 <lsin+0x30>
ucomiss %xmm3,%xmm1
jne    1140 <lsin+0x30>
jp     1140 <lsin+0x30>
xorps  %xmm4,%xmm4
ucomiss %xmm4,%xmm0
jne    1140 <lsin+0x30>
jp     1140 <lsin+0x30>
ucomiss %xmm4,%xmm2
jne    1140 <lsin+0x30>
jp     1140 <lsin+0x30>
movss  0xec2(%rip),%xmm5
jmp    117d <lsin+0x6d>
subss  %xmm1,%xmm5
subss  %xmm0,%xmm2
movaps %xmm5,%xmm0
mulss  %xmm5,%xmm0
mulss  %xmm2,%xmm2
addss  %xmm0,%xmm2
ucomiss %xmm3,%xmm2
jb     1165 <lsin+0x55>
xorps  %xmm0,%xmm0
sqrtss %xmm2,%xmm0
jmp    1179 <lsin+0x69>
movaps %xmm2,%xmm0
movss  %xmm5,0x4(%rsp)
call   1030 <sqrt@plt>
movss  0x4(%rsp),%xmm5
divss  %xmm0,%xmm5
movaps %xmm5,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @lsin(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
store float %0, float* %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
%10 = load float, float* %6
%11 = fcmp oeq float %10, 0.000000e+00
br i1 %11, label %12, label %22
12: ; preds = %4
%13 = load float, float* %8
%14 = fcmp oeq float %13, 0.000000e+00
br i1 %14, label %15, label %22
15: ; preds = %12
%16 = load float, float* %7
%17 = fcmp oeq float %16, 0.000000e+00
br i1 %17, label %18, label %22
18: ; preds = %15
%19 = load float, float* %9
%20 = fcmp oeq float %19, 0.000000e+00
br i1 %20, label %21, label %22
21: ; preds = %18
store float -1.000000e+00, float* %5
br label %42
22: ; preds = %18, %15, %12, %4
%23 = load float, float* %9
%24 = load float, float* %7
%25 = fsub float %23, %24
%26 = load float, float* %8
%27 = load float, float* %6
%28 = fsub float %26, %27
%29 = load float, float* %8
%30 = load float, float* %6
%31 = fsub float %29, %30
%32 = load float, float* %9
%33 = load float, float* %7
%34 = fsub float %32, %33
%35 = load float, float* %9
%36 = load float, float* %7
%37 = fsub float %35, %36
%38 = fmul float %34, %37
%39 = call float @llvm.fmuladd.f32(float %28, float %31, float %38)
%40 = call float @sqrt(float %39)
%41 = fdiv float %25, %40
store float %41, float* %5
br label %42
42: ; preds = %22, %21
%43 = load float, float* %5
ret float %43
}

LLVM IR (-O2):
define float @lsin(float %0, float %1, float %2, float %3) {
%5 = fcmp oeq float %0, 0.000000e+00
%6 = fcmp oeq float %2, 0.000000e+00
%7 = and i1 %5, %6
%8 = fcmp oeq float %1, 0.000000e+00
%9 = and i1 %8, %7
%10 = fcmp oeq float %3, 0.000000e+00
%11 = and i1 %10, %9
br i1 %11, label %19, label %12
12: ; preds = %4
%13 = fsub float %3, %1
%14 = fsub float %2, %0
%15 = fmul float %13, %13
%16 = tail call float @llvm.fmuladd.f32(float %14, float %14, float %15)
%17 = tail call float @sqrt(float %16)
%18 = fdiv float %13, %17
br label %19
19: ; preds = %4, %12
%20 = phi float [ %18, %12 ], [ -1.000000e+00, %4 ]
ret float %20
}