#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 log(double);
double usoilbare_func(double Zref, double Zu, double d0m, double z0m,
                      double Psimr, double Psim, double u) {
  double numer, denom, usoil;
  numer = log((Zref - d0m) / z0m) - Psimr;
  denom = log((Zu - d0m) / z0m) - Psim;
  usoil = (numer / denom) * u;
  return (usoil);
}


x86 assembly (clang, -O0):
<usoilbare_func>:
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  %xmm6,-0x38(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
call   1030 <log@plt>
subsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
call   1030 <log@plt>
subsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x40(%rbp),%xmm0
divsd  -0x48(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usoilbare_func>:
sub    $0x38,%rsp
movsd  %xmm6,0x30(%rsp)
movsd  %xmm5,0x28(%rsp)
movsd  %xmm4,0x8(%rsp)
movsd  %xmm3,0x18(%rsp)
movsd  %xmm2,0x10(%rsp)
movsd  %xmm1,0x20(%rsp)
subsd  %xmm2,%xmm0
divsd  %xmm3,%xmm0
call   1030 <log@plt>
subsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x20(%rsp),%xmm0
subsd  0x10(%rsp),%xmm0
divsd  0x18(%rsp),%xmm0
call   1030 <log@plt>
subsd  0x28(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
mulsd  0x30(%rsp),%xmm1
movapd %xmm1,%xmm0
add    $0x38,%rsp
ret

LLVM IR (-O0):
define double @usoilbare_func(double %0, double %1, double %2, double %3, double %4, double %5, double %6) {
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
store double %0, double* %8
store double %1, double* %9
store double %2, double* %10
store double %3, double* %11
store double %4, double* %12
store double %5, double* %13
store double %6, double* %14
%18 = load double, double* %8
%19 = load double, double* %10
%20 = fsub double %18, %19
%21 = load double, double* %11
%22 = fdiv double %20, %21
%23 = call double @log(double %22)
%24 = load double, double* %12
%25 = fsub double %23, %24
store double %25, double* %15
%26 = load double, double* %9
%27 = load double, double* %10
%28 = fsub double %26, %27
%29 = load double, double* %11
%30 = fdiv double %28, %29
%31 = call double @log(double %30)
%32 = load double, double* %13
%33 = fsub double %31, %32
store double %33, double* %16
%34 = load double, double* %15
%35 = load double, double* %16
%36 = fdiv double %34, %35
%37 = load double, double* %14
%38 = fmul double %36, %37
store double %38, double* %17
%39 = load double, double* %17
ret double %39
}

LLVM IR (-O2):
define double @usoilbare_func(double %0, double %1, double %2, double %3, double %4, double %5, double %6) {
%8 = fsub double %0, %2
%9 = fdiv double %8, %3
%10 = tail call double @log(double %9)
%11 = fsub double %10, %4
%12 = fsub double %1, %2
%13 = fdiv double %12, %3
%14 = tail call double @log(double %13)
%15 = fsub double %14, %5
%16 = fdiv double %11, %15
%17 = fmul double %16, %6
ret double %17
}