#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*/ dxdxsi3D_lin(double *, double *, double *, double, double,
                                double, double *, int);
double jacobian3D_lin(double *px, double *py, double *pz, double xsi,
                      double eta, double zet, int sphere_mesh) {
  double jacM[9];
  dxdxsi3D_lin(px, py, pz, xsi, eta, zet, jacM, sphere_mesh);
  double jac = jacM[3 * 0 + 0] * (jacM[3 * 1 + 1] * jacM[3 * 2 + 2] -
                                  jacM[3 * 2 + 1] * jacM[3 * 1 + 2]) -
               jacM[3 * 0 + 1] * (jacM[3 * 1 + 0] * jacM[3 * 2 + 2] -
                                  jacM[3 * 2 + 0] * jacM[3 * 1 + 2]) +
               jacM[3 * 0 + 2] * (jacM[3 * 1 + 0] * jacM[3 * 2 + 1] -
                                  jacM[3 * 2 + 0] * jacM[3 * 1 + 1]);
  return jac;
}


x86 assembly (clang, -O0):
<jacobian3D_lin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x28(%rbp)
movsd  %xmm2,-0x30(%rbp)
mov    %ecx,-0x34(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
lea    -0x80(%rbp),%rcx
mov    -0x34(%rbp),%r8d
call   1030 <dxdxsi3D_lin@plt>
movsd  -0x80(%rbp),%xmm1
movsd  -0x60(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm3
movsd  -0x48(%rbp),%xmm0
mulsd  -0x58(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm3,%xmm2
addsd  %xmm0,%xmm2
movsd  -0x78(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm3
movsd  -0x40(%rbp),%xmm5
movsd  -0x50(%rbp),%xmm4
mulsd  -0x58(%rbp),%xmm4
movq   %xmm4,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm4
mulsd  %xmm5,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x70(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm4
movsd  -0x50(%rbp),%xmm3
mulsd  -0x60(%rbp),%xmm3
movq   %xmm3,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm3
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jacobian3D_lin>:
sub    $0x48,%rsp
mov    %ecx,%r8d
mov    %rsp,%rcx
call   1030 <dxdxsi3D_lin@plt>
movsd  0x18(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
movsd  0x40(%rsp),%xmm2
movsd  0x38(%rsp),%xmm3
movsd  0x28(%rsp),%xmm4
movapd %xmm4,%xmm5
mulsd  %xmm3,%xmm5
movapd %xmm1,%xmm6
mulsd  %xmm2,%xmm6
subsd  %xmm5,%xmm6
movsd  0x30(%rsp),%xmm5
mulsd  %xmm5,%xmm4
mulsd  %xmm0,%xmm2
subsd  %xmm4,%xmm2
mulsd  0x8(%rsp),%xmm2
mulsd  (%rsp),%xmm6
subsd  %xmm2,%xmm6
mulsd  %xmm5,%xmm1
mulsd  %xmm3,%xmm0
subsd  %xmm1,%xmm0
mulsd  0x10(%rsp),%xmm0
addsd  %xmm6,%xmm0
add    $0x48,%rsp
ret

LLVM IR (-O0):
define double @jacobian3D_lin(double* %0, double* %1, double* %2, double %3, double %4, double %5, i32 %6) {
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca i32
%15 = alloca [9 x 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 i32 %6, i32* %14
%17 = load double*, double** %8
%18 = load double*, double** %9
%19 = load double*, double** %10
%20 = load double, double* %11
%21 = load double, double* %12
%22 = load double, double* %13
%23 = getelementptr inbounds [9 x double], [9 x double]* %15, i64 0, i64 0
%24 = load i32, i32* %14
%25 = call i32 @dxdxsi3D_lin(double* %17, double* %18, double* %19, double %20, double %21, double %22, double* %23, i32 %24)
%26 = getelementptr inbounds [9 x double], [9 x double]* %15, i64 0, i64 0
%27 = load double, double* %26
%28 = getelementptr inbounds [9 x double], [9 x double]* %15, i64 0, i64 4
%29 = load double, double* %28
%30 = getelementptr inbounds [9 x double], [9 x double]* %15, i64 0, i64 8
%31 = load double, double* %30
%32 = getelementptr inbounds [9 x double], [9 x double]* %15, i64 0, i64 7
%33 = load double, double* %32
%34 = getelementptr inbounds [9 x double], [9 x double]* %15, i64 0, i64 5
%35 = load double, double* %34
%36 = fmul double %33, %35
%37 = fneg double %36
%38 = call double @llvm.fmuladd.f64(double %29, double %31, double %37)
%39 = getelementptr inbounds [9 x double], [9 x double]* %15, i64 0, i64 1
%40 = load double, double* %39
%41 = getelementptr inbounds [9 x double], [9 x double]* %15, i64 0, i64 3
%42 = load double, double* %41
%43 = getelementptr inbounds [9 x double], [9 x double]* %15, i64 0, i64 8
%44 = load double, double* %43
%45 = getelementptr inbounds [9 x double], [9 x double]* %15, i64 0, i64 6
%46 = load double, double* %45
%47 = getelementptr inbounds [9 x double], [9 x double]* %15, i64 0, i64 5
%48 = load double, double* %47
%49 = fmul double %46, %48
%50 = fneg double %49
%51 = call double @llvm.fmuladd.f64(double %42, double %44, double %50)
%52 = fmul double %40, %51
%53 = fneg double %52
%54 = call double @llvm.fmuladd.f64(double %27, double %38, double %53)
%55 = getelementptr inbounds [9 x double], [9 x double]* %15, i64 0, i64 2
%56 = load double, double* %55
%57 = getelementptr inbounds [9 x double], [9 x double]* %15, i64 0, i64 3
%58 = load double, double* %57
%59 = getelementptr inbounds [9 x double], [9 x double]* %15, i64 0, i64 7
%60 = load double, double* %59
%61 = getelementptr inbounds [9 x double], [9 x double]* %15, i64 0, i64 6
%62 = load double, double* %61
%63 = getelementptr inbounds [9 x double], [9 x double]* %15, i64 0, i64 4
%64 = load double, double* %63
%65 = fmul double %62, %64
%66 = fneg double %65
%67 = call double @llvm.fmuladd.f64(double %58, double %60, double %66)
%68 = call double @llvm.fmuladd.f64(double %56, double %67, double %54)
store double %68, double* %16
%69 = load double, double* %16
ret double %69
}

LLVM IR (-O2):
define double @jacobian3D_lin(double* %0, double* %1, double* %2, double %3, double %4, double %5, i32 %6) {
%8 = alloca [9 x double]
%9 = bitcast [9 x double]* %8 to i8*
%10 = getelementptr inbounds [9 x double], [9 x double]* %8, i64 0, i64 0
%11 = call i32 @dxdxsi3D_lin(double* %0, double* %1, double* %2, double %3, double %4, double %5, double* %10, i32 %6)
%12 = load double, double* %10
%13 = getelementptr inbounds [9 x double], [9 x double]* %8, i64 0, i64 4
%14 = load double, double* %13
%15 = getelementptr inbounds [9 x double], [9 x double]* %8, i64 0, i64 8
%16 = load double, double* %15
%17 = getelementptr inbounds [9 x double], [9 x double]* %8, i64 0, i64 7
%18 = load double, double* %17
%19 = getelementptr inbounds [9 x double], [9 x double]* %8, i64 0, i64 5
%20 = load double, double* %19
%21 = fneg double %18
%22 = fmul double %20, %21
%23 = call double @llvm.fmuladd.f64(double %14, double %16, double %22)
%24 = getelementptr inbounds [9 x double], [9 x double]* %8, i64 0, i64 1
%25 = load double, double* %24
%26 = getelementptr inbounds [9 x double], [9 x double]* %8, i64 0, i64 3
%27 = load double, double* %26
%28 = getelementptr inbounds [9 x double], [9 x double]* %8, i64 0, i64 6
%29 = load double, double* %28
%30 = fneg double %29
%31 = fmul double %20, %30
%32 = call double @llvm.fmuladd.f64(double %27, double %16, double %31)
%33 = fneg double %25
%34 = fmul double %32, %33
%35 = call double @llvm.fmuladd.f64(double %12, double %23, double %34)
%36 = getelementptr inbounds [9 x double], [9 x double]* %8, i64 0, i64 2
%37 = load double, double* %36
%38 = fmul double %14, %30
%39 = call double @llvm.fmuladd.f64(double %27, double %18, double %38)
%40 = call double @llvm.fmuladd.f64(double %37, double %39, double %35)
ret double %40
}