#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 /*<<< orphan*/ Neumann_XZ(double *, int, int, int, int, int, int, double);
int /*<<< orphan*/ Neumann_YZ(double *, int, int, int, int, int, int, double);
void Phi_2D_BC_2(double *phi, int nX, int nY, double delta_x) {
  Neumann_XZ(phi, nX, nY, 1, 1, 1, 0., delta_x);
  Neumann_XZ(phi, nX, nY, 1, (nY - 2), -1, 0., delta_x);
  Neumann_YZ(phi, nX, nY, 1, 1, 1, 0., delta_x);
  Neumann_YZ(phi, nX, nY, 1, (nX - 2), -1, 0., delta_x);
  Neumann_XZ(phi, nX, nY, 1, 0, 1, 0., delta_x);
  Neumann_XZ(phi, nX, nY, 1, (nY - 1), -1, 0., delta_x);
  Neumann_YZ(phi, nX, nY, 1, 0, 1, 0., delta_x);
  Neumann_YZ(phi, nX, nY, 1, (nX - 1), -1, 0., delta_x);
}


x86 assembly (clang, -O0):
<Phi_2D_BC_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
movsd  -0x18(%rbp),%xmm0
mov    $0x1,%r9d
xor    %eax,%eax
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x0,(%rsp)
call   1030 <Neumann_XZ@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x10(%rbp),%r8d
sub    $0x2,%r8d
movsd  -0x18(%rbp),%xmm0
mov    $0x1,%ecx
mov    $0xffffffff,%r9d
xor    %eax,%eax
movl   $0x0,(%rsp)
call   1030 <Neumann_XZ@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
movsd  -0x18(%rbp),%xmm0
mov    $0x1,%r9d
xor    %eax,%eax
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x0,(%rsp)
call   1040 <Neumann_YZ@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%r8d
sub    $0x2,%r8d
movsd  -0x18(%rbp),%xmm0
mov    $0x1,%ecx
mov    $0xffffffff,%r9d
xor    %eax,%eax
movl   $0x0,(%rsp)
call   1040 <Neumann_YZ@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
movsd  -0x18(%rbp),%xmm0
mov    $0x1,%r9d
xor    %r8d,%r8d
mov    %r9d,%ecx
movl   $0x0,(%rsp)
call   1030 <Neumann_XZ@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x10(%rbp),%r8d
sub    $0x1,%r8d
movsd  -0x18(%rbp),%xmm0
mov    $0x1,%ecx
mov    $0xffffffff,%r9d
xor    %eax,%eax
movl   $0x0,(%rsp)
call   1030 <Neumann_XZ@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
movsd  -0x18(%rbp),%xmm0
mov    $0x1,%r9d
xor    %r8d,%r8d
mov    %r9d,%ecx
movl   $0x0,(%rsp)
call   1040 <Neumann_YZ@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%r8d
sub    $0x1,%r8d
movsd  -0x18(%rbp),%xmm0
mov    $0x1,%ecx
mov    $0xffffffff,%r9d
xor    %eax,%eax
movl   $0x0,(%rsp)
call   1040 <Neumann_YZ@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Phi_2D_BC_2>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
mov    %edx,%r14d
mov    %esi,%ebx
mov    %rdi,%r15
movl   $0x0,(%rsp)
mov    $0x1,%ecx
mov    $0x1,%r8d
mov    $0x1,%r9d
call   1030 <Neumann_XZ@plt>
lea    -0x2(%r14),%r8d
movl   $0x0,(%rsp)
mov    %r15,%rdi
mov    %ebx,%esi
mov    %r14d,%edx
mov    $0x1,%ecx
mov    $0xffffffff,%r9d
movsd  0x8(%rsp),%xmm0
call   1030 <Neumann_XZ@plt>
movl   $0x0,(%rsp)
mov    %r15,%rdi
mov    %ebx,%esi
mov    %r14d,%edx
mov    $0x1,%ecx
mov    $0x1,%r8d
mov    $0x1,%r9d
movsd  0x8(%rsp),%xmm0
call   1040 <Neumann_YZ@plt>
lea    -0x2(%rbx),%r8d
movl   $0x0,(%rsp)
mov    %r15,%rdi
mov    %ebx,%esi
mov    %r14d,%edx
mov    $0x1,%ecx
mov    $0xffffffff,%r9d
movsd  0x8(%rsp),%xmm0
call   1040 <Neumann_YZ@plt>
movl   $0x0,(%rsp)
mov    %r15,%rdi
mov    %ebx,%esi
mov    %r14d,%edx
mov    $0x1,%ecx
xor    %r8d,%r8d
mov    $0x1,%r9d
movsd  0x8(%rsp),%xmm0
call   1030 <Neumann_XZ@plt>
lea    -0x1(%r14),%r8d
movl   $0x0,(%rsp)
mov    %r15,%rdi
mov    %ebx,%esi
mov    %r14d,%edx
mov    $0x1,%ecx
mov    $0xffffffff,%r9d
movsd  0x8(%rsp),%xmm0
call   1030 <Neumann_XZ@plt>
movl   $0x0,(%rsp)
mov    %r15,%rdi
mov    %ebx,%esi
mov    %r14d,%edx
mov    $0x1,%ecx
xor    %r8d,%r8d
mov    $0x1,%r9d
movsd  0x8(%rsp),%xmm0
call   1040 <Neumann_YZ@plt>
lea    -0x1(%rbx),%r8d
movl   $0x0,(%rsp)
mov    %r15,%rdi
mov    %ebx,%esi
mov    %r14d,%edx
mov    $0x1,%ecx
mov    $0xffffffff,%r9d
movsd  0x8(%rsp),%xmm0
call   1040 <Neumann_YZ@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @Phi_2D_BC_2(double* %0, i32 %1, i32 %2, double %3) {
%5 = alloca double*
%6 = alloca i32
%7 = alloca i32
%8 = alloca double
store double* %0, double** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store double %3, double* %8
%9 = load double*, double** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load double, double* %8
%13 = call i32 @Neumann_XZ(double* %9, i32 %10, i32 %11, i32 1, i32 1, i32 1, i32 0, double %12)
%14 = load double*, double** %5
%15 = load i32, i32* %6
%16 = load i32, i32* %7
%17 = load i32, i32* %7
%18 = sub nsw i32 %17, 2
%19 = load double, double* %8
%20 = call i32 @Neumann_XZ(double* %14, i32 %15, i32 %16, i32 1, i32 %18, i32 -1, i32 0, double %19)
%21 = load double*, double** %5
%22 = load i32, i32* %6
%23 = load i32, i32* %7
%24 = load double, double* %8
%25 = call i32 @Neumann_YZ(double* %21, i32 %22, i32 %23, i32 1, i32 1, i32 1, i32 0, double %24)
%26 = load double*, double** %5
%27 = load i32, i32* %6
%28 = load i32, i32* %7
%29 = load i32, i32* %6
%30 = sub nsw i32 %29, 2
%31 = load double, double* %8
%32 = call i32 @Neumann_YZ(double* %26, i32 %27, i32 %28, i32 1, i32 %30, i32 -1, i32 0, double %31)
%33 = load double*, double** %5
%34 = load i32, i32* %6
%35 = load i32, i32* %7
%36 = load double, double* %8
%37 = call i32 @Neumann_XZ(double* %33, i32 %34, i32 %35, i32 1, i32 0, i32 1, i32 0, double %36)
%38 = load double*, double** %5
%39 = load i32, i32* %6
%40 = load i32, i32* %7
%41 = load i32, i32* %7
%42 = sub nsw i32 %41, 1
%43 = load double, double* %8
%44 = call i32 @Neumann_XZ(double* %38, i32 %39, i32 %40, i32 1, i32 %42, i32 -1, i32 0, double %43)
%45 = load double*, double** %5
%46 = load i32, i32* %6
%47 = load i32, i32* %7
%48 = load double, double* %8
%49 = call i32 @Neumann_YZ(double* %45, i32 %46, i32 %47, i32 1, i32 0, i32 1, i32 0, double %48)
%50 = load double*, double** %5
%51 = load i32, i32* %6
%52 = load i32, i32* %7
%53 = load i32, i32* %6
%54 = sub nsw i32 %53, 1
%55 = load double, double* %8
%56 = call i32 @Neumann_YZ(double* %50, i32 %51, i32 %52, i32 1, i32 %54, i32 -1, i32 0, double %55)
ret void
}

