int reg_rectangle_inside(double *xpos1, double *ypos1, double *xpos2,
                         double *ypos2) {
  int ok =
      (xpos1[0] >= xpos2[0] && xpos1[0] <= xpos2[1] && xpos1[1] >= xpos2[0] &&
       xpos1[1] <= xpos2[1] && ypos1[0] >= ypos2[0] && ypos1[0] <= ypos2[1] &&
       ypos1[1] >= ypos2[0] && ypos1[1] <= ypos2[1]);
  return ok;
}


x86 assembly (clang, -O0):
<reg_rectangle_inside>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rcx
xor    %eax,%eax
ucomisd (%rcx),%xmm0
mov    %al,-0x25(%rbp)
jb     11ff <reg_rectangle_inside+0xff>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
xor    %eax,%eax
ucomisd %xmm1,%xmm0
mov    %al,-0x25(%rbp)
jb     11ff <reg_rectangle_inside+0xff>
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rcx
xor    %eax,%eax
ucomisd (%rcx),%xmm0
mov    %al,-0x25(%rbp)
jb     11ff <reg_rectangle_inside+0xff>
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
xor    %eax,%eax
ucomisd %xmm1,%xmm0
mov    %al,-0x25(%rbp)
jb     11ff <reg_rectangle_inside+0xff>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x20(%rbp),%rcx
xor    %eax,%eax
ucomisd (%rcx),%xmm0
mov    %al,-0x25(%rbp)
jb     11ff <reg_rectangle_inside+0xff>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x20(%rbp),%rax
movsd  0x8(%rax),%xmm0
xor    %eax,%eax
ucomisd %xmm1,%xmm0
mov    %al,-0x25(%rbp)
jb     11ff <reg_rectangle_inside+0xff>
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x20(%rbp),%rcx
xor    %eax,%eax
ucomisd (%rcx),%xmm0
mov    %al,-0x25(%rbp)
jb     11ff <reg_rectangle_inside+0xff>
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x20(%rbp),%rax
movsd  0x8(%rax),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
mov    %al,-0x25(%rbp)
mov    -0x25(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reg_rectangle_inside>:
movsd  (%rdi),%xmm2
movsd  (%rdx),%xmm0
xor    %eax,%eax
ucomisd %xmm0,%xmm2
jb     1159 <reg_rectangle_inside+0x59>
movsd  0x8(%rdx),%xmm1
ucomisd %xmm2,%xmm1
jb     1159 <reg_rectangle_inside+0x59>
movsd  0x8(%rdi),%xmm2
ucomisd %xmm0,%xmm2
jb     1159 <reg_rectangle_inside+0x59>
ucomisd %xmm2,%xmm1
jb     1159 <reg_rectangle_inside+0x59>
movsd  (%rsi),%xmm2
movsd  (%rcx),%xmm1
ucomisd %xmm1,%xmm2
jb     1159 <reg_rectangle_inside+0x59>
movsd  0x8(%rcx),%xmm0
ucomisd %xmm2,%xmm0
jb     1159 <reg_rectangle_inside+0x59>
movsd  0x8(%rsi),%xmm2
ucomisd %xmm1,%xmm2
jb     1159 <reg_rectangle_inside+0x59>
xor    %eax,%eax
ucomisd %xmm2,%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @reg_rectangle_inside(double* %0, double* %1, double* %2, double* %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
%9 = alloca i32
store double* %0, double** %5
store double* %1, double** %6
store double* %2, double** %7
store double* %3, double** %8
%10 = load double*, double** %5
%11 = getelementptr inbounds double, double* %10, i64 0
%12 = load double, double* %11
%13 = load double*, double** %7
%14 = getelementptr inbounds double, double* %13, i64 0
%15 = load double, double* %14
%16 = fcmp oge double %12, %15
br i1 %16, label %17, label %73
17: ; preds = %4
%18 = load double*, double** %5
%19 = getelementptr inbounds double, double* %18, i64 0
%20 = load double, double* %19
%21 = load double*, double** %7
%22 = getelementptr inbounds double, double* %21, i64 1
%23 = load double, double* %22
%24 = fcmp ole double %20, %23
br i1 %24, label %25, label %73
25: ; preds = %17
%26 = load double*, double** %5
%27 = getelementptr inbounds double, double* %26, i64 1
%28 = load double, double* %27
%29 = load double*, double** %7
%30 = getelementptr inbounds double, double* %29, i64 0
%31 = load double, double* %30
%32 = fcmp oge double %28, %31
br i1 %32, label %33, label %73
33: ; preds = %25
%34 = load double*, double** %5
%35 = getelementptr inbounds double, double* %34, i64 1
%36 = load double, double* %35
%37 = load double*, double** %7
%38 = getelementptr inbounds double, double* %37, i64 1
%39 = load double, double* %38
%40 = fcmp ole double %36, %39
br i1 %40, label %41, label %73
41: ; preds = %33
%42 = load double*, double** %6
%43 = getelementptr inbounds double, double* %42, i64 0
%44 = load double, double* %43
%45 = load double*, double** %8
%46 = getelementptr inbounds double, double* %45, i64 0
%47 = load double, double* %46
%48 = fcmp oge double %44, %47
br i1 %48, label %49, label %73
49: ; preds = %41
%50 = load double*, double** %6
%51 = getelementptr inbounds double, double* %50, i64 0
%52 = load double, double* %51
%53 = load double*, double** %8
%54 = getelementptr inbounds double, double* %53, i64 1
%55 = load double, double* %54
%56 = fcmp ole double %52, %55
br i1 %56, label %57, label %73
57: ; preds = %49
%58 = load double*, double** %6
%59 = getelementptr inbounds double, double* %58, i64 1
%60 = load double, double* %59
%61 = load double*, double** %8
%62 = getelementptr inbounds double, double* %61, i64 0
%63 = load double, double* %62
%64 = fcmp oge double %60, %63
br i1 %64, label %65, label %73
65: ; preds = %57
%66 = load double*, double** %6
%67 = getelementptr inbounds double, double* %66, i64 1
%68 = load double, double* %67
%69 = load double*, double** %8
%70 = getelementptr inbounds double, double* %69, i64 1
%71 = load double, double* %70
%72 = fcmp ole double %68, %71
br label %73
73: ; preds = %65, %57, %49, %41, %33, %25, %17, %4
%74 = phi i1 [ false, %57 ], [ false, %49 ], [ false, %41 ], [ false, %33 ], [ false, %25 ], [ false, %17 ], [ false, %4 ], [ %72, %65 ]
%75 = zext i1 %74 to i32
store i32 %75, i32* %9
%76 = load i32, i32* %9
ret i32 %76
}

LLVM IR (-O2):
define i32 @reg_rectangle_inside(double* nocapture %0, double* nocapture %1, double* nocapture %2, double* nocapture %3) {
%5 = load double, double* %0
%6 = load double, double* %2
%7 = fcmp ult double %5, %6
br i1 %7, label %33, label %8
8: ; preds = %4
%9 = getelementptr inbounds double, double* %2, i64 1
%10 = load double, double* %9
%11 = fcmp ugt double %5, %10
br i1 %11, label %33, label %12
12: ; preds = %8
%13 = getelementptr inbounds double, double* %0, i64 1
%14 = load double, double* %13
%15 = fcmp ult double %14, %6
%16 = fcmp ugt double %14, %10
%17 = select i1 %15, i1 true, i1 %16
br i1 %17, label %33, label %18
18: ; preds = %12
%19 = load double, double* %1
%20 = load double, double* %3
%21 = fcmp ult double %19, %20
br i1 %21, label %33, label %22
22: ; preds = %18
%23 = getelementptr inbounds double, double* %3, i64 1
%24 = load double, double* %23
%25 = fcmp ugt double %19, %24
br i1 %25, label %33, label %26
26: ; preds = %22
%27 = getelementptr inbounds double, double* %1, i64 1
%28 = load double, double* %27
%29 = fcmp ult double %28, %20
br i1 %29, label %33, label %30
30: ; preds = %26
%31 = fcmp ole double %28, %24
%32 = zext i1 %31 to i32
br label %33
33: ; preds = %30, %26, %22, %18, %12, %8, %4
%34 = phi i32 [ 0, %26 ], [ 0, %22 ], [ 0, %18 ], [ 0, %12 ], [ 0, %8 ], [ 0, %4 ], [ %32, %30 ]
ret i32 %34
}