#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 fabsf(float);
float dist_Chebychev(float x, float y, float z, float e) {
  float t;
  (void)e;
  x = fabsf(x);
  y = fabsf(y);
  z = fabsf(z);
  t = (x > y) ? x : y;
  return ((z > t) ? z : t);
}


x86 assembly (clang, -O0):
<dist_Chebychev>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movaps 0xedc(%rip),%xmm1
pand   %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x8(%rbp),%xmm0
movaps 0xec7(%rip),%xmm1
pand   %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0xc(%rbp),%xmm0
movaps 0xeb2(%rip),%xmm1
pand   %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1175 <dist_Chebychev+0x75>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
jmp    117f <dist_Chebychev+0x7f>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
ucomiss -0x14(%rbp),%xmm0
jbe    11a7 <dist_Chebychev+0xa7>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
jmp    11b1 <dist_Chebychev+0xb1>
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dist_Chebychev>:
movaps 0xef9(%rip),%xmm3
andps  %xmm3,%xmm0
andps  %xmm3,%xmm1
andps  %xmm2,%xmm3
maxss  %xmm1,%xmm0
maxss  %xmm0,%xmm3
movaps %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @dist_Chebychev(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* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%10 = load float, float* %8
%11 = load float, float* %5
%12 = call float @llvm.fabs.f32(float %11)
store float %12, float* %5
%13 = load float, float* %6
%14 = call float @llvm.fabs.f32(float %13)
store float %14, float* %6
%15 = load float, float* %7
%16 = call float @llvm.fabs.f32(float %15)
store float %16, float* %7
%17 = load float, float* %5
%18 = load float, float* %6
%19 = fcmp ogt float %17, %18
br i1 %19, label %20, label %22
20: ; preds = %4
%21 = load float, float* %5
br label %24
22: ; preds = %4
%23 = load float, float* %6
br label %24
24: ; preds = %22, %20
%25 = phi float [ %21, %20 ], [ %23, %22 ]
store float %25, float* %9
%26 = load float, float* %7
%27 = load float, float* %9
%28 = fcmp ogt float %26, %27
br i1 %28, label %29, label %31
29: ; preds = %24
%30 = load float, float* %7
br label %33
31: ; preds = %24
%32 = load float, float* %9
br label %33
33: ; preds = %31, %29
%34 = phi float [ %30, %29 ], [ %32, %31 ]
ret float %34
}

LLVM IR (-O2):
define float @dist_Chebychev(float %0, float %1, float %2, float %3) {
%5 = tail call float @llvm.fabs.f32(float %0)
%6 = tail call float @llvm.fabs.f32(float %1)
%7 = tail call float @llvm.fabs.f32(float %2)
%8 = fcmp ogt float %5, %6
%9 = select i1 %8, float %5, float %6
%10 = fcmp ogt float %7, %9
%11 = select i1 %10, float %7, float %9
ret float %11
}