#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*/ bcon_calc_g(double *, double *, double *, double *,
                               double *);
int /*<<< orphan*/ lower_g(double *, double **, double *);
int /*<<< orphan*/ ncov_calc(double **, double *);
double pressure_rho0_u(double, double);
double sqrt(double);
int /*<<< orphan*/ ucon_calc_g(double *, double **, double **, double *);
void primtoU_g(double prim[(9)], double gcov[(4)][(4)], double gcon[(4)][(4)],
               double gdet, double U[(9)]) {
  int i, j;
  double rho0;
  static double ucon[(4)], ucov[(4)], bcon[(4)], bcov[(4)], ncov[(4)];
  double gamma, n_dot_b, bsq, u, p, w, alpha;
  alpha = 1.0 / sqrt(-gcon[0][0]);
  ucon_calc_g(prim, gcov, gcon, ucon);
  lower_g(ucon, gcov, ucov);
  ncov_calc(gcon, ncov);
  gamma = -ncov[0] * ucon[0];
  bcon_calc_g(prim, ucon, ucov, ncov, bcon);
  lower_g(bcon, gcov, bcov);
  n_dot_b = 0.;
  for (i = 0; i < 4; i++)
    n_dot_b += ncov[i] * bcon[i];
  bsq = 0.;
  for (i = 0; i < 4; i++)
    bsq += bcov[i] * bcon[i];
  rho0 = prim[(0)];
  u = prim[(1)];
  p = pressure_rho0_u(rho0, u);
  w = rho0 + u + p;
  U[(0)] = ucon[0] * rho0;
  for (i = 0; i < 4; i++) {
    U[1 + i] = gamma * (w + bsq) * ucov[i] - (p + bsq / 2.) * ncov[i] +
               n_dot_b * bcov[i];
    U[1 + i] /= alpha;
  }
  U[1] = U[1] + U[(0)];
  U[5] = prim[5];
  U[6] = prim[6];
  U[7] = prim[7];
  for (i = 0; i < (9); i++) {
    U[i] *= gdet;
  }
  return;
}


