void hippo_cube_bound(float *v, const float *p, float d) {
  v[0] = 1.0f;
  v[1] = 0.0f;
  v[2] = 0.0f;
  v[3] = -p[0] + d;
  v[4] = -1.0f;
  v[5] = 0.0f;
  v[6] = 0.0f;
  v[7] = p[0] + d;
  v[8] = 0.0f;
  v[9] = 1.0f;
  v[10] = 0.0f;
  v[11] = -p[1] + d;
  v[12] = 0.0f;
  v[13] = -1.0f;
  v[14] = 0.0f;
  v[15] = p[1] + d;
  v[16] = 0.0f;
  v[17] = 0.0f;
  v[18] = 1.0f;
  v[19] = -p[2] + d;
  v[20] = 0.0f;
  v[21] = 0.0f;
  v[22] = -1.0f;
  v[23] = p[2] + d;
}


x86 assembly (clang, -O0):
<hippo_cube_bound>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movss  0xee7(%rip),%xmm0
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
addss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0xc(%rax)
mov    -0x8(%rbp),%rax
movss  0xe98(%rip),%xmm0
movss  %xmm0,0x10(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x14(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x18(%rax)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
addss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x1c(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x20(%rax)
mov    -0x8(%rbp),%rax
movss  0xe51(%rip),%xmm0
movss  %xmm0,0x24(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x28(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
addss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x2c(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x30(%rax)
mov    -0x8(%rbp),%rax
movss  0xe00(%rip),%xmm0
movss  %xmm0,0x34(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x38(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
addss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x3c(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x40(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x44(%rax)
mov    -0x8(%rbp),%rax
movss  0xdb8(%rip),%xmm0
movss  %xmm0,0x48(%rax)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
addss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4c(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x50(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x54(%rax)
mov    -0x8(%rbp),%rax
movss  0xd67(%rip),%xmm0
movss  %xmm0,0x58(%rax)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
addss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x5c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<hippo_cube_bound>:
movq   $0x3f800000,(%rdi)
movl   $0x0,0x8(%rdi)
movaps %xmm0,%xmm1
subss  (%rsi),%xmm1
movss  %xmm1,0xc(%rdi)
mov    $0xbf800000,%eax
mov    %rax,0x10(%rdi)
movl   $0x0,0x18(%rdi)
movss  (%rsi),%xmm1
addss  %xmm0,%xmm1
movss  %xmm1,0x1c(%rdi)
movabs $0x3f80000000000000,%rax
mov    %rax,0x20(%rdi)
movl   $0x0,0x28(%rdi)
movaps %xmm0,%xmm1
subss  0x4(%rsi),%xmm1
movss  %xmm1,0x2c(%rdi)
movabs $0xbf80000000000000,%rax
mov    %rax,0x30(%rdi)
movl   $0x0,0x38(%rdi)
movss  0x4(%rsi),%xmm1
addss  %xmm0,%xmm1
movss  %xmm1,0x3c(%rdi)
movq   $0x0,0x40(%rdi)
movl   $0x3f800000,0x48(%rdi)
movaps %xmm0,%xmm1
subss  0x8(%rsi),%xmm1
movss  %xmm1,0x4c(%rdi)
movq   $0x0,0x50(%rdi)
movl   $0xbf800000,0x58(%rdi)
addss  0x8(%rsi),%xmm0
movss  %xmm0,0x5c(%rdi)
ret

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

LLVM IR (-O2):
define void @hippo_cube_bound(float* writeonly %0, float* nocapture %1, float %2) {
store float 1.000000e+00, float* %0
%4 = getelementptr inbounds float, float* %0, i64 1
store float 0.000000e+00, float* %4
%5 = getelementptr inbounds float, float* %0, i64 2
store float 0.000000e+00, float* %5
%6 = load float, float* %1
%7 = fsub float %2, %6
%8 = getelementptr inbounds float, float* %0, i64 3
store float %7, float* %8
%9 = getelementptr inbounds float, float* %0, i64 4
store float -1.000000e+00, float* %9
%10 = getelementptr inbounds float, float* %0, i64 5
store float 0.000000e+00, float* %10
%11 = getelementptr inbounds float, float* %0, i64 6
store float 0.000000e+00, float* %11
%12 = load float, float* %1
%13 = fadd float %12, %2
%14 = getelementptr inbounds float, float* %0, i64 7
store float %13, float* %14
%15 = getelementptr inbounds float, float* %0, i64 8
store float 0.000000e+00, float* %15
%16 = getelementptr inbounds float, float* %0, i64 9
store float 1.000000e+00, float* %16
%17 = getelementptr inbounds float, float* %0, i64 10
store float 0.000000e+00, float* %17
%18 = getelementptr inbounds float, float* %1, i64 1
%19 = load float, float* %18
%20 = fsub float %2, %19
%21 = getelementptr inbounds float, float* %0, i64 11
store float %20, float* %21
%22 = getelementptr inbounds float, float* %0, i64 12
store float 0.000000e+00, float* %22
%23 = getelementptr inbounds float, float* %0, i64 13
store float -1.000000e+00, float* %23
%24 = getelementptr inbounds float, float* %0, i64 14
store float 0.000000e+00, float* %24
%25 = load float, float* %18
%26 = fadd float %25, %2
%27 = getelementptr inbounds float, float* %0, i64 15
store float %26, float* %27
%28 = getelementptr inbounds float, float* %0, i64 16
store float 0.000000e+00, float* %28
%29 = getelementptr inbounds float, float* %0, i64 17
store float 0.000000e+00, float* %29
%30 = getelementptr inbounds float, float* %0, i64 18
store float 1.000000e+00, float* %30
%31 = getelementptr inbounds float, float* %1, i64 2
%32 = load float, float* %31
%33 = fsub float %2, %32
%34 = getelementptr inbounds float, float* %0, i64 19
store float %33, float* %34
%35 = getelementptr inbounds float, float* %0, i64 20
store float 0.000000e+00, float* %35
%36 = getelementptr inbounds float, float* %0, i64 21
store float 0.000000e+00, float* %36
%37 = getelementptr inbounds float, float* %0, i64 22
store float -1.000000e+00, float* %37
%38 = load float, float* %31
%39 = fadd float %38, %2
%40 = getelementptr inbounds float, float* %0, i64 23
store float %39, float* %40
ret void
}