#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 log(double);
double ra_func_orig(double Zt, double d0m, double z0m, double Psih, double U,
                    double K, double Psim, double Zu) {
  double ra;
  double numer1, numer2, denom;
  double kB_1 = 2.0;
  double z0h;
  z0h = z0m / exp(kB_1);
  numer1 = log((Zu - d0m) / z0m) - Psim;
  numer2 = log((Zt - d0m) / z0h) - Psih;
  denom = K * K * U;
  ra = (numer1 * numer2) / denom;
  return (ra);
}


x86 assembly (clang, -O0):
<ra_func_orig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%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  %xmm7,-0x40(%rbp)
movsd  0xea5(%rip),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x68(%rbp),%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x78(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x40(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
call   1040 <log@plt>
subsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
divsd  -0x70(%rbp),%xmm0
call   1040 <log@plt>
subsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x30(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x50(%rbp),%xmm0
mulsd  -0x58(%rbp),%xmm0
divsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
add    $0x80,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define double @ra_func_orig(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7) {
%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
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
store double %0, double* %9
store double %1, double* %10
store double %2, double* %11
store double %3, double* %12
store double %4, double* %13
store double %5, double* %14
store double %6, double* %15
store double %7, double* %16
store double 2.000000e+00, double* %21
%23 = load double, double* %11
%24 = load double, double* %21
%25 = call double @exp(double %24)
%26 = fdiv double %23, %25
store double %26, double* %22
%27 = load double, double* %16
%28 = load double, double* %10
%29 = fsub double %27, %28
%30 = load double, double* %11
%31 = fdiv double %29, %30
%32 = call double @log(double %31)
%33 = load double, double* %15
%34 = fsub double %32, %33
store double %34, double* %18
%35 = load double, double* %9
%36 = load double, double* %10
%37 = fsub double %35, %36
%38 = load double, double* %22
%39 = fdiv double %37, %38
%40 = call double @log(double %39)
%41 = load double, double* %12
%42 = fsub double %40, %41
store double %42, double* %19
%43 = load double, double* %14
%44 = load double, double* %14
%45 = fmul double %43, %44
%46 = load double, double* %13
%47 = fmul double %45, %46
store double %47, double* %20
%48 = load double, double* %18
%49 = load double, double* %19
%50 = fmul double %48, %49
%51 = load double, double* %20
%52 = fdiv double %50, %51
store double %52, double* %17
%53 = load double, double* %17
ret double %53
}

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