#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*/ InterpolatedValue3DTranMirr(float *, double, double, double,
                                               float, double, double, double,
                                               long);
extern void BatchInterpolatedValue3DTranMirrWarp(
    float *Bout, float *Bcoeff, long Width, long Height, long Slice, double nx,
    double offx, double mx, float *WarpX, double ny, double offy, double my,
    float *WarpY, double nz, double offz, double mz, float *WarpZ,
    long SplineDegree) {
  double x, y, z;
  long idx;
  long idcoordx, idcoordy, idcoordz;
  for (idx = 0; idx < nx * ny * nz; idx++)
    Bout[idx] = 0;
  idx = 0;
  for (idcoordz = 0; idcoordz < Slice; idcoordz++) {
    for (idcoordy = 0; idcoordy < Height; idcoordy++) {
      for (idcoordx = 0; idcoordx < Width; idcoordx++) {
        x = (idcoordx + WarpX[idx] - offx) / mx;
        y = (idcoordy + WarpY[idx] - offy) / my;
        z = (idcoordz + WarpZ[idx] - offz) / mz;
        InterpolatedValue3DTranMirr(Bout, nx, ny, nz, Bcoeff[idx++], x, y, z,
                                    SplineDegree);
      }
    }
  }
}


x86 assembly (clang, -O0):
<BatchInterpolatedValue3DTranMirrWarp>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
movsd  0x18(%rbp),%xmm8
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
movsd  %xmm0,-0x30(%rbp)
movsd  %xmm1,-0x38(%rbp)
movsd  %xmm2,-0x40(%rbp)
mov    %r9,-0x48(%rbp)
movsd  %xmm3,-0x50(%rbp)
movsd  %xmm4,-0x58(%rbp)
movsd  %xmm5,-0x60(%rbp)
movsd  %xmm6,-0x68(%rbp)
movsd  %xmm7,-0x70(%rbp)
movq   $0x0,-0x90(%rbp)
cvtsi2sdq -0x90(%rbp),%xmm1
ff ff
movsd  -0x30(%rbp),%xmm0
mulsd  -0x50(%rbp),%xmm0
mulsd  -0x68(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    11c4 <BatchInterpolatedValue3DTranMirrWarp+0xb4>
mov    -0x8(%rbp),%rax
mov    -0x90(%rbp),%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x90(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x90(%rbp)
jmp    1178 <BatchInterpolatedValue3DTranMirrWarp+0x68>
movq   $0x0,-0x90(%rbp)
movq   $0x0,-0xa8(%rbp)
mov    -0xa8(%rbp),%rax
cmp    -0x28(%rbp),%rax
jge    1345 <BatchInterpolatedValue3DTranMirrWarp+0x235>
movq   $0x0,-0xa0(%rbp)
mov    -0xa0(%rbp),%rax
cmp    -0x20(%rbp),%rax
jge    1329 <BatchInterpolatedValue3DTranMirrWarp+0x219>
movq   $0x0,-0x98(%rbp)
mov    -0x98(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    130d <BatchInterpolatedValue3DTranMirrWarp+0x1fd>
cvtsi2ssq -0x98(%rbp),%xmm0
ff ff
mov    -0x48(%rbp),%rax
mov    -0x90(%rbp),%rcx
addss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
subsd  -0x38(%rbp),%xmm0
divsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
cvtsi2ssq -0xa0(%rbp),%xmm0
ff ff
mov    0x10(%rbp),%rax
mov    -0x90(%rbp),%rcx
addss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
subsd  -0x58(%rbp),%xmm0
divsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
cvtsi2ssq -0xa8(%rbp),%xmm0
ff ff
mov    0x20(%rbp),%rax
mov    -0x90(%rbp),%rcx
addss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
subsd  -0x70(%rbp),%xmm0
divsd  0x18(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0x8(%rbp),%rdi
movsd  -0x30(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm1
movsd  -0x68(%rbp),%xmm2
mov    -0x10(%rbp),%rax
mov    -0x90(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x90(%rbp)
movss  (%rax,%rcx,4),%xmm3
movsd  -0x78(%rbp),%xmm4
movsd  -0x80(%rbp),%xmm5
movsd  -0x88(%rbp),%xmm6
ff
mov    0x28(%rbp),%rsi
call   1030 <InterpolatedValue3DTranMirr@plt>
mov    -0x98(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x98(%rbp)
jmp    1212 <BatchInterpolatedValue3DTranMirrWarp+0x102>
jmp    1312 <BatchInterpolatedValue3DTranMirrWarp+0x202>
mov    -0xa0(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xa0(%rbp)
jmp    11f6 <BatchInterpolatedValue3DTranMirrWarp+0xe6>
jmp    132e <BatchInterpolatedValue3DTranMirrWarp+0x21e>
mov    -0xa8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xa8(%rbp)
jmp    11da <BatchInterpolatedValue3DTranMirrWarp+0xca>
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BatchInterpolatedValue3DTranMirrWarp>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
movapd %xmm6,%xmm8
movapd %xmm5,%xmm12
movapd %xmm4,%xmm9
movapd %xmm3,%xmm10
mov    %r9,0x30(%rsp)
mov    %r8,0x18(%rsp)
mov    %rcx,0x20(%rsp)
mov    %rdx,%r12
mov    %rsi,0x28(%rsp)
mov    %rdi,%rbx
movapd %xmm0,%xmm4
mulsd  %xmm3,%xmm4
mulsd  %xmm6,%xmm4
xorpd  %xmm3,%xmm3
ucomisd %xmm3,%xmm4
jbe    118a <BatchInterpolatedValue3DTranMirrWarp+0x7a>
mov    $0x1,%eax
nopw   0x0(%rax,%rax,1)
xorps  %xmm3,%xmm3
cvtsi2sd %rax,%xmm3
movl   $0x0,-0x4(%rbx,%rax,4)
add    $0x1,%rax
ucomisd %xmm3,%xmm4
ja     1170 <BatchInterpolatedValue3DTranMirrWarp+0x60>
cmpq   $0x0,0x18(%rsp)
jle    1387 <BatchInterpolatedValue3DTranMirrWarp+0x277>
mov    0xe8(%rsp),%r15
movsd  0xd8(%rsp),%xmm11
xor    %eax,%eax
mov    %rax,0x8(%rsp)
xor    %esi,%esi
movsd  %xmm7,0x80(%rsp)
movsd  %xmm8,0x78(%rsp)
movsd  %xmm12,0x70(%rsp)
movsd  %xmm9,0x68(%rsp)
movsd  %xmm10,0x60(%rsp)
movsd  %xmm2,0x58(%rsp)
movsd  %xmm1,0x50(%rsp)
movsd  %xmm0,0x48(%rsp)
jmp    120c <BatchInterpolatedValue3DTranMirrWarp+0xfc>
nopw   0x0(%rax,%rax,1)
mov    0x8(%rsp),%rcx
add    $0x1,%rcx
mov    %rcx,%rax
mov    %rcx,0x8(%rsp)
cmp    0x18(%rsp),%rcx
je     1387 <BatchInterpolatedValue3DTranMirrWarp+0x277>
cmpq   $0x0,0x20(%rsp)
jle    11f0 <BatchInterpolatedValue3DTranMirrWarp+0xe0>
xorps  %xmm6,%xmm6
cvtsi2ssq 0x8(%rsp),%xmm6
xor    %eax,%eax
movss  %xmm6,0x10(%rsp)
jmp    123b <BatchInterpolatedValue3DTranMirrWarp+0x12b>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rax
cmp    0x20(%rsp),%rax
je     11f0 <BatchInterpolatedValue3DTranMirrWarp+0xe0>
test   %r12,%r12
jle    1230 <BatchInterpolatedValue3DTranMirrWarp+0x120>
mov    %rax,0x38(%rsp)
xorps  %xmm3,%xmm3
cvtsi2ss %rax,%xmm3
movss  %xmm3,0x14(%rsp)
mov    0x30(%rsp),%rax
lea    (%rax,%rsi,4),%rax
mov    %rax,0x90(%rsp)
mov    0xd0(%rsp),%rax
lea    (%rax,%rsi,4),%rax
mov    %rax,0x88(%rsp)
mov    0xe0(%rsp),%rax
lea    (%rax,%rsi,4),%r13
mov    0x28(%rsp),%rax
mov    %rsi,0x40(%rsp)
lea    (%rax,%rsi,4),%rbp
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
nop
xorps  %xmm3,%xmm3
cvtsi2ss %r14,%xmm3
mov    0x90(%rsp),%rax
addss  (%rax,%r14,4),%xmm3
xorps  %xmm4,%xmm4
cvtss2sd %xmm3,%xmm4
subsd  %xmm1,%xmm4
divsd  %xmm2,%xmm4
mov    0x88(%rsp),%rax
movss  (%rax,%r14,4),%xmm1
addss  0x14(%rsp),%xmm1
xorps  %xmm5,%xmm5
cvtss2sd %xmm1,%xmm5
subsd  %xmm9,%xmm5
divsd  %xmm12,%xmm5
movss  0x0(%r13,%r14,4),%xmm1
addss  %xmm6,%xmm1
xorps  %xmm6,%xmm6
cvtss2sd %xmm1,%xmm6
subsd  %xmm7,%xmm6
divsd  %xmm11,%xmm6
movss  0x0(%rbp,%r14,4),%xmm3
mov    %rbx,%rdi
movapd %xmm10,%xmm1
movapd %xmm8,%xmm2
mov    %r15,%rsi
call   1030 <InterpolatedValue3DTranMirr@plt>
movss  0x10(%rsp),%xmm6
movsd  0xd8(%rsp),%xmm11
movsd  0x48(%rsp),%xmm0
movsd  0x50(%rsp),%xmm1
movsd  0x58(%rsp),%xmm2
movsd  0x60(%rsp),%xmm10
movsd  0x68(%rsp),%xmm9
movsd  0x70(%rsp),%xmm12
movsd  0x78(%rsp),%xmm8
movsd  0x80(%rsp),%xmm7
add    $0x1,%r14
cmp    %r14,%r12
jne    12a0 <BatchInterpolatedValue3DTranMirrWarp+0x190>
mov    0x40(%rsp),%rsi
add    %r14,%rsi
mov    0x38(%rsp),%rax
jmp    1230 <BatchInterpolatedValue3DTranMirrWarp+0x120>
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @BatchInterpolatedValue3DTranMirrWarp(float* %0, float* nocapture %1, i64 %2, i64 %3, i64 %4, double %5, double %6, double %7, float* nocapture %8, double %9, double %10, double %11, float* nocapture %12, double %13, double %14, double %15, float* nocapture %16, i64 %17) {
%19 = fmul double %5, %9
%20 = fmul double %19, %13
%21 = fcmp ogt double %20, 0.000000e+00
br i1 %21, label %27, label %22
22: ; preds = %27, %18
%23 = icmp sgt i64 %4, 0
br i1 %23, label %24, label %79
24: ; preds = %22
%25 = icmp sgt i64 %3, 0
%26 = icmp sgt i64 %2, 0
br label %33
27: ; preds = %18, %27
%28 = phi i64 [ %30, %27 ], [ 0, %18 ]
%29 = getelementptr inbounds float, float* %0, i64 %28
store float 0.000000e+00, float* %29
%30 = add nuw nsw i64 %28, 1
%31 = sitofp i64 %30 to double
%32 = fcmp ogt double %20, %31
br i1 %32, label %27, label %22
33: ; preds = %24, %75
%34 = phi i64 [ 0, %24 ], [ %77, %75 ]
%35 = phi i64 [ 0, %24 ], [ %76, %75 ]
br i1 %25, label %36, label %75
36: ; preds = %33
%37 = sitofp i64 %34 to float
br label %38
38: ; preds = %36, %71
%39 = phi i64 [ 0, %36 ], [ %73, %71 ]
%40 = phi i64 [ %35, %36 ], [ %72, %71 ]
br i1 %26, label %41, label %71
41: ; preds = %38
%42 = sitofp i64 %39 to float
br label %43
43: ; preds = %41, %43
%44 = phi i64 [ 0, %41 ], [ %69, %43 ]
%45 = phi i64 [ %40, %41 ], [ %65, %43 ]
%46 = sitofp i64 %44 to float
%47 = getelementptr inbounds float, float* %8, i64 %45
%48 = load float, float* %47
%49 = fadd float %48, %46
%50 = fpext float %49 to double
%51 = fsub double %50, %6
%52 = fdiv double %51, %7
%53 = getelementptr inbounds float, float* %12, i64 %45
%54 = load float, float* %53
%55 = fadd float %54, %42
%56 = fpext float %55 to double
%57 = fsub double %56, %10
%58 = fdiv double %57, %11
%59 = getelementptr inbounds float, float* %16, i64 %45
%60 = load float, float* %59
%61 = fadd float %60, %37
%62 = fpext float %61 to double
%63 = fsub double %62, %14
%64 = fdiv double %63, %15
%65 = add nsw i64 %45, 1
%66 = getelementptr inbounds float, float* %1, i64 %45
%67 = load float, float* %66
%68 = tail call i32 @InterpolatedValue3DTranMirr(float* %0, double %5, double %9, double %13, float %67, double %52, double %58, double %64, i64 %17)
%69 = add nuw nsw i64 %44, 1
%70 = icmp eq i64 %69, %2
br i1 %70, label %71, label %43
71: ; preds = %43, %38
%72 = phi i64 [ %40, %38 ], [ %65, %43 ]
%73 = add nuw nsw i64 %39, 1
%74 = icmp eq i64 %73, %3
br i1 %74, label %75, label %38
75: ; preds = %71, %33
%76 = phi i64 [ %35, %33 ], [ %72, %71 ]
%77 = add nuw nsw i64 %34, 1
%78 = icmp eq i64 %77, %4
br i1 %78, label %79, label %33
79: ; preds = %75, %22
ret void
}