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


x86 assembly (clang, -O0):
<SIM_omflip_out_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    %rax,-0x20(%rbp)
xor    %esi,%esi
mov    $0x1,%edx
mov    %esi,%edi
call   1030 <SIM_power_draincap@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
add    %rcx,%rax
cvtsi2sd %rax,%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    %rax,-0x18(%rbp)
xor    %esi,%esi
mov    $0x1,%edx
mov    %esi,%edi
call   1030 <SIM_power_draincap@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
xor    %esi,%esi
mov    %esi,%edi
call   1040 <SIM_power_gatecap@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
add    %rcx,%rax
cvtsi2sd %rax,%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_out_cap>:
push   %r14
push   %rbx
push   %rax
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <SIM_power_draincap@plt>
mov    %rax,%rbx
xor    %edi,%edi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <SIM_power_draincap@plt>
add    %rbx,%rax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,(%rsp)
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <SIM_power_draincap@plt>
mov    %rax,%r14
xor    %edi,%edi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <SIM_power_draincap@plt>
mov    %rax,%rbx
add    %r14,%rbx
xor    %edi,%edi
xor    %esi,%esi
call   1040 <SIM_power_gatecap@plt>
add    %rbx,%rax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  (%rsp),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

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