#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 pow(double, double);
double sqrt(double);
double STS_CorrectTimeStep(int n0, double dta) {
  double a, b, c;
  double dtr;
  a = (1.0 - sqrt(0.01)) / (1.0 + sqrt(0.01));
  b = pow(a, 2.0 * n0);
  c = (1.0 - b) / (1.0 + b);
  dtr = dta * 2.0 * sqrt(0.01) / (n0 * c);
  return (dtr);
}


x86 assembly (clang, -O0):
<STS_CorrectTimeStep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  0xec8(%rip),%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xec8(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xea7(%rip),%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm2
movsd  -0x40(%rbp),%xmm0
movsd  0xea2(%rip),%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
cvtsi2sdl -0x4(%rbp),%xmm2
movsd  0xe7b(%rip),%xmm1
mulsd  %xmm2,%xmm1
call   1030 <pow@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  0xe6d(%rip),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  0xe60(%rip),%xmm1
addsd  -0x20(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe42(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe28(%rip),%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<STS_CorrectTimeStep>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
cvtsi2sd %edi,%xmm1
movsd  %xmm1,0x10(%rsp)
addsd  %xmm1,%xmm1
movsd  0xed0(%rip),%xmm0
call   1030 <pow@plt>
movsd  0xecb(%rip),%xmm1
movapd %xmm1,%xmm2
subsd  %xmm0,%xmm2
addsd  %xmm1,%xmm0
divsd  %xmm0,%xmm2
movsd  0x8(%rsp),%xmm0
addsd  %xmm0,%xmm0
mulsd  0xeb1(%rip),%xmm0
mulsd  0x10(%rsp),%xmm2
divsd  %xmm2,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @STS_CorrectTimeStep(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
%9 = call double @sqrt(double 1.000000e-02)
%10 = fsub double 1.000000e+00, %9
%11 = call double @sqrt(double 1.000000e-02)
%12 = fadd double 1.000000e+00, %11
%13 = fdiv double %10, %12
store double %13, double* %5
%14 = load double, double* %5
%15 = load i32, i32* %3
%16 = sitofp i32 %15 to double
%17 = fmul double 2.000000e+00, %16
%18 = call double @pow(double %14, double %17)
store double %18, double* %6
%19 = load double, double* %6
%20 = fsub double 1.000000e+00, %19
%21 = load double, double* %6
%22 = fadd double 1.000000e+00, %21
%23 = fdiv double %20, %22
store double %23, double* %7
%24 = load double, double* %4
%25 = fmul double %24, 2.000000e+00
%26 = call double @sqrt(double 1.000000e-02)
%27 = fmul double %25, %26
%28 = load i32, i32* %3
%29 = sitofp i32 %28 to double
%30 = load double, double* %7
%31 = fmul double %29, %30
%32 = fdiv double %27, %31
store double %32, double* %8
%33 = load double, double* %8
ret double %33
}

LLVM IR (-O2):
define double @STS_CorrectTimeStep(i32 %0, double %1) {
%3 = sitofp i32 %0 to double
%4 = fmul double %3, 2.000000e+00
%5 = tail call double @pow(double 0x3FEA2E8BA2E8BA2E, double %4)
%6 = fsub double 1.000000e+00, %5
%7 = fadd double %5, 1.000000e+00
%8 = fdiv double %6, %7
%9 = fmul double %1, 2.000000e+00
%10 = fmul double %9, 1.000000e-01
%11 = fmul double %8, %3
%12 = fdiv double %10, %11
ret double %12
}