#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*/ cp_vect(double **, double **, unsigned long);
int /*<<< orphan*/ do_vect(double **, unsigned long);
int /*<<< orphan*/ error_kernel_size(int, char *, unsigned int);
int /*<<< orphan*/ free(double *);
int gidz_cube(int, int, int, unsigned int);
int gidz_general(unsigned int, unsigned int, unsigned int, unsigned int,
                 unsigned int);
int /*<<< orphan*/ zero_vect(double *, unsigned long);
void convolve_kernel_inside(double **outmap, double *inmap, unsigned in_extx,
                            unsigned in_exty, unsigned in_extz, double *kernel,
                            unsigned kernel_size) {
  double dval;
  unsigned long out_nvox;
  unsigned indx, indy, indz;
  int indx2, indy2, indz2, margin;
  double *tmpmap;
  char *program = "lib_vwk";
  if (kernel_size < 1 || 2 * ((kernel_size + 1) / 2) - kernel_size - 1 != 0) {
    error_kernel_size(17140, program, kernel_size);
  }
  margin = (kernel_size - 1) / 2;
  out_nvox = in_extx * in_exty * in_extz;
  do_vect(&tmpmap, out_nvox);
  cp_vect(&tmpmap, &inmap, out_nvox);
  zero_vect(*outmap, out_nvox);
  for (indz = margin; indz < in_extz - margin; indz++)
    for (indy = margin; indy < in_exty - margin; indy++)
      for (indx = margin; indx < in_extx - margin; indx++) {
        dval = *(tmpmap + gidz_general(indz, indy, indx, in_exty, in_extx));
        if (dval != 0.0)
          for (indz2 = -margin; indz2 <= margin; indz2++)
            for (indy2 = -margin; indy2 <= margin; indy2++)
              for (indx2 = -margin; indx2 <= margin; indx2++) {
                *(*outmap + gidz_general(indz + indz2, indy + indy2,
                                         indx + indx2, in_exty, in_extx)) +=
                    *(kernel + gidz_cube(indz2 + margin, indy2 + margin,
                                         indx2 + margin, kernel_size)) *
                    dval;
              }
      }
  free(tmpmap);
}


