#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 measure_plaquette_sf_weights_improved_boundary_0(double, double);
double measure_plaquette_sf_weights_improved_boundary_t(int, double);
double measure_plaquette_sf_weights_improved_boundary_t_minus_1(int, double);
double measure_plaquette_sf_weights_improved_bulk(int);
double measure_wilson_action_sf_weights_improvement_separate_boundary(
    int t, double beta, double cs, double ct) {
  double plaquette;
  double wilson;
  plaquette = measure_plaquette_sf_weights_improved_bulk(t) +
              measure_plaquette_sf_weights_improved_boundary_0(cs, ct) +
              measure_plaquette_sf_weights_improved_boundary_t(t, cs) +
              measure_plaquette_sf_weights_improved_boundary_t_minus_1(t, ct);
  wilson = -(beta / (2. * 3.)) * plaquette;
  return wilson;
}


x86 assembly (clang, -O0):
<measure_wilson_action_sf_weights_improvement_separate_boundary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <measure_plaquette_sf_weights_improved_bulk@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
call   1050 <measure_plaquette_sf_weights_improved_boundary_0@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x4(%rbp),%edi
movsd  -0x18(%rbp),%xmm0
call   1040 <measure_plaquette_sf_weights_improved_boundary_t@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x4(%rbp),%edi
movsd  -0x20(%rbp),%xmm0
call   1060 <measure_plaquette_sf_weights_improved_boundary_t_minus_1@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe30(%rip),%xmm1
divsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<measure_wilson_action_sf_weights_improvement_separate_boundary>:
push   %rbx
sub    $0x20,%rsp
movsd  %xmm2,0x10(%rsp)
movsd  %xmm1,(%rsp)
movsd  %xmm0,0x18(%rsp)
mov    %edi,%ebx
call   1030 <measure_plaquette_sf_weights_improved_bulk@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1050 <measure_plaquette_sf_weights_improved_boundary_0@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %ebx,%edi
movsd  (%rsp),%xmm0
call   1040 <measure_plaquette_sf_weights_improved_boundary_t@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%rsp)
mov    %ebx,%edi
movsd  0x10(%rsp),%xmm0
call   1060 <measure_plaquette_sf_weights_improved_boundary_t_minus_1@plt>
addsd  (%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
divsd  0xe4a(%rip),%xmm1
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @measure_wilson_action_sf_weights_improvement_separate_boundary(i32 %0, double %1, double %2, double %3) {
%5 = alloca i32
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store i32 %0, i32* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%11 = load i32, i32* %5
%12 = call double @measure_plaquette_sf_weights_improved_bulk(i32 %11)
%13 = load double, double* %7
%14 = load double, double* %8
%15 = call double @measure_plaquette_sf_weights_improved_boundary_0(double %13, double %14)
%16 = fadd double %12, %15
%17 = load i32, i32* %5
%18 = load double, double* %7
%19 = call double @measure_plaquette_sf_weights_improved_boundary_t(i32 %17, double %18)
%20 = fadd double %16, %19
%21 = load i32, i32* %5
%22 = load double, double* %8
%23 = call double @measure_plaquette_sf_weights_improved_boundary_t_minus_1(i32 %21, double %22)
%24 = fadd double %20, %23
store double %24, double* %9
%25 = load double, double* %6
%26 = fdiv double %25, 6.000000e+00
%27 = fneg double %26
%28 = load double, double* %9
%29 = fmul double %27, %28
store double %29, double* %10
%30 = load double, double* %10
ret double %30
}

LLVM IR (-O2):
define double @measure_wilson_action_sf_weights_improvement_separate_boundary(i32 %0, double %1, double %2, double %3) {
%5 = tail call double @measure_plaquette_sf_weights_improved_bulk(i32 %0)
%6 = tail call double @measure_plaquette_sf_weights_improved_boundary_0(double %2, double %3)
%7 = fadd double %5, %6
%8 = tail call double @measure_plaquette_sf_weights_improved_boundary_t(i32 %0, double %2)
%9 = fadd double %7, %8
%10 = tail call double @measure_plaquette_sf_weights_improved_boundary_t_minus_1(i32 %0, double %3)
%11 = fadd double %9, %10
%12 = fdiv double %1, -6.000000e+00
%13 = fmul double %12, %11
ret double %13
}