int point_in_rectangle_full(float point_x, float point_y, float x1, float y1,
                            float x2, float y2) {
  if (x1 < x2) {
    if (point_x < x1 || point_x > x2)
      return 0;
  } else {
    if (point_x < x2 || point_x > x1)
      return 0;
  }
  if (y1 < y2) {
    if (point_y < y1 || point_y > y2)
      return 0;
  } else {
    if (point_y < y2 || point_y > y1)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<point_in_rectangle_full>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  %xmm3,-0x14(%rbp)
movss  %xmm4,-0x18(%rbp)
movss  %xmm5,-0x1c(%rbp)
movss  -0x10(%rbp),%xmm1
movss  -0x18(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1168 <point_in_rectangle_full+0x68>
movss  -0x8(%rbp),%xmm1
movss  -0x10(%rbp),%xmm0
ucomiss %xmm1,%xmm0
ja     1157 <point_in_rectangle_full+0x57>
movss  -0x8(%rbp),%xmm0
ucomiss -0x18(%rbp),%xmm0
jbe    1163 <point_in_rectangle_full+0x63>
movl   $0x0,-0x4(%rbp)
jmp    121b <point_in_rectangle_full+0x11b>
jmp    119b <point_in_rectangle_full+0x9b>
movss  -0x8(%rbp),%xmm1
movss  -0x18(%rbp),%xmm0
ucomiss %xmm1,%xmm0
ja     118a <point_in_rectangle_full+0x8a>
movss  -0x8(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    1196 <point_in_rectangle_full+0x96>
movl   $0x0,-0x4(%rbp)
jmp    121b <point_in_rectangle_full+0x11b>
jmp    119b <point_in_rectangle_full+0x9b>
movss  -0x14(%rbp),%xmm1
movss  -0x1c(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    11e1 <point_in_rectangle_full+0xe1>
movss  -0xc(%rbp),%xmm1
movss  -0x14(%rbp),%xmm0
ucomiss %xmm1,%xmm0
ja     11d0 <point_in_rectangle_full+0xd0>
movss  -0xc(%rbp),%xmm0
ucomiss -0x1c(%rbp),%xmm0
jbe    11dc <point_in_rectangle_full+0xdc>
movl   $0x0,-0x4(%rbp)
jmp    121b <point_in_rectangle_full+0x11b>
jmp    1214 <point_in_rectangle_full+0x114>
movss  -0xc(%rbp),%xmm1
movss  -0x1c(%rbp),%xmm0
ucomiss %xmm1,%xmm0
ja     1203 <point_in_rectangle_full+0x103>
movss  -0xc(%rbp),%xmm0
ucomiss -0x14(%rbp),%xmm0
jbe    120f <point_in_rectangle_full+0x10f>
movl   $0x0,-0x4(%rbp)
jmp    121b <point_in_rectangle_full+0x11b>
jmp    1214 <point_in_rectangle_full+0x114>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<point_in_rectangle_full>:
xor    %eax,%eax
ucomiss %xmm2,%xmm4
jbe    1112 <point_in_rectangle_full+0x12>
ucomiss %xmm0,%xmm2
ja     1111 <point_in_rectangle_full+0x11>
ucomiss %xmm4,%xmm0
jbe    111c <point_in_rectangle_full+0x1c>
ret
ucomiss %xmm2,%xmm0
ja     1111 <point_in_rectangle_full+0x11>
ucomiss %xmm0,%xmm4
ja     1111 <point_in_rectangle_full+0x11>
xor    %eax,%eax
ucomiss %xmm3,%xmm5
jbe    112f <point_in_rectangle_full+0x2f>
ucomiss %xmm1,%xmm3
ja     1111 <point_in_rectangle_full+0x11>
ucomiss %xmm5,%xmm1
jbe    1139 <point_in_rectangle_full+0x39>
jmp    1111 <point_in_rectangle_full+0x11>
ucomiss %xmm3,%xmm1
ja     1111 <point_in_rectangle_full+0x11>
ucomiss %xmm1,%xmm5
ja     1111 <point_in_rectangle_full+0x11>
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @point_in_rectangle_full(float %0, float %1, float %2, float %3, float %4, float %5) {
%7 = alloca i32
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float
store float %0, float* %8
store float %1, float* %9
store float %2, float* %10
store float %3, float* %11
store float %4, float* %12
store float %5, float* %13
%14 = load float, float* %10
%15 = load float, float* %12
%16 = fcmp olt float %14, %15
br i1 %16, label %17, label %27
17: ; preds = %6
%18 = load float, float* %8
%19 = load float, float* %10
%20 = fcmp olt float %18, %19
br i1 %20, label %25, label %21
21: ; preds = %17
%22 = load float, float* %8
%23 = load float, float* %12
%24 = fcmp ogt float %22, %23
br i1 %24, label %25, label %26
25: ; preds = %21, %17
store i32 0, i32* %7
br label %62
26: ; preds = %21
br label %37
27: ; preds = %6
%28 = load float, float* %8
%29 = load float, float* %12
%30 = fcmp olt float %28, %29
br i1 %30, label %35, label %31
31: ; preds = %27
%32 = load float, float* %8
%33 = load float, float* %10
%34 = fcmp ogt float %32, %33
br i1 %34, label %35, label %36
35: ; preds = %31, %27
store i32 0, i32* %7
br label %62
36: ; preds = %31
br label %37
37: ; preds = %36, %26
%38 = load float, float* %11
%39 = load float, float* %13
%40 = fcmp olt float %38, %39
br i1 %40, label %41, label %51
41: ; preds = %37
%42 = load float, float* %9
%43 = load float, float* %11
%44 = fcmp olt float %42, %43
br i1 %44, label %49, label %45
45: ; preds = %41
%46 = load float, float* %9
%47 = load float, float* %13
%48 = fcmp ogt float %46, %47
br i1 %48, label %49, label %50
49: ; preds = %45, %41
store i32 0, i32* %7
br label %62
50: ; preds = %45
br label %61
51: ; preds = %37
%52 = load float, float* %9
%53 = load float, float* %13
%54 = fcmp olt float %52, %53
br i1 %54, label %59, label %55
55: ; preds = %51
%56 = load float, float* %9
%57 = load float, float* %11
%58 = fcmp ogt float %56, %57
br i1 %58, label %59, label %60
59: ; preds = %55, %51
store i32 0, i32* %7
br label %62
60: ; preds = %55
br label %61
61: ; preds = %60, %50
store i32 1, i32* %7
br label %62
62: ; preds = %61, %59, %49, %35, %25
%63 = load i32, i32* %7
ret i32 %63
}

LLVM IR (-O2):
define i32 @point_in_rectangle_full(float %0, float %1, float %2, float %3, float %4, float %5) {
%7 = fcmp olt float %2, %4
br i1 %7, label %8, label %12
8: ; preds = %6
%9 = fcmp olt float %0, %2
%10 = fcmp ogt float %0, %4
%11 = or i1 %9, %10
br i1 %11, label %27, label %16
12: ; preds = %6
%13 = fcmp olt float %0, %4
%14 = fcmp ogt float %0, %2
%15 = or i1 %14, %13
br i1 %15, label %27, label %16
16: ; preds = %12, %8
%17 = fcmp olt float %3, %5
br i1 %17, label %18, label %22
18: ; preds = %16
%19 = fcmp olt float %1, %3
%20 = fcmp ogt float %1, %5
%21 = or i1 %19, %20
br i1 %21, label %27, label %26
22: ; preds = %16
%23 = fcmp olt float %1, %5
%24 = fcmp ogt float %1, %3
%25 = or i1 %24, %23
br i1 %25, label %27, label %26
26: ; preds = %22, %18
br label %27
27: ; preds = %22, %18, %12, %8, %26
%28 = phi i32 [ 1, %26 ], [ 0, %8 ], [ 0, %12 ], [ 0, %18 ], [ 0, %22 ]
ret i32 %28
}