void metric_igam(const double x[3], double igam[9]) {
  double r = x[0];
  igam[0] = 1.0;
  igam[1] = 0.0;
  igam[2] = 0.0;
  igam[3] = 0.0;
  igam[4] = 1.0 / (r * r);
  igam[5] = 0.0;
  igam[6] = 0.0;
  igam[7] = 0.0;
  igam[8] = 1.0;
}


x86 assembly (clang, -O0):
<metric_igam>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  0xedb(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x10(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x18(%rax)
movsd  -0x18(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
movsd  0xea1(%rip),%xmm0
divsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x20(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x28(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x30(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x38(%rax)
mov    -0x10(%rbp),%rax
movsd  0xe64(%rip),%xmm0
movsd  %xmm0,0x40(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<metric_igam>:
movsd  (%rdi),%xmm0
movabs $0x3ff0000000000000,%rax
mov    %rax,(%rsi)
mulsd  %xmm0,%xmm0
movsd  0xee3(%rip),%xmm1
divsd  %xmm0,%xmm1
xorpd  %xmm0,%xmm0
movupd %xmm0,0x8(%rsi)
movq   $0x0,0x18(%rsi)
movsd  %xmm1,0x20(%rsi)
movupd %xmm0,0x28(%rsi)
movq   $0x0,0x38(%rsi)
mov    %rax,0x40(%rsi)
ret

LLVM IR (-O0):
define void @metric_igam(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%6 = load double*, double** %3
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
store double %8, double* %5
%9 = load double*, double** %4
%10 = getelementptr inbounds double, double* %9, i64 0
store double 1.000000e+00, double* %10
%11 = load double*, double** %4
%12 = getelementptr inbounds double, double* %11, i64 1
store double 0.000000e+00, double* %12
%13 = load double*, double** %4
%14 = getelementptr inbounds double, double* %13, i64 2
store double 0.000000e+00, double* %14
%15 = load double*, double** %4
%16 = getelementptr inbounds double, double* %15, i64 3
store double 0.000000e+00, double* %16
%17 = load double, double* %5
%18 = load double, double* %5
%19 = fmul double %17, %18
%20 = fdiv double 1.000000e+00, %19
%21 = load double*, double** %4
%22 = getelementptr inbounds double, double* %21, i64 4
store double %20, double* %22
%23 = load double*, double** %4
%24 = getelementptr inbounds double, double* %23, i64 5
store double 0.000000e+00, double* %24
%25 = load double*, double** %4
%26 = getelementptr inbounds double, double* %25, i64 6
store double 0.000000e+00, double* %26
%27 = load double*, double** %4
%28 = getelementptr inbounds double, double* %27, i64 7
store double 0.000000e+00, double* %28
%29 = load double*, double** %4
%30 = getelementptr inbounds double, double* %29, i64 8
store double 1.000000e+00, double* %30
ret void
}

LLVM IR (-O2):
define void @metric_igam(double* nocapture %0, double* nocapture writeonly %1) {
%3 = load double, double* %0
store double 1.000000e+00, double* %1
%4 = getelementptr inbounds double, double* %1, i64 1
%5 = fmul double %3, %3
%6 = fdiv double 1.000000e+00, %5
%7 = getelementptr inbounds double, double* %1, i64 4
%8 = bitcast double* %4 to i8*
store double %6, double* %7
%9 = getelementptr inbounds double, double* %1, i64 5
%10 = getelementptr inbounds double, double* %1, i64 8
%11 = bitcast double* %9 to i8*
store double 1.000000e+00, double* %10
ret void
}