#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*/ printf(char *, double);
int main() {
  int i, j, k;
  int grid_x = 10;
  int grid_y = 10;
  int grid_z = 10;
  double XYa[grid_x + 1];
  double YYa[grid_y + 1];
  double koeff_x_close[grid_x + 1];
  double koeff_y_close[grid_y + 1];
  double koeff_z_open[grid_z + 1];
  double total_N;
  koeff_x_close[1] = koeff_y_close[1] = 25. / 24.;
  koeff_x_close[2] = koeff_y_close[2] = 25. / 24.;
  koeff_x_close[3] = koeff_y_close[3] = 3. / 4.;
  koeff_x_close[grid_x - 2] = koeff_y_close[grid_y - 2] = 3. / 4.;
  koeff_x_close[grid_x - 1] = koeff_y_close[grid_y - 1] = 25. / 24.;
  koeff_x_close[grid_x] = koeff_y_close[grid_y] = 25. / 24.;
  koeff_z_open[1] = koeff_z_open[grid_z] = 11. / 24.;
  koeff_z_open[2] = koeff_z_open[grid_z - 1] = 7. / 8.;
  koeff_z_open[3] = koeff_z_open[grid_z - 2] = 5. / 3.;
  for (i = 4; i <= grid_x - 3; i++) {
    koeff_x_close[i] = 1.;
  }
  for (i = 4; i <= grid_y - 3; i++) {
    koeff_y_close[i] = 1.;
  }
  for (i = 4; i <= grid_x - 3; i++) {
    if (i % 2 == 0)
      koeff_z_open[i] = 4. / 3.;
    else
      koeff_z_open[i] = 2. / 3.;
  }
  total_N = 0.;
  for (i = 1; i < grid_x + 1; i++) {
    XYa[i] = 0.;
    total_N = total_N + koeff_x_close[i];
  }
  printf("total_N is %8.4f\n", total_N);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x14(%rbp)
movl   $0xa,-0x18(%rbp)
movl   $0xa,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %rsp,%rcx
mov    %rcx,-0x28(%rbp)
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x78(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,%rsp
mov    %rax,-0x38(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x70(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x40(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
lea    0xf(,%rax,8),%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0x68(%rbp)
mov    %rdx,%rsp
mov    %rax,-0x48(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,%esi
lea    0xf(,%rsi,8),%rdi
and    $0xfffffffffffffff0,%rdi
mov    %rsp,%rax
sub    %rdi,%rax
mov    %rax,-0x60(%rbp)
mov    %rax,%rsp
mov    %rsi,-0x50(%rbp)
movsd  0xe25(%rip),%xmm0
movsd  %xmm0,0x8(%rdx)
movsd  0xe18(%rip),%xmm0
movsd  %xmm0,0x8(%rcx)
movsd  0xe0b(%rip),%xmm0
movsd  %xmm0,0x10(%rdx)
movsd  0xdfe(%rip),%xmm0
movsd  %xmm0,0x10(%rcx)
movsd  0xdf9(%rip),%xmm0
movsd  %xmm0,0x18(%rdx)
movsd  0xdec(%rip),%xmm0
movsd  %xmm0,0x18(%rcx)
mov    -0x18(%rbp),%esi
sub    $0x2,%esi
movslq %esi,%rsi
movsd  0xdd6(%rip),%xmm0
movsd  %xmm0,(%rdx,%rsi,8)
mov    -0x14(%rbp),%esi
sub    $0x2,%esi
movslq %esi,%rsi
movsd  0xdc0(%rip),%xmm0
movsd  %xmm0,(%rcx,%rsi,8)
mov    -0x18(%rbp),%esi
sub    $0x1,%esi
movslq %esi,%rsi
movsd  0xda2(%rip),%xmm0
movsd  %xmm0,(%rdx,%rsi,8)
mov    -0x14(%rbp),%esi
sub    $0x1,%esi
movslq %esi,%rsi
movsd  0xd8c(%rip),%xmm0
movsd  %xmm0,(%rcx,%rsi,8)
movslq -0x18(%rbp),%rsi
movsd  0xd7b(%rip),%xmm0
movsd  %xmm0,(%rdx,%rsi,8)
movslq -0x14(%rbp),%rdx
movsd  0xd6a(%rip),%xmm0
movsd  %xmm0,(%rcx,%rdx,8)
movslq -0x1c(%rbp),%rcx
movsd  0xd51(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  0xd44(%rip),%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  0xd26(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  0xd19(%rip),%xmm0
movsd  %xmm0,0x10(%rax)
mov    -0x1c(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
movsd  0xcfb(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  0xcee(%rip),%xmm0
movsd  %xmm0,0x18(%rax)
movl   $0x4,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x3,%ecx
cmp    %ecx,%eax
jg     1352 <main+0x242>
mov    -0x70(%rbp),%rax
movslq -0x8(%rbp),%rcx
movsd  0xcf9(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    131e <main+0x20e>
movl   $0x4,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x18(%rbp),%ecx
sub    $0x3,%ecx
cmp    %ecx,%eax
jg     138d <main+0x27d>
mov    -0x68(%rbp),%rax
movslq -0x8(%rbp),%rcx
movsd  0xcbe(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1359 <main+0x249>
movl   $0x4,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x3,%ecx
cmp    %ecx,%eax
jg     13fb <main+0x2eb>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    13d3 <main+0x2c3>
mov    -0x60(%rbp),%rax
movslq -0x8(%rbp),%rcx
movsd  0xc67(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    13e8 <main+0x2d8>
mov    -0x60(%rbp),%rax
movslq -0x8(%rbp),%rcx
movsd  0xc45(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    13ed <main+0x2dd>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1394 <main+0x284>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    1450 <main+0x340>
mov    -0x70(%rbp),%rax
mov    -0x78(%rbp),%rcx
movslq -0x8(%rbp),%rdx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rcx,%rdx,8)
movsd  -0x58(%rbp),%xmm0
movslq -0x8(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    140a <main+0x2fa>
movsd  -0x58(%rbp),%xmm0
lea    0xbe4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
movsd  0xee0(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"total_N is %8.4f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca double
store i32 0, i32* %1
store i32 10, i32* %5
store i32 10, i32* %6
store i32 10, i32* %7
%15 = load i32, i32* %5
%16 = add nsw i32 %15, 1
%17 = zext i32 %16 to i64
%18 = call i8* @llvm.stacksave()
store i8* %18, i8** %8
%19 = alloca double, i64 %17
store i64 %17, i64* %9
%20 = load i32, i32* %6
%21 = add nsw i32 %20, 1
%22 = zext i32 %21 to i64
%23 = alloca double, i64 %22
store i64 %22, i64* %10
%24 = load i32, i32* %5
%25 = add nsw i32 %24, 1
%26 = zext i32 %25 to i64
%27 = alloca double, i64 %26
store i64 %26, i64* %11
%28 = load i32, i32* %6
%29 = add nsw i32 %28, 1
%30 = zext i32 %29 to i64
%31 = alloca double, i64 %30
store i64 %30, i64* %12
%32 = load i32, i32* %7
%33 = add nsw i32 %32, 1
%34 = zext i32 %33 to i64
%35 = alloca double, i64 %34
store i64 %34, i64* %13
%36 = getelementptr inbounds double, double* %31, i64 1
store double 0x3FF0AAAAAAAAAAAB, double* %36
%37 = getelementptr inbounds double, double* %27, i64 1
store double 0x3FF0AAAAAAAAAAAB, double* %37
%38 = getelementptr inbounds double, double* %31, i64 2
store double 0x3FF0AAAAAAAAAAAB, double* %38
%39 = getelementptr inbounds double, double* %27, i64 2
store double 0x3FF0AAAAAAAAAAAB, double* %39
%40 = getelementptr inbounds double, double* %31, i64 3
store double 7.500000e-01, double* %40
%41 = getelementptr inbounds double, double* %27, i64 3
store double 7.500000e-01, double* %41
%42 = load i32, i32* %6
%43 = sub nsw i32 %42, 2
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds double, double* %31, i64 %44
store double 7.500000e-01, double* %45
%46 = load i32, i32* %5
%47 = sub nsw i32 %46, 2
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds double, double* %27, i64 %48
store double 7.500000e-01, double* %49
%50 = load i32, i32* %6
%51 = sub nsw i32 %50, 1
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds double, double* %31, i64 %52
store double 0x3FF0AAAAAAAAAAAB, double* %53
%54 = load i32, i32* %5
%55 = sub nsw i32 %54, 1
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds double, double* %27, i64 %56
store double 0x3FF0AAAAAAAAAAAB, double* %57
%58 = load i32, i32* %6
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds double, double* %31, i64 %59
store double 0x3FF0AAAAAAAAAAAB, double* %60
%61 = load i32, i32* %5
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds double, double* %27, i64 %62
store double 0x3FF0AAAAAAAAAAAB, double* %63
%64 = load i32, i32* %7
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds double, double* %35, i64 %65
store double 0x3FDD555555555555, double* %66
%67 = getelementptr inbounds double, double* %35, i64 1
store double 0x3FDD555555555555, double* %67
%68 = load i32, i32* %7
%69 = sub nsw i32 %68, 1
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds double, double* %35, i64 %70
store double 8.750000e-01, double* %71
%72 = getelementptr inbounds double, double* %35, i64 2
store double 8.750000e-01, double* %72
%73 = load i32, i32* %7
%74 = sub nsw i32 %73, 2
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds double, double* %35, i64 %75
store double 0x3FFAAAAAAAAAAAAB, double* %76
%77 = getelementptr inbounds double, double* %35, i64 3
store double 0x3FFAAAAAAAAAAAAB, double* %77
store i32 4, i32* %2
br label %78
78: ; preds = %87, %0
%79 = load i32, i32* %2
%80 = load i32, i32* %5
%81 = sub nsw i32 %80, 3
%82 = icmp sle i32 %79, %81
br i1 %82, label %83, label %90
83: ; preds = %78
%84 = load i32, i32* %2
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds double, double* %27, i64 %85
store double 1.000000e+00, double* %86
br label %87
87: ; preds = %83
%88 = load i32, i32* %2
%89 = add nsw i32 %88, 1
store i32 %89, i32* %2
br label %78
90: ; preds = %78
store i32 4, i32* %2
br label %91
91: ; preds = %100, %90
%92 = load i32, i32* %2
%93 = load i32, i32* %6
%94 = sub nsw i32 %93, 3
%95 = icmp sle i32 %92, %94
br i1 %95, label %96, label %103
96: ; preds = %91
%97 = load i32, i32* %2
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds double, double* %31, i64 %98
store double 1.000000e+00, double* %99
br label %100
100: ; preds = %96
%101 = load i32, i32* %2
%102 = add nsw i32 %101, 1
store i32 %102, i32* %2
br label %91
103: ; preds = %91
store i32 4, i32* %2
br label %104
104: ; preds = %122, %103
%105 = load i32, i32* %2
%106 = load i32, i32* %5
%107 = sub nsw i32 %106, 3
%108 = icmp sle i32 %105, %107
br i1 %108, label %109, label %125
109: ; preds = %104
%110 = load i32, i32* %2
%111 = srem i32 %110, 2
%112 = icmp eq i32 %111, 0
br i1 %112, label %113, label %117
113: ; preds = %109
%114 = load i32, i32* %2
%115 = sext i32 %114 to i64
%116 = getelementptr inbounds double, double* %35, i64 %115
store double 0x3FF5555555555555, double* %116
br label %121
117: ; preds = %109
%118 = load i32, i32* %2
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds double, double* %35, i64 %119
store double 0x3FE5555555555555, double* %120
br label %121
121: ; preds = %117, %113
br label %122
122: ; preds = %121
%123 = load i32, i32* %2
%124 = add nsw i32 %123, 1
store i32 %124, i32* %2
br label %104
125: ; preds = %104
store double 0.000000e+00, double* %14
store i32 1, i32* %2
br label %126
126: ; preds = %141, %125
%127 = load i32, i32* %2
%128 = load i32, i32* %5
%129 = add nsw i32 %128, 1
%130 = icmp slt i32 %127, %129
br i1 %130, label %131, label %144
131: ; preds = %126
%132 = load i32, i32* %2
%133 = sext i32 %132 to i64
%134 = getelementptr inbounds double, double* %19, i64 %133
store double 0.000000e+00, double* %134
%135 = load double, double* %14
%136 = load i32, i32* %2
%137 = sext i32 %136 to i64
%138 = getelementptr inbounds double, double* %27, i64 %137
%139 = load double, double* %138
%140 = fadd double %135, %139
store double %140, double* %14
br label %141
141: ; preds = %131
%142 = load i32, i32* %2
%143 = add nsw i32 %142, 1
store i32 %143, i32* %2
br label %126
144: ; preds = %126
%145 = load double, double* %14
%146 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), double %145)
%147 = load i8*, i8** %8
%148 = load i32, i32* %1
ret i32 %148
}

LLVM IR (-O2):
@.str = [18 x i8] c"total_N is %8.4f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), double 0x4023555555555555)
ret i32 0
}