#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 */
int /*<<< orphan*/ bbox_from_extents(float **, float *, float, float, float);
float max(float const, float const);
float min(float const, float const);
int /*<<< orphan*/ vec3_mix(float *, float *, double, float *);
void bbox_from_points(float box[4][4], const float a[3], const float b[3]) {
  float v0[3], v1[3], mid[3];
  v0[0] = min(a[0], b[0]);
  v0[1] = min(a[1], b[1]);
  v0[2] = min(a[2], b[2]);
  v1[0] = max(a[0], b[0]);
  v1[1] = max(a[1], b[1]);
  v1[2] = max(a[2], b[2]);
  vec3_mix(v0, v1, 0.5, mid);
  bbox_from_extents(box, mid, (v1[0] - v0[0]) / 2, (v1[1] - v0[1]) / 2,
                    (v1[2] - v0[2]) / 2);
}


x86 assembly (clang, -O0):
<bbox_from_points>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm1
call   1030 <min@plt>
movss  %xmm0,-0x24(%rbp)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  0x4(%rax),%xmm1
call   1030 <min@plt>
movss  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  0x8(%rax),%xmm1
call   1030 <min@plt>
movss  %xmm0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm1
call   1040 <max@plt>
movss  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  0x4(%rax),%xmm1
call   1040 <max@plt>
movss  %xmm0,-0x2c(%rbp)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  0x8(%rax),%xmm1
call   1040 <max@plt>
movss  %xmm0,-0x28(%rbp)
lea    -0x24(%rbp),%rdi
lea    -0x30(%rbp),%rsi
lea    -0x3c(%rbp),%rdx
movsd  0xdfc(%rip),%xmm0
call   1060 <vec3_mix@plt>
mov    -0x8(%rbp),%rdi
lea    -0x3c(%rbp),%rsi
movss  -0x30(%rbp),%xmm0
subss  -0x24(%rbp),%xmm0
movss  0xdd5(%rip),%xmm1
divss  %xmm1,%xmm0
movss  -0x2c(%rbp),%xmm1
subss  -0x20(%rbp),%xmm1
movss  0xdbf(%rip),%xmm2
divss  %xmm2,%xmm1
movss  -0x28(%rbp),%xmm2
subss  -0x1c(%rbp),%xmm2
movss  0xda9(%rip),%xmm3
divss  %xmm3,%xmm2
call   1050 <bbox_from_extents@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bbox_from_points>:
push   %r15
push   %r14
push   %rbx
sub    $0x30,%rsp
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %rdi,%r14
movss  (%rsi),%xmm0
movss  (%rdx),%xmm1
call   1030 <min@plt>
movss  %xmm0,0x18(%rsp)
movss  0x4(%rbx),%xmm0
movss  0x4(%r15),%xmm1
call   1030 <min@plt>
movss  %xmm0,0x1c(%rsp)
movss  0x8(%rbx),%xmm0
movss  0x8(%r15),%xmm1
call   1030 <min@plt>
movss  %xmm0,0x20(%rsp)
movss  (%rbx),%xmm0
movss  (%r15),%xmm1
call   1040 <max@plt>
movss  %xmm0,0xc(%rsp)
movss  0x4(%rbx),%xmm0
movss  0x4(%r15),%xmm1
call   1040 <max@plt>
movss  %xmm0,0x10(%rsp)
movss  0x8(%rbx),%xmm0
movss  0x8(%r15),%xmm1
call   1040 <max@plt>
movss  %xmm0,0x14(%rsp)
lea    0x18(%rsp),%rdi
lea    0xc(%rsp),%rsi
movsd  0xe1d(%rip),%xmm0
lea    0x24(%rsp),%rbx
mov    %rbx,%rdx
call   1060 <vec3_mix@plt>
movss  0xc(%rsp),%xmm0
movss  0x10(%rsp),%xmm1
subss  0x18(%rsp),%xmm0
movss  0xdfe(%rip),%xmm3
mulss  %xmm3,%xmm0
subss  0x1c(%rsp),%xmm1
mulss  %xmm3,%xmm1
movss  0x14(%rsp),%xmm2
subss  0x20(%rsp),%xmm2
mulss  %xmm3,%xmm2
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <bbox_from_extents@plt>
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @bbox_from_points([4 x float]* %0, float* %1, float* %2) {
%4 = alloca [4 x float]*
%5 = alloca float*
%6 = alloca float*
%7 = alloca [3 x float]
%8 = alloca [3 x float]
%9 = alloca [3 x float]
store [4 x float]* %0, [4 x float]** %4
store float* %1, float** %5
store float* %2, float** %6
%10 = load float*, float** %5
%11 = getelementptr inbounds float, float* %10, i64 0
%12 = load float, float* %11
%13 = load float*, float** %6
%14 = getelementptr inbounds float, float* %13, i64 0
%15 = load float, float* %14
%16 = call float @min(float %12, float %15)
%17 = getelementptr inbounds [3 x float], [3 x float]* %7, i64 0, i64 0
store float %16, float* %17
%18 = load float*, float** %5
%19 = getelementptr inbounds float, float* %18, i64 1
%20 = load float, float* %19
%21 = load float*, float** %6
%22 = getelementptr inbounds float, float* %21, i64 1
%23 = load float, float* %22
%24 = call float @min(float %20, float %23)
%25 = getelementptr inbounds [3 x float], [3 x float]* %7, i64 0, i64 1
store float %24, float* %25
%26 = load float*, float** %5
%27 = getelementptr inbounds float, float* %26, i64 2
%28 = load float, float* %27
%29 = load float*, float** %6
%30 = getelementptr inbounds float, float* %29, i64 2
%31 = load float, float* %30
%32 = call float @min(float %28, float %31)
%33 = getelementptr inbounds [3 x float], [3 x float]* %7, i64 0, i64 2
store float %32, float* %33
%34 = load float*, float** %5
%35 = getelementptr inbounds float, float* %34, i64 0
%36 = load float, float* %35
%37 = load float*, float** %6
%38 = getelementptr inbounds float, float* %37, i64 0
%39 = load float, float* %38
%40 = call float @max(float %36, float %39)
%41 = getelementptr inbounds [3 x float], [3 x float]* %8, i64 0, i64 0
store float %40, float* %41
%42 = load float*, float** %5
%43 = getelementptr inbounds float, float* %42, i64 1
%44 = load float, float* %43
%45 = load float*, float** %6
%46 = getelementptr inbounds float, float* %45, i64 1
%47 = load float, float* %46
%48 = call float @max(float %44, float %47)
%49 = getelementptr inbounds [3 x float], [3 x float]* %8, i64 0, i64 1
store float %48, float* %49
%50 = load float*, float** %5
%51 = getelementptr inbounds float, float* %50, i64 2
%52 = load float, float* %51
%53 = load float*, float** %6
%54 = getelementptr inbounds float, float* %53, i64 2
%55 = load float, float* %54
%56 = call float @max(float %52, float %55)
%57 = getelementptr inbounds [3 x float], [3 x float]* %8, i64 0, i64 2
store float %56, float* %57
%58 = getelementptr inbounds [3 x float], [3 x float]* %7, i64 0, i64 0
%59 = getelementptr inbounds [3 x float], [3 x float]* %8, i64 0, i64 0
%60 = getelementptr inbounds [3 x float], [3 x float]* %9, i64 0, i64 0
%61 = call i32 @vec3_mix(float* %58, float* %59, double 5.000000e-01, float* %60)
%62 = load [4 x float]*, [4 x float]** %4
%63 = bitcast [4 x float]* %62 to float**
%64 = getelementptr inbounds [3 x float], [3 x float]* %9, i64 0, i64 0
%65 = getelementptr inbounds [3 x float], [3 x float]* %8, i64 0, i64 0
%66 = load float, float* %65
%67 = getelementptr inbounds [3 x float], [3 x float]* %7, i64 0, i64 0
%68 = load float, float* %67
%69 = fsub float %66, %68
%70 = fdiv float %69, 2.000000e+00
%71 = getelementptr inbounds [3 x float], [3 x float]* %8, i64 0, i64 1
%72 = load float, float* %71
%73 = getelementptr inbounds [3 x float], [3 x float]* %7, i64 0, i64 1
%74 = load float, float* %73
%75 = fsub float %72, %74
%76 = fdiv float %75, 2.000000e+00
%77 = getelementptr inbounds [3 x float], [3 x float]* %8, i64 0, i64 2
%78 = load float, float* %77
%79 = getelementptr inbounds [3 x float], [3 x float]* %7, i64 0, i64 2
%80 = load float, float* %79
%81 = fsub float %78, %80
%82 = fdiv float %81, 2.000000e+00
%83 = call i32 @bbox_from_extents(float** %63, float* %64, float %70, float %76, float %82)
ret void
}

