#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 zom_0(double ndvi, double ndvi_max) {
  double a, b, zom;
  double hv_ndvimax = 1.0;
  double hv_desert = 0.0002;
  a = (log(hv_desert) -
       ((log(hv_ndvimax / 7) - log(hv_desert)) / (ndvi_max - 0.02) * 0.002));
  b = (log(hv_ndvimax / 7) - log(hv_desert)) / (ndvi_max - 0.02);
  zom = exp(a + b * ndvi);
  return zom;
}


x86 assembly (clang, -O0):
<zom_0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xee6(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xed1(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
call   1040 <log@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  0xea0(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1040 <log@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  -0x38(%rbp),%xmm0
call   1040 <log@plt>
movsd  -0x50(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x48(%rbp),%xmm0
subsd  %xmm2,%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  0xe62(%rip),%xmm3
subsd  %xmm3,%xmm2
divsd  %xmm2,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xe4b(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  0xe29(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1040 <log@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x38(%rbp),%xmm0
call   1040 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xdf0(%rip),%xmm2
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zom_0>:
addsd  0xee8(%rip),%xmm1
movsd  0xee8(%rip),%xmm2
divsd  %xmm1,%xmm2
movsd  0xee4(%rip),%xmm1
mulsd  %xmm2,%xmm1
addsd  0xee0(%rip),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
jmp    1030 <exp@plt>

LLVM IR (-O0):
define double @zom_0(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %3
store double %1, double* %4
store double 1.000000e+00, double* %8
store double 2.000000e-04, double* %9
%10 = load double, double* %9
%11 = call double @log(double %10)
%12 = load double, double* %8
%13 = fdiv double %12, 7.000000e+00
%14 = call double @log(double %13)
%15 = load double, double* %9
%16 = call double @log(double %15)
%17 = fsub double %14, %16
%18 = load double, double* %4
%19 = fsub double %18, 2.000000e-02
%20 = fdiv double %17, %19
%21 = fneg double %20
%22 = call double @llvm.fmuladd.f64(double %21, double 2.000000e-03, double %11)
store double %22, double* %5
%23 = load double, double* %8
%24 = fdiv double %23, 7.000000e+00
%25 = call double @log(double %24)
%26 = load double, double* %9
%27 = call double @log(double %26)
%28 = fsub double %25, %27
%29 = load double, double* %4
%30 = fsub double %29, 2.000000e-02
%31 = fdiv double %28, %30
store double %31, double* %6
%32 = load double, double* %5
%33 = load double, double* %6
%34 = load double, double* %3
%35 = call double @llvm.fmuladd.f64(double %33, double %34, double %32)
%36 = call double @exp(double %35)
store double %36, double* %7
%37 = load double, double* %7
ret double %37
}

LLVM IR (-O2):
define double @zom_0(double %0, double %1) {
%3 = fadd double %1, -2.000000e-02
%4 = fdiv double 0x401A48FE6BFECC58, %3
%5 = fneg double %4
%6 = tail call double @llvm.fmuladd.f64(double %5, double 2.000000e-03, double 0xC02108CD8BC5B177)
%7 = tail call double @llvm.fmuladd.f64(double %4, double %0, double %6)
%8 = tail call double @exp(double %7)
ret double %8
}