#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*/ do_vect(double **, unsigned long);
int /*<<< orphan*/ printf(char *, double, double, double, ...);
void create_padded_map(double **outmap, unsigned *out_extx, unsigned *out_exty,
                       unsigned *out_extz, double *out_origx, double *out_origy,
                       double *out_origz, unsigned long *out_nvox,
                       double *inmap, unsigned in_extx, unsigned in_exty,
                       unsigned in_extz, double in_origx, double in_origy,
                       double in_origz, double widthx, double widthy,
                       double widthz, unsigned margin[3]) {
  unsigned indz, indx, indy;
  unsigned long index_old, index_new;
  *out_nvox = (in_extx + margin[0] * 2) * (in_exty + margin[1] * 2) *
              (in_extz + margin[2] * 2);
  do_vect(outmap, *out_nvox);
  for (indz = 0; indz < in_extz; indz++)
    for (indy = 0; indy < in_exty; indy++)
      for (indx = 0; indx < in_extx; indx++) {
        index_old = in_extx * in_exty * indz + in_extx * indy + indx;
        index_new = ((in_extx + 2 * margin[0]) * (in_exty + 2 * margin[1]) *
                         (indz + margin[2]) +
                     (in_extx + 2 * margin[0]) * (indy + margin[1]) +
                     (indx + margin[0]));
        *(*outmap + index_new) = *(inmap + index_old);
      }
  *out_extx = in_extx + margin[0] * 2;
  *out_exty = in_exty + margin[1] * 2;
  *out_extz = in_extz + margin[2] * 2;
  *out_origx = in_origx - margin[0] * widthx;
  *out_origy = in_origy - margin[1] * widthy;
  *out_origz = in_origz - margin[2] * widthz;
  printf("lib_vwk> Map size expanded from %d x %d x %d to %d x %d x %d by "
         "zero-padding.\n",
         *out_extx - margin[0] * 2, *out_exty - margin[1] * 2,
         *out_extz - margin[2] * 2, *out_extx, *out_exty, *out_extz);
  printf("lib_vwk> New map origin (coord of first voxel): (%.3f,%.3f,%.3f)\n",
         *out_origx, *out_origy, *out_origz);
}