LLVM IR (-O2):
define void @bbox_from_points([4 x float]* %0, float* nocapture %1, float* nocapture %2) {
%4 = alloca [3 x float]
%5 = alloca [3 x float]
%6 = alloca [3 x float]
%7 = bitcast [3 x float]* %4 to i8*
%8 = bitcast [3 x float]* %5 to i8*
%9 = bitcast [3 x float]* %6 to i8*
%10 = load float, float* %1
%11 = load float, float* %2
%12 = tail call float @min(float %10, float %11)
%13 = getelementptr inbounds [3 x float], [3 x float]* %4, i64 0, i64 0
store float %12, float* %13
%14 = getelementptr inbounds float, float* %1, i64 1
%15 = load float, float* %14
%16 = getelementptr inbounds float, float* %2, i64 1
%17 = load float, float* %16
%18 = tail call float @min(float %15, float %17)
%19 = getelementptr inbounds [3 x float], [3 x float]* %4, i64 0, i64 1
store float %18, float* %19
%20 = getelementptr inbounds float, float* %1, i64 2
%21 = load float, float* %20
%22 = getelementptr inbounds float, float* %2, i64 2
%23 = load float, float* %22
%24 = tail call float @min(float %21, float %23)
%25 = getelementptr inbounds [3 x float], [3 x float]* %4, i64 0, i64 2
store float %24, float* %25
%26 = load float, float* %1
%27 = load float, float* %2
%28 = tail call float @max(float %26, float %27)
%29 = getelementptr inbounds [3 x float], [3 x float]* %5, i64 0, i64 0
store float %28, float* %29
%30 = load float, float* %14
%31 = load float, float* %16
%32 = tail call float @max(float %30, float %31)
%33 = getelementptr inbounds [3 x float], [3 x float]* %5, i64 0, i64 1
store float %32, float* %33
%34 = load float, float* %20
%35 = load float, float* %22
%36 = tail call float @max(float %34, float %35)
%37 = getelementptr inbounds [3 x float], [3 x float]* %5, i64 0, i64 2
store float %36, float* %37
%38 = getelementptr inbounds [3 x float], [3 x float]* %6, i64 0, i64 0
%39 = call i32 @vec3_mix(float* %13, float* %29, double 5.000000e-01, float* %38)
%40 = bitcast [4 x float]* %0 to float**
%41 = load float, float* %29
%42 = load float, float* %13
%43 = fsub float %41, %42
%44 = fmul float %43, 5.000000e-01
%45 = load float, float* %33
%46 = load float, float* %19
%47 = fsub float %45, %46
%48 = fmul float %47, 5.000000e-01
%49 = load float, float* %37
%50 = load float, float* %25
%51 = fsub float %49, %50
%52 = fmul float %51, 5.000000e-01
%53 = call i32 @bbox_from_extents(float** %40, float* %38, float %44, float %48, float %52)
ret void
}