#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 fabs(double);
double pow(double, double);
double dvv_dy(double **V, int i, int j, double dy, double gamma) {
  return 1.0 / dy *
             (pow((V[i][j] + V[i][j + 1]) / 2.0, 2.0) -
              pow((V[i][j - 1] + V[i][j]) / 2.0, 2.0)) +
         gamma / dy *
             (fabs(V[i][j] + V[i][j + 1]) / 2.0 * (V[i][j] - V[i][j + 1]) /
                  2.0 -
              fabs(V[i][j - 1] + V[i][j]) / 2.0 * (V[i][j - 1] - V[i][j]) /
                  2.0);
}


x86 assembly (clang, -O0):
<dvv_dy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
movsd  0xed4(%rip),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x10(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  0xe8b(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe7f(%rip),%xmm1
call   1030 <pow@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x10(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  0xe3e(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe32(%rip),%xmm1
call   1030 <pow@plt>
movsd  -0x30(%rbp),%xmm2
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
subsd  %xmm1,%xmm2
movsd  -0x20(%rbp),%xmm1
divsd  -0x18(%rbp),%xmm1
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x10(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm3
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
addsd  (%rax,%rcx,8),%xmm3
movaps 0xdec(%rip),%xmm4
pand   %xmm4,%xmm3
movsd  0xdd0(%rip),%xmm4
divsd  %xmm4,%xmm3
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x10(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm4
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm4
mulsd  %xmm4,%xmm3
movsd  0xd91(%rip),%xmm4
divsd  %xmm4,%xmm3
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm4
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x10(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm4
movaps 0xd67(%rip),%xmm5
pand   %xmm5,%xmm4
movsd  0xd4b(%rip),%xmm5
divsd  %xmm5,%xmm4
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm5
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x10(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm5
mulsd  %xmm5,%xmm4
movsd  0xd0c(%rip),%xmm5
divsd  %xmm5,%xmm4
subsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dvv_dy>:
movapd %xmm0,%xmm2
movsd  0xef4(%rip),%xmm3
divsd  %xmm0,%xmm3
movslq %esi,%rax
mov    (%rdi,%rax,8),%rax
movslq %edx,%rcx
movupd (%rax,%rcx,8),%xmm0
movapd %xmm0,%xmm6
shufpd $0x1,%xmm0,%xmm6
movhpd -0x8(%rax,%rcx,8),%xmm0
movapd %xmm6,%xmm4
addpd  %xmm0,%xmm4
movapd 0xed1(%rip),%xmm8
movapd %xmm4,%xmm5
mulpd  %xmm8,%xmm5
mulpd  %xmm5,%xmm5
movapd %xmm5,%xmm7
unpckhpd %xmm5,%xmm7
subsd  %xmm7,%xmm5
mulsd  %xmm3,%xmm5
divsd  %xmm2,%xmm1
andpd  0xeb8(%rip),%xmm4
mulpd  %xmm8,%xmm4
subpd  %xmm6,%xmm0
mulpd  %xmm4,%xmm0
mulpd  %xmm8,%xmm0
movapd %xmm0,%xmm2
unpckhpd %xmm0,%xmm2
subsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm5,%xmm0
ret

LLVM IR (-O0):
define double @dvv_dy(double** %0, i32 %1, i32 %2, double %3, double %4) {
%6 = alloca double**
%7 = alloca i32
%8 = alloca i32
%9 = alloca double
%10 = alloca double
store double** %0, double*** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store double %3, double* %9
store double %4, double* %10
%11 = load double, double* %9
%12 = fdiv double 1.000000e+00, %11
%13 = load double**, double*** %6
%14 = load i32, i32* %7
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds double*, double** %13, i64 %15
%17 = load double*, double** %16
%18 = load i32, i32* %8
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds double, double* %17, i64 %19
%21 = load double, double* %20
%22 = load double**, double*** %6
%23 = load i32, i32* %7
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds double*, double** %22, i64 %24
%26 = load double*, double** %25
%27 = load i32, i32* %8
%28 = add nsw i32 %27, 1
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds double, double* %26, i64 %29
%31 = load double, double* %30
%32 = fadd double %21, %31
%33 = fdiv double %32, 2.000000e+00
%34 = call double @pow(double %33, double 2.000000e+00)
%35 = load double**, double*** %6
%36 = load i32, i32* %7
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds double*, double** %35, i64 %37
%39 = load double*, double** %38
%40 = load i32, i32* %8
%41 = sub nsw i32 %40, 1
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds double, double* %39, i64 %42
%44 = load double, double* %43
%45 = load double**, double*** %6
%46 = load i32, i32* %7
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds double*, double** %45, i64 %47
%49 = load double*, double** %48
%50 = load i32, i32* %8
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds double, double* %49, i64 %51
%53 = load double, double* %52
%54 = fadd double %44, %53
%55 = fdiv double %54, 2.000000e+00
%56 = call double @pow(double %55, double 2.000000e+00)
%57 = fsub double %34, %56
%58 = load double, double* %10
%59 = load double, double* %9
%60 = fdiv double %58, %59
%61 = load double**, double*** %6
%62 = load i32, i32* %7
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds double*, double** %61, i64 %63
%65 = load double*, double** %64
%66 = load i32, i32* %8
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds double, double* %65, i64 %67
%69 = load double, double* %68
%70 = load double**, double*** %6
%71 = load i32, i32* %7
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds double*, double** %70, i64 %72
%74 = load double*, double** %73
%75 = load i32, i32* %8
%76 = add nsw i32 %75, 1
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds double, double* %74, i64 %77
%79 = load double, double* %78
%80 = fadd double %69, %79
%81 = call double @llvm.fabs.f64(double %80)
%82 = fdiv double %81, 2.000000e+00
%83 = load double**, double*** %6
%84 = load i32, i32* %7
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds double*, double** %83, i64 %85
%87 = load double*, double** %86
%88 = load i32, i32* %8
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds double, double* %87, i64 %89
%91 = load double, double* %90
%92 = load double**, double*** %6
%93 = load i32, i32* %7
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds double*, double** %92, i64 %94
%96 = load double*, double** %95
%97 = load i32, i32* %8
%98 = add nsw i32 %97, 1
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds double, double* %96, i64 %99
%101 = load double, double* %100
%102 = fsub double %91, %101
%103 = fmul double %82, %102
%104 = fdiv double %103, 2.000000e+00
%105 = load double**, double*** %6
%106 = load i32, i32* %7
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds double*, double** %105, i64 %107
%109 = load double*, double** %108
%110 = load i32, i32* %8
%111 = sub nsw i32 %110, 1
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds double, double* %109, i64 %112
%114 = load double, double* %113
%115 = load double**, double*** %6
%116 = load i32, i32* %7
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds double*, double** %115, i64 %117
%119 = load double*, double** %118
%120 = load i32, i32* %8
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds double, double* %119, i64 %121
%123 = load double, double* %122
%124 = fadd double %114, %123
%125 = call double @llvm.fabs.f64(double %124)
%126 = fdiv double %125, 2.000000e+00
%127 = load double**, double*** %6
%128 = load i32, i32* %7
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds double*, double** %127, i64 %129
%131 = load double*, double** %130
%132 = load i32, i32* %8
%133 = sub nsw i32 %132, 1
%134 = sext i32 %133 to i64
%135 = getelementptr inbounds double, double* %131, i64 %134
%136 = load double, double* %135
%137 = load double**, double*** %6
%138 = load i32, i32* %7
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds double*, double** %137, i64 %139
%141 = load double*, double** %140
%142 = load i32, i32* %8
%143 = sext i32 %142 to i64
%144 = getelementptr inbounds double, double* %141, i64 %143
%145 = load double, double* %144
%146 = fsub double %136, %145
%147 = fmul double %126, %146
%148 = fdiv double %147, 2.000000e+00
%149 = fsub double %104, %148
%150 = fmul double %60, %149
%151 = call double @llvm.fmuladd.f64(double %12, double %57, double %150)
ret double %151
}

LLVM IR (-O2):
define double @dvv_dy(double** nocapture %0, i32 %1, i32 %2, double %3, double %4) {
%6 = fdiv double 1.000000e+00, %3
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds double*, double** %0, i64 %7
%9 = load double*, double** %8
%10 = sext i32 %2 to i64
%11 = getelementptr inbounds double, double* %9, i64 %10
%12 = bitcast double* %11 to <2 x double>*
%13 = load <2 x double>, <2 x double>* %12
%14 = shufflevector <2 x double> %13, <2 x double> poison, <2 x i32> <i32 1, i32 0>
%15 = add nsw i32 %2, -1
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds double, double* %9, i64 %16
%18 = load double, double* %17
%19 = insertelement <2 x double> %13, double %18, i64 1
%20 = fadd <2 x double> %14, %19
%21 = fmul <2 x double> %20, <double 5.000000e-01, double 5.000000e-01>
%22 = fmul <2 x double> %21, %21
%23 = shufflevector <2 x double> %22, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%24 = fsub <2 x double> %22, %23
%25 = extractelement <2 x double> %24, i64 0
%26 = fdiv double %4, %3
%27 = call <2 x double> @llvm.fabs.v2f64(<2 x double> %20)
%28 = fmul <2 x double> %27, <double 5.000000e-01, double 5.000000e-01>
%29 = fsub <2 x double> %19, %14
%30 = fmul <2 x double> %29, %28
%31 = fmul <2 x double> %30, <double 5.000000e-01, double 5.000000e-01>
%32 = shufflevector <2 x double> %31, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%33 = fsub <2 x double> %31, %32
%34 = extractelement <2 x double> %33, i64 0
%35 = fmul double %26, %34
%36 = tail call double @llvm.fmuladd.f64(double %6, double %25, double %35)
ret double %36
}