void brickToTet(double xi, double eta, double zeta, double *r, double *s,
                double *t, double *J) {
  double r1, rs1;
  *r = 0.5e0 * (1.0e0 + xi);
  r1 = 1.0e0 - (*r);
  *s = 0.5e0 * (1.0e0 + eta) * r1;
  rs1 = 1.0e0 - (*r) - (*s);
  *t = 0.5e0 * (1.0e0 + zeta) * rs1;
  *J = 0.125e0 * r1 * rs1;
}


x86 assembly (clang, -O0):
<brickToTet>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x28(%rbp)
mov    %rdx,-0x30(%rbp)
mov    %rcx,-0x38(%rbp)
movsd  0xee5(%rip),%xmm1
addsd  -0x8(%rbp),%xmm1
movsd  0xed0(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
movsd  0xec0(%rip),%xmm0
subsd  (%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xeaf(%rip),%xmm1
addsd  -0x10(%rbp),%xmm1
movsd  0xe9a(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  -0x40(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
movsd  0xe85(%rip),%xmm0
subsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xe6c(%rip),%xmm1
addsd  -0x18(%rbp),%xmm1
movsd  0xe57(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  -0x48(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0xe36(%rip),%xmm0
mulsd  -0x40(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
mov    -0x38(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<brickToTet>:
movsd  0xef8(%rip),%xmm3
addsd  %xmm3,%xmm0
movsd  0xef4(%rip),%xmm4
mulsd  %xmm4,%xmm0
movsd  %xmm0,(%rdi)
movapd %xmm3,%xmm5
subsd  %xmm0,%xmm5
addsd  %xmm3,%xmm1
mulsd  %xmm4,%xmm1
mulsd  %xmm5,%xmm1
movsd  %xmm1,(%rsi)
addsd  %xmm3,%xmm2
subsd  (%rdi),%xmm3
subsd  %xmm1,%xmm3
mulsd  %xmm4,%xmm2
mulsd  %xmm3,%xmm2
movsd  %xmm2,(%rdx)
mulsd  0xebc(%rip),%xmm5
mulsd  %xmm3,%xmm5
movsd  %xmm5,(%rcx)
ret

LLVM IR (-O0):
define void @brickToTet(double %0, double %1, double %2, double* %3, double* %4, double* %5, double* %6) {
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double*
%12 = alloca double*
%13 = alloca double*
%14 = alloca double*
%15 = alloca double
%16 = alloca double
store double %0, double* %8
store double %1, double* %9
store double %2, double* %10
store double* %3, double** %11
store double* %4, double** %12
store double* %5, double** %13
store double* %6, double** %14
%17 = load double, double* %8
%18 = fadd double 1.000000e+00, %17
%19 = fmul double 5.000000e-01, %18
%20 = load double*, double** %11
store double %19, double* %20
%21 = load double*, double** %11
%22 = load double, double* %21
%23 = fsub double 1.000000e+00, %22
store double %23, double* %15
%24 = load double, double* %9
%25 = fadd double 1.000000e+00, %24
%26 = fmul double 5.000000e-01, %25
%27 = load double, double* %15
%28 = fmul double %26, %27
%29 = load double*, double** %12
store double %28, double* %29
%30 = load double*, double** %11
%31 = load double, double* %30
%32 = fsub double 1.000000e+00, %31
%33 = load double*, double** %12
%34 = load double, double* %33
%35 = fsub double %32, %34
store double %35, double* %16
%36 = load double, double* %10
%37 = fadd double 1.000000e+00, %36
%38 = fmul double 5.000000e-01, %37
%39 = load double, double* %16
%40 = fmul double %38, %39
%41 = load double*, double** %13
store double %40, double* %41
%42 = load double, double* %15
%43 = fmul double 1.250000e-01, %42
%44 = load double, double* %16
%45 = fmul double %43, %44
%46 = load double*, double** %14
store double %45, double* %46
ret void
}

LLVM IR (-O2):
define void @brickToTet(double %0, double %1, double %2, double* nocapture %3, double* nocapture writeonly %4, double* nocapture writeonly %5, double* nocapture writeonly %6) {
%8 = fadd double %0, 1.000000e+00
%9 = fmul double %8, 5.000000e-01
store double %9, double* %3
%10 = fsub double 1.000000e+00, %9
%11 = fadd double %1, 1.000000e+00
%12 = fmul double %11, 5.000000e-01
%13 = fmul double %12, %10
store double %13, double* %4
%14 = load double, double* %3
%15 = fsub double 1.000000e+00, %14
%16 = fsub double %15, %13
%17 = fadd double %2, 1.000000e+00
%18 = fmul double %17, 5.000000e-01
%19 = fmul double %18, %16
store double %19, double* %5
%20 = fmul double %10, 1.250000e-01
%21 = fmul double %20, %16
store double %21, double* %6
ret void
}