double SIM_power_decoder_delay(C, B, A, Ndwl, Ndbl, Nspd, Ntwl, Ntbl, Ntspd,
                               Tdecdrive, Tdecoder1, Tdecoder2, outrisetime)
int C, B, A, Ndwl, Ndbl, Nspd, Ntwl, Ntbl, Ntspd;
double *Tdecdrive, *Tdecoder1, *Tdecoder2, *outrisetime;
{
  double Ceq, Req, Rwire, rows, tf, nextinputtime, vth = 0.0, tstep, m, a, b, c;
  int numstack;
  double z = 0.0;
  Ceq = SIM_power_draincap((57.0 * 0.0875), 0, 1) +
        SIM_power_draincap((40.0 * 0.0875), 1, 1) +
        SIM_power_gatecap((57.0 * 0.0875) + (40.0 * 0.0875), 0.0);
  tf = Ceq * SIM_power_transreson((40.0 * 0.0875), 1, 1);
  nextinputtime = SIM_power_horowitz(z, tf, (4.380000e-01), (4.380000e-01), 0) /
                  ((4.380000e-01));
  Ceq = SIM_power_draincap((57.0 * 0.0875), 0, 1) +
        SIM_power_draincap((40.0 * 0.0875), 1, 1) +
        SIM_power_gatecap((57.0 * 0.0875) + (40.0 * 0.0875), 0.0);
  tf = Ceq * SIM_power_transreson((40.0 * 0.0875), 1, 1);
  nextinputtime =
      SIM_power_horowitz(nextinputtime, tf, (4.380000e-01), (4.380000e-01), 1) /
      (1.0 - (4.380000e-01));
  rows = C / (8 * B * A * Ndbl * Nspd);
  Ceq = SIM_power_draincap((57.0 * 0.0875), 0, 1) +
        SIM_power_draincap((40.0 * 0.0875), 1, 1) +
        4 * SIM_power_gatecap((14.4 * 0.0875) + (14.4 * 0.0875), 10.0) *
            (Ndwl * Ndbl) +
        (1.8e-15 * ((172.2157) * (0.0875 * 0.0875))) * 0.25 * 8 * B * A * Ndbl *
            Nspd;
  Rwire = (0.080 * ((160.0000) * (0.0875 * 0.0875))) * 0.125 * 8 * B * A *
          Ndbl * Nspd;
  tf = (Rwire + SIM_power_transreson((57.0 * 0.0875), 0, 1)) * Ceq;
  *Tdecdrive =
      SIM_power_horowitz(nextinputtime, tf, (4.380000e-01), (5.610000e-01), 0);
  nextinputtime = *Tdecdrive / (5.610000e-01);
  numstack = ceil((1.0 / 3.0) *
                  logtwo((double)((double)C / (double)(B * A * Ndbl * Nspd))));
  if (numstack == 0)
    numstack = 1;
  if (numstack > 5)
    numstack = 5;
  Ceq = 3 * SIM_power_draincap((14.4 * 0.0875), 0, 1) +
        SIM_power_draincap((14.4 * 0.0875), 1, 3) +
        SIM_power_gatecap((5.4 * 0.0875) + (30.5 * 0.0875),
                          ((numstack * 40) + 20.0)) *
            rows +
        (4.4e-15 * ((172.2157) * (0.0875 * 0.0875))) * rows * 8;
  Rwire = (0.320 * ((160.0000) * (0.0875 * 0.0875))) * rows * 8 / 2;
  tf = Ceq * (Rwire + SIM_power_transreson((14.4 * 0.0875), 1, 3));
  switch (numstack) {
  case 1:
    vth = (5.030000e-01);
    break;
  case 2:
    vth = (4.520000e-01);
    break;
  case 3:
    vth = (4.170000e-01);
    break;
  case 4:
    vth = (3.900000e-01);
    break;
  case 5:
    vth = (3.900000e-01);
    break;
  default:
    printf("error:numstack=%d\n", numstack);
  }
  *Tdecoder1 = SIM_power_horowitz(nextinputtime, tf, (5.610000e-01), vth, 1);
  nextinputtime = *Tdecoder1 / (1.0 - vth);
  Req = SIM_power_transreson((30.5 * 0.0875), 0, numstack);
  Ceq = (SIM_power_gatecap((5.0 * 0.0875) + (10.0 * 0.0875), 20.0) +
         numstack * SIM_power_draincap((5.4 * 0.0875), 1, 1) +
         SIM_power_draincap((30.5 * 0.0875), 0, numstack));
  tf = Req * Ceq;
  *Tdecoder2 = SIM_power_horowitz(nextinputtime, tf, vth, (4.560000e-01), 0);
  *outrisetime = *Tdecoder2 / ((4.560000e-01));
  return (*Tdecdrive + *Tdecoder1 + *Tdecoder2);
}


