#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 log10(double);
double dcs_photonuclear_shadowing_DRSS(double Z, double A, double x) {
  if (Z == 1.)
    return 1.;
  if (x < 0.0014)
    return exp(-0.1 * log(A));
  else if (x < 0.04)
    return exp((0.069 * log10(x) + 0.097) * log(A));
  else
    return 1.;
}


x86 assembly (clang, -O0):
<dcs_photonuclear_shadowing_DRSS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xeac(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1176 <dcs_photonuclear_shadowing_DRSS+0x46>
jp     1176 <dcs_photonuclear_shadowing_DRSS+0x46>
movsd  0xe94(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    121d <dcs_photonuclear_shadowing_DRSS+0xed>
movsd  0xe8a(%rip),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    11b1 <dcs_photonuclear_shadowing_DRSS+0x81>
movsd  -0x18(%rbp),%xmm0
call   1040 <log@plt>
movaps %xmm0,%xmm1
movsd  0xe8a(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    121d <dcs_photonuclear_shadowing_DRSS+0xed>
movsd  0xe57(%rip),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1210 <dcs_photonuclear_shadowing_DRSS+0xe0>
movsd  -0x20(%rbp),%xmm0
call   1050 <log10@plt>
movsd  0xe42(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe3e(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    121d <dcs_photonuclear_shadowing_DRSS+0xed>
movsd  0xde8(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcs_photonuclear_shadowing_DRSS>:
sub    $0x18,%rsp
ucomisd 0xec4(%rip),%xmm0
jne    114d <dcs_photonuclear_shadowing_DRSS+0x1d>
jp     114d <dcs_photonuclear_shadowing_DRSS+0x1d>
movsd  0xeb8(%rip),%xmm0
add    $0x18,%rsp
ret
movsd  0xeb3(%rip),%xmm0
ucomisd %xmm2,%xmm0
jbe    1172 <dcs_photonuclear_shadowing_DRSS+0x42>
movapd %xmm1,%xmm0
call   1040 <log@plt>
movapd %xmm0,%xmm1
movsd  0xeb8(%rip),%xmm0
jmp    11b6 <dcs_photonuclear_shadowing_DRSS+0x86>
movsd  0xe96(%rip),%xmm0
ucomisd %xmm2,%xmm0
jbe    1140 <dcs_photonuclear_shadowing_DRSS+0x10>
movapd %xmm2,%xmm0
movsd  %xmm1,0x10(%rsp)
call   1050 <log10@plt>
mulsd  0xe81(%rip),%xmm0
addsd  0xe81(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <log@plt>
movsd  0x8(%rsp),%xmm1
mulsd  %xmm1,%xmm0
add    $0x18,%rsp
jmp    1030 <exp@plt>

LLVM IR (-O0):
define double @dcs_photonuclear_shadowing_DRSS(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
%8 = load double, double* %5
%9 = fcmp oeq double %8, 1.000000e+00
br i1 %9, label %10, label %11
10: ; preds = %3
store double 1.000000e+00, double* %4
br label %31
11: ; preds = %3
%12 = load double, double* %7
%13 = fcmp olt double %12, 1.400000e-03
br i1 %13, label %14, label %19
14: ; preds = %11
%15 = load double, double* %6
%16 = call double @log(double %15)
%17 = fmul double -1.000000e-01, %16
%18 = call double @exp(double %17)
store double %18, double* %4
br label %31
19: ; preds = %11
%20 = load double, double* %7
%21 = fcmp olt double %20, 4.000000e-02
br i1 %21, label %22, label %30
22: ; preds = %19
%23 = load double, double* %7
%24 = call double @log10(double %23)
%25 = call double @llvm.fmuladd.f64(double 6.900000e-02, double %24, double 9.700000e-02)
%26 = load double, double* %6
%27 = call double @log(double %26)
%28 = fmul double %25, %27
%29 = call double @exp(double %28)
store double %29, double* %4
br label %31
30: ; preds = %19
store double 1.000000e+00, double* %4
br label %31
31: ; preds = %30, %22, %14, %10
%32 = load double, double* %4
ret double %32
}

LLVM IR (-O2):
define double @dcs_photonuclear_shadowing_DRSS(double %0, double %1, double %2) {
%4 = fcmp oeq double %0, 1.000000e+00
br i1 %4, label %20, label %5
5: ; preds = %3
%6 = fcmp olt double %2, 1.400000e-03
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = tail call double @log(double %1)
br label %15
9: ; preds = %5
%10 = fcmp olt double %2, 4.000000e-02
br i1 %10, label %11, label %20
11: ; preds = %9
%12 = tail call double @log10(double %2)
%13 = tail call double @llvm.fmuladd.f64(double %12, double 6.900000e-02, double 9.700000e-02)
%14 = tail call double @log(double %1)
br label %15
15: ; preds = %7, %11
%16 = phi double [ %14, %11 ], [ -1.000000e-01, %7 ]
%17 = phi double [ %13, %11 ], [ %8, %7 ]
%18 = fmul double %17, %16
%19 = tail call double @exp(double %18)
br label %20
20: ; preds = %15, %9, %3
%21 = phi double [ 1.000000e+00, %3 ], [ 1.000000e+00, %9 ], [ %19, %15 ]
ret double %21
}