#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 */
double exp(double);
double sqrt(double);
double rhocpyfunc(double rhonothor, double rhosoil, double absorptivity,
                  double K, double LAI, double clump_factor) {
  double expterm, fracterm, rho_sparse;
  expterm = exp(-2.0 * sqrt(absorptivity) * K * LAI * clump_factor);
  fracterm = (rhonothor - rhosoil) / (rhonothor * rhosoil - 1.0);
  rho_sparse =
      (rhonothor + fracterm * expterm) / (1.0 + rhonothor * fracterm * expterm);
  return (rho_sparse);
}


x86 assembly (clang, -O0):
<rhocpyfunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xeb5(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  -0x20(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe70(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  -0x40(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe29(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rhocpyfunc>:
sub    $0x28,%rsp
movsd  %xmm1,0x18(%rsp)
movsd  %xmm0,0x20(%rsp)
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm2
jb     1143 <rhocpyfunc+0x23>
xorps  %xmm0,%xmm0
sqrtsd %xmm2,%xmm0
jmp    116e <rhocpyfunc+0x4e>
movapd %xmm2,%xmm0
movsd  %xmm5,0x10(%rsp)
movsd  %xmm4,0x8(%rsp)
movsd  %xmm3,(%rsp)
call   1040 <sqrt@plt>
movsd  (%rsp),%xmm3
movsd  0x8(%rsp),%xmm4
movsd  0x10(%rsp),%xmm5
mulsd  0xe8a(%rip),%xmm0
mulsd  %xmm3,%xmm0
mulsd  %xmm4,%xmm0
mulsd  %xmm5,%xmm0
call   1030 <exp@plt>
movsd  0x20(%rsp),%xmm3
movapd %xmm3,%xmm2
movsd  0x18(%rsp),%xmm1
subsd  %xmm1,%xmm2
mulsd  %xmm3,%xmm1
addsd  0xe61(%rip),%xmm1
divsd  %xmm1,%xmm2
movapd %xmm2,%xmm1
mulsd  %xmm0,%xmm1
addsd  %xmm3,%xmm1
mulsd  %xmm3,%xmm2
mulsd  %xmm0,%xmm2
addsd  0xe49(%rip),%xmm2
divsd  %xmm2,%xmm1
movapd %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @rhocpyfunc(double %0, double %1, double %2, double %3, double %4, double %5) {
%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 double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%16 = load double, double* %9
%17 = call double @sqrt(double %16)
%18 = fmul double -2.000000e+00, %17
%19 = load double, double* %10
%20 = fmul double %18, %19
%21 = load double, double* %11
%22 = fmul double %20, %21
%23 = load double, double* %12
%24 = fmul double %22, %23
%25 = call double @exp(double %24)
store double %25, double* %13
%26 = load double, double* %7
%27 = load double, double* %8
%28 = fsub double %26, %27
%29 = load double, double* %7
%30 = load double, double* %8
%31 = call double @llvm.fmuladd.f64(double %29, double %30, double -1.000000e+00)
%32 = fdiv double %28, %31
store double %32, double* %14
%33 = load double, double* %7
%34 = load double, double* %14
%35 = load double, double* %13
%36 = call double @llvm.fmuladd.f64(double %34, double %35, double %33)
%37 = load double, double* %7
%38 = load double, double* %14
%39 = fmul double %37, %38
%40 = load double, double* %13
%41 = call double @llvm.fmuladd.f64(double %39, double %40, double 1.000000e+00)
%42 = fdiv double %36, %41
store double %42, double* %15
%43 = load double, double* %15
ret double %43
}

LLVM IR (-O2):
define double @rhocpyfunc(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = tail call double @sqrt(double %2)
%8 = fmul double %7, -2.000000e+00
%9 = fmul double %8, %3
%10 = fmul double %9, %4
%11 = fmul double %10, %5
%12 = tail call double @exp(double %11)
%13 = fsub double %0, %1
%14 = tail call double @llvm.fmuladd.f64(double %0, double %1, double -1.000000e+00)
%15 = fdiv double %13, %14
%16 = tail call double @llvm.fmuladd.f64(double %15, double %12, double %0)
%17 = fmul double %15, %0
%18 = tail call double @llvm.fmuladd.f64(double %17, double %12, double 1.000000e+00)
%19 = fdiv double %16, %18
ret double %19
}