#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 transition_rate_from_energies_with_hastings(double from, double to,
                                                   double num_from,
                                                   double num_to) {
  return (((1.) < ((num_from / num_to) *
                   exp(-(to - from) / (1e-3 * 1.9872041 * (273.15 + 37)))))
              ? (1.)
              : ((num_from / num_to) *
                 exp(-(to - from) / (1e-3 * 1.9872041 * (273.15 + 37))))) /
         num_from;
}


x86 assembly (clang, -O0):
<transition_rate_from_energies_with_hastings>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xea4(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe7f(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    119d <transition_rate_from_energies_with_hastings+0x8d>
movsd  0xe6d(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    11ef <transition_rate_from_energies_with_hastings+0xdf>
movsd  -0x18(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xe33(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<transition_rate_from_energies_with_hastings>:
sub    $0x18,%rsp
movsd  %xmm2,0x10(%rsp)
divsd  %xmm3,%xmm2
movsd  %xmm2,(%rsp)
subsd  %xmm0,%xmm1
divsd  0xed1(%rip),%xmm1
movsd  %xmm1,0x8(%rsp)
movapd %xmm1,%xmm0
call   1030 <exp@plt>
movapd %xmm0,%xmm1
mulsd  (%rsp),%xmm1
movsd  0xeb9(%rip),%xmm0
ucomisd %xmm0,%xmm1
ja     116d <transition_rate_from_energies_with_hastings+0x5d>
movsd  0x8(%rsp),%xmm0
call   1030 <exp@plt>
movsd  (%rsp),%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
divsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @transition_rate_from_energies_with_hastings(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %7
%10 = load double, double* %8
%11 = fdiv double %9, %10
%12 = load double, double* %6
%13 = load double, double* %5
%14 = fsub double %12, %13
%15 = fneg double %14
%16 = fdiv double %15, 0x3FE3B8FC86D5F2E9
%17 = call double @exp(double %16)
%18 = fmul double %11, %17
%19 = fcmp olt double 1.000000e+00, %18
br i1 %19, label %20, label %21
20: ; preds = %4
br label %32
21: ; preds = %4
%22 = load double, double* %7
%23 = load double, double* %8
%24 = fdiv double %22, %23
%25 = load double, double* %6
%26 = load double, double* %5
%27 = fsub double %25, %26
%28 = fneg double %27
%29 = fdiv double %28, 0x3FE3B8FC86D5F2E9
%30 = call double @exp(double %29)
%31 = fmul double %24, %30
br label %32
32: ; preds = %21, %20
%33 = phi double [ 1.000000e+00, %20 ], [ %31, %21 ]
%34 = load double, double* %7
%35 = fdiv double %33, %34
ret double %35
}

LLVM IR (-O2):
define double @transition_rate_from_energies_with_hastings(double %0, double %1, double %2, double %3) {
%5 = fdiv double %2, %3
%6 = fsub double %1, %0
%7 = fdiv double %6, 0xBFE3B8FC86D5F2E9
%8 = tail call double @exp(double %7)
%9 = fmul double %5, %8
%10 = fcmp ogt double %9, 1.000000e+00
br i1 %10, label %14, label %11
11: ; preds = %4
%12 = tail call double @exp(double %7)
%13 = fmul double %5, %12
br label %14
14: ; preds = %4, %11
%15 = phi double [ %13, %11 ], [ 1.000000e+00, %4 ]
%16 = fdiv double %15, %2
ret double %16
}