#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 estimate_MOSFET_CG(int, double);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned int);
double pow(double, double);
int /*<<< orphan*/ stderr;
double estimate_btr_opt(unsigned nbstages_opt, double switching_CL) {
  fprintf(stderr, "in btr_opt nbstage_opt:%d\n", nbstages_opt);
  return pow((switching_CL / (estimate_MOSFET_CG(1, 3. * (0.18)) +
                              estimate_MOSFET_CG(0, 1.5 * 3. * (0.18)))),
             (1.0 / (double)nbstages_opt));
}


x86 assembly (clang, -O0):
<estimate_btr_opt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xec5(%rip),%rsi
call   1040 <fprintf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    $0x1,%edi
movsd  0xe99(%rip),%xmm0
call   1030 <estimate_MOSFET_CG@plt>
movsd  %xmm0,-0x20(%rbp)
xor    %edi,%edi
movsd  0xe8d(%rip),%xmm0
call   1030 <estimate_MOSFET_CG@plt>
movsd  -0x20(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x18(%rbp),%xmm0
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mov    -0x4(%rbp),%eax
cvtsi2sd %rax,%xmm2
movsd  0xe53(%rip),%xmm1
divsd  %xmm2,%xmm1
call   1050 <pow@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<estimate_btr_opt>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
mov    %edi,%ebx
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xecb(%rip),%rsi
mov    %ebx,%edx
call   1040 <fprintf@plt>
movsd  0xea4(%rip),%xmm0
mov    $0x1,%edi
call   1030 <estimate_MOSFET_CG@plt>
movsd  %xmm0,(%rsp)
movsd  0xe95(%rip),%xmm0
xor    %edi,%edi
call   1030 <estimate_MOSFET_CG@plt>
addsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm2
divsd  %xmm0,%xmm2
mov    %ebx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  0xe75(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm2,%xmm0
add    $0x10,%rsp
pop    %rbx
jmp    1050 <pow@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"in btr_opt nbstage_opt:%d\0A\00"
define double @estimate_btr_opt(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
%5 = load i32, i32* @stderr
%6 = load i32, i32* %3
%7 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load double, double* %4
%9 = call double @estimate_MOSFET_CG(i32 1, double 5.400000e-01)
%10 = call double @estimate_MOSFET_CG(i32 0, double 0x3FE9EB851EB851EB)
%11 = fadd double %9, %10
%12 = fdiv double %8, %11
%13 = load i32, i32* %3
%14 = uitofp i32 %13 to double
%15 = fdiv double 1.000000e+00, %14
%16 = call double @pow(double %12, double %15)
ret double %16
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"in btr_opt nbstage_opt:%d\0A\00"
define double @estimate_btr_opt(i32 %0, double %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = tail call double @estimate_MOSFET_CG(i32 1, double 5.400000e-01)
%6 = tail call double @estimate_MOSFET_CG(i32 0, double 0x3FE9EB851EB851EB)
%7 = fadd double %5, %6
%8 = fdiv double %1, %7
%9 = uitofp i32 %0 to double
%10 = fdiv double 1.000000e+00, %9
%11 = tail call double @pow(double %8, double %10)
ret double %11
}