#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 detSweepFreq(double t, double alpha) {
  double epsilon, ts;
  double denom;
  epsilon = 0.05 / alpha;
  ts = -2.0 * log(epsilon) / alpha;
  denom = epsilon + ((1.0 - epsilon) * exp(alpha * (t - ts)));
  return (epsilon / denom);
}


x86 assembly (clang, -O0):
<detSweepFreq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xed6(%rip),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <log@plt>
movaps %xmm0,%xmm1
movsd  0xeaf(%rip),%xmm0
mulsd  %xmm1,%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe87(%rip),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
subsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  -0x38(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
divsd  -0x28(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<detSweepFreq>:
sub    $0x28,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x20(%rsp)
movsd  0xec8(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
call   1040 <log@plt>
addsd  %xmm0,%xmm0
movsd  0x10(%rsp),%xmm1
divsd  %xmm1,%xmm0
movsd  0xeab(%rip),%xmm2
subsd  0x8(%rsp),%xmm2
movsd  %xmm2,0x18(%rsp)
addsd  0x20(%rsp),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
mulsd  0x18(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
addsd  %xmm1,%xmm0
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @detSweepFreq(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %3
store double %1, double* %4
%8 = load double, double* %4
%9 = fdiv double 5.000000e-02, %8
store double %9, double* %5
%10 = load double, double* %5
%11 = call double @log(double %10)
%12 = fmul double -2.000000e+00, %11
%13 = load double, double* %4
%14 = fdiv double %12, %13
store double %14, double* %6
%15 = load double, double* %5
%16 = load double, double* %5
%17 = fsub double 1.000000e+00, %16
%18 = load double, double* %4
%19 = load double, double* %3
%20 = load double, double* %6
%21 = fsub double %19, %20
%22 = fmul double %18, %21
%23 = call double @exp(double %22)
%24 = call double @llvm.fmuladd.f64(double %17, double %23, double %15)
store double %24, double* %7
%25 = load double, double* %5
%26 = load double, double* %7
%27 = fdiv double %25, %26
ret double %27
}

LLVM IR (-O2):
define double @detSweepFreq(double %0, double %1) {
%3 = fdiv double 5.000000e-02, %1
%4 = tail call double @log(double %3)
%5 = fmul double %4, 2.000000e+00
%6 = fdiv double %5, %1
%7 = fsub double 1.000000e+00, %3
%8 = fadd double %6, %0
%9 = fmul double %8, %1
%10 = tail call double @exp(double %9)
%11 = tail call double @llvm.fmuladd.f64(double %7, double %10, double %3)
%12 = fdiv double %3, %11
ret double %12
}