#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*/ flux(double const *, double, double *);
double const max(double const, double);
double const min(double const, double);
int /*<<< orphan*/ printf(char *, double const, double const, double const,
                          ...);
double sqrt(double);
void riemann_hllc(const double *uL, const double *uR, double *f, double g) {
  double cL = sqrt(g * uL[0]), cR = sqrt(g * uR[0]);
  double ustar = (uL[1] + uR[1]) / 2. + cL - cR;
  double cstar = (cL + cR) / 2. + (uL[1] - uR[1]) / 4.;
  double SL = uL[0] == 0. ? uR[1] - 2. * cR : min(uL[1] - cL, ustar - cstar);
  double SR = uR[0] == 0. ? uL[1] + 2. * cL : max(uR[1] + cR, ustar + cstar);
  if (0. <= SL)
    flux(uL, g, f);
  else if (0. >= SR)
    flux(uR, g, f);
  else {
    double fL[3], fR[3], SM;
    flux(uL, g, fL);
    flux(uR, g, fR);
    f[0] = (SR * fL[0] - SL * fR[0] + SL * SR * (uR[0] - uL[0])) / (SR - SL);
    f[1] =
        (SR * fL[1] - SL * fR[1] + SL * SR * (uR[0] * uR[1] - uL[0] * uL[1])) /
        (SR - SL);
    SM = ((SL * uR[0] * (uR[1] - SR) - SR * uL[0] * (uL[1] - SL)) /
          (uR[0] * (uR[1] - SR) - uL[0] * (uL[1] - SL)));
    if (SL <= 0. && 0. <= SM)
      f[2] = uL[2] * f[0];
    else if (SM <= 0. && 0. <= SR)
      f[2] = uR[2] * f[0];
    else {
      printf("L: %g %g %g R: %g %g %g\n", uL[0], uL[1], uL[2], uR[0], uR[1],
             uR[2]);
      printf("SL: %g SR: %g SM: %g\n", SL, SR, SM);
    }
  }
}


