#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 max(float, float, float);
float min(float, float, float);
float rectangle_area(float px1, float px2, float px3, float py1, float py2,
                     float py3) {
  float x_max, x_min, y_max, y_min;
  x_max = max(px1, px2, px3);
  x_min = min(px1, px2, px3);
  y_max = max(py1, py2, py3);
  y_min = min(py1, py2, py3);
  return (x_max - x_min) * (y_max - y_min);
}


x86 assembly (clang, -O0):
<rectangle_area>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  %xmm5,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
call   1040 <max@plt>
movss  %xmm0,-0x1c(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
call   1030 <min@plt>
movss  %xmm0,-0x20(%rbp)
movss  -0x10(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
movss  -0x18(%rbp),%xmm2
call   1040 <max@plt>
movss  %xmm0,-0x24(%rbp)
movss  -0x10(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
movss  -0x18(%rbp),%xmm2
call   1030 <min@plt>
movss  %xmm0,-0x28(%rbp)
movss  -0x1c(%rbp),%xmm0
subss  -0x20(%rbp),%xmm0
movss  -0x24(%rbp),%xmm1
subss  -0x28(%rbp),%xmm1
mulss  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rectangle_area>:
sub    $0x28,%rsp
movss  %xmm5,0x1c(%rsp)
movss  %xmm4,0x18(%rsp)
movss  %xmm3,0x14(%rsp)
movss  %xmm2,0x10(%rsp)
movss  %xmm1,0xc(%rsp)
movss  %xmm0,0x20(%rsp)
call   1040 <max@plt>
movss  %xmm0,0x24(%rsp)
movss  0x20(%rsp),%xmm0
movss  0xc(%rsp),%xmm1
movss  0x10(%rsp),%xmm2
call   1030 <min@plt>
movss  %xmm0,0x10(%rsp)
movss  0x14(%rsp),%xmm0
movss  0x18(%rsp),%xmm1
movss  0x1c(%rsp),%xmm2
call   1040 <max@plt>
movss  %xmm0,0xc(%rsp)
movss  0x14(%rsp),%xmm0
movss  0x18(%rsp),%xmm1
movss  0x1c(%rsp),%xmm2
call   1030 <min@plt>
movss  0x24(%rsp),%xmm1
subss  0x10(%rsp),%xmm1
movss  0xc(%rsp),%xmm2
subss  %xmm0,%xmm2
mulss  %xmm1,%xmm2
movaps %xmm2,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define float @rectangle_area(float %0, float %1, float %2, float %3, float %4, float %5) {
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca float
%15 = alloca float
%16 = alloca float
store float %0, float* %7
store float %1, float* %8
store float %2, float* %9
store float %3, float* %10
store float %4, float* %11
store float %5, float* %12
%17 = load float, float* %7
%18 = load float, float* %8
%19 = load float, float* %9
%20 = call float @max(float %17, float %18, float %19)
store float %20, float* %13
%21 = load float, float* %7
%22 = load float, float* %8
%23 = load float, float* %9
%24 = call float @min(float %21, float %22, float %23)
store float %24, float* %14
%25 = load float, float* %10
%26 = load float, float* %11
%27 = load float, float* %12
%28 = call float @max(float %25, float %26, float %27)
store float %28, float* %15
%29 = load float, float* %10
%30 = load float, float* %11
%31 = load float, float* %12
%32 = call float @min(float %29, float %30, float %31)
store float %32, float* %16
%33 = load float, float* %13
%34 = load float, float* %14
%35 = fsub float %33, %34
%36 = load float, float* %15
%37 = load float, float* %16
%38 = fsub float %36, %37
%39 = fmul float %35, %38
ret float %39
}

LLVM IR (-O2):
define float @rectangle_area(float %0, float %1, float %2, float %3, float %4, float %5) {
%7 = tail call float @max(float %0, float %1, float %2)
%8 = tail call float @min(float %0, float %1, float %2)
%9 = tail call float @max(float %3, float %4, float %5)
%10 = tail call float @min(float %3, float %4, float %5)
%11 = fsub float %7, %8
%12 = fsub float %9, %10
%13 = fmul float %11, %12
ret float %13
}