#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 SIM_power_restowidth(double, int);
double log(double);
double SIM_power_driver_size(double driving_cap, double desiredrisetime) {
  double nsize, psize;
  double Rpdrive;
  Rpdrive = desiredrisetime / (driving_cap * log((4.560000e-01)) * -1.0);
  psize = SIM_power_restowidth(Rpdrive, 0);
  nsize = SIM_power_restowidth(Rpdrive, 1);
  if (psize > (100.0 * 0.0875)) {
    psize = (100.0 * 0.0875);
  }
  if (psize < 4.0 * 0.0875)
    psize = 4.0 * 0.0875;
  return (psize);
}


x86 assembly (clang, -O0):
<SIM_power_driver_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xec2(%rip),%xmm0
call   1040 <log@plt>
movsd  -0x38(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm2,%xmm1
movsd  0xe9c(%rip),%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
xor    %edi,%edi
call   1030 <SIM_power_restowidth@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x28(%rbp),%xmm0
mov    $0x1,%edi
call   1030 <SIM_power_restowidth@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xe55(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11c2 <SIM_power_driver_size+0xa2>
movsd  0xe43(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe4e(%rip),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    11e2 <SIM_power_driver_size+0xc2>
movsd  0xe3b(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SIM_power_driver_size>:
sub    $0x18,%rsp
mulsd  0xee4(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movapd %xmm1,%xmm0
xor    %edi,%edi
call   1030 <SIM_power_restowidth@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
mov    $0x1,%edi
call   1030 <SIM_power_restowidth@plt>
movsd  0xeb9(%rip),%xmm1
minsd  0x10(%rsp),%xmm1
movsd  0xeb3(%rip),%xmm0
maxsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @SIM_power_driver_size(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 = load double, double* %3
%10 = call double @log(double 4.560000e-01)
%11 = fmul double %9, %10
%12 = fmul double %11, -1.000000e+00
%13 = fdiv double %8, %12
store double %13, double* %7
%14 = load double, double* %7
%15 = call double @SIM_power_restowidth(double %14, i32 0)
store double %15, double* %6
%16 = load double, double* %7
%17 = call double @SIM_power_restowidth(double %16, i32 1)
store double %17, double* %5
%18 = load double, double* %6
%19 = fcmp ogt double %18, 8.750000e+00
br i1 %19, label %20, label %21
20: ; preds = %2
store double 8.750000e+00, double* %6
br label %21
21: ; preds = %20, %2
%22 = load double, double* %6
%23 = fcmp olt double %22, 3.500000e-01
br i1 %23, label %24, label %25
24: ; preds = %21
store double 3.500000e-01, double* %6
br label %25
25: ; preds = %24, %21
%26 = load double, double* %6
ret double %26
}

LLVM IR (-O2):
define double @SIM_power_driver_size(double %0, double %1) {
%3 = fmul double %0, 0x3FE920DEC2247C6D
%4 = fdiv double %1, %3
%5 = tail call double @SIM_power_restowidth(double %4, i32 0)
%6 = tail call double @SIM_power_restowidth(double %4, i32 1)
%7 = fcmp ogt double %5, 8.750000e+00
%8 = select i1 %7, double 8.750000e+00, double %5
%9 = fcmp olt double %8, 3.500000e-01
%10 = select i1 %9, double 3.500000e-01, double %8
ret double %10
}