x86 assembly (clang, -O0):
<create_padded_map>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    0x40(%rbp),%rax
mov    0x38(%rbp),%eax
mov    0x30(%rbp),%eax
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movsd  %xmm0,-0x38(%rbp)
movsd  %xmm1,-0x40(%rbp)
movsd  %xmm2,-0x48(%rbp)
movsd  %xmm3,-0x50(%rbp)
movsd  %xmm4,-0x58(%rbp)
movsd  %xmm5,-0x60(%rbp)
mov    0x28(%rbp),%eax
mov    0x40(%rbp),%rcx
mov    (%rcx),%ecx
shl    $0x1,%ecx
add    %ecx,%eax
mov    0x30(%rbp),%ecx
mov    0x40(%rbp),%rdx
mov    0x4(%rdx),%edx
shl    $0x1,%edx
add    %edx,%ecx
imul   %ecx,%eax
mov    0x38(%rbp),%ecx
mov    0x40(%rbp),%rdx
mov    0x8(%rdx),%edx
shl    $0x1,%edx
add    %edx,%ecx
imul   %ecx,%eax
mov    %eax,%eax
mov    %eax,%ecx
mov    0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rdi
mov    0x18(%rbp),%rax
mov    (%rax),%rsi
call   1040 <do_vect@plt>
movl   $0x0,-0x64(%rbp)
mov    -0x64(%rbp),%eax
cmp    0x38(%rbp),%eax
jae    12c9 <create_padded_map+0x1a9>
movl   $0x0,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
cmp    0x30(%rbp),%eax
jae    12b6 <create_padded_map+0x196>
movl   $0x0,-0x68(%rbp)
mov    -0x68(%rbp),%eax
cmp    0x28(%rbp),%eax
jae    12a3 <create_padded_map+0x183>
mov    0x28(%rbp),%eax
imul   0x30(%rbp),%eax
imul   -0x64(%rbp),%eax
mov    0x28(%rbp),%ecx
imul   -0x6c(%rbp),%ecx
add    %ecx,%eax
add    -0x68(%rbp),%eax
mov    %eax,%eax
mov    %rax,-0x78(%rbp)
mov    0x28(%rbp),%eax
mov    0x40(%rbp),%rcx
mov    (%rcx),%ecx
shl    $0x1,%ecx
add    %ecx,%eax
mov    0x30(%rbp),%ecx
mov    0x40(%rbp),%rdx
mov    0x4(%rdx),%edx
shl    $0x1,%edx
add    %edx,%ecx
imul   %ecx,%eax
mov    -0x64(%rbp),%ecx
mov    0x40(%rbp),%rdx
add    0x8(%rdx),%ecx
imul   %ecx,%eax
mov    0x28(%rbp),%ecx
mov    0x40(%rbp),%rdx
mov    (%rdx),%edx
shl    $0x1,%edx
add    %edx,%ecx
mov    -0x6c(%rbp),%edx
mov    0x40(%rbp),%rsi
add    0x4(%rsi),%edx
imul   %edx,%ecx
add    %ecx,%eax
mov    -0x68(%rbp),%ecx
mov    0x40(%rbp),%rdx
add    (%rdx),%ecx
add    %ecx,%eax
mov    %eax,%eax
mov    %rax,-0x80(%rbp)
mov    0x20(%rbp),%rax
mov    -0x78(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x80(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    11f4 <create_padded_map+0xd4>
jmp    12a8 <create_padded_map+0x188>
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
jmp    11e1 <create_padded_map+0xc1>
jmp    12bb <create_padded_map+0x19b>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    11ce <create_padded_map+0xae>
mov    0x28(%rbp),%ecx
mov    0x40(%rbp),%rax
mov    (%rax),%edx
mov    %ecx,%eax
mov    %edx,%ecx
lea    (%rax,%rcx,2),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    0x30(%rbp),%ecx
mov    0x40(%rbp),%rax
mov    0x4(%rax),%edx
mov    %ecx,%eax
mov    %edx,%ecx
lea    (%rax,%rcx,2),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    0x38(%rbp),%ecx
mov    0x40(%rbp),%rax
mov    0x8(%rax),%edx
mov    %ecx,%eax
mov    %edx,%ecx
lea    (%rax,%rcx,2),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
movsd  -0x38(%rbp),%xmm0
mov    0x40(%rbp),%rax
mov    (%rax),%eax
cvtsi2sd %rax,%xmm1
movsd  -0x50(%rbp),%xmm2
mulsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x40(%rbp),%xmm0
mov    0x40(%rbp),%rax
mov    0x4(%rax),%eax
cvtsi2sd %rax,%xmm1
movsd  -0x58(%rbp),%xmm2
mulsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x48(%rbp),%xmm0
mov    0x40(%rbp),%rax
mov    0x8(%rax),%eax
cvtsi2sd %rax,%xmm1
movsd  -0x60(%rbp),%xmm2
mulsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
mov    0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    0x40(%rbp),%rcx
mov    (%rcx),%esi
mov    0x4(%rcx),%edx
add    %esi,%esi
sub    %esi,%eax
cvtsi2sd %rax,%xmm0
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
add    %edx,%edx
sub    %edx,%eax
cvtsi2sd %rax,%xmm1
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    0x8(%rcx),%ecx
add    %ecx,%ecx
sub    %ecx,%eax
cvtsi2sd %rax,%xmm2
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
lea    0xc30(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm1
mov    0x10(%rbp),%rax
movsd  (%rax),%xmm2
lea    0xc59(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_padded_map>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xf8,%rsp
movsd  %xmm5,0x88(%rsp)
movsd  %xmm4,0x70(%rsp)
movsd  %xmm3,0x60(%rsp)
movsd  %xmm2,0x80(%rsp)
movsd  %xmm1,0x68(%rsp)
movsd  %xmm0,0x58(%rsp)
mov    %r9,0xa8(%rsp)
mov    %r8,0xa0(%rsp)
mov    %rcx,0x50(%rsp)
mov    %rdx,0x90(%rsp)
mov    %rsi,0x78(%rsp)
mov    0x160(%rsp),%rsi
mov    0x158(%rsp),%ebp
mov    0x150(%rsp),%edx
mov    0x148(%rsp),%r14d
mov    0x140(%rsp),%rbx
mov    0x130(%rsp),%rax
mov    %rax,0x98(%rsp)
mov    0x138(%rsp),%r8
mov    (%rsi),%ecx
mov    0x4(%rsi),%eax
lea    (%r14,%rcx,2),%ecx
mov    %rdx,0x10(%rsp)
lea    (%rdx,%rax,2),%edx
imul   %ecx,%edx
mov    %rsi,0x38(%rsp)
mov    0x8(%rsi),%ecx
lea    0x0(%rbp,%rcx,2),%esi
imul   %edx,%esi
mov    %rsi,(%r8)
mov    %rdi,0xe8(%rsp)
call   1040 <do_vect@plt>
mov    %r14,%rcx
mov    %rbp,0x20(%rsp)
test   %ebp,%ebp
je     1516 <create_padded_map+0x3f6>
mov    %ecx,%r13d
lea    -0x1(%r13),%rax
mov    %rax,0xd8(%rsp)
mov    0x10(%rsp),%rax
imul   %ecx,%eax
mov    %rax,0x30(%rsp)
lea    (%rbx,%r13,8),%rax
mov    %rax,0xd0(%rsp)
mov    %r13d,%eax
and    $0xfffffffc,%eax
mov    %rax,0xc8(%rsp)
add    $0xfffffffffffffffc,%rax
mov    %rax,0xc0(%rsp)
mov    %rax,%rdx
shr    $0x2,%rdx
add    $0x1,%rdx
mov    %rdx,%rax
mov    %rdx,0xb8(%rsp)
and    $0xfffffffffffffffe,%rdx
mov    %rdx,0xb0(%rsp)
mov    %r13,%rax
neg    %rax
mov    %rax,0xe0(%rsp)
xor    %eax,%eax
mov    %rax,0x28(%rsp)
movl   $0x4,0x18(%rsp)
movl   $0x0,0xc(%rsp)
mov    %rcx,0x48(%rsp)
jmp    12b3 <create_padded_map+0x193>
xchg   %ax,%ax
mov    0xc(%rsp),%edx
add    $0x1,%edx
mov    0x30(%rsp),%rax
add    %eax,0x18(%rsp)
add    %rax,0x28(%rsp)
mov    %edx,0xc(%rsp)
cmp    0x20(%rsp),%edx
je     1516 <create_padded_map+0x3f6>
cmpl   $0x0,0x10(%rsp)
je     1290 <create_padded_map+0x170>
mov    0x30(%rsp),%rax
mov    %eax,%edx
mov    0xc(%rsp),%eax
imul   %eax,%edx
mov    %edx,0x1c(%rsp)
imul   0x10(%rsp),%eax
mov    %rax,0xf0(%rsp)
xor    %r12d,%r12d
mov    0x28(%rsp),%r15
mov    0x18(%rsp),%r10d
jmp    1306 <create_padded_map+0x1e6>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r12d
mov    0x48(%rsp),%rcx
add    %ecx,%r10d
add    %r13,%r15
cmp    0x10(%rsp),%r12d
je     1290 <create_padded_map+0x170>
test   %ecx,%ecx
je     12f0 <create_padded_map+0x1d0>
mov    0xf0(%rsp),%rax
add    %r12d,%eax
mov    0x48(%rsp),%rsi
imul   %esi,%eax
mov    %rax,0x40(%rsp)
mov    0x38(%rsp),%rax
mov    (%rax),%edi
mov    0x4(%rax),%r14d
lea    (%rsi,%rdi,2),%ecx
mov    0x10(%rsp),%rdx
lea    (%rdx,%r14,2),%edx
mov    0x8(%rax),%ebp
add    0xc(%rsp),%ebp
imul   %edx,%ebp
add    %r12d,%r14d
add    %ebp,%r14d
imul   %ecx,%r14d
mov    0xe8(%rsp),%rax
mov    (%rax),%r9
cmp    $0x4,%esi
jb     13d0 <create_padded_map+0x2b0>
mov    %r12d,%ecx
imul   %esi,%ecx
add    0x1c(%rsp),%ecx
lea    (%rdi,%r14,1),%r11d
mov    %ecx,%edx
mov    0xd8(%rsp),%rax
add    %eax,%edx
setb   %dl
mov    %r11d,%ebp
add    %eax,%ebp
jb     13d0 <create_padded_map+0x2b0>
mov    %rax,%rbp
shr    $0x20,%rbp
jne    13d0 <create_padded_map+0x2b0>
test   %dl,%dl
jne    13d0 <create_padded_map+0x2b0>
mov    $0x0,%r8d
test   %rbp,%rbp
jne    13d3 <create_padded_map+0x2b3>
mov    0xd0(%rsp),%rax
lea    (%rax,%rcx,8),%rdx
lea    (%r9,%r11,8),%rbp
cmp    %rdx,%rbp
jae    1456 <create_padded_map+0x336>
lea    (%rbx,%rcx,8),%rcx
lea    (%r9,%r13,8),%rdx
lea    (%rdx,%r11,8),%rdx
cmp    %rdx,%rcx
jae    1456 <create_padded_map+0x336>
nopw   0x0(%rax,%rax,1)
xor    %r8d,%r8d
mov    %r8,%rcx
test   $0x1,%r13b
je     13fd <create_padded_map+0x2dd>
mov    0x40(%rsp),%rcx
add    %r8d,%ecx
lea    (%rdi,%r8,1),%eax
add    %r14d,%eax
movsd  (%rbx,%rcx,8),%xmm0
movsd  %xmm0,(%r9,%rax,8)
mov    %r8,%rcx
or     $0x1,%rcx
not    %r8
cmp    0xe0(%rsp),%r8
je     12f0 <create_padded_map+0x1d0>
add    %r14d,%edi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    (%r15,%rcx,1),%rax
mov    %eax,%edx
lea    (%rdi,%rcx,1),%rsi
mov    %esi,%ebp
movsd  (%rbx,%rdx,8),%xmm0
movsd  %xmm0,(%r9,%rbp,8)
add    $0x1,%eax
add    $0x1,%esi
movsd  (%rbx,%rax,8),%xmm0
movsd  %xmm0,(%r9,%rsi,8)
add    $0x2,%rcx
cmp    %rcx,%r13
jne    1420 <create_padded_map+0x300>
jmp    12f0 <create_padded_map+0x1d0>
cmpq   $0x0,0xc0(%rsp)
je     1508 <create_padded_map+0x3e8>
mov    0xb0(%rsp),%rdx
mov    %r10d,%ebp
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    -0x4(%rbp),%esi
mov    %r11d,%eax
movups (%rbx,%rsi,8),%xmm0
movups 0x10(%rbx,%rsi,8),%xmm1
movups %xmm0,(%r9,%rax,8)
movups %xmm1,0x10(%r9,%rax,8)
mov    %ebp,%eax
lea    0x4(%r11),%esi
movups (%rbx,%rax,8),%xmm0
movups 0x10(%rbx,%rax,8),%xmm1
movups %xmm0,(%r9,%rsi,8)
movups %xmm1,0x10(%r9,%rsi,8)
add    $0x8,%rcx
add    $0x8,%ebp
add    $0x8,%r11d
add    $0xfffffffffffffffe,%rdx
jne    1480 <create_padded_map+0x360>
testb  $0x1,0xb8(%rsp)
01
je     14ef <create_padded_map+0x3cf>
mov    0x40(%rsp),%rax
add    %ecx,%eax
add    %edi,%ecx
add    %r14d,%ecx
movups (%rbx,%rax,8),%xmm0
movups 0x10(%rbx,%rax,8),%xmm1
movups %xmm0,(%r9,%rcx,8)
movups %xmm1,0x10(%r9,%rcx,8)
mov    0xc8(%rsp),%rax
mov    %rax,%r8
cmp    %r13,%rax
je     12f0 <create_padded_map+0x1d0>
jmp    13d3 <create_padded_map+0x2b3>
xor    %ecx,%ecx
testb  $0x1,0xb8(%rsp)
01
jne    14cf <create_padded_map+0x3af>
jmp    14ef <create_padded_map+0x3cf>
mov    0x38(%rsp),%rsi
mov    (%rsi),%eax
lea    (%rcx,%rax,2),%eax
mov    0x78(%rsp),%rdx
mov    %eax,(%rdx)
mov    0x4(%rsi),%eax
mov    0x10(%rsp),%rcx
lea    (%rcx,%rax,2),%eax
mov    0x90(%rsp),%r8
mov    %eax,(%r8)
mov    0x8(%rsi),%eax
mov    0x20(%rsp),%rcx
lea    (%rcx,%rax,2),%ecx
mov    0x50(%rsp),%rax
mov    %ecx,(%rax)
mov    (%rsi),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mulsd  0x60(%rsp),%xmm0
movsd  0x58(%rsp),%xmm1
subsd  %xmm0,%xmm1
mov    0xa0(%rsp),%r14
movsd  %xmm1,(%r14)
mov    0x4(%rsi),%edi
xorps  %xmm0,%xmm0
cvtsi2sd %rdi,%xmm0
mulsd  0x70(%rsp),%xmm0
movsd  0x68(%rsp),%xmm1
subsd  %xmm0,%xmm1
mov    0xa8(%rsp),%r15
movsd  %xmm1,(%r15)
mov    0x8(%rsi),%ebp
xorps  %xmm0,%xmm0
cvtsi2sd %rbp,%xmm0
mulsd  0x88(%rsp),%xmm0
movsd  0x80(%rsp),%xmm1
subsd  %xmm0,%xmm1
mov    0x98(%rsp),%rbx
movsd  %xmm1,(%rbx)
mov    (%rdx),%esi
add    %eax,%eax
mov    %esi,%edx
sub    %eax,%edx
xorps  %xmm0,%xmm0
cvtsi2sd %rdx,%xmm0
mov    (%r8),%edx
lea    (%rdi,%rdi,1),%eax
mov    %edx,%edi
sub    %eax,%edi
xorps  %xmm1,%xmm1
cvtsi2sd %rdi,%xmm1
mov    %ecx,%edi
sub    %ebp,%edi
sub    %ebp,%edi
cvtsi2sd %rdi,%xmm2
lea    0xa01(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
movsd  (%r14),%xmm0
movsd  (%r15),%xmm1
movsd  (%rbx),%xmm2
lea    0xa34(%rip),%rdi
mov    $0x3,%al
add    $0xf8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [79 x i8] c"lib_vwk> Map size expanded from %d x %d x %d to %d x %d x %d by zero-padding.\0A\00"
@.str.1 = [66 x i8] c"lib_vwk> New map origin (coord of first voxel): (%.3f,%.3f,%.3f)\0A\00"
define void @create_padded_map(double** %0, i32* %1, i32* %2, i32* %3, double* %4, double* %5, double* %6, i64* %7, double* %8, i32 %9, i32 %10, i32 %11, double %12, double %13, double %14, double %15, double %16, double %17, i32* %18) {
%20 = alloca double**
%21 = alloca i32*
%22 = alloca i32*
%23 = alloca i32*
%24 = alloca double*
%25 = alloca double*
%26 = alloca double*
%27 = alloca i64*
%28 = alloca double*
%29 = alloca i32
%30 = alloca i32
%31 = alloca i32
%32 = alloca double
%33 = alloca double
%34 = alloca double
%35 = alloca double
%36 = alloca double
%37 = alloca double
%38 = alloca i32*
%39 = alloca i32
%40 = alloca i32
%41 = alloca i32
%42 = alloca i64
%43 = alloca i64
store double** %0, double*** %20
store i32* %1, i32** %21
store i32* %2, i32** %22
store i32* %3, i32** %23
store double* %4, double** %24
store double* %5, double** %25
store double* %6, double** %26
store i64* %7, i64** %27
store double* %8, double** %28
store i32 %9, i32* %29
store i32 %10, i32* %30
store i32 %11, i32* %31
store double %12, double* %32
store double %13, double* %33
store double %14, double* %34
store double %15, double* %35
store double %16, double* %36
store double %17, double* %37
store i32* %18, i32** %38
%44 = load i32, i32* %29
%45 = load i32*, i32** %38
%46 = getelementptr inbounds i32, i32* %45, i64 0
%47 = load i32, i32* %46
%48 = mul i32 %47, 2
%49 = add i32 %44, %48
%50 = load i32, i32* %30
%51 = load i32*, i32** %38
%52 = getelementptr inbounds i32, i32* %51, i64 1
%53 = load i32, i32* %52
%54 = mul i32 %53, 2
%55 = add i32 %50, %54
%56 = mul i32 %49, %55
%57 = load i32, i32* %31
%58 = load i32*, i32** %38
%59 = getelementptr inbounds i32, i32* %58, i64 2
%60 = load i32, i32* %59
%61 = mul i32 %60, 2
%62 = add i32 %57, %61
%63 = mul i32 %56, %62
%64 = zext i32 %63 to i64
%65 = load i64*, i64** %27
store i64 %64, i64* %65
%66 = load double**, double*** %20
%67 = load i64*, i64** %27
%68 = load i64, i64* %67
%69 = call i32 @do_vect(double** %66, i64 %68)
store i32 0, i32* %39
br label %70
70: ; preds = %152, %19
%71 = load i32, i32* %39
%72 = load i32, i32* %31
%73 = icmp ult i32 %71, %72
br i1 %73, label %74, label %155
74: ; preds = %70
store i32 0, i32* %41
br label %75
75: ; preds = %148, %74
%76 = load i32, i32* %41
%77 = load i32, i32* %30
%78 = icmp ult i32 %76, %77
br i1 %78, label %79, label %151
79: ; preds = %75
store i32 0, i32* %40
br label %80
80: ; preds = %144, %79
%81 = load i32, i32* %40
%82 = load i32, i32* %29
%83 = icmp ult i32 %81, %82
br i1 %83, label %84, label %147
84: ; preds = %80
%85 = load i32, i32* %29
%86 = load i32, i32* %30
%87 = mul i32 %85, %86
%88 = load i32, i32* %39
%89 = mul i32 %87, %88
%90 = load i32, i32* %29
%91 = load i32, i32* %41
%92 = mul i32 %90, %91
%93 = add i32 %89, %92
%94 = load i32, i32* %40
%95 = add i32 %93, %94
%96 = zext i32 %95 to i64
store i64 %96, i64* %42
%97 = load i32, i32* %29
%98 = load i32*, i32** %38
%99 = getelementptr inbounds i32, i32* %98, i64 0
%100 = load i32, i32* %99
%101 = mul i32 2, %100
%102 = add i32 %97, %101
%103 = load i32, i32* %30
%104 = load i32*, i32** %38
%105 = getelementptr inbounds i32, i32* %104, i64 1
%106 = load i32, i32* %105
%107 = mul i32 2, %106
%108 = add i32 %103, %107
%109 = mul i32 %102, %108
%110 = load i32, i32* %39
%111 = load i32*, i32** %38
%112 = getelementptr inbounds i32, i32* %111, i64 2
%113 = load i32, i32* %112
%114 = add i32 %110, %113
%115 = mul i32 %109, %114
%116 = load i32, i32* %29
%117 = load i32*, i32** %38
%118 = getelementptr inbounds i32, i32* %117, i64 0
%119 = load i32, i32* %118
%120 = mul i32 2, %119
%121 = add i32 %116, %120
%122 = load i32, i32* %41
%123 = load i32*, i32** %38
%124 = getelementptr inbounds i32, i32* %123, i64 1
%125 = load i32, i32* %124
%126 = add i32 %122, %125
%127 = mul i32 %121, %126
%128 = add i32 %115, %127
%129 = load i32, i32* %40
%130 = load i32*, i32** %38
%131 = getelementptr inbounds i32, i32* %130, i64 0
%132 = load i32, i32* %131
%133 = add i32 %129, %132
%134 = add i32 %128, %133
%135 = zext i32 %134 to i64
store i64 %135, i64* %43
%136 = load double*, double** %28
%137 = load i64, i64* %42
%138 = getelementptr inbounds double, double* %136, i64 %137
%139 = load double, double* %138
%140 = load double**, double*** %20
%141 = load double*, double** %140
%142 = load i64, i64* %43
%143 = getelementptr inbounds double, double* %141, i64 %142
store double %139, double* %143
br label %144
144: ; preds = %84
%145 = load i32, i32* %40
%146 = add i32 %145, 1
store i32 %146, i32* %40
br label %80
147: ; preds = %80
br label %148
148: ; preds = %147
%149 = load i32, i32* %41
%150 = add i32 %149, 1
store i32 %150, i32* %41
br label %75
151: ; preds = %75
br label %152
152: ; preds = %151
%153 = load i32, i32* %39
%154 = add i32 %153, 1
store i32 %154, i32* %39
br label %70
155: ; preds = %70
%156 = load i32, i32* %29
%157 = load i32*, i32** %38
%158 = getelementptr inbounds i32, i32* %157, i64 0
%159 = load i32, i32* %158
%160 = mul i32 %159, 2
%161 = add i32 %156, %160
%162 = load i32*, i32** %21
store i32 %161, i32* %162
%163 = load i32, i32* %30
%164 = load i32*, i32** %38
%165 = getelementptr inbounds i32, i32* %164, i64 1
%166 = load i32, i32* %165
%167 = mul i32 %166, 2
%168 = add i32 %163, %167
%169 = load i32*, i32** %22
store i32 %168, i32* %169
%170 = load i32, i32* %31
%171 = load i32*, i32** %38
%172 = getelementptr inbounds i32, i32* %171, i64 2
%173 = load i32, i32* %172
%174 = mul i32 %173, 2
%175 = add i32 %170, %174
%176 = load i32*, i32** %23
store i32 %175, i32* %176
%177 = load double, double* %32
%178 = load i32*, i32** %38
%179 = getelementptr inbounds i32, i32* %178, i64 0
%180 = load i32, i32* %179
%181 = uitofp i32 %180 to double
%182 = load double, double* %35
%183 = fneg double %181
%184 = call double @llvm.fmuladd.f64(double %183, double %182, double %177)
%185 = load double*, double** %24
store double %184, double* %185
%186 = load double, double* %33
%187 = load i32*, i32** %38
%188 = getelementptr inbounds i32, i32* %187, i64 1
%189 = load i32, i32* %188
%190 = uitofp i32 %189 to double
%191 = load double, double* %36
%192 = fneg double %190
%193 = call double @llvm.fmuladd.f64(double %192, double %191, double %186)
%194 = load double*, double** %25
store double %193, double* %194
%195 = load double, double* %34
%196 = load i32*, i32** %38
%197 = getelementptr inbounds i32, i32* %196, i64 2
%198 = load i32, i32* %197
%199 = uitofp i32 %198 to double
%200 = load double, double* %37
%201 = fneg double %199
%202 = call double @llvm.fmuladd.f64(double %201, double %200, double %195)
%203 = load double*, double** %26
store double %202, double* %203
%204 = load i32*, i32** %21
%205 = load i32, i32* %204
%206 = load i32*, i32** %38
%207 = getelementptr inbounds i32, i32* %206, i64 0
%208 = load i32, i32* %207
%209 = mul i32 %208, 2
%210 = sub i32 %205, %209
%211 = uitofp i32 %210 to double
%212 = load i32*, i32** %22
%213 = load i32, i32* %212
%214 = load i32*, i32** %38
%215 = getelementptr inbounds i32, i32* %214, i64 1
%216 = load i32, i32* %215
%217 = mul i32 %216, 2
%218 = sub i32 %213, %217
%219 = uitofp i32 %218 to double
%220 = load i32*, i32** %23
%221 = load i32, i32* %220
%222 = load i32*, i32** %38
%223 = getelementptr inbounds i32, i32* %222, i64 2
%224 = load i32, i32* %223
%225 = mul i32 %224, 2
%226 = sub i32 %221, %225
%227 = uitofp i32 %226 to double
%228 = load i32*, i32** %21
%229 = load i32, i32* %228
%230 = load i32*, i32** %22
%231 = load i32, i32* %230
%232 = load i32*, i32** %23
%233 = load i32, i32* %232
%234 = call i32 (i8*, double, double, double, ...) @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0), double %211, double %219, double %227, i32 %229, i32 %231, i32 %233)
%235 = load double*, double** %24
%236 = load double, double* %235
%237 = load double*, double** %25
%238 = load double, double* %237
%239 = load double*, double** %26
%240 = load double, double* %239
%241 = call i32 (i8*, double, double, double, ...) @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.1, i64 0, i64 0), double %236, double %238, double %240)
ret void
}

LLVM IR (-O2):
@.str = [79 x i8] c"lib_vwk> Map size expanded from %d x %d x %d to %d x %d x %d by zero-padding.\0A\00"
@.str.1 = [66 x i8] c"lib_vwk> New map origin (coord of first voxel): (%.3f,%.3f,%.3f)\0A\00"
define void @create_padded_map(double** %0, i32* nocapture %1, i32* nocapture %2, i32* nocapture %3, double* nocapture %4, double* nocapture %5, double* nocapture %6, i64* nocapture writeonly %7, double* nocapture %8, i32 %9, i32 %10, i32 %11, double %12, double %13, double %14, double %15, double %16, double %17, i32* nocapture %18) {
%20 = load i32, i32* %18
%21 = shl i32 %20, 1
%22 = add i32 %21, %9
%23 = getelementptr inbounds i32, i32* %18, i64 1
%24 = load i32, i32* %23
%25 = shl i32 %24, 1
%26 = add i32 %25, %10
%27 = mul i32 %26, %22
%28 = getelementptr inbounds i32, i32* %18, i64 2
%29 = load i32, i32* %28
%30 = shl i32 %29, 1
%31 = add i32 %30, %11
%32 = mul i32 %27, %31
%33 = zext i32 %32 to i64
store i64 %33, i64* %7
%34 = tail call i32 @do_vect(double** %0, i64 %33)
%35 = icmp eq i32 %11, 0
br i1 %35, label %217, label %36
36: ; preds = %19
%37 = icmp eq i32 %10, 0
%38 = icmp eq i32 %9, 0
%39 = zext i32 %9 to i64
%40 = add nsw i64 %39, -1
%41 = mul i32 %10, %9
%42 = mul i32 %10, %9
%43 = getelementptr double, double* %8, i64 %39
%44 = and i64 %39, 4294967292
%45 = add nsw i64 %44, -4
%46 = lshr exact i64 %45, 2
%47 = add nuw nsw i64 %46, 1
%48 = icmp ult i32 %9, 4
%49 = trunc i64 %40 to i32
%50 = icmp ugt i64 %40, 4294967295
%51 = trunc i64 %40 to i32
%52 = icmp ugt i64 %40, 4294967295
%53 = and i64 %39, 4294967292
%54 = and i64 %47, 1
%55 = icmp eq i64 %45, 0
%56 = and i64 %47, 9223372036854775806
%57 = icmp eq i64 %54, 0
%58 = icmp eq i64 %53, %39
%59 = and i64 %39, 1
%60 = icmp eq i64 %59, 0
%61 = sub nsw i64 0, %39
br label %62
62: ; preds = %36, %214
%63 = phi i32 [ 0, %36 ], [ %215, %214 ]
%64 = mul i32 %42, %63
%65 = mul i32 %41, %63
br i1 %37, label %214, label %66
66: ; preds = %62
%67 = mul i32 %63, %10
br label %68
68: ; preds = %66, %211
%69 = phi i32 [ 0, %66 ], [ %212, %211 ]
%70 = mul i32 %69, %9
%71 = add i32 %64, %70
%72 = zext i32 %71 to i64
%73 = getelementptr double, double* %8, i64 %72
%74 = getelementptr double, double* %43, i64 %72
%75 = mul i32 %69, %9
%76 = add i32 %65, %75
br i1 %38, label %211, label %77
77: ; preds = %68
%78 = add i32 %69, %67
%79 = mul i32 %78, %9
%80 = load i32, i32* %18
%81 = shl i32 %80, 1
%82 = add i32 %81, %9
%83 = load i32, i32* %23
%84 = shl i32 %83, 1
%85 = add i32 %84, %10
%86 = load i32, i32* %28
%87 = add i32 %86, %63
%88 = mul i32 %87, %85
%89 = add i32 %83, %69
%90 = add i32 %89, %88
%91 = mul i32 %90, %82
%92 = load double*, double** %0
br i1 %48, label %171, label %93
93: ; preds = %77
%94 = add i32 %80, %91
%95 = xor i32 %94, -1
%96 = icmp ult i32 %95, %49
%97 = or i1 %96, %50
%98 = xor i32 %76, -1
%99 = icmp ult i32 %98, %51
%100 = or i1 %99, %52
%101 = or i1 %97, %100
br i1 %101, label %171, label %102
102: ; preds = %93
%103 = add i32 %80, %91
%104 = zext i32 %103 to i64
%105 = getelementptr double, double* %92, i64 %104
%106 = getelementptr double, double* %92, i64 %39
%107 = getelementptr double, double* %106, i64 %104
%108 = icmp ult double* %105, %74
%109 = icmp ult double* %73, %107
%110 = and i1 %108, %109
br i1 %110, label %171, label %111
111: ; preds = %102
br i1 %55, label %151, label %112
112: ; preds = %111, %112
%113 = phi i64 [ %148, %112 ], [ 0, %111 ]
%114 = phi i64 [ %149, %112 ], [ 0, %111 ]
%115 = trunc i64 %113 to i32
%116 = add i32 %79, %115
%117 = zext i32 %116 to i64
%118 = add i32 %80, %115
%119 = add i32 %118, %91
%120 = zext i32 %119 to i64
%121 = getelementptr inbounds double, double* %8, i64 %117
%122 = bitcast double* %121 to <2 x double>*
%123 = load <2 x double>, <2 x double>* %122
%124 = getelementptr inbounds double, double* %121, i64 2
%125 = bitcast double* %124 to <2 x double>*
%126 = load <2 x double>, <2 x double>* %125
%127 = getelementptr inbounds double, double* %92, i64 %120
%128 = bitcast double* %127 to <2 x double>*
store <2 x double> %123, <2 x double>* %128
%129 = getelementptr inbounds double, double* %127, i64 2
%130 = bitcast double* %129 to <2 x double>*
store <2 x double> %126, <2 x double>* %130
%131 = trunc i64 %113 to i32
%132 = or i32 %131, 4
%133 = add i32 %79, %132
%134 = zext i32 %133 to i64
%135 = add i32 %80, %132
%136 = add i32 %135, %91
%137 = zext i32 %136 to i64
%138 = getelementptr inbounds double, double* %8, i64 %134
%139 = bitcast double* %138 to <2 x double>*
%140 = load <2 x double>, <2 x double>* %139
%141 = getelementptr inbounds double, double* %138, i64 2
%142 = bitcast double* %141 to <2 x double>*
%143 = load <2 x double>, <2 x double>* %142
%144 = getelementptr inbounds double, double* %92, i64 %137
%145 = bitcast double* %144 to <2 x double>*
store <2 x double> %140, <2 x double>* %145
%146 = getelementptr inbounds double, double* %144, i64 2
%147 = bitcast double* %146 to <2 x double>*
store <2 x double> %143, <2 x double>* %147
%148 = add nuw i64 %113, 8
%149 = add i64 %114, 2
%150 = icmp eq i64 %149, %56
br i1 %150, label %151, label %112
151: ; preds = %112, %111
%152 = phi i64 [ 0, %111 ], [ %148, %112 ]
br i1 %57, label %170, label %153
153: ; preds = %151
%154 = trunc i64 %152 to i32
%155 = add i32 %79, %154
%156 = zext i32 %155 to i64
%157 = add i32 %80, %154
%158 = add i32 %157, %91
%159 = zext i32 %158 to i64
%160 = getelementptr inbounds double, double* %8, i64 %156
%161 = bitcast double* %160 to <2 x double>*
%162 = load <2 x double>, <2 x double>* %161
%163 = getelementptr inbounds double, double* %160, i64 2
%164 = bitcast double* %163 to <2 x double>*
%165 = load <2 x double>, <2 x double>* %164
%166 = getelementptr inbounds double, double* %92, i64 %159
%167 = bitcast double* %166 to <2 x double>*
store <2 x double> %162, <2 x double>* %167
%168 = getelementptr inbounds double, double* %166, i64 2
%169 = bitcast double* %168 to <2 x double>*
store <2 x double> %165, <2 x double>* %169
br label %170
170: ; preds = %151, %153
br i1 %58, label %211, label %171
171: ; preds = %102, %93, %77, %170
%172 = phi i64 [ 0, %102 ], [ 0, %93 ], [ 0, %77 ], [ %53, %170 ]
%173 = xor i64 %172, -1
br i1 %60, label %185, label %174
174: ; preds = %171
%175 = trunc i64 %172 to i32
%176 = add i32 %79, %175
%177 = zext i32 %176 to i64
%178 = add i32 %80, %175
%179 = add i32 %178, %91
%180 = zext i32 %179 to i64
%181 = getelementptr inbounds double, double* %8, i64 %177
%182 = load double, double* %181
%183 = getelementptr inbounds double, double* %92, i64 %180
store double %182, double* %183
%184 = or i64 %172, 1
br label %185
185: ; preds = %174, %171
%186 = phi i64 [ %172, %171 ], [ %184, %174 ]
%187 = icmp eq i64 %173, %61
br i1 %187, label %211, label %188
188: ; preds = %185, %188
%189 = phi i64 [ %209, %188 ], [ %186, %185 ]
%190 = trunc i64 %189 to i32
%191 = add i32 %79, %190
%192 = zext i32 %191 to i64
%193 = add i32 %80, %190
%194 = add i32 %193, %91
%195 = zext i32 %194 to i64
%196 = getelementptr inbounds double, double* %8, i64 %192
%197 = load double, double* %196
%198 = getelementptr inbounds double, double* %92, i64 %195
store double %197, double* %198
%199 = trunc i64 %189 to i32
%200 = add i32 %199, 1
%201 = add i32 %79, %200
%202 = zext i32 %201 to i64
%203 = add i32 %80, %200
%204 = add i32 %203, %91
%205 = zext i32 %204 to i64
%206 = getelementptr inbounds double, double* %8, i64 %202
%207 = load double, double* %206
%208 = getelementptr inbounds double, double* %92, i64 %205
store double %207, double* %208
%209 = add nuw nsw i64 %189, 2
%210 = icmp eq i64 %209, %39
br i1 %210, label %211, label %188
211: ; preds = %185, %188, %170, %68
%212 = add nuw i32 %69, 1
%213 = icmp eq i32 %212, %10
br i1 %213, label %214, label %68
214: ; preds = %211, %62
%215 = add nuw i32 %63, 1
%216 = icmp eq i32 %215, %11
br i1 %216, label %217, label %62
217: ; preds = %214, %19
%218 = load i32, i32* %18
%219 = shl i32 %218, 1
%220 = add i32 %219, %9
store i32 %220, i32* %1
%221 = load i32, i32* %23
%222 = shl i32 %221, 1
%223 = add i32 %222, %10
store i32 %223, i32* %2
%224 = load i32, i32* %28
%225 = shl i32 %224, 1
%226 = add i32 %225, %11
store i32 %226, i32* %3
%227 = load i32, i32* %18
%228 = uitofp i32 %227 to double
%229 = fneg double %228
%230 = tail call double @llvm.fmuladd.f64(double %229, double %15, double %12)
store double %230, double* %4
%231 = load i32, i32* %23
%232 = uitofp i32 %231 to double
%233 = fneg double %232
%234 = tail call double @llvm.fmuladd.f64(double %233, double %16, double %13)
store double %234, double* %5
%235 = load i32, i32* %28
%236 = uitofp i32 %235 to double
%237 = fneg double %236
%238 = tail call double @llvm.fmuladd.f64(double %237, double %17, double %14)
store double %238, double* %6
%239 = load i32, i32* %1
%240 = mul i32 %227, -2
%241 = add i32 %239, %240
%242 = uitofp i32 %241 to double
%243 = load i32, i32* %2
%244 = mul i32 %231, -2
%245 = add i32 %243, %244
%246 = uitofp i32 %245 to double
%247 = mul i32 %235, -2
%248 = add i32 %247, %226
%249 = uitofp i32 %248 to double
%250 = tail call i32 (i8*, double, double, double, ...) @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0), double %242, double %246, double %249, i32 %239, i32 %243, i32 %226)
%251 = load double, double* %4
%252 = load double, double* %5
%253 = load double, double* %6
%254 = tail call i32 (i8*, double, double, double, ...) @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.1, i64 0, i64 0), double %251, double %252, double %253)
ret void
}