#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 sqrt(double);
double dcs_photonuclear_phn_Kokoulin(double q) {
  if (q <= 17.) {
    return 96.1 + 82. / sqrt(q);
  } else if (q <= 200.) {
    const double aux = log(0.0213 * q);
    return 114.3 + 1.647 * aux * aux;
  } else {
    return 49.2 + 11.1 * log(q) + 151.8 / sqrt(q);
  }
}


x86 assembly (clang, -O0):
<dcs_photonuclear_phn_Kokoulin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  0xecb(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     116c <dcs_photonuclear_phn_Kokoulin+0x4c>
movsd  -0x10(%rbp),%xmm0
call   1040 <sqrt@plt>
movsd  0xef6(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  0xee2(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1210 <dcs_photonuclear_phn_Kokoulin+0xf0>
movsd  0xe94(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     11c2 <dcs_photonuclear_phn_Kokoulin+0xa2>
movsd  0xeb1(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
call   1030 <log@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  0xe92(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe74(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1210 <dcs_photonuclear_phn_Kokoulin+0xf0>
movsd  -0x10(%rbp),%xmm0
call   1030 <log@plt>
movsd  0xe44(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe40(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
movsd  0xe0d(%rip),%xmm1
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcs_photonuclear_phn_Kokoulin>:
push   %rax
movsd  0xed7(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    1173 <dcs_photonuclear_phn_Kokoulin+0x53>
movsd  0xee1(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    1183 <dcs_photonuclear_phn_Kokoulin+0x63>
movsd  %xmm0,(%rsp)
call   1030 <log@plt>
movsd  (%rsp),%xmm1
movapd %xmm0,%xmm2
mulsd  0xee0(%rip),%xmm2
addsd  0xee0(%rip),%xmm2
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jb     11c5 <dcs_photonuclear_phn_Kokoulin+0xa5>
xorps  %xmm0,%xmm0
sqrtsd %xmm1,%xmm0
jmp    11d8 <dcs_photonuclear_phn_Kokoulin+0xb8>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     11aa <dcs_photonuclear_phn_Kokoulin+0x8a>
sqrtsd %xmm0,%xmm0
jmp    11af <dcs_photonuclear_phn_Kokoulin+0x8f>
mulsd  0xe95(%rip),%xmm0
call   1030 <log@plt>
movsd  0xe90(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
addsd  0xe88(%rip),%xmm0
pop    %rax
ret
call   1040 <sqrt@plt>
movsd  0xe51(%rip),%xmm2
divsd  %xmm0,%xmm2
addsd  0xe4d(%rip),%xmm2
jmp    11e8 <dcs_photonuclear_phn_Kokoulin+0xc8>
movapd %xmm1,%xmm0
movsd  %xmm2,(%rsp)
call   1040 <sqrt@plt>
movsd  (%rsp),%xmm2
movsd  0xe68(%rip),%xmm1
divsd  %xmm0,%xmm1
addsd  %xmm1,%xmm2
movapd %xmm2,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @dcs_photonuclear_phn_Kokoulin(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %3
%5 = load double, double* %3
%6 = fcmp ole double %5, 1.700000e+01
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load double, double* %3
%9 = call double @sqrt(double %8)
%10 = fdiv double 8.200000e+01, %9
%11 = fadd double 0x4058066666666666, %10
store double %11, double* %2
br label %31
12: ; preds = %1
%13 = load double, double* %3
%14 = fcmp ole double %13, 2.000000e+02
br i1 %14, label %15, label %23
15: ; preds = %12
%16 = load double, double* %3
%17 = fmul double 2.130000e-02, %16
%18 = call double @log(double %17)
store double %18, double* %4
%19 = load double, double* %4
%20 = fmul double 1.647000e+00, %19
%21 = load double, double* %4
%22 = call double @llvm.fmuladd.f64(double %20, double %21, double 1.143000e+02)
store double %22, double* %2
br label %31
23: ; preds = %12
%24 = load double, double* %3
%25 = call double @log(double %24)
%26 = call double @llvm.fmuladd.f64(double 1.110000e+01, double %25, double 4.920000e+01)
%27 = load double, double* %3
%28 = call double @sqrt(double %27)
%29 = fdiv double 1.518000e+02, %28
%30 = fadd double %26, %29
store double %30, double* %2
br label %31
31: ; preds = %23, %15, %7
%32 = load double, double* %2
ret double %32
}

LLVM IR (-O2):
define double @dcs_photonuclear_phn_Kokoulin(double %0) {
%2 = fcmp ugt double %0, 1.700000e+01
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call double @sqrt(double %0)
%5 = fdiv double 8.200000e+01, %4
%6 = fadd double %5, 0x4058066666666666
br label %20
7: ; preds = %1
%8 = fcmp ugt double %0, 2.000000e+02
br i1 %8, label %14, label %9
9: ; preds = %7
%10 = fmul double %0, 2.130000e-02
%11 = tail call double @log(double %10)
%12 = fmul double %11, 1.647000e+00
%13 = tail call double @llvm.fmuladd.f64(double %12, double %11, double 1.143000e+02)
br label %20
14: ; preds = %7
%15 = tail call double @log(double %0)
%16 = tail call double @llvm.fmuladd.f64(double %15, double 1.110000e+01, double 4.920000e+01)
%17 = tail call double @sqrt(double %0)
%18 = fdiv double 1.518000e+02, %17
%19 = fadd double %16, %18
br label %20
20: ; preds = %14, %9, %3
%21 = phi double [ %6, %3 ], [ %13, %9 ], [ %19, %14 ]
ret double %21
}