x86 assembly (clang, -O0):
<convolve_kernel_inside>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9,-0x28(%rbp)
lea    0xe65(%rip),%rax
mov    %rax,-0x68(%rbp)
cmpl   $0x1,0x10(%rbp)
jb     11c4 <convolve_kernel_inside+0x54>
mov    0x10(%rbp),%eax
add    $0x1,%eax
shr    $0x1,%eax
shl    $0x1,%eax
sub    0x10(%rbp),%eax
sub    $0x1,%eax
cmp    $0x0,%eax
je     11d5 <convolve_kernel_inside+0x65>
mov    -0x68(%rbp),%rsi
mov    0x10(%rbp),%edx
mov    $0x42f4,%edi
call   1040 <error_kernel_size@plt>
mov    0x10(%rbp),%eax
sub    $0x1,%eax
shr    $0x1,%eax
mov    %eax,-0x54(%rbp)
mov    -0x14(%rbp),%eax
imul   -0x18(%rbp),%eax
imul   -0x1c(%rbp),%eax
mov    %eax,%eax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rsi
lea    -0x60(%rbp),%rdi
call   1070 <do_vect@plt>
mov    -0x38(%rbp),%rdx
lea    -0x60(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1090 <cp_vect@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x38(%rbp),%rsi
call   1060 <zero_vect@plt>
mov    -0x54(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%eax
mov    -0x1c(%rbp),%ecx
sub    -0x54(%rbp),%ecx
cmp    %ecx,%eax
jae    13f9 <convolve_kernel_inside+0x289>
mov    -0x54(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x40(%rbp),%eax
mov    -0x18(%rbp),%ecx
sub    -0x54(%rbp),%ecx
cmp    %ecx,%eax
jae    13e6 <convolve_kernel_inside+0x276>
mov    -0x54(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    -0x54(%rbp),%ecx
cmp    %ecx,%eax
jae    13d3 <convolve_kernel_inside+0x263>
mov    -0x60(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    -0x44(%rbp),%edi
mov    -0x40(%rbp),%esi
mov    -0x3c(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x14(%rbp),%r8d
call   1050 <gidz_general@plt>
mov    %eax,%ecx
mov    -0x70(%rbp),%rax
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    12b2 <convolve_kernel_inside+0x142>
jp     12b2 <convolve_kernel_inside+0x142>
jmp    13c0 <convolve_kernel_inside+0x250>
xor    %eax,%eax
sub    -0x54(%rbp),%eax
mov    %eax,-0x50(%rbp)
mov    -0x50(%rbp),%eax
cmp    -0x54(%rbp),%eax
jg     13bb <convolve_kernel_inside+0x24b>
xor    %eax,%eax
sub    -0x54(%rbp),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x54(%rbp),%eax
jg     13a8 <convolve_kernel_inside+0x238>
xor    %eax,%eax
sub    -0x54(%rbp),%eax
mov    %eax,-0x48(%rbp)
mov    -0x48(%rbp),%eax
cmp    -0x54(%rbp),%eax
jg     1395 <convolve_kernel_inside+0x225>
mov    -0x28(%rbp),%rax
mov    %rax,-0x90(%rbp)
mov    -0x50(%rbp),%edi
add    -0x54(%rbp),%edi
mov    -0x4c(%rbp),%esi
add    -0x54(%rbp),%esi
mov    -0x48(%rbp),%edx
add    -0x54(%rbp),%edx
mov    0x10(%rbp),%ecx
call   1080 <gidz_cube@plt>
mov    %eax,%ecx
mov    -0x90(%rbp),%rax
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x78(%rbp)
mov    -0x44(%rbp),%edi
add    -0x50(%rbp),%edi
mov    -0x40(%rbp),%esi
add    -0x4c(%rbp),%esi
mov    -0x3c(%rbp),%edx
add    -0x48(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x14(%rbp),%r8d
call   1050 <gidz_general@plt>
movsd  -0x88(%rbp),%xmm0
ff
movsd  -0x80(%rbp),%xmm2
mov    %eax,%ecx
mov    -0x78(%rbp),%rax
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    12e2 <convolve_kernel_inside+0x172>
jmp    139a <convolve_kernel_inside+0x22a>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    12ce <convolve_kernel_inside+0x15e>
jmp    13ad <convolve_kernel_inside+0x23d>
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    12ba <convolve_kernel_inside+0x14a>
jmp    13c0 <convolve_kernel_inside+0x250>
jmp    13c5 <convolve_kernel_inside+0x255>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1254 <convolve_kernel_inside+0xe4>
jmp    13d8 <convolve_kernel_inside+0x268>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    123d <convolve_kernel_inside+0xcd>
jmp    13eb <convolve_kernel_inside+0x27b>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1226 <convolve_kernel_inside+0xb6>
mov    -0x60(%rbp),%rdi
call   1030 <free@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convolve_kernel_inside>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
mov    %r9,0x78(%rsp)
mov    %r8d,%ebp
mov    %ecx,%r15d
mov    %edx,%r12d
mov    %rdi,0x50(%rsp)
mov    0xd0(%rsp),%ebx
mov    %rsi,0x90(%rsp)
test   %ebx,%ebx
je     11ae <convolve_kernel_inside+0x3e>
lea    0x1(%rbx),%eax
test   $0x1,%al
je     11c1 <convolve_kernel_inside+0x51>
lea    0xe53(%rip),%rsi
mov    $0x42f4,%edi
mov    %ebx,%edx
call   1040 <error_kernel_size@plt>
add    $0xffffffff,%ebx
shr    %ebx
mov    %r15d,%r13d
imul   %r12d,%r13d
imul   %ebp,%r13d
lea    0x58(%rsp),%r14
mov    %r14,%rdi
mov    %r13,%rsi
call   1070 <do_vect@plt>
lea    0x90(%rsp),%rsi
mov    %r14,%rdi
mov    %r13,%rdx
call   1090 <cp_vect@plt>
mov    0x50(%rsp),%rax
mov    (%rax),%rdi
mov    %r13,%rsi
call   1060 <zero_vect@plt>
sub    %ebx,%ebp
mov    %ebp,0x30(%rsp)
cmp    %ebp,%ebx
jae    1421 <convolve_kernel_inside+0x2b1>
mov    %r15d,%eax
sub    %ebx,%eax
mov    %eax,0xc(%rsp)
mov    %r12d,%eax
sub    %ebx,%eax
mov    %eax,0x10(%rsp)
mov    %ebx,%eax
neg    %eax
mov    %eax,0x14(%rsp)
lea    (%rbx,%rbx,1),%eax
add    $0x1,%eax
mov    %eax,0x38(%rsp)
mov    %ebx,%eax
mov    %rax,0x20(%rsp)
mov    %r15d,0x1c(%rsp)
mov    %r12d,0x18(%rsp)
mov    %rbx,0x68(%rsp)
mov    0x38(%rsp),%r14d
jmp    127a <convolve_kernel_inside+0x10a>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x20(%rsp),%rcx
add    $0x1,%ecx
mov    %rcx,%rax
mov    %rcx,0x20(%rsp)
cmp    0x30(%rsp),%ecx
je     1421 <convolve_kernel_inside+0x2b1>
cmp    0xc(%rsp),%ebx
jae    1260 <convolve_kernel_inside+0xf0>
mov    %ebx,%eax
mov    %rax,0x28(%rsp)
jmp    12a6 <convolve_kernel_inside+0x136>
nopl   0x0(%rax)
mov    0x28(%rsp),%rcx
add    $0x1,%ecx
mov    %rcx,%rax
mov    %rcx,0x28(%rsp)
cmp    0xc(%rsp),%ecx
je     1260 <convolve_kernel_inside+0xf0>
cmp    0x10(%rsp),%ebx
jae    1290 <convolve_kernel_inside+0x120>
xor    %eax,%eax
mov    %ebx,%edx
jmp    12df <convolve_kernel_inside+0x16f>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x34(%rsp),%edx
add    $0x1,%edx
mov    0x48(%rsp),%rax
add    $0x1,%eax
cmp    0x10(%rsp),%edx
mov    0x1c(%rsp),%r15d
mov    0x18(%rsp),%r12d
je     1290 <convolve_kernel_inside+0x120>
mov    %rax,0x48(%rsp)
mov    0x58(%rsp),%rbp
mov    0x20(%rsp),%rdi
mov    0x28(%rsp),%rsi
mov    %edx,0x34(%rsp)
mov    %r15d,%ecx
mov    %r12d,%r8d
call   1050 <gidz_general@plt>
cltq
movsd  0x0(%rbp,%rax,8),%xmm0
movsd  %xmm0,0x80(%rsp)
ucomisd 0xce5(%rip),%xmm0
jne    131f <convolve_kernel_inside+0x1af>
jnp    12c0 <convolve_kernel_inside+0x150>
mov    0x14(%rsp),%eax
mov    %eax,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
lea    (%rcx,%rbx,1),%r15d
mov    0x20(%rsp),%rax
mov    %rcx,0x60(%rsp)
add    %ecx,%eax
mov    %eax,0x3c(%rsp)
mov    0x14(%rsp),%eax
mov    %eax,%ecx
nopw   0x0(%rax,%rax,1)
lea    (%rcx,%rbx,1),%eax
mov    %eax,0x44(%rsp)
mov    0x28(%rsp),%rax
mov    %rcx,0x70(%rsp)
add    %ecx,%eax
mov    %eax,0x40(%rsp)
xor    %ebx,%ebx
mov    0x48(%rsp),%r13
mov    0x3c(%rsp),%r12d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15d,%edi
mov    0x44(%rsp),%esi
mov    %ebx,%edx
mov    0xd0(%rsp),%ecx
call   1080 <gidz_cube@plt>
cltq
mov    0x50(%rsp),%rcx
mov    (%rcx),%rbp
lea    (%rbx,%r13,1),%edx
mov    0x78(%rsp),%rcx
movsd  (%rcx,%rax,8),%xmm0
mulsd  0x80(%rsp),%xmm0
movsd  %xmm0,0x88(%rsp)
mov    %r12d,%edi
mov    0x40(%rsp),%esi
mov    0x1c(%rsp),%ecx
mov    0x18(%rsp),%r8d
call   1050 <gidz_general@plt>
cltq
movsd  0x88(%rsp),%xmm0
addsd  0x0(%rbp,%rax,8),%xmm0
movsd  %xmm0,0x0(%rbp,%rax,8)
add    $0x1,%ebx
cmp    %ebx,%r14d
jne    1380 <convolve_kernel_inside+0x210>
mov    0x70(%rsp),%rcx
lea    0x1(%rcx),%eax
mov    0x68(%rsp),%rbx
cmp    %ebx,%ecx
mov    %eax,%ecx
jne    1350 <convolve_kernel_inside+0x1e0>
mov    0x60(%rsp),%rcx
lea    0x1(%rcx),%eax
cmp    %ebx,%ecx
mov    %eax,%ecx
jne    1330 <convolve_kernel_inside+0x1c0>
jmp    12c0 <convolve_kernel_inside+0x150>
mov    0x58(%rsp),%rdi
call   1030 <free@plt>
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"lib_vwk\00"
define void @convolve_kernel_inside(double** %0, double* %1, i32 %2, i32 %3, i32 %4, double* %5, i32 %6) {
%8 = alloca double**
%9 = alloca double*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca double*
%14 = alloca i32
%15 = alloca double
%16 = alloca i64
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca double*
%25 = alloca i8*
store double** %0, double*** %8
store double* %1, double** %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store double* %5, double** %13
store i32 %6, i32* %14
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %25
%26 = load i32, i32* %14
%27 = icmp ult i32 %26, 1
br i1 %27, label %37, label %28
28: ; preds = %7
%29 = load i32, i32* %14
%30 = add i32 %29, 1
%31 = udiv i32 %30, 2
%32 = mul i32 2, %31
%33 = load i32, i32* %14
%34 = sub i32 %32, %33
%35 = sub i32 %34, 1
%36 = icmp ne i32 %35, 0
br i1 %36, label %37, label %41
37: ; preds = %28, %7
%38 = load i8*, i8** %25
%39 = load i32, i32* %14
%40 = call i32 @error_kernel_size(i32 17140, i8* %38, i32 %39)
br label %41
41: ; preds = %37, %28
%42 = load i32, i32* %14
%43 = sub i32 %42, 1
%44 = udiv i32 %43, 2
store i32 %44, i32* %23
%45 = load i32, i32* %10
%46 = load i32, i32* %11
%47 = mul i32 %45, %46
%48 = load i32, i32* %12
%49 = mul i32 %47, %48
%50 = zext i32 %49 to i64
store i64 %50, i64* %16
%51 = load i64, i64* %16
%52 = call i32 @do_vect(double** %24, i64 %51)
%53 = load i64, i64* %16
%54 = call i32 @cp_vect(double** %24, double** %9, i64 %53)
%55 = load double**, double*** %8
%56 = load double*, double** %55
%57 = load i64, i64* %16
%58 = call i32 @zero_vect(double* %56, i64 %57)
%59 = load i32, i32* %23
store i32 %59, i32* %19
br label %60
60: ; preds = %172, %41
%61 = load i32, i32* %19
%62 = load i32, i32* %12
%63 = load i32, i32* %23
%64 = sub i32 %62, %63
%65 = icmp ult i32 %61, %64
br i1 %65, label %66, label %175
66: ; preds = %60
%67 = load i32, i32* %23
store i32 %67, i32* %18
br label %68
68: ; preds = %168, %66
%69 = load i32, i32* %18
%70 = load i32, i32* %11
%71 = load i32, i32* %23
%72 = sub i32 %70, %71
%73 = icmp ult i32 %69, %72
br i1 %73, label %74, label %171
74: ; preds = %68
%75 = load i32, i32* %23
store i32 %75, i32* %17
br label %76
76: ; preds = %164, %74
%77 = load i32, i32* %17
%78 = load i32, i32* %10
%79 = load i32, i32* %23
%80 = sub i32 %78, %79
%81 = icmp ult i32 %77, %80
br i1 %81, label %82, label %167
82: ; preds = %76
%83 = load double*, double** %24
%84 = load i32, i32* %19
%85 = load i32, i32* %18
%86 = load i32, i32* %17
%87 = load i32, i32* %11
%88 = load i32, i32* %10
%89 = call i32 @gidz_general(i32 %84, i32 %85, i32 %86, i32 %87, i32 %88)
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds double, double* %83, i64 %90
%92 = load double, double* %91
store double %92, double* %15
%93 = load double, double* %15
%94 = fcmp une double %93, 0.000000e+00
br i1 %94, label %95, label %163
95: ; preds = %82
%96 = load i32, i32* %23
%97 = sub nsw i32 0, %96
store i32 %97, i32* %22
br label %98
98: ; preds = %159, %95
%99 = load i32, i32* %22
%100 = load i32, i32* %23
%101 = icmp sle i32 %99, %100
br i1 %101, label %102, label %162
102: ; preds = %98
%103 = load i32, i32* %23
%104 = sub nsw i32 0, %103
store i32 %104, i32* %21
br label %105
105: ; preds = %155, %102
%106 = load i32, i32* %21
%107 = load i32, i32* %23
%108 = icmp sle i32 %106, %107
br i1 %108, label %109, label %158
109: ; preds = %105
%110 = load i32, i32* %23
%111 = sub nsw i32 0, %110
store i32 %111, i32* %20
br label %112
112: ; preds = %151, %109
%113 = load i32, i32* %20
%114 = load i32, i32* %23
%115 = icmp sle i32 %113, %114
br i1 %115, label %116, label %154
116: ; preds = %112
%117 = load double*, double** %13
%118 = load i32, i32* %22
%119 = load i32, i32* %23
%120 = add nsw i32 %118, %119
%121 = load i32, i32* %21
%122 = load i32, i32* %23
%123 = add nsw i32 %121, %122
%124 = load i32, i32* %20
%125 = load i32, i32* %23
%126 = add nsw i32 %124, %125
%127 = load i32, i32* %14
%128 = call i32 @gidz_cube(i32 %120, i32 %123, i32 %126, i32 %127)
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds double, double* %117, i64 %129
%131 = load double, double* %130
%132 = load double, double* %15
%133 = load double**, double*** %8
%134 = load double*, double** %133
%135 = load i32, i32* %19
%136 = load i32, i32* %22
%137 = add i32 %135, %136
%138 = load i32, i32* %18
%139 = load i32, i32* %21
%140 = add i32 %138, %139
%141 = load i32, i32* %17
%142 = load i32, i32* %20
%143 = add i32 %141, %142
%144 = load i32, i32* %11
%145 = load i32, i32* %10
%146 = call i32 @gidz_general(i32 %137, i32 %140, i32 %143, i32 %144, i32 %145)
%147 = sext i32 %146 to i64
%148 = getelementptr inbounds double, double* %134, i64 %147
%149 = load double, double* %148
%150 = call double @llvm.fmuladd.f64(double %131, double %132, double %149)
store double %150, double* %148
br label %151
151: ; preds = %116
%152 = load i32, i32* %20
%153 = add nsw i32 %152, 1
store i32 %153, i32* %20
br label %112
154: ; preds = %112
br label %155
155: ; preds = %154
%156 = load i32, i32* %21
%157 = add nsw i32 %156, 1
store i32 %157, i32* %21
br label %105
158: ; preds = %105
br label %159
159: ; preds = %158
%160 = load i32, i32* %22
%161 = add nsw i32 %160, 1
store i32 %161, i32* %22
br label %98
162: ; preds = %98
br label %163
163: ; preds = %162, %82
br label %164
164: ; preds = %163
%165 = load i32, i32* %17
%166 = add i32 %165, 1
store i32 %166, i32* %17
br label %76
167: ; preds = %76
br label %168
168: ; preds = %167
%169 = load i32, i32* %18
%170 = add i32 %169, 1
store i32 %170, i32* %18
br label %68
171: ; preds = %68
br label %172
172: ; preds = %171
%173 = load i32, i32* %19
%174 = add i32 %173, 1
store i32 %174, i32* %19
br label %60
175: ; preds = %60
%176 = load double*, double** %24
%177 = call i32 @free(double* %176)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"lib_vwk\00"
define void @convolve_kernel_inside(double** nocapture %0, double* %1, i32 %2, i32 %3, i32 %4, double* nocapture %5, i32 %6) {
%8 = alloca double*
%9 = alloca double*
store double* %1, double** %8
%10 = bitcast double** %9 to i8*
%11 = icmp eq i32 %6, 0
br i1 %11, label %16, label %12
12: ; preds = %7
%13 = add i32 %6, 1
%14 = and i32 %13, -2
%15 = icmp eq i32 %14, %13
br i1 %15, label %18, label %16
16: ; preds = %12, %7
%17 = tail call i32 @error_kernel_size(i32 17140, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %18
18: ; preds = %16, %12
%19 = add i32 %6, -1
%20 = lshr i32 %19, 1
%21 = mul i32 %3, %2
%22 = mul i32 %21, %4
%23 = zext i32 %22 to i64
%24 = call i32 @do_vect(double** %9, i64 %23)
%25 = call i32 @cp_vect(double** %9, double** %8, i64 %23)
%26 = load double*, double** %0
%27 = call i32 @zero_vect(double* %26, i64 %23)
%28 = sub i32 %4, %20
%29 = icmp ult i32 %20, %28
br i1 %29, label %30, label %87
30: ; preds = %18
%31 = sub i32 %3, %20
%32 = icmp ult i32 %20, %31
%33 = sub i32 %2, %20
%34 = icmp ult i32 %20, %33
%35 = sub nsw i32 0, %20
br label %36
36: ; preds = %30, %84
%37 = phi i32 [ %20, %30 ], [ %85, %84 ]
br i1 %32, label %38, label %84
38: ; preds = %36, %81
%39 = phi i32 [ %82, %81 ], [ %20, %36 ]
br i1 %34, label %40, label %81
40: ; preds = %38, %78
%41 = phi i32 [ %79, %78 ], [ %20, %38 ]
%42 = load double*, double** %9
%43 = call i32 @gidz_general(i32 %37, i32 %39, i32 %41, i32 %3, i32 %2)
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds double, double* %42, i64 %44
%46 = load double, double* %45
%47 = fcmp oeq double %46, 0.000000e+00
br i1 %47, label %78, label %48
48: ; preds = %40, %75
%49 = phi i32 [ %76, %75 ], [ %35, %40 ]
%50 = add nsw i32 %49, %20
%51 = add i32 %49, %37
br label %52
52: ; preds = %72, %48
%53 = phi i32 [ %35, %48 ], [ %73, %72 ]
%54 = add nsw i32 %53, %20
%55 = add i32 %53, %39
br label %56
56: ; preds = %52, %56
%57 = phi i32 [ %35, %52 ], [ %70, %56 ]
%58 = add nsw i32 %57, %20
%59 = call i32 @gidz_cube(i32 %50, i32 %54, i32 %58, i32 %6)
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds double, double* %5, i64 %60
%62 = load double, double* %61
%63 = load double*, double** %0
%64 = add i32 %57, %41
%65 = call i32 @gidz_general(i32 %51, i32 %55, i32 %64, i32 %3, i32 %2)
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds double, double* %63, i64 %66
%68 = load double, double* %67
%69 = call double @llvm.fmuladd.f64(double %62, double %46, double %68)
store double %69, double* %67
%70 = add i32 %57, 1
%71 = icmp eq i32 %57, %20
br i1 %71, label %72, label %56
72: ; preds = %56
%73 = add i32 %53, 1
%74 = icmp eq i32 %53, %20
br i1 %74, label %75, label %52
75: ; preds = %72
%76 = add i32 %49, 1
%77 = icmp eq i32 %49, %20
br i1 %77, label %78, label %48
78: ; preds = %75, %40
%79 = add nuw i32 %41, 1
%80 = icmp eq i32 %79, %33
br i1 %80, label %81, label %40
81: ; preds = %78, %38
%82 = add nuw i32 %39, 1
%83 = icmp eq i32 %82, %31
br i1 %83, label %84, label %38
84: ; preds = %81, %36
%85 = add nuw i32 %37, 1
%86 = icmp eq i32 %85, %28
br i1 %86, label %87, label %36
87: ; preds = %84, %18
%88 = load double*, double** %9
%89 = call i32 @free(double* %88)
ret void
}