#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 DBL_MAX;
double reg_bounds_area(double *fieldx, double *fieldy) {
  double field_area;
  if (fieldx[1] >= DBL_MAX || fieldx[0] <= -DBL_MAX || fieldy[1] >= DBL_MAX ||
      fieldy[0] <= -DBL_MAX) {
    field_area = DBL_MAX;
  } else {
    field_area = (fieldx[1] - fieldx[0]) * (fieldy[1] - fieldy[0]);
  }
  return field_area;
}


x86 assembly (clang, -O0):
<reg_bounds_area>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    0x2ec4(%rip),%rax
ucomisd (%rax),%xmm0
jae    11a8 <reg_bounds_area+0xa8>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    0x2eab(%rip),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
ucomisd %xmm1,%xmm0
jae    11a8 <reg_bounds_area+0xa8>
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    0x2e76(%rip),%rax
ucomisd (%rax),%xmm0
jae    11a8 <reg_bounds_area+0xa8>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    0x2e5d(%rip),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
ucomisd %xmm1,%xmm0
jb     11bd <reg_bounds_area+0xbd>
mov    0x2e31(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    11e8 <reg_bounds_area+0xe8>
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
subsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x10(%rbp),%rax
subsd  (%rax),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<reg_bounds_area>:
movsd  0x8(%rdi),%xmm1
mov    0x2ed4(%rip),%rax
movsd  (%rax),%xmm0
ucomisd %xmm0,%xmm1
jae    1151 <reg_bounds_area+0x51>
movsd  (%rdi),%xmm2
movapd 0xede(%rip),%xmm4
xorpd  %xmm0,%xmm4
ucomisd %xmm2,%xmm4
jae    1151 <reg_bounds_area+0x51>
movsd  0x8(%rsi),%xmm3
ucomisd %xmm0,%xmm3
jae    1151 <reg_bounds_area+0x51>
movsd  (%rsi),%xmm5
ucomisd %xmm5,%xmm4
jae    1151 <reg_bounds_area+0x51>
subsd  %xmm2,%xmm1
subsd  %xmm5,%xmm3
mulsd  %xmm1,%xmm3
movapd %xmm3,%xmm0
ret

LLVM IR (-O0):
@DBL_MAX = global double 0.000000e+00
define double @reg_bounds_area(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%6 = load double*, double** %3
%7 = getelementptr inbounds double, double* %6, i64 1
%8 = load double, double* %7
%9 = load double, double* @DBL_MAX
%10 = fcmp oge double %8, %9
br i1 %10, label %31, label %11
11: ; preds = %2
%12 = load double*, double** %3
%13 = getelementptr inbounds double, double* %12, i64 0
%14 = load double, double* %13
%15 = load double, double* @DBL_MAX
%16 = fneg double %15
%17 = fcmp ole double %14, %16
br i1 %17, label %31, label %18
18: ; preds = %11
%19 = load double*, double** %4
%20 = getelementptr inbounds double, double* %19, i64 1
%21 = load double, double* %20
%22 = load double, double* @DBL_MAX
%23 = fcmp oge double %21, %22
br i1 %23, label %31, label %24
24: ; preds = %18
%25 = load double*, double** %4
%26 = getelementptr inbounds double, double* %25, i64 0
%27 = load double, double* %26
%28 = load double, double* @DBL_MAX
%29 = fneg double %28
%30 = fcmp ole double %27, %29
br i1 %30, label %31, label %33
31: ; preds = %24, %18, %11, %2
%32 = load double, double* @DBL_MAX
store double %32, double* %5
br label %49
33: ; preds = %24
%34 = load double*, double** %3
%35 = getelementptr inbounds double, double* %34, i64 1
%36 = load double, double* %35
%37 = load double*, double** %3
%38 = getelementptr inbounds double, double* %37, i64 0
%39 = load double, double* %38
%40 = fsub double %36, %39
%41 = load double*, double** %4
%42 = getelementptr inbounds double, double* %41, i64 1
%43 = load double, double* %42
%44 = load double*, double** %4
%45 = getelementptr inbounds double, double* %44, i64 0
%46 = load double, double* %45
%47 = fsub double %43, %46
%48 = fmul double %40, %47
store double %48, double* %5
br label %49
49: ; preds = %33, %31
%50 = load double, double* %5
ret double %50
}

LLVM IR (-O2):
@DBL_MAX = global double 0.000000e+00
define double @reg_bounds_area(double* nocapture %0, double* nocapture %1) {
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = load double, double* @DBL_MAX
%6 = fcmp ult double %4, %5
br i1 %6, label %7, label %22
7: ; preds = %2
%8 = load double, double* %0
%9 = fneg double %5
%10 = fcmp ugt double %8, %9
br i1 %10, label %11, label %22
11: ; preds = %7
%12 = getelementptr inbounds double, double* %1, i64 1
%13 = load double, double* %12
%14 = fcmp ult double %13, %5
br i1 %14, label %15, label %22
15: ; preds = %11
%16 = load double, double* %1
%17 = fcmp ugt double %16, %9
br i1 %17, label %18, label %22
18: ; preds = %15
%19 = fsub double %4, %8
%20 = fsub double %13, %16
%21 = fmul double %19, %20
br label %22
22: ; preds = %2, %7, %11, %15, %18
%23 = phi double [ %21, %18 ], [ %5, %15 ], [ %5, %11 ], [ %5, %7 ], [ %5, %2 ]
ret double %23
}