#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 rxnparam_erfccD(double);
double sqrt(double);
double actrxnrate(double step, double a) {
  double ka;
  if (step < 0 || a <= 0)
    return -1;
  if (step == 0)
    return 0;
  step /= a;
  ka = 4.0 * 3.14159265358979323846 / 3.0 *
       (rxnparam_erfccD(sqrt(2.0) / step) +
        step * sqrt(2.0 / 3.14159265358979323846));
  ka += 2.0 * 2.50662827462 / 3.0 * step * (step * step - 1.0) *
        (exp(-2.0 / step / step) - 1.0);
  return ka * a * a * a;
}


x86 assembly (clang, -O0):
<actrxnrate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
ja     115e <actrxnrate+0x2e>
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     1170 <actrxnrate+0x40>
movsd  0xeaa(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1287 <actrxnrate+0x157>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1195 <actrxnrate+0x65>
jp     1195 <actrxnrate+0x65>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1287 <actrxnrate+0x157>
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xe80(%rip),%xmm0
call   1050 <sqrt@plt>
divsd  -0x10(%rbp),%xmm0
call   1030 <rxnparam_erfccD@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe52(%rip),%xmm0
call   1050 <sqrt@plt>
movsd  -0x38(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xe28(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe0f(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xdec(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xdcf(%rip),%xmm0
divsd  -0x10(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1040 <exp@plt>
movaps %xmm0,%xmm2
movsd  -0x28(%rbp),%xmm0
movsd  0xda8(%rip),%xmm1
subsd  %xmm1,%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<actrxnrate>:
sub    $0x28,%rsp
movapd %xmm0,%xmm3
xorpd  %xmm2,%xmm2
ucomisd %xmm0,%xmm2
movsd  0xec8(%rip),%xmm0
ja     114c <actrxnrate+0x2c>
ucomisd %xmm1,%xmm2
jae    114c <actrxnrate+0x2c>
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm3
jne    1151 <actrxnrate+0x31>
jp     1151 <actrxnrate+0x31>
add    $0x28,%rsp
ret
divsd  %xmm1,%xmm3
movsd  %xmm3,0x8(%rsp)
movsd  0xea5(%rip),%xmm0
divsd  %xmm3,%xmm0
movsd  %xmm1,0x20(%rsp)
call   1030 <rxnparam_erfccD@plt>
movsd  0xe96(%rip),%xmm1
movsd  0x8(%rsp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mulsd  0xe88(%rip),%xmm1
movsd  %xmm1,0x18(%rsp)
movsd  0xe82(%rip),%xmm0
mulsd  %xmm2,%xmm0
movapd %xmm2,%xmm1
mulsd  %xmm2,%xmm1
addsd  0xe4e(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
movsd  0xe64(%rip),%xmm0
divsd  %xmm2,%xmm0
divsd  %xmm2,%xmm0
call   1040 <exp@plt>
addsd  0xe27(%rip),%xmm0
mulsd  0x10(%rsp),%xmm0
addsd  0x18(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @actrxnrate(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
%7 = load double, double* %4
%8 = fcmp olt double %7, 0.000000e+00
br i1 %8, label %12, label %9
9: ; preds = %2
%10 = load double, double* %5
%11 = fcmp ole double %10, 0.000000e+00
br i1 %11, label %12, label %13
12: ; preds = %9, %2
store double -1.000000e+00, double* %3
br label %50
13: ; preds = %9
%14 = load double, double* %4
%15 = fcmp oeq double %14, 0.000000e+00
br i1 %15, label %16, label %17
16: ; preds = %13
store double 0.000000e+00, double* %3
br label %50
17: ; preds = %13
%18 = load double, double* %5
%19 = load double, double* %4
%20 = fdiv double %19, %18
store double %20, double* %4
%21 = call double @sqrt(double 2.000000e+00)
%22 = load double, double* %4
%23 = fdiv double %21, %22
%24 = call double @rxnparam_erfccD(double %23)
%25 = load double, double* %4
%26 = call double @sqrt(double 0x3FE45F306DC9C883)
%27 = call double @llvm.fmuladd.f64(double %25, double %26, double %24)
%28 = fmul double 0x4010C152382D7365, %27
store double %28, double* %6
%29 = load double, double* %4
%30 = fmul double 0x3FFABCC42A9D0859, %29
%31 = load double, double* %4
%32 = load double, double* %4
%33 = call double @llvm.fmuladd.f64(double %31, double %32, double -1.000000e+00)
%34 = fmul double %30, %33
%35 = load double, double* %4
%36 = fdiv double -2.000000e+00, %35
%37 = load double, double* %4
%38 = fdiv double %36, %37
%39 = call double @exp(double %38)
%40 = fsub double %39, 1.000000e+00
%41 = load double, double* %6
%42 = call double @llvm.fmuladd.f64(double %34, double %40, double %41)
store double %42, double* %6
%43 = load double, double* %6
%44 = load double, double* %5
%45 = fmul double %43, %44
%46 = load double, double* %5
%47 = fmul double %45, %46
%48 = load double, double* %5
%49 = fmul double %47, %48
store double %49, double* %3
br label %50
50: ; preds = %17, %16, %12
%51 = load double, double* %3
ret double %51
}

LLVM IR (-O2):
define double @actrxnrate(double %0, double %1) {
%3 = fcmp olt double %0, 0.000000e+00
%4 = fcmp ole double %1, 0.000000e+00
%5 = or i1 %3, %4
br i1 %5, label %25, label %6
6: ; preds = %2
%7 = fcmp oeq double %0, 0.000000e+00
br i1 %7, label %25, label %8
8: ; preds = %6
%9 = fdiv double %0, %1
%10 = fdiv double 0x3FF6A09E667F3BCD, %9
%11 = tail call double @rxnparam_erfccD(double %10)
%12 = tail call double @llvm.fmuladd.f64(double %9, double 0x3FE9884533D43651, double %11)
%13 = fmul double %12, 0x4010C152382D7365
%14 = fmul double %9, 0x3FFABCC42A9D0859
%15 = tail call double @llvm.fmuladd.f64(double %9, double %9, double -1.000000e+00)
%16 = fmul double %14, %15
%17 = fdiv double -2.000000e+00, %9
%18 = fdiv double %17, %9
%19 = tail call double @exp(double %18)
%20 = fadd double %19, -1.000000e+00
%21 = tail call double @llvm.fmuladd.f64(double %16, double %20, double %13)
%22 = fmul double %21, %1
%23 = fmul double %22, %1
%24 = fmul double %23, %1
br label %25
25: ; preds = %6, %2, %8
%26 = phi double [ %24, %8 ], [ -1.000000e+00, %2 ], [ 0.000000e+00, %6 ]
ret double %26
}