#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 */
int SIM_power_draincap(int, int, int);
int SIM_power_gatecap(int, int /*<<< orphan*/);
double SIM_omflip_int_cap(void) {
  double Ctotal = 0;
  Ctotal += SIM_power_draincap((3 * ((0.8 * 0.0875) * 0.5)), 1, 1) +
            SIM_power_draincap((6 * ((0.8 * 0.0875) * 0.5)), 0, 1) +
            SIM_power_gatecap(
                (3 * ((0.8 * 0.0875) * 0.5)) + (6 * ((0.8 * 0.0875) * 0.5)), 0);
  Ctotal += SIM_power_draincap((6 * ((0.8 * 0.0875) * 0.5)), 1, 1) +
            2 * SIM_power_draincap((6 * ((0.8 * 0.0875) * 0.5)), 0, 1);
  return Ctotal;
}


x86 assembly (clang, -O0):
<SIM_omflip_int_cap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
xor    %edi,%edi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <SIM_power_draincap@plt>
mov    %eax,-0x14(%rbp)
xor    %esi,%esi
mov    $0x1,%edx
mov    %esi,%edi
call   1030 <SIM_power_draincap@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
xor    %esi,%esi
mov    %esi,%edi
call   1040 <SIM_power_gatecap@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
cvtsi2sd %eax,%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
xor    %edi,%edi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <SIM_power_draincap@plt>
mov    %eax,-0xc(%rbp)
xor    %esi,%esi
mov    $0x1,%edx
mov    %esi,%edi
call   1030 <SIM_power_draincap@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
shl    $0x1,%ecx
add    %ecx,%eax
cvtsi2sd %eax,%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SIM_omflip_int_cap>:
push   %rbp
push   %rbx
push   %rax
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <SIM_power_draincap@plt>
mov    %eax,%ebx
xor    %edi,%edi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <SIM_power_draincap@plt>
mov    %eax,%ebp
add    %ebx,%ebp
xor    %edi,%edi
xor    %esi,%esi
call   1040 <SIM_power_gatecap@plt>
add    %ebp,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,(%rsp)
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <SIM_power_draincap@plt>
mov    %eax,%ebx
xor    %edi,%edi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <SIM_power_draincap@plt>
lea    (%rbx,%rax,2),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  (%rsp),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define double @SIM_omflip_int_cap() {
%1 = alloca double
store double 0.000000e+00, double* %1
%2 = call i32 @SIM_power_draincap(i32 0, i32 1, i32 1)
%3 = call i32 @SIM_power_draincap(i32 0, i32 0, i32 1)
%4 = add nsw i32 %2, %3
%5 = call i32 @SIM_power_gatecap(i32 0, i32 0)
%6 = add nsw i32 %4, %5
%7 = sitofp i32 %6 to double
%8 = load double, double* %1
%9 = fadd double %8, %7
store double %9, double* %1
%10 = call i32 @SIM_power_draincap(i32 0, i32 1, i32 1)
%11 = call i32 @SIM_power_draincap(i32 0, i32 0, i32 1)
%12 = mul nsw i32 2, %11
%13 = add nsw i32 %10, %12
%14 = sitofp i32 %13 to double
%15 = load double, double* %1
%16 = fadd double %15, %14
store double %16, double* %1
%17 = load double, double* %1
ret double %17
}

LLVM IR (-O2):
define double @SIM_omflip_int_cap() {
%1 = tail call i32 @SIM_power_draincap(i32 0, i32 1, i32 1)
%2 = tail call i32 @SIM_power_draincap(i32 0, i32 0, i32 1)
%3 = add nsw i32 %2, %1
%4 = tail call i32 @SIM_power_gatecap(i32 0, i32 0)
%5 = add nsw i32 %3, %4
%6 = sitofp i32 %5 to double
%7 = tail call i32 @SIM_power_draincap(i32 0, i32 1, i32 1)
%8 = tail call i32 @SIM_power_draincap(i32 0, i32 0, i32 1)
%9 = shl nsw i32 %8, 1
%10 = add nsw i32 %9, %7
%11 = sitofp i32 %10 to double
%12 = fadd double %6, %11
ret double %12
}