x86 assembly (clang, -O0):
<primtoU_g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1070 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xe54(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0x2e98(%rip),%rcx
call   1080 <ucon_calc_g@plt>
mov    -0x10(%rbp),%rsi
lea    0x2e88(%rip),%rdi
lea    0x2ea1(%rip),%rdx
call   1050 <lower_g@plt>
mov    -0x18(%rbp),%rdi
lea    0x2ef1(%rip),%rsi
call   1030 <ncov_calc@plt>
movsd  0x2ee4(%rip),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  0x2e45(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x8(%rbp),%rdi
lea    0x2e35(%rip),%rsi
lea    0x2e4e(%rip),%rdx
lea    0x2ea7(%rip),%rcx
lea    0x2e60(%rip),%r8
call   1060 <bcon_calc_g@plt>
mov    -0x10(%rbp),%rsi
lea    0x2e50(%rip),%rdi
lea    0x2e69(%rip),%rdx
call   1050 <lower_g@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
movl   $0x0,-0x2c(%rbp)
cmpl   $0x4,-0x2c(%rbp)
jge    12b5 <primtoU_g+0x155>
movslq -0x2c(%rbp),%rcx
lea    0x2e60(%rip),%rax
movsd  (%rax,%rcx,8),%xmm0
movslq -0x2c(%rbp),%rcx
lea    0x2e10(%rip),%rax
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x48(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    126b <primtoU_g+0x10b>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
movl   $0x0,-0x2c(%rbp)
cmpl   $0x4,-0x2c(%rbp)
jge    130e <primtoU_g+0x1ae>
movslq -0x2c(%rbp),%rcx
lea    0x2de7(%rip),%rax
movsd  (%rax,%rcx,8),%xmm0
movslq -0x2c(%rbp),%rcx
lea    0x2db7(%rip),%rax
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x50(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    12c4 <primtoU_g+0x164>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
call   1040 <pressure_rho0_u@plt>
movsd  %xmm0,-0x60(%rbp)
movsd  -0x38(%rbp),%xmm0
addsd  -0x58(%rbp),%xmm0
addsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0x2d07(%rip),%xmm0
mulsd  -0x38(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x0,-0x2c(%rbp)
cmpl   $0x4,-0x2c(%rbp)
jge    1440 <primtoU_g+0x2e0>
movsd  -0x40(%rbp),%xmm1
movsd  -0x68(%rbp),%xmm0
addsd  -0x50(%rbp),%xmm0
mulsd  %xmm0,%xmm1
movslq -0x2c(%rbp),%rcx
lea    0x2ceb(%rip),%rax
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x60(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm3
movsd  0xc5c(%rip),%xmm4
divsd  %xmm4,%xmm3
addsd  %xmm3,%xmm0
movslq -0x2c(%rbp),%rcx
lea    0x2d21(%rip),%rax
mulsd  (%rax,%rcx,8),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
movslq -0x2c(%rbp),%rcx
lea    0x2ccd(%rip),%rax
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
mov    -0x2c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x70(%rbp),%xmm1
mov    -0x28(%rbp),%rax
mov    -0x2c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    136d <primtoU_g+0x20d>
mov    -0x28(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x28(%rbp),%rax
addsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movsd  0x28(%rax),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,0x28(%rax)
mov    -0x8(%rbp),%rax
movsd  0x30(%rax),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,0x30(%rax)
mov    -0x8(%rbp),%rax
movsd  0x38(%rax),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,0x38(%rax)
movl   $0x0,-0x2c(%rbp)
cmpl   $0x9,-0x2c(%rbp)
jge    14c6 <primtoU_g+0x366>
movsd  -0x20(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1497 <primtoU_g+0x337>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<primtoU_g>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %rcx,%r12
movaps %xmm0,0x50(%rsp)
mov    %rdx,%rbx
mov    %rsi,%r15
mov    %rdi,%r14
movsd  (%rdx),%xmm1
movapd 0xe75(%rip),%xmm0
xorpd  %xmm1,%xmm0
movsd  0xe79(%rip),%xmm2
ucomisd %xmm1,%xmm2
jb     11a3 <primtoU_g+0x43>
sqrtsd %xmm0,%xmm0
jmp    11a8 <primtoU_g+0x48>
call   1070 <sqrt@plt>
movsd  %xmm0,0x8(%rsp)
lea    0x2eab(%rip),%r13
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
mov    %r13,%rcx
call   1080 <ucon_calc_g@plt>
lea    0x2eb3(%rip),%rdx
mov    %r13,%rdi
mov    %r15,%rsi
call   1050 <lower_g@plt>
lea    0x2f01(%rip),%rbp
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1030 <ncov_calc@plt>
movsd  0x2eee(%rip),%xmm0
xorpd  0xe06(%rip),%xmm0
mulsd  0x2e5e(%rip),%xmm0
movapd %xmm0,0x40(%rsp)
lea    0x2e91(%rip),%rbx
mov    %r14,%rdi
mov    %r13,%rsi
lea    0x2e64(%rip),%rdx
mov    %rbp,%rcx
mov    %rbx,%r8
call   1060 <bcon_calc_g@plt>
lea    0x2e92(%rip),%rdx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <lower_g@plt>
movsd  0x2e5f(%rip),%xmm0
movsd  0x2e97(%rip),%xmm1
mulsd  %xmm0,%xmm1
xorpd  %xmm2,%xmm2
addsd  %xmm2,%xmm1
movsd  0x2e4b(%rip),%xmm3
movsd  0x2e83(%rip),%xmm4
mulsd  %xmm3,%xmm4
addsd  %xmm1,%xmm4
movsd  0x2e3b(%rip),%xmm1
movsd  0x2e73(%rip),%xmm5
mulsd  %xmm1,%xmm5
addsd  %xmm4,%xmm5
movsd  0x2e2b(%rip),%xmm6
movsd  0x2e63(%rip),%xmm4
mulsd  %xmm6,%xmm4
addsd  %xmm5,%xmm4
movapd %xmm4,0x30(%rsp)
mulsd  0x2e15(%rip),%xmm0
mulsd  0x2e15(%rip),%xmm3
addsd  %xmm2,%xmm0
addsd  %xmm0,%xmm3
mulsd  0x2e0d(%rip),%xmm1
addsd  %xmm3,%xmm1
mulsd  0x2e09(%rip),%xmm6
addsd  %xmm1,%xmm6
movsd  %xmm6,0x18(%rsp)
movsd  0xd37(%rip),%xmm0
divsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  (%r14),%xmm0
movapd %xmm0,0x20(%rsp)
movsd  0x8(%r14),%xmm1
movsd  %xmm1,0x10(%rsp)
call   1040 <pressure_rho0_u@plt>
movapd 0x20(%rsp),%xmm7
movsd  0x10(%rsp),%xmm6
addsd  %xmm7,%xmm6
addsd  %xmm0,%xmm6
mulsd  0x2d3b(%rip),%xmm7
movsd  %xmm7,(%r12)
movsd  0x18(%rsp),%xmm4
addsd  %xmm4,%xmm6
mulsd  0x40(%rsp),%xmm6
mulsd  0xcdd(%rip),%xmm4
addsd  %xmm0,%xmm4
movsd  0x2d91(%rip),%xmm0
mulsd  %xmm4,%xmm0
movsd  0x2d25(%rip),%xmm1
mulsd  %xmm6,%xmm1
subsd  %xmm0,%xmm1
movsd  0x2d55(%rip),%xmm0
movapd 0x30(%rsp),%xmm5
mulsd  %xmm5,%xmm0
addsd  %xmm1,%xmm0
movsd  0x8(%rsp),%xmm3
divsd  %xmm3,%xmm0
movsd  %xmm0,0x8(%r12)
movsd  0x2d56(%rip),%xmm1
mulsd  %xmm4,%xmm1
movsd  0x2cea(%rip),%xmm2
mulsd  %xmm6,%xmm2
subsd  %xmm1,%xmm2
movsd  0x2d1a(%rip),%xmm1
mulsd  %xmm5,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm3,%xmm1
movapd %xmm3,%xmm8
movsd  %xmm1,0x10(%r12)
movsd  0x2d22(%rip),%xmm2
mulsd  %xmm4,%xmm2
movsd  0x2cb6(%rip),%xmm3
mulsd  %xmm6,%xmm3
subsd  %xmm2,%xmm3
movsd  0x2ce6(%rip),%xmm2
mulsd  %xmm5,%xmm2
addsd  %xmm3,%xmm2
divsd  %xmm8,%xmm2
movsd  %xmm2,0x18(%r12)
mulsd  0x2cf2(%rip),%xmm4
mulsd  0x2c8a(%rip),%xmm6
subsd  %xmm4,%xmm6
movapd %xmm5,%xmm3
mulsd  0x2cba(%rip),%xmm3
addsd  %xmm6,%xmm3
divsd  %xmm8,%xmm3
movsd  %xmm3,0x20(%r12)
movapd %xmm3,%xmm6
addsd  %xmm7,%xmm0
movsd  %xmm0,0x8(%r12)
movsd  0x28(%r14),%xmm3
movsd  %xmm3,0x28(%r12)
movsd  0x30(%r14),%xmm4
movsd  %xmm4,0x30(%r12)
unpcklpd %xmm0,%xmm7
movapd 0x50(%rsp),%xmm5
movapd %xmm5,%xmm0
unpcklpd %xmm5,%xmm0
mulpd  %xmm0,%xmm7
movhpd 0x38(%r14),%xmm4
movupd %xmm7,(%r12)
unpcklpd %xmm2,%xmm1
mulpd  %xmm0,%xmm1
movupd %xmm1,0x10(%r12)
unpcklpd %xmm3,%xmm6
mulpd  %xmm0,%xmm6
movupd %xmm6,0x20(%r12)
mulpd  %xmm0,%xmm4
movupd %xmm4,0x30(%r12)
mulsd  0x40(%r12),%xmm5
movsd  %xmm5,0x40(%r12)
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@primtoU_g.ucon = internal global [4 x double] zeroinitializer
@primtoU_g.ucov = internal global [4 x double] zeroinitializer
@primtoU_g.bcon = internal global [4 x double] zeroinitializer
@primtoU_g.bcov = internal global [4 x double] zeroinitializer
@primtoU_g.ncov = internal global [4 x double] zeroinitializer
define void @primtoU_g(double* %0, [4 x double]* %1, [4 x double]* %2, double %3, double* %4) {
%6 = alloca double*
%7 = alloca [4 x double]*
%8 = alloca [4 x double]*
%9 = alloca double
%10 = alloca double*
%11 = alloca i32
%12 = alloca i32
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
store double* %0, double** %6
store [4 x double]* %1, [4 x double]** %7
store [4 x double]* %2, [4 x double]** %8
store double %3, double* %9
store double* %4, double** %10
%21 = load [4 x double]*, [4 x double]** %8
%22 = getelementptr inbounds [4 x double], [4 x double]* %21, i64 0
%23 = getelementptr inbounds [4 x double], [4 x double]* %22, i64 0, i64 0
%24 = load double, double* %23
%25 = fneg double %24
%26 = call double @sqrt(double %25)
%27 = fdiv double 1.000000e+00, %26
store double %27, double* %20
%28 = load double*, double** %6
%29 = load [4 x double]*, [4 x double]** %7
%30 = bitcast [4 x double]* %29 to double**
%31 = load [4 x double]*, [4 x double]** %8
%32 = bitcast [4 x double]* %31 to double**
%33 = call i32 @ucon_calc_g(double* %28, double** %30, double** %32, double* getelementptr inbounds ([4 x double], [4 x double]* @primtoU_g.ucon, i64 0, i64 0))
%34 = load [4 x double]*, [4 x double]** %7
%35 = bitcast [4 x double]* %34 to double**
%36 = call i32 @lower_g(double* getelementptr inbounds ([4 x double], [4 x double]* @primtoU_g.ucon, i64 0, i64 0), double** %35, double* getelementptr inbounds ([4 x double], [4 x double]* @primtoU_g.ucov, i64 0, i64 0))
%37 = load [4 x double]*, [4 x double]** %8
%38 = bitcast [4 x double]* %37 to double**
%39 = call i32 @ncov_calc(double** %38, double* getelementptr inbounds ([4 x double], [4 x double]* @primtoU_g.ncov, i64 0, i64 0))
%40 = load double, double* getelementptr inbounds ([4 x double], [4 x double]* @primtoU_g.ncov, i64 0, i64 0)
%41 = fneg double %40
%42 = load double, double* getelementptr inbounds ([4 x double], [4 x double]* @primtoU_g.ucon, i64 0, i64 0)
%43 = fmul double %41, %42
store double %43, double* %14
%44 = load double*, double** %6
%45 = call i32 @bcon_calc_g(double* %44, double* getelementptr inbounds ([4 x double], [4 x double]* @primtoU_g.ucon, i64 0, i64 0), double* getelementptr inbounds ([4 x double], [4 x double]* @primtoU_g.ucov, i64 0, i64 0), double* getelementptr inbounds ([4 x double], [4 x double]* @primtoU_g.ncov, i64 0, i64 0), double* getelementptr inbounds ([4 x double], [4 x double]* @primtoU_g.bcon, i64 0, i64 0))
%46 = load [4 x double]*, [4 x double]** %7
%47 = bitcast [4 x double]* %46 to double**
%48 = call i32 @lower_g(double* getelementptr inbounds ([4 x double], [4 x double]* @primtoU_g.bcon, i64 0, i64 0), double** %47, double* getelementptr inbounds ([4 x double], [4 x double]* @primtoU_g.bcov, i64 0, i64 0))
store double 0.000000e+00, double* %15
store i32 0, i32* %11
br label %49
49: ; preds = %63, %5
%50 = load i32, i32* %11
%51 = icmp slt i32 %50, 4
br i1 %51, label %52, label %66
52: ; preds = %49
%53 = load i32, i32* %11
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [4 x double], [4 x double]* @primtoU_g.ncov, i64 0, i64 %54
%56 = load double, double* %55
%57 = load i32, i32* %11
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds [4 x double], [4 x double]* @primtoU_g.bcon, i64 0, i64 %58
%60 = load double, double* %59
%61 = load double, double* %15
%62 = call double @llvm.fmuladd.f64(double %56, double %60, double %61)
store double %62, double* %15
br label %63
63: ; preds = %52
%64 = load i32, i32* %11
%65 = add nsw i32 %64, 1
store i32 %65, i32* %11
br label %49
66: ; preds = %49
store double 0.000000e+00, double* %16
store i32 0, i32* %11
br label %67
67: ; preds = %81, %66
%68 = load i32, i32* %11
%69 = icmp slt i32 %68, 4
br i1 %69, label %70, label %84
70: ; preds = %67
%71 = load i32, i32* %11
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds [4 x double], [4 x double]* @primtoU_g.bcov, i64 0, i64 %72
%74 = load double, double* %73
%75 = load i32, i32* %11
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds [4 x double], [4 x double]* @primtoU_g.bcon, i64 0, i64 %76
%78 = load double, double* %77
%79 = load double, double* %16
%80 = call double @llvm.fmuladd.f64(double %74, double %78, double %79)
store double %80, double* %16
br label %81
81: ; preds = %70
%82 = load i32, i32* %11
%83 = add nsw i32 %82, 1
store i32 %83, i32* %11
br label %67
84: ; preds = %67
%85 = load double*, double** %6
%86 = getelementptr inbounds double, double* %85, i64 0
%87 = load double, double* %86
store double %87, double* %13
%88 = load double*, double** %6
%89 = getelementptr inbounds double, double* %88, i64 1
%90 = load double, double* %89
store double %90, double* %17
%91 = load double, double* %13
%92 = load double, double* %17
%93 = call double @pressure_rho0_u(double %91, double %92)
store double %93, double* %18
%94 = load double, double* %13
%95 = load double, double* %17
%96 = fadd double %94, %95
%97 = load double, double* %18
%98 = fadd double %96, %97
store double %98, double* %19
%99 = load double, double* getelementptr inbounds ([4 x double], [4 x double]* @primtoU_g.ucon, i64 0, i64 0)
%100 = load double, double* %13
%101 = fmul double %99, %100
%102 = load double*, double** %10
%103 = getelementptr inbounds double, double* %102, i64 0
store double %101, double* %103
store i32 0, i32* %11
br label %104
104: ; preds = %147, %84
%105 = load i32, i32* %11
%106 = icmp slt i32 %105, 4
br i1 %106, label %107, label %150
107: ; preds = %104
%108 = load double, double* %14
%109 = load double, double* %19
%110 = load double, double* %16
%111 = fadd double %109, %110
%112 = fmul double %108, %111
%113 = load i32, i32* %11
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds [4 x double], [4 x double]* @primtoU_g.ucov, i64 0, i64 %114
%116 = load double, double* %115
%117 = load double, double* %18
%118 = load double, double* %16
%119 = fdiv double %118, 2.000000e+00
%120 = fadd double %117, %119
%121 = load i32, i32* %11
%122 = sext i32 %121 to i64
%123 = getelementptr inbounds [4 x double], [4 x double]* @primtoU_g.ncov, i64 0, i64 %122
%124 = load double, double* %123
%125 = fmul double %120, %124
%126 = fneg double %125
%127 = call double @llvm.fmuladd.f64(double %112, double %116, double %126)
%128 = load double, double* %15
%129 = load i32, i32* %11
%130 = sext i32 %129 to i64
%131 = getelementptr inbounds [4 x double], [4 x double]* @primtoU_g.bcov, i64 0, i64 %130
%132 = load double, double* %131
%133 = call double @llvm.fmuladd.f64(double %128, double %132, double %127)
%134 = load double*, double** %10
%135 = load i32, i32* %11
%136 = add nsw i32 1, %135
%137 = sext i32 %136 to i64
%138 = getelementptr inbounds double, double* %134, i64 %137
store double %133, double* %138
%139 = load double, double* %20
%140 = load double*, double** %10
%141 = load i32, i32* %11
%142 = add nsw i32 1, %141
%143 = sext i32 %142 to i64
%144 = getelementptr inbounds double, double* %140, i64 %143
%145 = load double, double* %144
%146 = fdiv double %145, %139
store double %146, double* %144
br label %147
147: ; preds = %107
%148 = load i32, i32* %11
%149 = add nsw i32 %148, 1
store i32 %149, i32* %11
br label %104
150: ; preds = %104
%151 = load double*, double** %10
%152 = getelementptr inbounds double, double* %151, i64 1
%153 = load double, double* %152
%154 = load double*, double** %10
%155 = getelementptr inbounds double, double* %154, i64 0
%156 = load double, double* %155
%157 = fadd double %153, %156
%158 = load double*, double** %10
%159 = getelementptr inbounds double, double* %158, i64 1
store double %157, double* %159
%160 = load double*, double** %6
%161 = getelementptr inbounds double, double* %160, i64 5
%162 = load double, double* %161
%163 = load double*, double** %10
%164 = getelementptr inbounds double, double* %163, i64 5
store double %162, double* %164
%165 = load double*, double** %6
%166 = getelementptr inbounds double, double* %165, i64 6
%167 = load double, double* %166
%168 = load double*, double** %10
%169 = getelementptr inbounds double, double* %168, i64 6
store double %167, double* %169
%170 = load double*, double** %6
%171 = getelementptr inbounds double, double* %170, i64 7
%172 = load double, double* %171
%173 = load double*, double** %10
%174 = getelementptr inbounds double, double* %173, i64 7
store double %172, double* %174
store i32 0, i32* %11
br label %175
175: ; preds = %186, %150
%176 = load i32, i32* %11
%177 = icmp slt i32 %176, 9
br i1 %177, label %178, label %189
178: ; preds = %175
%179 = load double, double* %9
%180 = load double*, double** %10
%181 = load i32, i32* %11
%182 = sext i32 %181 to i64
%183 = getelementptr inbounds double, double* %180, i64 %182
%184 = load double, double* %183
%185 = fmul double %184, %179
store double %185, double* %183
br label %186
186: ; preds = %178
%187 = load i32, i32* %11
%188 = add nsw i32 %187, 1
store i32 %188, i32* %11
br label %175
189: ; preds = %175
ret void
}

LLVM IR (-O2):
@primtoU_g.ucon = internal global [4 x double] zeroinitializer
@primtoU_g.ucov = internal global [4 x double] zeroinitializer
@primtoU_g.bcon = internal global [4 x double] zeroinitializer
@primtoU_g.bcov = internal global [4 x double] zeroinitializer
@primtoU_g.ncov = internal global [4 x double] zeroinitializer
define void @primtoU_g(double* %0, [4 x double]* %1, [4 x double]* %2, double %3, double* nocapture %4) {
%6 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 0, i64 0
%7 = load double, double* %6
%8 = fneg double %7
%9 = tail call double @sqrt(double %8)
%10 = bitcast [4 x double]* %1 to double**
%11 = bitcast [4 x double]* %2 to double**
%12 = tail call i32 @ucon_calc_g(double* %0, double** %10, double** %11, double* getelementptr inbounds ([4 x double], [4 x double]* @primtoU_g.ucon, i64 0, i64 0))
%13 = tail call i32 @lower_g(double* getelementptr inbounds ([4 x double], [4 x double]* @primtoU_g.ucon, i64 0, i64 0), double** %10, double* getelementptr inbounds ([4 x double], [4 x double]* @primtoU_g.ucov, i64 0, i64 0))
%14 = tail call i32 @ncov_calc(double** %11, double* getelementptr inbounds ([4 x double], [4 x double]* @primtoU_g.ncov, i64 0, i64 0))
%15 = load double, double* getelementptr inbounds ([4 x double], [4 x double]* @primtoU_g.ncov, i64 0, i64 0)
%16 = load double, double* getelementptr inbounds ([4 x double], [4 x double]* @primtoU_g.ucon, i64 0, i64 0)
%17 = tail call i32 @bcon_calc_g(double* %0, double* getelementptr inbounds ([4 x double], [4 x double]* @primtoU_g.ucon, i64 0, i64 0), double* getelementptr inbounds ([4 x double], [4 x double]* @primtoU_g.ucov, i64 0, i64 0), double* getelementptr inbounds ([4 x double], [4 x double]* @primtoU_g.ncov, i64 0, i64 0), double* getelementptr inbounds ([4 x double], [4 x double]* @primtoU_g.bcon, i64 0, i64 0))
%18 = tail call i32 @lower_g(double* getelementptr inbounds ([4 x double], [4 x double]* @primtoU_g.bcon, i64 0, i64 0), double** %10, double* getelementptr inbounds ([4 x double], [4 x double]* @primtoU_g.bcov, i64 0, i64 0))
%19 = load double, double* getelementptr inbounds ([4 x double], [4 x double]* @primtoU_g.ncov, i64 0, i64 0)
%20 = load double, double* getelementptr inbounds ([4 x double], [4 x double]* @primtoU_g.bcon, i64 0, i64 0)
%21 = tail call double @llvm.fmuladd.f64(double %19, double %20, double 0.000000e+00)
%22 = load double, double* getelementptr inbounds ([4 x double], [4 x double]* @primtoU_g.ncov, i64 0, i64 1)
%23 = load double, double* getelementptr inbounds ([4 x double], [4 x double]* @primtoU_g.bcon, i64 0, i64 1)
%24 = tail call double @llvm.fmuladd.f64(double %22, double %23, double %21)
%25 = load double, double* getelementptr inbounds ([4 x double], [4 x double]* @primtoU_g.ncov, i64 0, i64 2)
%26 = load double, double* getelementptr inbounds ([4 x double], [4 x double]* @primtoU_g.bcon, i64 0, i64 2)
%27 = tail call double @llvm.fmuladd.f64(double %25, double %26, double %24)
%28 = load double, double* getelementptr inbounds ([4 x double], [4 x double]* @primtoU_g.ncov, i64 0, i64 3)
%29 = load double, double* getelementptr inbounds ([4 x double], [4 x double]* @primtoU_g.bcon, i64 0, i64 3)
%30 = tail call double @llvm.fmuladd.f64(double %28, double %29, double %27)
%31 = fneg double %15
%32 = load double, double* getelementptr inbounds ([4 x double], [4 x double]* @primtoU_g.bcov, i64 0, i64 0)
%33 = tail call double @llvm.fmuladd.f64(double %32, double %20, double 0.000000e+00)
%34 = load double, double* getelementptr inbounds ([4 x double], [4 x double]* @primtoU_g.bcov, i64 0, i64 1)
%35 = tail call double @llvm.fmuladd.f64(double %34, double %23, double %33)
%36 = load double, double* getelementptr inbounds ([4 x double], [4 x double]* @primtoU_g.bcov, i64 0, i64 2)
%37 = tail call double @llvm.fmuladd.f64(double %36, double %26, double %35)
%38 = load double, double* getelementptr inbounds ([4 x double], [4 x double]* @primtoU_g.bcov, i64 0, i64 3)
%39 = tail call double @llvm.fmuladd.f64(double %38, double %29, double %37)
%40 = fdiv double 1.000000e+00, %9
%41 = fmul double %16, %31
%42 = load double, double* %0
%43 = getelementptr inbounds double, double* %0, i64 1
%44 = load double, double* %43
%45 = tail call double @pressure_rho0_u(double %42, double %44)
%46 = fadd double %42, %44
%47 = fadd double %46, %45
%48 = load double, double* getelementptr inbounds ([4 x double], [4 x double]* @primtoU_g.ucon, i64 0, i64 0)
%49 = fmul double %42, %48
store double %49, double* %4
%50 = fadd double %39, %47
%51 = fmul double %41, %50
%52 = fmul double %39, 5.000000e-01
%53 = fadd double %52, %45
%54 = fneg double %53
%55 = load double, double* getelementptr inbounds ([4 x double], [4 x double]* @primtoU_g.ucov, i64 0, i64 0)
%56 = load double, double* getelementptr inbounds ([4 x double], [4 x double]* @primtoU_g.ncov, i64 0, i64 0)
%57 = fmul double %56, %54
%58 = tail call double @llvm.fmuladd.f64(double %51, double %55, double %57)
%59 = load double, double* getelementptr inbounds ([4 x double], [4 x double]* @primtoU_g.bcov, i64 0, i64 0)
%60 = tail call double @llvm.fmuladd.f64(double %30, double %59, double %58)
%61 = getelementptr inbounds double, double* %4, i64 1
%62 = fdiv double %60, %40
store double %62, double* %61
%63 = load double, double* getelementptr inbounds ([4 x double], [4 x double]* @primtoU_g.ucov, i64 0, i64 1)
%64 = load double, double* getelementptr inbounds ([4 x double], [4 x double]* @primtoU_g.ncov, i64 0, i64 1)
%65 = fmul double %64, %54
%66 = tail call double @llvm.fmuladd.f64(double %51, double %63, double %65)
%67 = load double, double* getelementptr inbounds ([4 x double], [4 x double]* @primtoU_g.bcov, i64 0, i64 1)
%68 = tail call double @llvm.fmuladd.f64(double %30, double %67, double %66)
%69 = getelementptr inbounds double, double* %4, i64 2
%70 = fdiv double %68, %40
store double %70, double* %69
%71 = load double, double* getelementptr inbounds ([4 x double], [4 x double]* @primtoU_g.ucov, i64 0, i64 2)
%72 = load double, double* getelementptr inbounds ([4 x double], [4 x double]* @primtoU_g.ncov, i64 0, i64 2)
%73 = fmul double %72, %54
%74 = tail call double @llvm.fmuladd.f64(double %51, double %71, double %73)
%75 = load double, double* getelementptr inbounds ([4 x double], [4 x double]* @primtoU_g.bcov, i64 0, i64 2)
%76 = tail call double @llvm.fmuladd.f64(double %30, double %75, double %74)
%77 = getelementptr inbounds double, double* %4, i64 3
%78 = fdiv double %76, %40
store double %78, double* %77
%79 = load double, double* getelementptr inbounds ([4 x double], [4 x double]* @primtoU_g.ucov, i64 0, i64 3)
%80 = load double, double* getelementptr inbounds ([4 x double], [4 x double]* @primtoU_g.ncov, i64 0, i64 3)
%81 = fmul double %80, %54
%82 = tail call double @llvm.fmuladd.f64(double %51, double %79, double %81)
%83 = load double, double* getelementptr inbounds ([4 x double], [4 x double]* @primtoU_g.bcov, i64 0, i64 3)
%84 = tail call double @llvm.fmuladd.f64(double %30, double %83, double %82)
%85 = getelementptr inbounds double, double* %4, i64 4
%86 = fdiv double %84, %40
store double %86, double* %85
%87 = fadd double %49, %62
store double %87, double* %61
%88 = getelementptr inbounds double, double* %0, i64 5
%89 = load double, double* %88
%90 = getelementptr inbounds double, double* %4, i64 5
store double %89, double* %90
%91 = getelementptr inbounds double, double* %0, i64 6
%92 = load double, double* %91
%93 = getelementptr inbounds double, double* %4, i64 6
store double %92, double* %93
%94 = getelementptr inbounds double, double* %0, i64 7
%95 = load double, double* %94
%96 = insertelement <2 x double> poison, double %49, i64 0
%97 = insertelement <2 x double> %96, double %87, i64 1
%98 = insertelement <2 x double> poison, double %3, i64 0
%99 = shufflevector <2 x double> %98, <2 x double> poison, <2 x i32> zeroinitializer
%100 = fmul <2 x double> %97, %99
%101 = bitcast double* %4 to <2 x double>*
store <2 x double> %100, <2 x double>* %101
%102 = insertelement <2 x double> poison, double %70, i64 0
%103 = insertelement <2 x double> %102, double %78, i64 1
%104 = fmul <2 x double> %103, %99
%105 = bitcast double* %69 to <2 x double>*
store <2 x double> %104, <2 x double>* %105
%106 = insertelement <2 x double> poison, double %86, i64 0
%107 = insertelement <2 x double> %106, double %89, i64 1
%108 = fmul <2 x double> %107, %99
%109 = bitcast double* %85 to <2 x double>*
store <2 x double> %108, <2 x double>* %109
%110 = insertelement <2 x double> poison, double %92, i64 0
%111 = insertelement <2 x double> %110, double %95, i64 1
%112 = fmul <2 x double> %111, %99
%113 = bitcast double* %93 to <2 x double>*
store <2 x double> %112, <2 x double>* %113
%114 = getelementptr inbounds double, double* %4, i64 8
%115 = load double, double* %114
%116 = fmul double %115, %3
store double %116, double* %114
ret void
}