x86 assembly (clang, -O0):
<riemann_hllc>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulsd  (%rax),%xmm0
call   1070 <sqrt@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mulsd  (%rax),%xmm0
call   1070 <sqrt@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
addsd  0x8(%rax),%xmm0
movsd  0xe54(%rip),%xmm1
divsd  %xmm1,%xmm0
addsd  -0x28(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x28(%rbp),%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  0xe2f(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x10(%rbp),%rax
subsd  0x8(%rax),%xmm1
movsd  0xe09(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1242 <riemann_hllc+0xf2>
jp     1242 <riemann_hllc+0xf2>
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  -0x30(%rbp),%xmm1
addsd  %xmm1,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
jmp    1267 <riemann_hllc+0x117>
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
subsd  -0x28(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
subsd  -0x40(%rbp),%xmm1
call   1040 <min@plt>
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0x48(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    12b2 <riemann_hllc+0x162>
jp     12b2 <riemann_hllc+0x162>
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
movsd  -0x28(%rbp),%xmm0
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
jmp    12d7 <riemann_hllc+0x187>
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
addsd  -0x40(%rbp),%xmm1
call   1050 <max@plt>
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0x50(%rbp)
movsd  -0x48(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     130d <riemann_hllc+0x1bd>
mov    -0x8(%rbp),%rdi
movsd  -0x20(%rbp),%xmm0
mov    -0x18(%rbp),%rsi
call   1060 <flux@plt>
jmp    1610 <riemann_hllc+0x4c0>
xorps  %xmm0,%xmm0
ucomisd -0x50(%rbp),%xmm0
jb     1332 <riemann_hllc+0x1e2>
mov    -0x10(%rbp),%rdi
movsd  -0x20(%rbp),%xmm0
mov    -0x18(%rbp),%rsi
call   1060 <flux@plt>
jmp    160b <riemann_hllc+0x4bb>
mov    -0x8(%rbp),%rdi
movsd  -0x20(%rbp),%xmm0
lea    -0x70(%rbp),%rsi
call   1060 <flux@plt>
mov    -0x10(%rbp),%rdi
movsd  -0x20(%rbp),%xmm0
lea    -0x90(%rbp),%rsi
call   1060 <flux@plt>
movsd  -0x50(%rbp),%xmm1
movsd  -0x70(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm0
mulsd  -0x90(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
mulsd  -0x50(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
subsd  (%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x50(%rbp),%xmm1
subsd  -0x48(%rbp),%xmm1
divsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x50(%rbp),%xmm1
movsd  -0x68(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm0
mulsd  -0x88(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
mulsd  -0x50(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm4
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm3
mov    -0x8(%rbp),%rax
mulsd  0x8(%rax),%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  -0x50(%rbp),%xmm1
subsd  -0x48(%rbp),%xmm1
divsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x48(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mulsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm2
subsd  -0x50(%rbp),%xmm2
movsd  -0x50(%rbp),%xmm1
mov    -0x8(%rbp),%rax
mulsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm3
subsd  -0x48(%rbp),%xmm3
mulsd  %xmm3,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm3
subsd  -0x50(%rbp),%xmm3
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm4
subsd  -0x48(%rbp),%xmm4
mulsd  %xmm4,%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
xorps  %xmm0,%xmm0
ucomisd -0x48(%rbp),%xmm0
jb     155d <riemann_hllc+0x40d>
movsd  -0x98(%rbp),%xmm0
ff
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     155d <riemann_hllc+0x40d>
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x18(%rbp),%rax
mulsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x10(%rax)
jmp    1606 <riemann_hllc+0x4b6>
xorps  %xmm0,%xmm0
ucomisd -0x98(%rbp),%xmm0
ff
jb     159f <riemann_hllc+0x44f>
movsd  -0x50(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     159f <riemann_hllc+0x44f>
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x18(%rbp),%rax
mulsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x10(%rax)
jmp    1601 <riemann_hllc+0x4b1>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm2
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm3
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm4
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm5
lea    0xa36(%rip),%rdi
mov    $0x6,%al
call   1030 <printf@plt>
movsd  -0x48(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
movsd  -0x98(%rbp),%xmm2
ff
lea    0xa2f(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
jmp    1606 <riemann_hllc+0x4b6>
jmp    160b <riemann_hllc+0x4bb>
jmp    1610 <riemann_hllc+0x4c0>
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<riemann_hllc>:
push   %r15
push   %r14
push   %rbx
sub    $0x80,%rsp
movapd %xmm0,%xmm1
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
movsd  (%rdi),%xmm0
mulsd  %xmm1,%xmm0
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
movsd  %xmm1,0x10(%rsp)
jb     1187 <riemann_hllc+0x37>
sqrtsd %xmm0,%xmm4
jmp    119a <riemann_hllc+0x4a>
call   1070 <sqrt@plt>
xorpd  %xmm2,%xmm2
movsd  0x10(%rsp),%xmm1
movapd %xmm0,%xmm4
movsd  (%r15),%xmm0
mulsd  %xmm1,%xmm0
ucomisd %xmm2,%xmm0
movapd %xmm4,0x20(%rsp)
jb     11b6 <riemann_hllc+0x66>
sqrtsd %xmm0,%xmm8
jmp    11c6 <riemann_hllc+0x76>
call   1070 <sqrt@plt>
movapd 0x20(%rsp),%xmm4
movapd %xmm0,%xmm8
movsd  (%rbx),%xmm1
movsd  0x8(%rbx),%xmm0
movsd  0x8(%r15),%xmm5
movapd %xmm0,%xmm7
addsd  %xmm5,%xmm7
movsd  0xe1b(%rip),%xmm2
mulsd  %xmm2,%xmm7
addsd  %xmm4,%xmm7
subsd  %xmm8,%xmm7
movapd %xmm4,%xmm3
addsd  %xmm8,%xmm3
mulsd  %xmm2,%xmm3
movapd %xmm0,%xmm6
subsd  %xmm5,%xmm6
mulsd  0xdf9(%rip),%xmm6
addsd  %xmm3,%xmm6
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm1
movsd  %xmm7,0x38(%rsp)
movsd  %xmm6,0x30(%rsp)
jne    123b <riemann_hllc+0xeb>
jp     123b <riemann_hllc+0xeb>
movapd %xmm8,%xmm0
addsd  %xmm8,%xmm0
subsd  %xmm0,%xmm5
jmp    125e <riemann_hllc+0x10e>
subsd  %xmm4,%xmm0
movapd %xmm7,%xmm1
subsd  %xmm6,%xmm1
movsd  %xmm8,0x8(%rsp)
call   1040 <min@plt>
movsd  0x8(%rsp),%xmm8
movapd %xmm0,%xmm5
movsd  (%r15),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1280 <riemann_hllc+0x130>
jp     1280 <riemann_hllc+0x130>
movapd 0x20(%rsp),%xmm1
addsd  %xmm1,%xmm1
addsd  0x8(%rbx),%xmm1
jmp    12ac <riemann_hllc+0x15c>
addsd  0x8(%r15),%xmm8
movsd  0x30(%rsp),%xmm1
addsd  0x38(%rsp),%xmm1
movapd %xmm8,%xmm0
movsd  %xmm5,0x8(%rsp)
call   1050 <max@plt>
movsd  0x8(%rsp),%xmm5
movapd %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm5
jae    1429 <riemann_hllc+0x2d9>
ucomisd %xmm1,%xmm0
jae    142e <riemann_hllc+0x2de>
lea    0x60(%rsp),%rsi
mov    %rbx,%rdi
movsd  0x10(%rsp),%xmm0
movapd %xmm1,0x20(%rsp)
movsd  %xmm5,0x8(%rsp)
call   1060 <flux@plt>
lea    0x40(%rsp),%rsi
mov    %r15,%rdi
movsd  0x10(%rsp),%xmm0
call   1060 <flux@plt>
movsd  0x8(%rsp),%xmm10
movapd 0x20(%rsp),%xmm9
movsd  0x40(%rsp),%xmm0
mulsd  %xmm10,%xmm0
movsd  0x60(%rsp),%xmm1
mulsd  %xmm9,%xmm1
subsd  %xmm0,%xmm1
movapd %xmm10,%xmm0
mulsd  %xmm9,%xmm0
movsd  (%r15),%xmm8
subsd  (%rbx),%xmm8
mulsd  %xmm0,%xmm8
addsd  %xmm1,%xmm8
movapd %xmm9,%xmm1
subsd  %xmm10,%xmm1
divsd  %xmm1,%xmm8
movsd  %xmm8,(%r14)
movsd  0x48(%rsp),%xmm3
mulsd  %xmm10,%xmm3
movsd  0x68(%rsp),%xmm4
mulsd  %xmm9,%xmm4
subsd  %xmm3,%xmm4
movsd  (%r15),%xmm3
movsd  0x8(%rbx),%xmm5
mulsd  (%rbx),%xmm5
mulsd  0x8(%r15),%xmm3
subsd  %xmm5,%xmm3
mulsd  %xmm0,%xmm3
addsd  %xmm4,%xmm3
divsd  %xmm1,%xmm3
movsd  %xmm3,0x8(%r14)
movsd  (%r15),%xmm3
movsd  0x8(%r15),%xmm4
movapd %xmm10,%xmm11
mulsd  %xmm3,%xmm11
movapd %xmm4,%xmm7
subsd  %xmm9,%xmm7
movsd  (%rbx),%xmm0
movsd  0x8(%rbx),%xmm1
movapd %xmm1,%xmm6
subsd  %xmm10,%xmm6
movapd 0xc44(%rip),%xmm5
movapd %xmm9,%xmm2
xorpd  %xmm5,%xmm2
mulsd  %xmm0,%xmm2
xorpd  %xmm0,%xmm5
unpcklpd %xmm5,%xmm2
unpcklpd %xmm6,%xmm6
mulpd  %xmm2,%xmm6
unpcklpd %xmm3,%xmm11
unpcklpd %xmm7,%xmm7
mulpd  %xmm11,%xmm7
addpd  %xmm6,%xmm7
movapd %xmm7,%xmm2
unpckhpd %xmm7,%xmm2
divsd  %xmm2,%xmm7
xorpd  %xmm5,%xmm5
ucomisd %xmm10,%xmm5
jb     144b <riemann_hllc+0x2fb>
ucomisd %xmm5,%xmm7
jb     144b <riemann_hllc+0x2fb>
mulsd  0x10(%rbx),%xmm8
movsd  %xmm8,0x10(%r14)
jmp    14a9 <riemann_hllc+0x359>
mov    %rbx,%rdi
jmp    1431 <riemann_hllc+0x2e1>
mov    %r15,%rdi
movsd  0x10(%rsp),%xmm0
mov    %r14,%rsi
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %r15
jmp    1060 <flux@plt>
ucomisd %xmm7,%xmm5
jb     146a <riemann_hllc+0x31a>
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm9
jb     146a <riemann_hllc+0x31a>
mulsd  0x10(%r15),%xmm8
movsd  %xmm8,0x10(%r14)
jmp    14a9 <riemann_hllc+0x359>
movsd  0x10(%rbx),%xmm2
movsd  0x10(%r15),%xmm5
lea    0xba4(%rip),%rdi
mov    $0x6,%al
movapd %xmm7,0x10(%rsp)
call   1030 <printf@plt>
lea    0xba9(%rip),%rdi
movsd  0x8(%rsp),%xmm0
movapd 0x20(%rsp),%xmm1
movapd 0x10(%rsp),%xmm2
mov    $0x3,%al
call   1030 <printf@plt>
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [25 x i8] c"L: %g %g %g R: %g %g %g\0A\00"
@.str.1 = [22 x i8] c"SL: %g SR: %g SM: %g\0A\00"
define void @riemann_hllc(double* %0, double* %1, double* %2, double %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca double*
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca [3 x double]
%16 = alloca [3 x double]
%17 = alloca double
store double* %0, double** %5
store double* %1, double** %6
store double* %2, double** %7
store double %3, double* %8
%18 = load double, double* %8
%19 = load double*, double** %5
%20 = getelementptr inbounds double, double* %19, i64 0
%21 = load double, double* %20
%22 = fmul double %18, %21
%23 = call double @sqrt(double %22)
store double %23, double* %9
%24 = load double, double* %8
%25 = load double*, double** %6
%26 = getelementptr inbounds double, double* %25, i64 0
%27 = load double, double* %26
%28 = fmul double %24, %27
%29 = call double @sqrt(double %28)
store double %29, double* %10
%30 = load double*, double** %5
%31 = getelementptr inbounds double, double* %30, i64 1
%32 = load double, double* %31
%33 = load double*, double** %6
%34 = getelementptr inbounds double, double* %33, i64 1
%35 = load double, double* %34
%36 = fadd double %32, %35
%37 = fdiv double %36, 2.000000e+00
%38 = load double, double* %9
%39 = fadd double %37, %38
%40 = load double, double* %10
%41 = fsub double %39, %40
store double %41, double* %11
%42 = load double, double* %9
%43 = load double, double* %10
%44 = fadd double %42, %43
%45 = fdiv double %44, 2.000000e+00
%46 = load double*, double** %5
%47 = getelementptr inbounds double, double* %46, i64 1
%48 = load double, double* %47
%49 = load double*, double** %6
%50 = getelementptr inbounds double, double* %49, i64 1
%51 = load double, double* %50
%52 = fsub double %48, %51
%53 = fdiv double %52, 4.000000e+00
%54 = fadd double %45, %53
store double %54, double* %12
%55 = load double*, double** %5
%56 = getelementptr inbounds double, double* %55, i64 0
%57 = load double, double* %56
%58 = fcmp oeq double %57, 0.000000e+00
br i1 %58, label %59, label %65
59: ; preds = %4
%60 = load double*, double** %6
%61 = getelementptr inbounds double, double* %60, i64 1
%62 = load double, double* %61
%63 = load double, double* %10
%64 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %63, double %62)
br label %75
65: ; preds = %4
%66 = load double*, double** %5
%67 = getelementptr inbounds double, double* %66, i64 1
%68 = load double, double* %67
%69 = load double, double* %9
%70 = fsub double %68, %69
%71 = load double, double* %11
%72 = load double, double* %12
%73 = fsub double %71, %72
%74 = call double @min(double %70, double %73)
br label %75
75: ; preds = %65, %59
%76 = phi double [ %64, %59 ], [ %74, %65 ]
store double %76, double* %13
%77 = load double*, double** %6
%78 = getelementptr inbounds double, double* %77, i64 0
%79 = load double, double* %78
%80 = fcmp oeq double %79, 0.000000e+00
br i1 %80, label %81, label %87
81: ; preds = %75
%82 = load double*, double** %5
%83 = getelementptr inbounds double, double* %82, i64 1
%84 = load double, double* %83
%85 = load double, double* %9
%86 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %85, double %84)
br label %97
87: ; preds = %75
%88 = load double*, double** %6
%89 = getelementptr inbounds double, double* %88, i64 1
%90 = load double, double* %89
%91 = load double, double* %10
%92 = fadd double %90, %91
%93 = load double, double* %11
%94 = load double, double* %12
%95 = fadd double %93, %94
%96 = call double @max(double %92, double %95)
br label %97
97: ; preds = %87, %81
%98 = phi double [ %86, %81 ], [ %96, %87 ]
store double %98, double* %14
%99 = load double, double* %13
%100 = fcmp ole double 0.000000e+00, %99
br i1 %100, label %101, label %106
101: ; preds = %97
%102 = load double*, double** %5
%103 = load double, double* %8
%104 = load double*, double** %7
%105 = call i32 @flux(double* %102, double %103, double* %104)
br label %284
106: ; preds = %97
%107 = load double, double* %14
%108 = fcmp oge double 0.000000e+00, %107
br i1 %108, label %109, label %114
109: ; preds = %106
%110 = load double*, double** %6
%111 = load double, double* %8
%112 = load double*, double** %7
%113 = call i32 @flux(double* %110, double %111, double* %112)
br label %283
114: ; preds = %106
%115 = load double*, double** %5
%116 = load double, double* %8
%117 = getelementptr inbounds [3 x double], [3 x double]* %15, i64 0, i64 0
%118 = call i32 @flux(double* %115, double %116, double* %117)
%119 = load double*, double** %6
%120 = load double, double* %8
%121 = getelementptr inbounds [3 x double], [3 x double]* %16, i64 0, i64 0
%122 = call i32 @flux(double* %119, double %120, double* %121)
%123 = load double, double* %14
%124 = getelementptr inbounds [3 x double], [3 x double]* %15, i64 0, i64 0
%125 = load double, double* %124
%126 = load double, double* %13
%127 = getelementptr inbounds [3 x double], [3 x double]* %16, i64 0, i64 0
%128 = load double, double* %127
%129 = fmul double %126, %128
%130 = fneg double %129
%131 = call double @llvm.fmuladd.f64(double %123, double %125, double %130)
%132 = load double, double* %13
%133 = load double, double* %14
%134 = fmul double %132, %133
%135 = load double*, double** %6
%136 = getelementptr inbounds double, double* %135, i64 0
%137 = load double, double* %136
%138 = load double*, double** %5
%139 = getelementptr inbounds double, double* %138, i64 0
%140 = load double, double* %139
%141 = fsub double %137, %140
%142 = call double @llvm.fmuladd.f64(double %134, double %141, double %131)
%143 = load double, double* %14
%144 = load double, double* %13
%145 = fsub double %143, %144
%146 = fdiv double %142, %145
%147 = load double*, double** %7
%148 = getelementptr inbounds double, double* %147, i64 0
store double %146, double* %148
%149 = load double, double* %14
%150 = getelementptr inbounds [3 x double], [3 x double]* %15, i64 0, i64 1
%151 = load double, double* %150
%152 = load double, double* %13
%153 = getelementptr inbounds [3 x double], [3 x double]* %16, i64 0, i64 1
%154 = load double, double* %153
%155 = fmul double %152, %154
%156 = fneg double %155
%157 = call double @llvm.fmuladd.f64(double %149, double %151, double %156)
%158 = load double, double* %13
%159 = load double, double* %14
%160 = fmul double %158, %159
%161 = load double*, double** %6
%162 = getelementptr inbounds double, double* %161, i64 0
%163 = load double, double* %162
%164 = load double*, double** %6
%165 = getelementptr inbounds double, double* %164, i64 1
%166 = load double, double* %165
%167 = load double*, double** %5
%168 = getelementptr inbounds double, double* %167, i64 0
%169 = load double, double* %168
%170 = load double*, double** %5
%171 = getelementptr inbounds double, double* %170, i64 1
%172 = load double, double* %171
%173 = fmul double %169, %172
%174 = fneg double %173
%175 = call double @llvm.fmuladd.f64(double %163, double %166, double %174)
%176 = call double @llvm.fmuladd.f64(double %160, double %175, double %157)
%177 = load double, double* %14
%178 = load double, double* %13
%179 = fsub double %177, %178
%180 = fdiv double %176, %179
%181 = load double*, double** %7
%182 = getelementptr inbounds double, double* %181, i64 1
store double %180, double* %182
%183 = load double, double* %13
%184 = load double*, double** %6
%185 = getelementptr inbounds double, double* %184, i64 0
%186 = load double, double* %185
%187 = fmul double %183, %186
%188 = load double*, double** %6
%189 = getelementptr inbounds double, double* %188, i64 1
%190 = load double, double* %189
%191 = load double, double* %14
%192 = fsub double %190, %191
%193 = load double, double* %14
%194 = load double*, double** %5
%195 = getelementptr inbounds double, double* %194, i64 0
%196 = load double, double* %195
%197 = fmul double %193, %196
%198 = load double*, double** %5
%199 = getelementptr inbounds double, double* %198, i64 1
%200 = load double, double* %199
%201 = load double, double* %13
%202 = fsub double %200, %201
%203 = fmul double %197, %202
%204 = fneg double %203
%205 = call double @llvm.fmuladd.f64(double %187, double %192, double %204)
%206 = load double*, double** %6
%207 = getelementptr inbounds double, double* %206, i64 0
%208 = load double, double* %207
%209 = load double*, double** %6
%210 = getelementptr inbounds double, double* %209, i64 1
%211 = load double, double* %210
%212 = load double, double* %14
%213 = fsub double %211, %212
%214 = load double*, double** %5
%215 = getelementptr inbounds double, double* %214, i64 0
%216 = load double, double* %215
%217 = load double*, double** %5
%218 = getelementptr inbounds double, double* %217, i64 1
%219 = load double, double* %218
%220 = load double, double* %13
%221 = fsub double %219, %220
%222 = fmul double %216, %221
%223 = fneg double %222
%224 = call double @llvm.fmuladd.f64(double %208, double %213, double %223)
%225 = fdiv double %205, %224
store double %225, double* %17
%226 = load double, double* %13
%227 = fcmp ole double %226, 0.000000e+00
br i1 %227, label %228, label %241
228: ; preds = %114
%229 = load double, double* %17
%230 = fcmp ole double 0.000000e+00, %229
br i1 %230, label %231, label %241
231: ; preds = %228
%232 = load double*, double** %5
%233 = getelementptr inbounds double, double* %232, i64 2
%234 = load double, double* %233
%235 = load double*, double** %7
%236 = getelementptr inbounds double, double* %235, i64 0
%237 = load double, double* %236
%238 = fmul double %234, %237
%239 = load double*, double** %7
%240 = getelementptr inbounds double, double* %239, i64 2
store double %238, double* %240
br label %282
241: ; preds = %228, %114
%242 = load double, double* %17
%243 = fcmp ole double %242, 0.000000e+00
br i1 %243, label %244, label %257
244: ; preds = %241
%245 = load double, double* %14
%246 = fcmp ole double 0.000000e+00, %245
br i1 %246, label %247, label %257
247: ; preds = %244
%248 = load double*, double** %6
%249 = getelementptr inbounds double, double* %248, i64 2
%250 = load double, double* %249
%251 = load double*, double** %7
%252 = getelementptr inbounds double, double* %251, i64 0
%253 = load double, double* %252
%254 = fmul double %250, %253
%255 = load double*, double** %7
%256 = getelementptr inbounds double, double* %255, i64 2
store double %254, double* %256
br label %281
257: ; preds = %244, %241
%258 = load double*, double** %5
%259 = getelementptr inbounds double, double* %258, i64 0
%260 = load double, double* %259
%261 = load double*, double** %5
%262 = getelementptr inbounds double, double* %261, i64 1
%263 = load double, double* %262
%264 = load double*, double** %5
%265 = getelementptr inbounds double, double* %264, i64 2
%266 = load double, double* %265
%267 = load double*, double** %6
%268 = getelementptr inbounds double, double* %267, i64 0
%269 = load double, double* %268
%270 = load double*, double** %6
%271 = getelementptr inbounds double, double* %270, i64 1
%272 = load double, double* %271
%273 = load double*, double** %6
%274 = getelementptr inbounds double, double* %273, i64 2
%275 = load double, double* %274
%276 = call i32 (i8*, double, double, double, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), double %260, double %263, double %266, double %269, double %272, double %275)
%277 = load double, double* %13
%278 = load double, double* %14
%279 = load double, double* %17
%280 = call i32 (i8*, double, double, double, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), double %277, double %278, double %279)
br label %281
281: ; preds = %257, %247
br label %282
282: ; preds = %281, %231
br label %283
283: ; preds = %282, %109
br label %284
284: ; preds = %283, %101
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"L: %g %g %g R: %g %g %g\0A\00"
@.str.1 = [22 x i8] c"SL: %g SR: %g SM: %g\0A\00"
define void @riemann_hllc(double* %0, double* %1, double* %2, double %3) {
%5 = alloca [3 x double]
%6 = alloca [3 x double]
%7 = load double, double* %0
%8 = fmul double %7, %3
%9 = tail call double @sqrt(double %8)
%10 = load double, double* %1
%11 = fmul double %10, %3
%12 = tail call double @sqrt(double %11)
%13 = getelementptr inbounds double, double* %0, i64 1
%14 = load double, double* %13
%15 = getelementptr inbounds double, double* %1, i64 1
%16 = load double, double* %15
%17 = fadd double %14, %16
%18 = fmul double %17, 5.000000e-01
%19 = fadd double %9, %18
%20 = fsub double %19, %12
%21 = fadd double %9, %12
%22 = fmul double %21, 5.000000e-01
%23 = fsub double %14, %16
%24 = fmul double %23, 2.500000e-01
%25 = fadd double %22, %24
%26 = load double, double* %0
%27 = fcmp oeq double %26, 0.000000e+00
br i1 %27, label %28, label %30
28: ; preds = %4
%29 = tail call double @llvm.fmuladd.f64(double %12, double -2.000000e+00, double %16)
br label %34
30: ; preds = %4
%31 = fsub double %14, %9
%32 = fsub double %20, %25
%33 = tail call double @min(double %31, double %32)
br label %34
34: ; preds = %30, %28
%35 = phi double [ %29, %28 ], [ %33, %30 ]
%36 = load double, double* %1
%37 = fcmp oeq double %36, 0.000000e+00
br i1 %37, label %38, label %41
38: ; preds = %34
%39 = load double, double* %13
%40 = tail call double @llvm.fmuladd.f64(double %9, double 2.000000e+00, double %39)
br label %46
41: ; preds = %34
%42 = load double, double* %15
%43 = fadd double %12, %42
%44 = fadd double %25, %20
%45 = tail call double @max(double %43, double %44)
br label %46
46: ; preds = %41, %38
%47 = phi double [ %40, %38 ], [ %45, %41 ]
%48 = fcmp ult double %35, 0.000000e+00
br i1 %48, label %51, label %49
49: ; preds = %46
%50 = tail call i32 @flux(double* %0, double %3, double* %2)
br label %138
51: ; preds = %46
%52 = fcmp ugt double %47, 0.000000e+00
br i1 %52, label %55, label %53
53: ; preds = %51
%54 = tail call i32 @flux(double* %1, double %3, double* %2)
br label %138
55: ; preds = %51
%56 = bitcast [3 x double]* %5 to i8*
%57 = bitcast [3 x double]* %6 to i8*
%58 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 0
%59 = call i32 @flux(double* %0, double %3, double* %58)
%60 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 0
%61 = call i32 @flux(double* %1, double %3, double* %60)
%62 = load double, double* %58
%63 = load double, double* %60
%64 = fneg double %35
%65 = fmul double %63, %64
%66 = call double @llvm.fmuladd.f64(double %47, double %62, double %65)
%67 = fmul double %35, %47
%68 = load double, double* %1
%69 = load double, double* %0
%70 = fsub double %68, %69
%71 = call double @llvm.fmuladd.f64(double %67, double %70, double %66)
%72 = fsub double %47, %35
%73 = fdiv double %71, %72
store double %73, double* %2
%74 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 1
%75 = load double, double* %74
%76 = getelementptr inbounds [3 x double], [3 x double]* %6, i64 0, i64 1
%77 = load double, double* %76
%78 = fmul double %77, %64
%79 = call double @llvm.fmuladd.f64(double %47, double %75, double %78)
%80 = load double, double* %1
%81 = load double, double* %15
%82 = load double, double* %0
%83 = load double, double* %13
%84 = fneg double %82
%85 = fmul double %83, %84
%86 = call double @llvm.fmuladd.f64(double %80, double %81, double %85)
%87 = call double @llvm.fmuladd.f64(double %67, double %86, double %79)
%88 = fdiv double %87, %72
%89 = getelementptr inbounds double, double* %2, i64 1
store double %88, double* %89
%90 = load double, double* %1
%91 = fmul double %35, %90
%92 = load double, double* %15
%93 = fsub double %92, %47
%94 = load double, double* %0
%95 = load double, double* %13
%96 = fsub double %95, %35
%97 = fneg double %47
%98 = fmul double %94, %97
%99 = fneg double %94
%100 = insertelement <2 x double> poison, double %96, i64 0
%101 = shufflevector <2 x double> %100, <2 x double> poison, <2 x i32> zeroinitializer
%102 = insertelement <2 x double> poison, double %98, i64 0
%103 = insertelement <2 x double> %102, double %99, i64 1
%104 = fmul <2 x double> %101, %103
%105 = insertelement <2 x double> poison, double %91, i64 0
%106 = insertelement <2 x double> %105, double %90, i64 1
%107 = insertelement <2 x double> poison, double %93, i64 0
%108 = shufflevector <2 x double> %107, <2 x double> poison, <2 x i32> zeroinitializer
%109 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %106, <2 x double> %108, <2 x double> %104)
%110 = extractelement <2 x double> %109, i64 0
%111 = extractelement <2 x double> %109, i64 1
%112 = fdiv double %110, %111
%113 = fcmp ole double %35, 0.000000e+00
%114 = fcmp oge double %112, 0.000000e+00
%115 = select i1 %113, i1 %114, i1 false
br i1 %115, label %116, label %121
116: ; preds = %55
%117 = getelementptr inbounds double, double* %0, i64 2
%118 = load double, double* %117
%119 = fmul double %73, %118
%120 = getelementptr inbounds double, double* %2, i64 2
store double %119, double* %120
br label %137
121: ; preds = %55
%122 = fcmp ole double %112, 0.000000e+00
%123 = fcmp oge double %47, 0.000000e+00
%124 = select i1 %122, i1 %123, i1 false
br i1 %124, label %125, label %130
125: ; preds = %121
%126 = getelementptr inbounds double, double* %1, i64 2
%127 = load double, double* %126
%128 = fmul double %73, %127
%129 = getelementptr inbounds double, double* %2, i64 2
store double %128, double* %129
br label %137
130: ; preds = %121
%131 = getelementptr inbounds double, double* %0, i64 2
%132 = load double, double* %131
%133 = getelementptr inbounds double, double* %1, i64 2
%134 = load double, double* %133
%135 = call i32 (i8*, double, double, double, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), double %94, double %95, double %132, double %90, double %92, double %134)
%136 = call i32 (i8*, double, double, double, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), double %35, double %47, double %112)
br label %137
137: ; preds = %125, %130, %116
br label %138
138: ; preds = %53, %137, %49
ret void
}