#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*/ conservativeToPrimitive(double *, double *);
double fabs(double);
double sqrt(double);
double getMaxAbsEigenValue(double U[]) {
  double primVar[3];
  conservativeToPrimitive(U, primVar);
  double rho = primVar[0];
  double u = primVar[1];
  double p = primVar[2];
  return fabs(u) + sqrt(1.4 * p / rho);
}


x86 assembly (clang, -O0):
<getMaxAbsEigenValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <conservativeToPrimitive@plt>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
movaps 0xead(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xe8c(%rip),%xmm0
mulsd  -0x38(%rbp),%xmm0
divsd  -0x28(%rbp),%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
addsd  %xmm1,%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getMaxAbsEigenValue>:
sub    $0x38,%rsp
mov    %rsp,%rsi
call   1040 <conservativeToPrimitive@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm2
andpd  0xec0(%rip),%xmm2
mulsd  0xec8(%rip),%xmm0
divsd  (%rsp),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     115d <getMaxAbsEigenValue+0x3d>
sqrtsd %xmm0,%xmm0
jmp    116e <getMaxAbsEigenValue+0x4e>
movapd %xmm2,0x20(%rsp)
call   1030 <sqrt@plt>
movapd 0x20(%rsp),%xmm2
addsd  %xmm0,%xmm2
movapd %xmm2,%xmm0
add    $0x38,%rsp
ret

LLVM IR (-O0):
define double @getMaxAbsEigenValue(double* %0) {
%2 = alloca double*
%3 = alloca [3 x double]
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double* %0, double** %2
%7 = load double*, double** %2
%8 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 0
%9 = call i32 @conservativeToPrimitive(double* %7, double* %8)
%10 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 0
%11 = load double, double* %10
store double %11, double* %4
%12 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 1
%13 = load double, double* %12
store double %13, double* %5
%14 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 2
%15 = load double, double* %14
store double %15, double* %6
%16 = load double, double* %5
%17 = call double @llvm.fabs.f64(double %16)
%18 = load double, double* %6
%19 = fmul double 1.400000e+00, %18
%20 = load double, double* %4
%21 = fdiv double %19, %20
%22 = call double @sqrt(double %21)
%23 = fadd double %17, %22
ret double %23
}

LLVM IR (-O2):
define double @getMaxAbsEigenValue(double* %0) {
%2 = alloca [3 x double]
%3 = bitcast [3 x double]* %2 to i8*
%4 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 0
%5 = call i32 @conservativeToPrimitive(double* %0, double* %4)
%6 = load double, double* %4
%7 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 1
%8 = load double, double* %7
%9 = getelementptr inbounds [3 x double], [3 x double]* %2, i64 0, i64 2
%10 = load double, double* %9
%11 = call double @llvm.fabs.f64(double %8)
%12 = fmul double %10, 1.400000e+00
%13 = fdiv double %12, %6
%14 = call double @sqrt(double %13)
%15 = fadd double %11, %14
ret double %15
}