LLVM IR (-O2):
define void @Phi_2D_BC_2(double* %0, i32 %1, i32 %2, double %3) {
%5 = tail call i32 @Neumann_XZ(double* %0, i32 %1, i32 %2, i32 1, i32 1, i32 1, i32 0, double %3)
%6 = add nsw i32 %2, -2
%7 = tail call i32 @Neumann_XZ(double* %0, i32 %1, i32 %2, i32 1, i32 %6, i32 -1, i32 0, double %3)
%8 = tail call i32 @Neumann_YZ(double* %0, i32 %1, i32 %2, i32 1, i32 1, i32 1, i32 0, double %3)
%9 = add nsw i32 %1, -2
%10 = tail call i32 @Neumann_YZ(double* %0, i32 %1, i32 %2, i32 1, i32 %9, i32 -1, i32 0, double %3)
%11 = tail call i32 @Neumann_XZ(double* %0, i32 %1, i32 %2, i32 1, i32 0, i32 1, i32 0, double %3)
%12 = add nsw i32 %2, -1
%13 = tail call i32 @Neumann_XZ(double* %0, i32 %1, i32 %2, i32 1, i32 %12, i32 -1, i32 0, double %3)
%14 = tail call i32 @Neumann_YZ(double* %0, i32 %1, i32 %2, i32 1, i32 0, i32 1, i32 0, double %3)
%15 = add nsw i32 %1, -1
%16 = tail call i32 @Neumann_YZ(double* %0, i32 %1, i32 %2, i32 1, i32 %15, i32 -1, i32 0, double %3)
ret void
}