x86 assembly (clang, -O0):
<SIM_power_decoder_delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
mov    0x40(%rbp),%rax
mov    0x38(%rbp),%rax
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  0xe55(%rip),%xmm0
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x1,%al
call   1060 <SIM_power_draincap@plt>
mov    %eax,-0xb8(%rbp)
movsd  0xe61(%rip),%xmm0
mov    $0x1,%esi
mov    %esi,%edi
mov    $0x1,%al
call   1060 <SIM_power_draincap@plt>
mov    %eax,%ecx
mov    -0xb8(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xb4(%rbp)
movsd  0xe4b(%rip),%xmm0
xorps  %xmm1,%xmm1
mov    $0x2,%al
call   1090 <SIM_power_gatecap@plt>
mov    %eax,%ecx
mov    -0xb4(%rbp),%eax
add    %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  0xe09(%rip),%xmm0
mov    $0x1,%esi
mov    %esi,%edi
mov    $0x1,%al
call   1030 <SIM_power_transreson@plt>
movsd  -0xb0(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x88(%rbp),%xmm0
ff
movsd  -0x40(%rbp),%xmm1
movsd  0xda1(%rip),%xmm3
xor    %edi,%edi
movaps %xmm3,%xmm2
mov    $0x4,%al
call   1070 <SIM_power_horowitz@plt>
cvtsi2sd %eax,%xmm0
movsd  0xd89(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xd80(%rip),%xmm0
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x1,%al
call   1060 <SIM_power_draincap@plt>
mov    %eax,-0xa8(%rbp)
movsd  0xd8c(%rip),%xmm0
mov    $0x1,%esi
mov    %esi,%edi
mov    $0x1,%al
call   1060 <SIM_power_draincap@plt>
mov    %eax,%ecx
mov    -0xa8(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xa4(%rbp)
movsd  0xd76(%rip),%xmm0
xorps  %xmm1,%xmm1
mov    $0x2,%al
call   1090 <SIM_power_gatecap@plt>
mov    %eax,%ecx
mov    -0xa4(%rbp),%eax
add    %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  0xd34(%rip),%xmm0
mov    $0x1,%esi
mov    %esi,%edi
mov    $0x1,%al
call   1030 <SIM_power_transreson@plt>
movsd  -0xa0(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
movsd  0xccf(%rip),%xmm3
mov    $0x1,%edi
movaps %xmm3,%xmm2
mov    $0x4,%al
call   1070 <SIM_power_horowitz@plt>
cvtsi2sd %eax,%xmm0
movsd  0xcec(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x3,%ecx
imul   -0xc(%rbp),%ecx
imul   -0x14(%rbp),%ecx
imul   -0x18(%rbp),%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xc8a(%rip),%xmm0
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x1,%al
call   1060 <SIM_power_draincap@plt>
mov    %eax,-0x98(%rbp)
movsd  0xc96(%rip),%xmm0
mov    $0x1,%esi
mov    %esi,%edi
mov    $0x1,%al
call   1060 <SIM_power_draincap@plt>
mov    %eax,%ecx
mov    -0x98(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x94(%rbp)
movsd  0xc60(%rip),%xmm0
movsd  0xc60(%rip),%xmm1
mov    $0x2,%al
call   1090 <SIM_power_gatecap@plt>
mov    %eax,%ecx
mov    -0x94(%rbp),%eax
shl    $0x2,%ecx
mov    -0x10(%rbp),%edx
imul   -0x14(%rbp),%edx
imul   %edx,%ecx
add    %ecx,%eax
cvtsi2sd %eax,%xmm1
cvtsi2sdl -0x8(%rbp),%xmm2
movsd  0xc21(%rip),%xmm0
mulsd  %xmm2,%xmm0
cvtsi2sdl -0xc(%rbp),%xmm2
mulsd  %xmm2,%xmm0
cvtsi2sdl -0x14(%rbp),%xmm2
mulsd  %xmm2,%xmm0
cvtsi2sdl -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xbe4(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  0xba3(%rip),%xmm0
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x1,%al
call   1030 <SIM_power_transreson@plt>
movsd  -0x90(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm1
addsd  %xmm1,%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
movsd  0xb61(%rip),%xmm2
movsd  0xb51(%rip),%xmm3
xor    %edi,%edi
mov    $0x4,%al
call   1070 <SIM_power_horowitz@plt>
cvtsi2sd %eax,%xmm0
mov    0x28(%rbp),%rax
movsd  %xmm0,(%rax)
mov    0x28(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xb2c(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
imul   -0x14(%rbp),%eax
imul   -0x18(%rbp),%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
mov    $0x1,%al
call   1080 <logtwo@plt>
cvtsi2sd %eax,%xmm1
movsd  0xaec(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1040 <ceil@plt>
cvttsd2si %xmm0,%eax
mov    %eax,-0x7c(%rbp)
cmpl   $0x0,-0x7c(%rbp)
jne    1535 <SIM_power_decoder_delay+0x3c5>
movl   $0x1,-0x7c(%rbp)
cmpl   $0x5,-0x7c(%rbp)
jle    1546 <SIM_power_decoder_delay+0x3d6>
movl   $0x5,-0x7c(%rbp)
movsd  0xb0a(%rip),%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
xor    %edi,%edi
mov    $0x1,%esi
mov    %esi,-0xdc(%rbp)
mov    $0x1,%al
mov    %al,-0xd1(%rbp)
call   1060 <SIM_power_draincap@plt>
movsd  -0xe8(%rbp),%xmm0
ff
mov    -0xdc(%rbp),%edi
mov    %eax,%edx
mov    -0xd1(%rbp),%al
mov    %edx,%ecx
lea    (%rcx,%rcx,2),%ecx
mov    %ecx,-0xf4(%rbp)
mov    $0x3,%esi
mov    %esi,-0xd8(%rbp)
call   1060 <SIM_power_draincap@plt>
mov    %eax,%ecx
mov    -0xf4(%rbp),%eax
add    %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0xf0(%rbp)
ff
mov    -0x7c(%rbp),%ecx
shl    $0x3,%ecx
mov    %ecx,%eax
lea    (%rax,%rax,4),%eax
cvtsi2sd %eax,%xmm1
movsd  0xa92(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xa8e(%rip),%xmm0
mov    $0x2,%al
call   1090 <SIM_power_gatecap@plt>
movsd  -0xf0(%rbp),%xmm2
ff
movsd  -0xe8(%rbp),%xmm0
ff
mov    -0xdc(%rbp),%edi
mov    -0xd8(%rbp),%esi
mov    %eax,%ecx
mov    -0xd1(%rbp),%al
cvtsi2sd %ecx,%xmm3
movsd  -0x38(%rbp),%xmm1
mulsd  %xmm1,%xmm3
addsd  %xmm2,%xmm3
movsd  0xa52(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xa4e(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm3,%xmm1
movsd  %xmm1,-0x20(%rbp)
movsd  -0x38(%rbp),%xmm1
movsd  0xa3c(%rip),%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm1
movsd  0xa34(%rip),%xmm2
divsd  %xmm2,%xmm1
movsd  %xmm1,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  %xmm1,-0xc8(%rbp)
ff
movsd  -0x30(%rbp),%xmm1
movsd  %xmm1,-0xd0(%rbp)
ff
call   1030 <SIM_power_transreson@plt>
movsd  -0xd0(%rbp),%xmm1
ff
movsd  -0xc8(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x7c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0xc0(%rbp)
sub    $0x4,%eax
ja     1726 <SIM_power_decoder_delay+0x5b6>
mov    -0xc0(%rbp),%rax
lea    0xa15(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movsd  0x9d4(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    1737 <SIM_power_decoder_delay+0x5c7>
movsd  0x9ba(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    1737 <SIM_power_decoder_delay+0x5c7>
movsd  0x9a0(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    1737 <SIM_power_decoder_delay+0x5c7>
movsd  0x986(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    1737 <SIM_power_decoder_delay+0x5c7>
movsd  0x974(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    1737 <SIM_power_decoder_delay+0x5c7>
mov    -0x7c(%rbp),%esi
lea    0x9bc(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movsd  -0x48(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm3
movsd  0x8ba(%rip),%xmm2
mov    $0x1,%edi
mov    $0x4,%al
call   1070 <SIM_power_horowitz@plt>
cvtsi2sd %eax,%xmm0
mov    0x30(%rbp),%rax
movsd  %xmm0,(%rax)
mov    0x30(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0x95a(%rip),%xmm1
subsd  -0x50(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x7c(%rbp),%esi
movsd  0x929(%rip),%xmm0
xor    %edi,%edi
mov    $0x1,%al
call   1030 <SIM_power_transreson@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0x91f(%rip),%xmm0
movsd  0x8af(%rip),%xmm1
mov    $0x2,%al
call   1090 <SIM_power_gatecap@plt>
mov    %eax,-0xfc(%rbp)
mov    -0x7c(%rbp),%eax
mov    %eax,-0x100(%rbp)
movsd  0x8f1(%rip),%xmm0
mov    $0x1,%esi
mov    %esi,%edi
mov    $0x1,%al
call   1060 <SIM_power_draincap@plt>
mov    -0x100(%rbp),%ecx
mov    %eax,%edx
mov    -0xfc(%rbp),%eax
imul   %edx,%ecx
add    %ecx,%eax
mov    %eax,-0xf8(%rbp)
mov    -0x7c(%rbp),%esi
movsd  0x8b7(%rip),%xmm0
xor    %edi,%edi
mov    $0x1,%al
call   1060 <SIM_power_draincap@plt>
mov    %eax,%ecx
mov    -0xf8(%rbp),%eax
add    %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm2
movsd  0x86d(%rip),%xmm3
xor    %edi,%edi
mov    $0x4,%al
call   1070 <SIM_power_horowitz@plt>
cvtsi2sd %eax,%xmm0
mov    0x38(%rbp),%rax
movsd  %xmm0,(%rax)
mov    0x38(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0x848(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    0x40(%rbp),%rax
movsd  %xmm0,(%rax)
mov    0x28(%rbp),%rax
movsd  (%rax),%xmm0
mov    0x30(%rbp),%rax
addsd  (%rax),%xmm0
mov    0x38(%rbp),%rax
addsd  (%rax),%xmm0
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SIM_power_decoder_delay>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %r9d,0x28(%rsp)
mov    %r8d,%r13d
mov    %rcx,0x8(%rsp)
mov    %edx,%r12d
mov    %edx,0x30(%rsp)
mov    %esi,0x34(%rsp)
mov    %edi,0x18(%rsp)
movsd  0xe5e(%rip),%xmm0
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x1,%al
call   1060 <SIM_power_draincap@plt>
mov    %eax,%r14d
movsd  0xe4d(%rip),%xmm0
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0x1,%al
call   1060 <SIM_power_draincap@plt>
mov    %eax,%r15d
add    %r14d,%r15d
movsd  0xe36(%rip),%xmm0
xorps  %xmm1,%xmm1
mov    $0x2,%al
call   1090 <SIM_power_gatecap@plt>
add    %r15d,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0xe0c(%rip),%xmm0
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0x1,%al
call   1030 <SIM_power_transreson@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
mulsd  0x10(%rsp),%xmm1
movsd  0xdf6(%rip),%xmm2
xorps  %xmm0,%xmm0
movaps %xmm2,%xmm3
xor    %edi,%edi
mov    $0x4,%al
call   1070 <SIM_power_horowitz@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
divsd  0xdd8(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0xdb2(%rip),%xmm0
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x1,%al
call   1060 <SIM_power_draincap@plt>
mov    %eax,%ebx
movsd  0xda2(%rip),%xmm0
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0x1,%al
call   1060 <SIM_power_draincap@plt>
mov    %eax,%ebp
add    %ebx,%ebp
xorpd  %xmm1,%xmm1
movsd  0xd89(%rip),%xmm0
mov    $0x2,%al
call   1090 <SIM_power_gatecap@plt>
add    %ebp,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  0xd63(%rip),%xmm0
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0x1,%al
call   1030 <SIM_power_transreson@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
mulsd  0x20(%rsp),%xmm1
movsd  0x10(%rsp),%xmm0
movsd  0xd47(%rip),%xmm2
movaps %xmm2,%xmm3
mov    $0x1,%edi
mov    $0x4,%al
call   1070 <SIM_power_horowitz@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
divsd  0xd31(%rip),%xmm0
movsd  %xmm0,0x20(%rsp)
mov    %r13d,%eax
imul   %r12d,%eax
mov    0x34(%rsp),%r15d
mov    %r15d,%ebx
mov    0x28(%rsp),%r12d
imul   %r12d,%ebx
imul   %eax,%ebx
lea    0x0(,%rbx,8),%ecx
mov    0x18(%rsp),%eax
cltd
idiv   %ecx
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0xccd(%rip),%xmm0
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x1,%al
call   1060 <SIM_power_draincap@plt>
mov    %eax,%r14d
movsd  0xcbc(%rip),%xmm0
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0x1,%al
call   1060 <SIM_power_draincap@plt>
mov    %eax,%ebp
add    %r14d,%ebp
movsd  0xcbe(%rip),%xmm0
movsd  0xcbe(%rip),%xmm1
mov    $0x2,%al
call   1090 <SIM_power_gatecap@plt>
mov    0x8(%rsp),%rdx
imul   %r13d,%edx
imul   %eax,%edx
lea    0x0(%rbp,%rdx,4),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
cvtsi2sd %r15d,%xmm5
movsd  0xc9b(%rip),%xmm4
mulsd  %xmm5,%xmm4
xorps  %xmm1,%xmm1
cvtsi2sdl 0x30(%rsp),%xmm1
mulsd  %xmm1,%xmm4
xorps  %xmm2,%xmm2
cvtsi2sd %r13d,%xmm2
xorps  %xmm3,%xmm3
cvtsi2sd %r12d,%xmm3
mulsd  %xmm2,%xmm4
mulsd  %xmm3,%xmm4
mulsd  0xc72(%rip),%xmm5
addsd  %xmm0,%xmm4
movsd  %xmm4,0x8(%rsp)
mulsd  %xmm1,%xmm5
mulsd  %xmm2,%xmm5
mulsd  %xmm3,%xmm5
movsd  %xmm5,0x28(%rsp)
movsd  0xc0e(%rip),%xmm0
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x1,%al
call   1030 <SIM_power_transreson@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
addsd  0x28(%rsp),%xmm1
mulsd  0x8(%rsp),%xmm1
movsd  0xc2d(%rip),%xmm3
movsd  0x20(%rsp),%xmm0
movsd  0xbef(%rip),%xmm2
xor    %edi,%edi
mov    $0x4,%al
call   1070 <SIM_power_horowitz@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
xorps  %xmm0,%xmm0
cvtsi2sdl 0x18(%rsp),%xmm0
mov    0x88(%rsp),%rax
movsd  %xmm1,0x8(%rsp)
movsd  %xmm1,(%rax)
xorps  %xmm1,%xmm1
cvtsi2sd %ebx,%xmm1
divsd  %xmm1,%xmm0
mov    $0x1,%al
call   1080 <logtwo@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xbdb(%rip),%xmm0
call   1040 <ceil@plt>
cvttsd2si %xmm0,%eax
test   %eax,%eax
mov    $0x1,%ecx
cmove  %ecx,%eax
cmp    $0x5,%eax
mov    $0x5,%r13d
cmovl  %eax,%r13d
movsd  0xbbb(%rip),%xmm0
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x1,%al
call   1060 <SIM_power_draincap@plt>
mov    %eax,%r14d
movsd  0xba2(%rip),%xmm0
mov    $0x1,%edi
mov    $0x3,%esi
mov    $0x1,%al
call   1060 <SIM_power_draincap@plt>
mov    %eax,%r15d
lea    0x0(,%r13,8),%eax
lea    (%rax,%rax,4),%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
addsd  0xb7c(%rip),%xmm1
movsd  0xb7c(%rip),%xmm0
mov    $0x2,%al
call   1090 <SIM_power_gatecap@plt>
mov    %eax,%ebp
movsd  0xb5b(%rip),%xmm0
mov    $0x1,%edi
mov    $0x3,%esi
mov    $0x1,%al
call   1030 <SIM_power_transreson@plt>
mov    %eax,%r12d
lea    -0x1(%r13),%eax
cmp    $0x5,%eax
jae    152a <SIM_power_decoder_delay+0x3ba>
cltq
lea    0xbad(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm3
jmp    153e <SIM_power_decoder_delay+0x3ce>
lea    0xb87(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xorps  %xmm3,%xmm3
movsd  0xb2a(%rip),%xmm0
xorps  %xmm2,%xmm2
cvtsi2sd %ebp,%xmm2
lea    (%r14,%r14,2),%eax
add    %r15d,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  0x10(%rsp),%xmm4
mulsd  %xmm4,%xmm0
mulsd  %xmm4,%xmm2
addsd  %xmm1,%xmm2
movsd  0xb03(%rip),%xmm1
mulsd  %xmm1,%xmm0
mulsd  0xaff(%rip),%xmm4
mulsd  %xmm1,%xmm4
mulsd  0xafb(%rip),%xmm4
xorps  %xmm1,%xmm1
cvtsi2sd %r12d,%xmm1
addsd  %xmm2,%xmm0
addsd  %xmm4,%xmm1
mulsd  %xmm0,%xmm1
movsd  0xa9f(%rip),%xmm2
movsd  0x8(%rsp),%xmm0
divsd  %xmm2,%xmm0
movsd  %xmm3,0x18(%rsp)
mov    $0x1,%edi
mov    $0x4,%al
call   1070 <SIM_power_horowitz@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
mov    0x90(%rsp),%r14
movsd  %xmm1,(%r14)
movsd  0xaaf(%rip),%xmm0
subsd  0x18(%rsp),%xmm0
divsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
movsd  0xa9f(%rip),%xmm0
xor    %edi,%edi
mov    %r13d,%esi
mov    $0x1,%al
call   1030 <SIM_power_transreson@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0xa86(%rip),%xmm0
movsd  0xa3e(%rip),%xmm1
mov    $0x2,%al
call   1090 <SIM_power_gatecap@plt>
mov    %eax,%ebp
movsd  0xa75(%rip),%xmm0
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0x1,%al
call   1060 <SIM_power_draincap@plt>
mov    %eax,%ebx
imul   %r13d,%ebx
add    %ebp,%ebx
movsd  0xa44(%rip),%xmm0
xor    %edi,%edi
mov    %r13d,%esi
mov    $0x1,%al
call   1060 <SIM_power_draincap@plt>
add    %ebx,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
mulsd  0x8(%rsp),%xmm1
movsd  0xa39(%rip),%xmm3
movsd  0x10(%rsp),%xmm0
movsd  0x18(%rsp),%xmm2
xor    %edi,%edi
mov    $0x4,%al
call   1070 <SIM_power_horowitz@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mov    0x98(%rsp),%rax
movsd  %xmm0,(%rax)
divsd  0xa09(%rip),%xmm0
mov    0xa0(%rsp),%rcx
movsd  %xmm0,(%rcx)
mov    0x88(%rsp),%rcx
movsd  (%rcx),%xmm0
addsd  (%r14),%xmm0
addsd  (%rax),%xmm0
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"error:numstack=%d\0A\00"
define double @SIM_power_decoder_delay(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, double* %9, double* %10, double* %11, double* %12) {
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca double*
%24 = alloca double*
%25 = alloca double*
%26 = alloca double*
%27 = alloca double
%28 = alloca double
%29 = alloca double
%30 = alloca double
%31 = alloca double
%32 = alloca double
%33 = alloca double
%34 = alloca double
%35 = alloca double
%36 = alloca double
%37 = alloca double
%38 = alloca double
%39 = alloca i32
%40 = alloca double
store i32 %0, i32* %14
store i32 %1, i32* %15
store i32 %2, i32* %16
store i32 %3, i32* %17
store i32 %4, i32* %18
store i32 %5, i32* %19
store i32 %6, i32* %20
store i32 %7, i32* %21
store i32 %8, i32* %22
store double* %9, double** %23
store double* %10, double** %24
store double* %11, double** %25
store double* %12, double** %26
store double 0.000000e+00, double* %33
store double 0.000000e+00, double* %40
%41 = call i32 (double, i32, i32, ...) bitcast (i32 (...)* @SIM_power_draincap to i32 (double, i32, i32, ...)*)(double 4.987500e+00, i32 0, i32 1)
%42 = call i32 (double, i32, i32, ...) bitcast (i32 (...)* @SIM_power_draincap to i32 (double, i32, i32, ...)*)(double 3.500000e+00, i32 1, i32 1)
%43 = add nsw i32 %41, %42
%44 = call i32 (double, double, ...) bitcast (i32 (...)* @SIM_power_gatecap to i32 (double, double, ...)*)(double 8.487500e+00, double 0.000000e+00)
%45 = add nsw i32 %43, %44
%46 = sitofp i32 %45 to double
store double %46, double* %27
%47 = load double, double* %27
%48 = call i32 (double, i32, i32, ...) bitcast (i32 (...)* @SIM_power_transreson to i32 (double, i32, i32, ...)*)(double 3.500000e+00, i32 1, i32 1)
%49 = sitofp i32 %48 to double
%50 = fmul double %47, %49
store double %50, double* %31
%51 = load double, double* %40
%52 = load double, double* %31
%53 = call i32 (double, double, double, double, i32, ...) bitcast (i32 (...)* @SIM_power_horowitz to i32 (double, double, double, double, i32, ...)*)(double %51, double %52, double 4.380000e-01, double 4.380000e-01, i32 0)
%54 = sitofp i32 %53 to double
%55 = fdiv double %54, 4.380000e-01
store double %55, double* %32
%56 = call i32 (double, i32, i32, ...) bitcast (i32 (...)* @SIM_power_draincap to i32 (double, i32, i32, ...)*)(double 4.987500e+00, i32 0, i32 1)
%57 = call i32 (double, i32, i32, ...) bitcast (i32 (...)* @SIM_power_draincap to i32 (double, i32, i32, ...)*)(double 3.500000e+00, i32 1, i32 1)
%58 = add nsw i32 %56, %57
%59 = call i32 (double, double, ...) bitcast (i32 (...)* @SIM_power_gatecap to i32 (double, double, ...)*)(double 8.487500e+00, double 0.000000e+00)
%60 = add nsw i32 %58, %59
%61 = sitofp i32 %60 to double
store double %61, double* %27
%62 = load double, double* %27
%63 = call i32 (double, i32, i32, ...) bitcast (i32 (...)* @SIM_power_transreson to i32 (double, i32, i32, ...)*)(double 3.500000e+00, i32 1, i32 1)
%64 = sitofp i32 %63 to double
%65 = fmul double %62, %64
store double %65, double* %31
%66 = load double, double* %32
%67 = load double, double* %31
%68 = call i32 (double, double, double, double, i32, ...) bitcast (i32 (...)* @SIM_power_horowitz to i32 (double, double, double, double, i32, ...)*)(double %66, double %67, double 4.380000e-01, double 4.380000e-01, i32 1)
%69 = sitofp i32 %68 to double
%70 = fdiv double %69, 5.620000e-01
store double %70, double* %32
%71 = load i32, i32* %14
%72 = load i32, i32* %15
%73 = mul nsw i32 8, %72
%74 = load i32, i32* %16
%75 = mul nsw i32 %73, %74
%76 = load i32, i32* %18
%77 = mul nsw i32 %75, %76
%78 = load i32, i32* %19
%79 = mul nsw i32 %77, %78
%80 = sdiv i32 %71, %79
%81 = sitofp i32 %80 to double
store double %81, double* %30
%82 = call i32 (double, i32, i32, ...) bitcast (i32 (...)* @SIM_power_draincap to i32 (double, i32, i32, ...)*)(double 4.987500e+00, i32 0, i32 1)
%83 = call i32 (double, i32, i32, ...) bitcast (i32 (...)* @SIM_power_draincap to i32 (double, i32, i32, ...)*)(double 3.500000e+00, i32 1, i32 1)
%84 = add nsw i32 %82, %83
%85 = call i32 (double, double, ...) bitcast (i32 (...)* @SIM_power_gatecap to i32 (double, double, ...)*)(double 2.520000e+00, double 1.000000e+01)
%86 = mul nsw i32 4, %85
%87 = load i32, i32* %17
%88 = load i32, i32* %18
%89 = mul nsw i32 %87, %88
%90 = mul nsw i32 %86, %89
%91 = add nsw i32 %84, %90
%92 = sitofp i32 %91 to double
%93 = load i32, i32* %15
%94 = sitofp i32 %93 to double
%95 = fmul double 0x3CF56091276E6568, %94
%96 = load i32, i32* %16
%97 = sitofp i32 %96 to double
%98 = fmul double %95, %97
%99 = load i32, i32* %18
%100 = sitofp i32 %99 to double
%101 = fmul double %98, %100
%102 = load i32, i32* %19
%103 = sitofp i32 %102 to double
%104 = call double @llvm.fmuladd.f64(double %101, double %103, double %92)
store double %104, double* %27
%105 = load i32, i32* %15
%106 = sitofp i32 %105 to double
%107 = fmul double 0x3FB916872B020C49, %106
%108 = load i32, i32* %16
%109 = sitofp i32 %108 to double
%110 = fmul double %107, %109
%111 = load i32, i32* %18
%112 = sitofp i32 %111 to double
%113 = fmul double %110, %112
%114 = load i32, i32* %19
%115 = sitofp i32 %114 to double
%116 = fmul double %113, %115
store double %116, double* %29
%117 = load double, double* %29
%118 = call i32 (double, i32, i32, ...) bitcast (i32 (...)* @SIM_power_transreson to i32 (double, i32, i32, ...)*)(double 4.987500e+00, i32 0, i32 1)
%119 = sitofp i32 %118 to double
%120 = fadd double %117, %119
%121 = load double, double* %27
%122 = fmul double %120, %121
store double %122, double* %31
%123 = load double, double* %32
%124 = load double, double* %31
%125 = call i32 (double, double, double, double, i32, ...) bitcast (i32 (...)* @SIM_power_horowitz to i32 (double, double, double, double, i32, ...)*)(double %123, double %124, double 4.380000e-01, double 5.610000e-01, i32 0)
%126 = sitofp i32 %125 to double
%127 = load double*, double** %23
store double %126, double* %127
%128 = load double*, double** %23
%129 = load double, double* %128
%130 = fdiv double %129, 5.610000e-01
store double %130, double* %32
%131 = load i32, i32* %14
%132 = sitofp i32 %131 to double
%133 = load i32, i32* %15
%134 = load i32, i32* %16
%135 = mul nsw i32 %133, %134
%136 = load i32, i32* %18
%137 = mul nsw i32 %135, %136
%138 = load i32, i32* %19
%139 = mul nsw i32 %137, %138
%140 = sitofp i32 %139 to double
%141 = fdiv double %132, %140
%142 = call i32 (double, ...) bitcast (i32 (...)* @logtwo to i32 (double, ...)*)(double %141)
%143 = sitofp i32 %142 to double
%144 = fmul double 0x3FD5555555555555, %143
%145 = call double @llvm.ceil.f64(double %144)
%146 = fptosi double %145 to i32
store i32 %146, i32* %39
%147 = load i32, i32* %39
%148 = icmp eq i32 %147, 0
br i1 %148, label %149, label %150
149: ; preds = %13
store i32 1, i32* %39
br label %150
150: ; preds = %149, %13
%151 = load i32, i32* %39
%152 = icmp sgt i32 %151, 5
br i1 %152, label %153, label %154
153: ; preds = %150
store i32 5, i32* %39
br label %154
154: ; preds = %153, %150
%155 = call i32 (double, i32, i32, ...) bitcast (i32 (...)* @SIM_power_draincap to i32 (double, i32, i32, ...)*)(double 1.260000e+00, i32 0, i32 1)
%156 = mul nsw i32 3, %155
%157 = call i32 (double, i32, i32, ...) bitcast (i32 (...)* @SIM_power_draincap to i32 (double, i32, i32, ...)*)(double 1.260000e+00, i32 1, i32 3)
%158 = add nsw i32 %156, %157
%159 = sitofp i32 %158 to double
%160 = load i32, i32* %39
%161 = mul nsw i32 %160, 40
%162 = sitofp i32 %161 to double
%163 = fadd double %162, 2.000000e+01
%164 = call i32 (double, double, ...) bitcast (i32 (...)* @SIM_power_gatecap to i32 (double, double, ...)*)(double 3.141250e+00, double %163)
%165 = sitofp i32 %164 to double
%166 = load double, double* %30
%167 = call double @llvm.fmuladd.f64(double %165, double %166, double %159)
%168 = load double, double* %30
%169 = fmul double 0x3CFA20B16915269B, %168
%170 = call double @llvm.fmuladd.f64(double %169, double 8.000000e+00, double %167)
store double %170, double* %27
%171 = load double, double* %30
%172 = fmul double 0x3FD916872B020C49, %171
%173 = fmul double %172, 8.000000e+00
%174 = fdiv double %173, 2.000000e+00
store double %174, double* %29
%175 = load double, double* %27
%176 = load double, double* %29
%177 = call i32 (double, i32, i32, ...) bitcast (i32 (...)* @SIM_power_transreson to i32 (double, i32, i32, ...)*)(double 1.260000e+00, i32 1, i32 3)
%178 = sitofp i32 %177 to double
%179 = fadd double %176, %178
%180 = fmul double %175, %179
store double %180, double* %31
%181 = load i32, i32* %39
switch i32 %181, label %187 [
i32 1, label %182
i32 2, label %183
i32 3, label %184
i32 4, label %185
i32 5, label %186
]
182: ; preds = %154
store double 5.030000e-01, double* %33
br label %190
183: ; preds = %154
store double 4.520000e-01, double* %33
br label %190
184: ; preds = %154
store double 4.170000e-01, double* %33
br label %190
185: ; preds = %154
store double 3.900000e-01, double* %33
br label %190
186: ; preds = %154
store double 3.900000e-01, double* %33
br label %190
187: ; preds = %154
%188 = load i32, i32* %39
%189 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %188)
br label %190
190: ; preds = %187, %186, %185, %184, %183, %182
%191 = load double, double* %32
%192 = load double, double* %31
%193 = load double, double* %33
%194 = call i32 (double, double, double, double, i32, ...) bitcast (i32 (...)* @SIM_power_horowitz to i32 (double, double, double, double, i32, ...)*)(double %191, double %192, double 5.610000e-01, double %193, i32 1)
%195 = sitofp i32 %194 to double
%196 = load double*, double** %24
store double %195, double* %196
%197 = load double*, double** %24
%198 = load double, double* %197
%199 = load double, double* %33
%200 = fsub double 1.000000e+00, %199
%201 = fdiv double %198, %200
store double %201, double* %32
%202 = load i32, i32* %39
%203 = call i32 (double, i32, i32, ...) bitcast (i32 (...)* @SIM_power_transreson to i32 (double, i32, i32, ...)*)(double 0x4005599999999999, i32 0, i32 %202)
%204 = sitofp i32 %203 to double
store double %204, double* %28
%205 = call i32 (double, double, ...) bitcast (i32 (...)* @SIM_power_gatecap to i32 (double, double, ...)*)(double 1.312500e+00, double 2.000000e+01)
%206 = load i32, i32* %39
%207 = call i32 (double, i32, i32, ...) bitcast (i32 (...)* @SIM_power_draincap to i32 (double, i32, i32, ...)*)(double 4.725000e-01, i32 1, i32 1)
%208 = mul nsw i32 %206, %207
%209 = add nsw i32 %205, %208
%210 = load i32, i32* %39
%211 = call i32 (double, i32, i32, ...) bitcast (i32 (...)* @SIM_power_draincap to i32 (double, i32, i32, ...)*)(double 0x4005599999999999, i32 0, i32 %210)
%212 = add nsw i32 %209, %211
%213 = sitofp i32 %212 to double
store double %213, double* %27
%214 = load double, double* %28
%215 = load double, double* %27
%216 = fmul double %214, %215
store double %216, double* %31
%217 = load double, double* %32
%218 = load double, double* %31
%219 = load double, double* %33
%220 = call i32 (double, double, double, double, i32, ...) bitcast (i32 (...)* @SIM_power_horowitz to i32 (double, double, double, double, i32, ...)*)(double %217, double %218, double %219, double 4.560000e-01, i32 0)
%221 = sitofp i32 %220 to double
%222 = load double*, double** %25
store double %221, double* %222
%223 = load double*, double** %25
%224 = load double, double* %223
%225 = fdiv double %224, 4.560000e-01
%226 = load double*, double** %26
store double %225, double* %226
%227 = load double*, double** %23
%228 = load double, double* %227
%229 = load double*, double** %24
%230 = load double, double* %229
%231 = fadd double %228, %230
%232 = load double*, double** %25
%233 = load double, double* %232
%234 = fadd double %231, %233
ret double %234
}

LLVM IR (-O2):
@.str = [19 x i8] c"error:numstack=%d\0A\00"
@switch.table.SIM_power_decoder_delay = [5 x double] [double 5.030000e-01, double 4.520000e-01, double 4.170000e-01, double 3.900000e-01, double 3.900000e-01]
define double @SIM_power_decoder_delay(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, double* nocapture %9, double* nocapture %10, double* nocapture %11, double* nocapture writeonly %12) {
%14 = tail call i32 (double, i32, i32, ...) bitcast (i32 (...)* @SIM_power_draincap to i32 (double, i32, i32, ...)*)(double 4.987500e+00, i32 0, i32 1)
%15 = tail call i32 (double, i32, i32, ...) bitcast (i32 (...)* @SIM_power_draincap to i32 (double, i32, i32, ...)*)(double 3.500000e+00, i32 1, i32 1)
%16 = add nsw i32 %15, %14
%17 = tail call i32 (double, double, ...) bitcast (i32 (...)* @SIM_power_gatecap to i32 (double, double, ...)*)(double 8.487500e+00, double 0.000000e+00)
%18 = add nsw i32 %16, %17
%19 = sitofp i32 %18 to double
%20 = tail call i32 (double, i32, i32, ...) bitcast (i32 (...)* @SIM_power_transreson to i32 (double, i32, i32, ...)*)(double 3.500000e+00, i32 1, i32 1)
%21 = sitofp i32 %20 to double
%22 = fmul double %19, %21
%23 = tail call i32 (double, double, double, double, i32, ...) bitcast (i32 (...)* @SIM_power_horowitz to i32 (double, double, double, double, i32, ...)*)(double 0.000000e+00, double %22, double 4.380000e-01, double 4.380000e-01, i32 0)
%24 = sitofp i32 %23 to double
%25 = fdiv double %24, 4.380000e-01
%26 = tail call i32 (double, i32, i32, ...) bitcast (i32 (...)* @SIM_power_draincap to i32 (double, i32, i32, ...)*)(double 4.987500e+00, i32 0, i32 1)
%27 = tail call i32 (double, i32, i32, ...) bitcast (i32 (...)* @SIM_power_draincap to i32 (double, i32, i32, ...)*)(double 3.500000e+00, i32 1, i32 1)
%28 = add nsw i32 %27, %26
%29 = tail call i32 (double, double, ...) bitcast (i32 (...)* @SIM_power_gatecap to i32 (double, double, ...)*)(double 8.487500e+00, double 0.000000e+00)
%30 = add nsw i32 %28, %29
%31 = sitofp i32 %30 to double
%32 = tail call i32 (double, i32, i32, ...) bitcast (i32 (...)* @SIM_power_transreson to i32 (double, i32, i32, ...)*)(double 3.500000e+00, i32 1, i32 1)
%33 = sitofp i32 %32 to double
%34 = fmul double %31, %33
%35 = tail call i32 (double, double, double, double, i32, ...) bitcast (i32 (...)* @SIM_power_horowitz to i32 (double, double, double, double, i32, ...)*)(double %25, double %34, double 4.380000e-01, double 4.380000e-01, i32 1)
%36 = sitofp i32 %35 to double
%37 = fdiv double %36, 5.620000e-01
%38 = mul i32 %4, %2
%39 = shl i32 %38, 3
%40 = mul i32 %39, %1
%41 = mul i32 %40, %5
%42 = sdiv i32 %0, %41
%43 = sitofp i32 %42 to double
%44 = tail call i32 (double, i32, i32, ...) bitcast (i32 (...)* @SIM_power_draincap to i32 (double, i32, i32, ...)*)(double 4.987500e+00, i32 0, i32 1)
%45 = tail call i32 (double, i32, i32, ...) bitcast (i32 (...)* @SIM_power_draincap to i32 (double, i32, i32, ...)*)(double 3.500000e+00, i32 1, i32 1)
%46 = add nsw i32 %45, %44
%47 = tail call i32 (double, double, ...) bitcast (i32 (...)* @SIM_power_gatecap to i32 (double, double, ...)*)(double 2.520000e+00, double 1.000000e+01)
%48 = shl i32 %3, 2
%49 = mul i32 %48, %4
%50 = mul i32 %49, %47
%51 = add nsw i32 %46, %50
%52 = sitofp i32 %51 to double
%53 = sitofp i32 %1 to double
%54 = fmul double %53, 0x3CF56091276E6568
%55 = sitofp i32 %2 to double
%56 = fmul double %54, %55
%57 = sitofp i32 %4 to double
%58 = fmul double %56, %57
%59 = sitofp i32 %5 to double
%60 = tail call double @llvm.fmuladd.f64(double %58, double %59, double %52)
%61 = fmul double %53, 0x3FB916872B020C49
%62 = fmul double %61, %55
%63 = fmul double %62, %57
%64 = fmul double %63, %59
%65 = tail call i32 (double, i32, i32, ...) bitcast (i32 (...)* @SIM_power_transreson to i32 (double, i32, i32, ...)*)(double 4.987500e+00, i32 0, i32 1)
%66 = sitofp i32 %65 to double
%67 = fadd double %64, %66
%68 = fmul double %67, %60
%69 = tail call i32 (double, double, double, double, i32, ...) bitcast (i32 (...)* @SIM_power_horowitz to i32 (double, double, double, double, i32, ...)*)(double %37, double %68, double 4.380000e-01, double 5.610000e-01, i32 0)
%70 = sitofp i32 %69 to double
store double %70, double* %9
%71 = sitofp i32 %0 to double
%72 = mul i32 %38, %1
%73 = mul i32 %72, %5
%74 = sitofp i32 %73 to double
%75 = fdiv double %71, %74
%76 = tail call i32 (double, ...) bitcast (i32 (...)* @logtwo to i32 (double, ...)*)(double %75)
%77 = sitofp i32 %76 to double
%78 = fmul double %77, 0x3FD5555555555555
%79 = tail call double @llvm.ceil.f64(double %78)
%80 = fptosi double %79 to i32
%81 = icmp eq i32 %80, 0
%82 = select i1 %81, i32 1, i32 %80
%83 = icmp slt i32 %82, 5
%84 = select i1 %83, i32 %82, i32 5
%85 = tail call i32 (double, i32, i32, ...) bitcast (i32 (...)* @SIM_power_draincap to i32 (double, i32, i32, ...)*)(double 1.260000e+00, i32 0, i32 1)
%86 = tail call i32 (double, i32, i32, ...) bitcast (i32 (...)* @SIM_power_draincap to i32 (double, i32, i32, ...)*)(double 1.260000e+00, i32 1, i32 3)
%87 = mul nsw i32 %84, 40
%88 = sitofp i32 %87 to double
%89 = fadd double %88, 2.000000e+01
%90 = tail call i32 (double, double, ...) bitcast (i32 (...)* @SIM_power_gatecap to i32 (double, double, ...)*)(double 3.141250e+00, double %89)
%91 = tail call i32 (double, i32, i32, ...) bitcast (i32 (...)* @SIM_power_transreson to i32 (double, i32, i32, ...)*)(double 1.260000e+00, i32 1, i32 3)
%92 = add i32 %84, -1
%93 = icmp ult i32 %92, 5
br i1 %93, label %96, label %94
94: ; preds = %13
%95 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %84)
br label %100
96: ; preds = %13
%97 = sext i32 %92 to i64
%98 = getelementptr inbounds [5 x double], [5 x double]* @switch.table.SIM_power_decoder_delay, i64 0, i64 %97
%99 = load double, double* %98
br label %100
100: ; preds = %96, %94
%101 = phi double [ 0.000000e+00, %94 ], [ %99, %96 ]
%102 = fmul double %43, 0x3CFA20B16915269B
%103 = sitofp i32 %90 to double
%104 = mul nsw i32 %85, 3
%105 = add nsw i32 %104, %86
%106 = sitofp i32 %105 to double
%107 = tail call double @llvm.fmuladd.f64(double %103, double %43, double %106)
%108 = tail call double @llvm.fmuladd.f64(double %102, double 8.000000e+00, double %107)
%109 = fmul double %43, 0x3FD916872B020C49
%110 = fmul double %109, 8.000000e+00
%111 = fmul double %110, 5.000000e-01
%112 = sitofp i32 %91 to double
%113 = fadd double %111, %112
%114 = fmul double %108, %113
%115 = fdiv double %70, 5.610000e-01
%116 = tail call i32 (double, double, double, double, i32, ...) bitcast (i32 (...)* @SIM_power_horowitz to i32 (double, double, double, double, i32, ...)*)(double %115, double %114, double 5.610000e-01, double %101, i32 1)
%117 = sitofp i32 %116 to double
store double %117, double* %10
%118 = fsub double 1.000000e+00, %101
%119 = fdiv double %117, %118
%120 = tail call i32 (double, i32, i32, ...) bitcast (i32 (...)* @SIM_power_transreson to i32 (double, i32, i32, ...)*)(double 0x4005599999999999, i32 0, i32 %84)
%121 = sitofp i32 %120 to double
%122 = tail call i32 (double, double, ...) bitcast (i32 (...)* @SIM_power_gatecap to i32 (double, double, ...)*)(double 1.312500e+00, double 2.000000e+01)
%123 = tail call i32 (double, i32, i32, ...) bitcast (i32 (...)* @SIM_power_draincap to i32 (double, i32, i32, ...)*)(double 4.725000e-01, i32 1, i32 1)
%124 = mul nsw i32 %123, %84
%125 = add nsw i32 %124, %122
%126 = tail call i32 (double, i32, i32, ...) bitcast (i32 (...)* @SIM_power_draincap to i32 (double, i32, i32, ...)*)(double 0x4005599999999999, i32 0, i32 %84)
%127 = add nsw i32 %125, %126
%128 = sitofp i32 %127 to double
%129 = fmul double %121, %128
%130 = tail call i32 (double, double, double, double, i32, ...) bitcast (i32 (...)* @SIM_power_horowitz to i32 (double, double, double, double, i32, ...)*)(double %119, double %129, double %101, double 4.560000e-01, i32 0)
%131 = sitofp i32 %130 to double
store double %131, double* %11
%132 = fdiv double %131, 4.560000e-01
store double %132, double* %12
%133 = load double, double* %9
%134 = load double, double* %10
%135 = fadd double %133, %134
%136 = load double, double* %11
%137 = fadd double %135, %136
ret double %137
}