#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 cos(double const);
double sin(double const);
void TROPOSPHERE_GetDayAndWetMappingValues_UsingThe_UNBabc_MappingFunction(
    const double elevation, const double latitude, const double height,
    double *drymap, double *wetmap) {
  double a, b, c, num, dem, sine;
  if (elevation > (1.5707963267948966192313216916398))
    sine = 1.0;
  else if (elevation < 2.0 * (0.017453292519943295769236907684886))
    sine = sin(2.0 * (0.017453292519943295769236907684886));
  else
    sine = sin(elevation);
  a = (1.18972 - 0.026855 * height / 1000.0 + 0.10664 * cos(latitude)) / 1000.0;
  b = 0.0035716;
  c = 0.082456;
  num = 1.0 + (a / (1.0 + (b / (1.0 + c))));
  dem = sine + (a / (sine + (b / (sine + c))));
  *drymap = num / dem;
  a = (0.61120 - 0.035348 * height / 1000.0 - 0.01526 * cos(latitude)) / 1000.0;
  b = 0.0018576;
  c = 0.062741;
  num = 1.0 + (a / (1.0 + (b / (1.0 + c))));
  dem = sine + (a / (sine + (b / (sine + c))));
  *wetmap = num / dem;
}


x86 assembly (clang, -O0):
<TROPOSPHERE_GetDayAndWetMappingValues_UsingThe_UNBabc_MappingFunction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeb4(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1168 <TROPOSPHERE_GetDayAndWetMappingValues_UsingThe_UNBabc_MappingFunction+0x48>
movsd  0xeb2(%rip),%xmm0
movsd  %xmm0,-0x58(%rbp)
jmp    11a6 <TROPOSPHERE_GetDayAndWetMappingValues_UsingThe_UNBabc_MappingFunction+0x86>
movsd  0xe98(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1192 <TROPOSPHERE_GetDayAndWetMappingValues_UsingThe_UNBabc_MappingFunction+0x72>
movsd  0xe85(%rip),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x58(%rbp)
jmp    11a1 <TROPOSPHERE_GetDayAndWetMappingValues_UsingThe_UNBabc_MappingFunction+0x81>
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x58(%rbp)
jmp    11a6 <TROPOSPHERE_GetDayAndWetMappingValues_UsingThe_UNBabc_MappingFunction+0x86>
movsd  0xeba(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
movsd  0xe6d(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xe99(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <cos@plt>
movsd  -0x68(%rbp),%xmm1
movsd  0xe71(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe31(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe48(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe33(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x30(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm2
movsd  0xde4(%rip),%xmm0
addsd  -0x40(%rbp),%xmm0
divsd  %xmm0,%xmm2
movsd  0xdd3(%rip),%xmm0
addsd  %xmm2,%xmm0
divsd  %xmm0,%xmm1
movsd  0xdc3(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm3
movsd  -0x58(%rbp),%xmm4
addsd  -0x40(%rbp),%xmm4
divsd  %xmm4,%xmm3
addsd  %xmm3,%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x48(%rbp),%xmm0
divsd  -0x50(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0xd9d(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
movsd  0xd78(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xd7c(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <cos@plt>
movsd  -0x60(%rbp),%xmm1
movsd  0xd54(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xd3c(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xd23(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xd0e(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x30(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm2
movsd  0xcef(%rip),%xmm0
addsd  -0x40(%rbp),%xmm0
divsd  %xmm0,%xmm2
movsd  0xcde(%rip),%xmm0
addsd  %xmm2,%xmm0
divsd  %xmm0,%xmm1
movsd  0xcce(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm3
movsd  -0x58(%rbp),%xmm4
addsd  -0x40(%rbp),%xmm4
divsd  %xmm4,%xmm3
addsd  %xmm3,%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x48(%rbp),%xmm0
divsd  -0x50(%rbp),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TROPOSPHERE_GetDayAndWetMappingValues_UsingThe_UNBabc_MappingFunction>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movapd %xmm1,%xmm3
movsd  0xec7(%rip),%xmm1
ucomisd 0xec7(%rip),%xmm0
movsd  %xmm2,0x8(%rsp)
movsd  %xmm3,0x10(%rsp)
ja     117c <TROPOSPHERE_GetDayAndWetMappingValues_UsingThe_UNBabc_MappingFunction+0x5c>
movsd  0xec1(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1167 <TROPOSPHERE_GetDayAndWetMappingValues_UsingThe_UNBabc_MappingFunction+0x47>
movsd  0xeab(%rip),%xmm1
jmp    117c <TROPOSPHERE_GetDayAndWetMappingValues_UsingThe_UNBabc_MappingFunction+0x5c>
call   1030 <sin@plt>
movsd  0x10(%rsp),%xmm3
movsd  0x8(%rsp),%xmm2
movapd %xmm0,%xmm1
movsd  %xmm1,0x18(%rsp)
movsd  0xe96(%rip),%xmm0
mulsd  %xmm2,%xmm0
divsd  0xe92(%rip),%xmm0
addsd  0xe92(%rip),%xmm0
movsd  %xmm0,0x20(%rsp)
movapd %xmm3,%xmm0
call   1040 <cos@plt>
mulsd  0xe83(%rip),%xmm0
addsd  0x20(%rsp),%xmm0
movsd  0xe65(%rip),%xmm5
divsd  %xmm5,%xmm0
movapd %xmm0,%xmm1
divsd  0xe6d(%rip),%xmm1
movsd  0xe25(%rip),%xmm2
addsd  %xmm2,%xmm1
movsd  0xe61(%rip),%xmm2
movsd  0x18(%rsp),%xmm4
addsd  %xmm4,%xmm2
movsd  0xe57(%rip),%xmm3
divsd  %xmm2,%xmm3
addsd  %xmm4,%xmm3
divsd  %xmm3,%xmm0
addsd  %xmm4,%xmm0
divsd  %xmm0,%xmm1
movsd  0x8(%rsp),%xmm0
mulsd  0xe3d(%rip),%xmm0
movsd  %xmm1,(%rbx)
divsd  %xmm5,%xmm0
addsd  0xe35(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <cos@plt>
mulsd  0xe24(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
divsd  0xdd6(%rip),%xmm0
movapd %xmm0,%xmm1
divsd  0xe12(%rip),%xmm1
addsd  0xd9a(%rip),%xmm1
movsd  0xe0a(%rip),%xmm2
movsd  0x18(%rsp),%xmm4
addsd  %xmm4,%xmm2
movsd  0xe00(%rip),%xmm3
divsd  %xmm2,%xmm3
addsd  %xmm4,%xmm3
divsd  %xmm3,%xmm0
addsd  %xmm4,%xmm0
divsd  %xmm0,%xmm1
movsd  %xmm1,(%r14)
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @TROPOSPHERE_GetDayAndWetMappingValues_UsingThe_UNBabc_MappingFunction(double %0, double %1, double %2, double* %3, double* %4) {
%6 = alloca double
%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
%16 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double* %3, double** %9
store double* %4, double** %10
%17 = load double, double* %6
%18 = fcmp ogt double %17, 0x3FF921FB54442D18
br i1 %18, label %19, label %20
19: ; preds = %5
store double 1.000000e+00, double* %16
br label %29
20: ; preds = %5
%21 = load double, double* %6
%22 = fcmp olt double %21, 0x3FA1DF46A2529D39
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = call double @sin(double 0x3FA1DF46A2529D39)
store double %24, double* %16
br label %28
25: ; preds = %20
%26 = load double, double* %6
%27 = call double @sin(double %26)
store double %27, double* %16
br label %28
28: ; preds = %25, %23
br label %29
29: ; preds = %28, %19
%30 = load double, double* %8
%31 = fmul double 2.685500e-02, %30
%32 = fdiv double %31, 1.000000e+03
%33 = fsub double 1.189720e+00, %32
%34 = load double, double* %7
%35 = call double @cos(double %34)
%36 = call double @llvm.fmuladd.f64(double 1.066400e-01, double %35, double %33)
%37 = fdiv double %36, 1.000000e+03
store double %37, double* %11
store double 3.571600e-03, double* %12
store double 8.245600e-02, double* %13
%38 = load double, double* %11
%39 = load double, double* %12
%40 = load double, double* %13
%41 = fadd double 1.000000e+00, %40
%42 = fdiv double %39, %41
%43 = fadd double 1.000000e+00, %42
%44 = fdiv double %38, %43
%45 = fadd double 1.000000e+00, %44
store double %45, double* %14
%46 = load double, double* %16
%47 = load double, double* %11
%48 = load double, double* %16
%49 = load double, double* %12
%50 = load double, double* %16
%51 = load double, double* %13
%52 = fadd double %50, %51
%53 = fdiv double %49, %52
%54 = fadd double %48, %53
%55 = fdiv double %47, %54
%56 = fadd double %46, %55
store double %56, double* %15
%57 = load double, double* %14
%58 = load double, double* %15
%59 = fdiv double %57, %58
%60 = load double*, double** %9
store double %59, double* %60
%61 = load double, double* %8
%62 = fmul double 3.534800e-02, %61
%63 = fdiv double %62, 1.000000e+03
%64 = fsub double 0x3FE38EF34D6A161E, %63
%65 = load double, double* %7
%66 = call double @cos(double %65)
%67 = call double @llvm.fmuladd.f64(double -1.526000e-02, double %66, double %64)
%68 = fdiv double %67, 1.000000e+03
store double %68, double* %11
store double 1.857600e-03, double* %12
store double 6.274100e-02, double* %13
%69 = load double, double* %11
%70 = load double, double* %12
%71 = load double, double* %13
%72 = fadd double 1.000000e+00, %71
%73 = fdiv double %70, %72
%74 = fadd double 1.000000e+00, %73
%75 = fdiv double %69, %74
%76 = fadd double 1.000000e+00, %75
store double %76, double* %14
%77 = load double, double* %16
%78 = load double, double* %11
%79 = load double, double* %16
%80 = load double, double* %12
%81 = load double, double* %16
%82 = load double, double* %13
%83 = fadd double %81, %82
%84 = fdiv double %80, %83
%85 = fadd double %79, %84
%86 = fdiv double %78, %85
%87 = fadd double %77, %86
store double %87, double* %15
%88 = load double, double* %14
%89 = load double, double* %15
%90 = fdiv double %88, %89
%91 = load double*, double** %10
store double %90, double* %91
ret void
}

LLVM IR (-O2):
define void @TROPOSPHERE_GetDayAndWetMappingValues_UsingThe_UNBabc_MappingFunction(double %0, double %1, double %2, double* nocapture writeonly %3, double* nocapture writeonly %4) {
%6 = fcmp ogt double %0, 0x3FF921FB54442D18
br i1 %6, label %11, label %7
7: ; preds = %5
%8 = fcmp olt double %0, 0x3FA1DF46A2529D39
br i1 %8, label %11, label %9
9: ; preds = %7
%10 = tail call double @sin(double %0)
br label %11
11: ; preds = %7, %5, %9
%12 = phi double [ %10, %9 ], [ 1.000000e+00, %5 ], [ 0x3FA1DE58C9F7DC27, %7 ]
%13 = fmul double %2, 2.685500e-02
%14 = fdiv double %13, 1.000000e+03
%15 = fsub double 1.189720e+00, %14
%16 = tail call double @cos(double %1)
%17 = tail call double @llvm.fmuladd.f64(double %16, double 1.066400e-01, double %15)
%18 = fdiv double %17, 1.000000e+03
%19 = fdiv double %18, 0x3FF00D83CFD21D26
%20 = fadd double %19, 1.000000e+00
%21 = fadd double %12, 8.245600e-02
%22 = fdiv double 3.571600e-03, %21
%23 = fadd double %12, %22
%24 = fdiv double %18, %23
%25 = fadd double %12, %24
%26 = fdiv double %20, %25
store double %26, double* %3
%27 = fmul double %2, 3.534800e-02
%28 = fdiv double %27, 1.000000e+03
%29 = fsub double 0x3FE38EF34D6A161E, %28
%30 = tail call double @cos(double %1)
%31 = tail call double @llvm.fmuladd.f64(double %30, double -1.526000e-02, double %29)
%32 = fdiv double %31, 1.000000e+03
%33 = fdiv double %32, 0x3FF00728D72CF7E7
%34 = fadd double %33, 1.000000e+00
%35 = fadd double %12, 6.274100e-02
%36 = fdiv double 1.857600e-03, %35
%37 = fadd double %12, %36
%38 = fdiv double %32, %37
%39 = fadd double %12, %38
%40 = fdiv double %34, %39
store double %40, double* %4
ret void
}