void p3dCartesian2polar_8(unsigned char *in_im, unsigned char **out_im,
                          const int dimx, const int dimy, const double centerX,
                          const double centerY, const double precision,
                          int *polarX) {
  int i, j;
  double r, phi;
  double x, y;
  double r1, r2, r3, r4;
  r1 = sqrt((centerX - 0) * (centerX - 0) + (centerY - 0) * (centerY - 0));
  r2 =
      sqrt((centerX - dimx) * (centerX - dimx) + (centerY - 0) * (centerY - 0));
  r3 =
      sqrt((centerX - 0) * (centerX - 0) + (centerY - dimy) * (centerY - dimy));
  r4 = sqrt((centerX - dimx) * (centerX - dimx) +
            (centerY - dimy) * (centerY - dimy));
  *polarX = (int)(precision * ((((((((((r1) > (r2)) ? (r1) : (r2))) > (r3))
                                       ? ((((r1) > (r2)) ? (r1) : (r2)))
                                       : (r3))) > (r4))
                                    ? (((((((r1) > (r2)) ? (r1) : (r2))) > (r3))
                                            ? ((((r1) > (r2)) ? (r1) : (r2)))
                                            : (r3)))
                                    : (r4)) +
                               0.5));
  (*out_im) =
      (unsigned char *)calloc((*polarX) * (*polarX), sizeof(unsigned char));
#pragma omp parallel for private(i, r, phi, x, y)
  for (j = 0; j < (*polarX); j++)
    for (i = 0; i < (*polarX); i++) {
      r = (double)(i);
      phi = ((double)(j) / (*polarX)) * 3.1415926535897932384626433 * 2;
      x = r * cos(phi) + centerX;
      y = r * sin(phi) + centerY;
      (*out_im)[((j) * ((*polarX)) + (i))] =
          p3dBicubicInterpolation_8(in_im, dimx, dimy, x, y);
    }
}


x86 assembly (clang, -O0):
<p3dCartesian2polar_8>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x28(%rbp)
movsd  %xmm2,-0x30(%rbp)
mov    %r8,-0x38(%rbp)
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
subsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm2
xorps  %xmm1,%xmm1
subsd  %xmm1,%xmm2
movsd  -0x28(%rbp),%xmm1
xorps  %xmm3,%xmm3
subsd  %xmm3,%xmm1
movsd  -0x28(%rbp),%xmm3
xorps  %xmm4,%xmm4
subsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1070 <sqrt@plt>
movsd  %xmm0,-0x68(%rbp)
movsd  -0x20(%rbp),%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm2
cvtsi2sdl -0x14(%rbp),%xmm1
subsd  %xmm1,%xmm2
movsd  -0x28(%rbp),%xmm1
xorps  %xmm3,%xmm3
subsd  %xmm3,%xmm1
movsd  -0x28(%rbp),%xmm3
xorps  %xmm4,%xmm4
subsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1070 <sqrt@plt>
movsd  %xmm0,-0x70(%rbp)
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
subsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm2
xorps  %xmm1,%xmm1
subsd  %xmm1,%xmm2
movsd  -0x28(%rbp),%xmm1
cvtsi2sdl -0x18(%rbp),%xmm3
subsd  %xmm3,%xmm1
movsd  -0x28(%rbp),%xmm3
cvtsi2sdl -0x18(%rbp),%xmm4
subsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1070 <sqrt@plt>
movsd  %xmm0,-0x78(%rbp)
movsd  -0x20(%rbp),%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm2
cvtsi2sdl -0x14(%rbp),%xmm1
subsd  %xmm1,%xmm2
movsd  -0x28(%rbp),%xmm1
cvtsi2sdl -0x18(%rbp),%xmm3
subsd  %xmm3,%xmm1
movsd  -0x28(%rbp),%xmm3
cvtsi2sdl -0x18(%rbp),%xmm4
subsd  %xmm4,%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1070 <sqrt@plt>
movsd  %xmm0,-0x80(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
ucomisd -0x70(%rbp),%xmm0
jbe    12d3 <p3dCartesian2polar_8+0x183>
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
jmp    12e0 <p3dCartesian2polar_8+0x190>
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
ucomisd -0x78(%rbp),%xmm0
jbe    1337 <p3dCartesian2polar_8+0x1e7>
movsd  -0x68(%rbp),%xmm0
ucomisd -0x70(%rbp),%xmm0
jbe    1315 <p3dCartesian2polar_8+0x1c5>
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
jmp    1322 <p3dCartesian2polar_8+0x1d2>
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0xa0(%rbp)
ff
jmp    1344 <p3dCartesian2polar_8+0x1f4>
movsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
ucomisd -0x80(%rbp),%xmm0
jbe    13ff <p3dCartesian2polar_8+0x2af>
movsd  -0x68(%rbp),%xmm0
ucomisd -0x70(%rbp),%xmm0
jbe    1379 <p3dCartesian2polar_8+0x229>
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
jmp    1386 <p3dCartesian2polar_8+0x236>
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
ucomisd -0x78(%rbp),%xmm0
jbe    13dd <p3dCartesian2polar_8+0x28d>
movsd  -0x68(%rbp),%xmm0
ucomisd -0x70(%rbp),%xmm0
jbe    13bb <p3dCartesian2polar_8+0x26b>
movsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
jmp    13c8 <p3dCartesian2polar_8+0x278>
movsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0xb0(%rbp),%xmm0
ff
movsd  %xmm0,-0xb8(%rbp)
ff
jmp    13ea <p3dCartesian2polar_8+0x29a>
movsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm0,-0xc0(%rbp)
ff
jmp    140c <p3dCartesian2polar_8+0x2bc>
movsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
movsd  -0xc0(%rbp),%xmm1
ff
movsd  0xbdc(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
mov    -0x38(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x38(%rbp),%rax
mov    (%rax),%eax
mov    -0x38(%rbp),%rcx
imul   (%rcx),%eax
movslq %eax,%rdi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%eax
mov    -0x38(%rbp),%rcx
cmp    (%rcx),%eax
jge    157e <p3dCartesian2polar_8+0x42e>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    -0x38(%rbp),%rcx
cmp    (%rcx),%eax
jge    156b <p3dCartesian2polar_8+0x41b>
cvtsi2sdl -0x3c(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
cvtsi2sdl -0x40(%rbp),%xmm0
mov    -0x38(%rbp),%rax
cvtsi2sdl (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  0xb67(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xb53(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
call   1050 <cos@plt>
movaps %xmm0,%xmm2
movsd  -0xd0(%rbp),%xmm0
ff
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
call   1040 <sin@plt>
movaps %xmm0,%xmm2
movsd  -0xc8(%rbp),%xmm0
ff
movsd  -0x28(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
movsd  -0x58(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm1
mov    $0x2,%al
call   1060 <p3dBicubicInterpolation_8@plt>
mov    %al,%dl
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x40(%rbp),%ecx
mov    -0x38(%rbp),%rsi
imul   (%rsi),%ecx
add    -0x3c(%rbp),%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1477 <p3dCartesian2polar_8+0x327>
jmp    1570 <p3dCartesian2polar_8+0x420>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    1461 <p3dCartesian2polar_8+0x311>
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p3dCartesian2polar_8>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %r8,0x20(%rsp)
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x28(%rsp)
movapd %xmm0,%xmm2
mov    %ecx,%r14d
mov    %edx,%ebp
mov    %rsi,0x48(%rsp)
mov    %rdi,0x50(%rsp)
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
movsd  %xmm0,(%rsp)
addsd  %xmm1,%xmm0
xorpd  %xmm3,%xmm3
ucomisd %xmm3,%xmm0
movsd  %xmm2,0x40(%rsp)
jb     11a9 <p3dCartesian2polar_8+0x59>
sqrtsd %xmm0,%xmm0
jmp    11c4 <p3dCartesian2polar_8+0x74>
movsd  %xmm1,0x8(%rsp)
call   1070 <sqrt@plt>
xorpd  %xmm3,%xmm3
movsd  0x8(%rsp),%xmm1
movsd  0x40(%rsp),%xmm2
movsd  %xmm0,0x10(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
subsd  %xmm0,%xmm2
mulsd  %xmm2,%xmm2
movsd  %xmm2,0x8(%rsp)
addsd  %xmm2,%xmm1
ucomisd %xmm3,%xmm1
jb     11f2 <p3dCartesian2polar_8+0xa2>
xorps  %xmm0,%xmm0
sqrtsd %xmm1,%xmm0
jmp    11fb <p3dCartesian2polar_8+0xab>
movapd %xmm1,%xmm0
call   1070 <sqrt@plt>
movsd  %xmm0,0x38(%rsp)
movsd  0x28(%rsp),%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %r14d,%xmm0
subsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm1
movsd  (%rsp),%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm3,%xmm3
ucomisd %xmm3,%xmm0
jb     1233 <p3dCartesian2polar_8+0xe3>
xorps  %xmm2,%xmm2
sqrtsd %xmm0,%xmm2
jmp    124a <p3dCartesian2polar_8+0xfa>
movsd  %xmm1,(%rsp)
call   1070 <sqrt@plt>
xorpd  %xmm3,%xmm3
movsd  (%rsp),%xmm1
movapd %xmm0,%xmm2
movsd  0x8(%rsp),%xmm0
addsd  %xmm1,%xmm0
ucomisd %xmm3,%xmm0
mov    %r14d,0x34(%rsp)
mov    %ebp,0x30(%rsp)
jb     1269 <p3dCartesian2polar_8+0x119>
sqrtsd %xmm0,%xmm0
jmp    1278 <p3dCartesian2polar_8+0x128>
movsd  %xmm2,(%rsp)
call   1070 <sqrt@plt>
movsd  (%rsp),%xmm2
mov    0x20(%rsp),%rax
movsd  0x10(%rsp),%xmm1
maxsd  0x38(%rsp),%xmm1
maxsd  %xmm2,%xmm1
maxsd  %xmm0,%xmm1
addsd  0xd67(%rip),%xmm1
mulsd  0x18(%rsp),%xmm1
cvttsd2si %xmm1,%r15d
mov    %r15d,(%rax)
mov    %r15d,%edi
imul   %edi,%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    0x48(%rsp),%rcx
mov    %rax,(%rcx)
test   %r15d,%r15d
jle    13d0 <p3dCartesian2polar_8+0x280>
xor    %esi,%esi
movsd  0xd36(%rip),%xmm1
mov    0x30(%rsp),%r13d
mov    0x50(%rsp),%r12
mov    0x20(%rsp),%rbp
jmp    12fc <p3dCartesian2polar_8+0x1ac>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%esi
cmp    %r15d,%esi
jge    13d0 <p3dCartesian2polar_8+0x280>
test   %r15d,%r15d
jle    12f0 <p3dCartesian2polar_8+0x1a0>
xorps  %xmm0,%xmm0
cvtsi2sd %esi,%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xorps  %xmm0,%xmm0
cvtsi2sd %r14d,%xmm0
movsd  %xmm0,0x18(%rsp)
xorps  %xmm2,%xmm2
cvtsi2sd %r15d,%xmm2
movsd  0x8(%rsp),%xmm0
divsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm0,%xmm0
movsd  %xmm0,(%rsp)
mov    %rsi,%rbx
call   1050 <cos@plt>
mulsd  0x18(%rsp),%xmm0
addsd  0x40(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  (%rsp),%xmm0
call   1040 <sin@plt>
movsd  0x18(%rsp),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x28(%rsp),%xmm1
mov    %r12,%rdi
mov    %r13d,%esi
mov    0x34(%rsp),%edx
movsd  0x10(%rsp),%xmm0
mov    $0x2,%al
call   1060 <p3dBicubicInterpolation_8@plt>
movsd  0xc68(%rip),%xmm1
mov    %rbx,%rsi
movslq 0x0(%rbp),%rcx
movslq %esi,%rdx
imul   %rcx,%rdx
mov    0x48(%rsp),%rcx
add    (%rcx),%rdx
mov    %al,(%r14,%rdx,1)
mov    0x0(%rbp),%r15d
add    $0x1,%r14
cmp    %r15d,%r14d
jl     1320 <p3dCartesian2polar_8+0x1d0>
jmp    12f0 <p3dCartesian2polar_8+0x1a0>
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @p3dCartesian2polar_8(i8* %0, i8** %1, i32 %2, i32 %3, double %4, double %5, double %6, i32* %7) {
%9 = alloca i8*
%10 = alloca i8**
%11 = alloca i32
%12 = alloca i32
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca i32*
%17 = alloca i32
%18 = alloca i32
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = alloca double
%25 = alloca double
%26 = alloca double
store i8* %0, i8** %9
store i8** %1, i8*** %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store double %4, double* %13
store double %5, double* %14
store double %6, double* %15
store i32* %7, i32** %16
%27 = load double, double* %13
%28 = fsub double %27, 0.000000e+00
%29 = load double, double* %13
%30 = fsub double %29, 0.000000e+00
%31 = load double, double* %14
%32 = fsub double %31, 0.000000e+00
%33 = load double, double* %14
%34 = fsub double %33, 0.000000e+00
%35 = fmul double %32, %34
%36 = call double @llvm.fmuladd.f64(double %28, double %30, double %35)
%37 = call double @sqrt(double %36)
store double %37, double* %23
%38 = load double, double* %13
%39 = load i32, i32* %11
%40 = sitofp i32 %39 to double
%41 = fsub double %38, %40
%42 = load double, double* %13
%43 = load i32, i32* %11
%44 = sitofp i32 %43 to double
%45 = fsub double %42, %44
%46 = load double, double* %14
%47 = fsub double %46, 0.000000e+00
%48 = load double, double* %14
%49 = fsub double %48, 0.000000e+00
%50 = fmul double %47, %49
%51 = call double @llvm.fmuladd.f64(double %41, double %45, double %50)
%52 = call double @sqrt(double %51)
store double %52, double* %24
%53 = load double, double* %13
%54 = fsub double %53, 0.000000e+00
%55 = load double, double* %13
%56 = fsub double %55, 0.000000e+00
%57 = load double, double* %14
%58 = load i32, i32* %12
%59 = sitofp i32 %58 to double
%60 = fsub double %57, %59
%61 = load double, double* %14
%62 = load i32, i32* %12
%63 = sitofp i32 %62 to double
%64 = fsub double %61, %63
%65 = fmul double %60, %64
%66 = call double @llvm.fmuladd.f64(double %54, double %56, double %65)
%67 = call double @sqrt(double %66)
store double %67, double* %25
%68 = load double, double* %13
%69 = load i32, i32* %11
%70 = sitofp i32 %69 to double
%71 = fsub double %68, %70
%72 = load double, double* %13
%73 = load i32, i32* %11
%74 = sitofp i32 %73 to double
%75 = fsub double %72, %74
%76 = load double, double* %14
%77 = load i32, i32* %12
%78 = sitofp i32 %77 to double
%79 = fsub double %76, %78
%80 = load double, double* %14
%81 = load i32, i32* %12
%82 = sitofp i32 %81 to double
%83 = fsub double %80, %82
%84 = fmul double %79, %83
%85 = call double @llvm.fmuladd.f64(double %71, double %75, double %84)
%86 = call double @sqrt(double %85)
store double %86, double* %26
%87 = load double, double* %15
%88 = load double, double* %23
%89 = load double, double* %24
%90 = fcmp ogt double %88, %89
br i1 %90, label %91, label %93
91: ; preds = %8
%92 = load double, double* %23
br label %95
93: ; preds = %8
%94 = load double, double* %24
br label %95
95: ; preds = %93, %91
%96 = phi double [ %92, %91 ], [ %94, %93 ]
%97 = load double, double* %25
%98 = fcmp ogt double %96, %97
br i1 %98, label %99, label %109
99: ; preds = %95
%100 = load double, double* %23
%101 = load double, double* %24
%102 = fcmp ogt double %100, %101
br i1 %102, label %103, label %105
103: ; preds = %99
%104 = load double, double* %23
br label %107
105: ; preds = %99
%106 = load double, double* %24
br label %107
107: ; preds = %105, %103
%108 = phi double [ %104, %103 ], [ %106, %105 ]
br label %111
109: ; preds = %95
%110 = load double, double* %25
br label %111
111: ; preds = %109, %107
%112 = phi double [ %108, %107 ], [ %110, %109 ]
%113 = load double, double* %26
%114 = fcmp ogt double %112, %113
br i1 %114, label %115, label %141
115: ; preds = %111
%116 = load double, double* %23
%117 = load double, double* %24
%118 = fcmp ogt double %116, %117
br i1 %118, label %119, label %121
119: ; preds = %115
%120 = load double, double* %23
br label %123
121: ; preds = %115
%122 = load double, double* %24
br label %123
123: ; preds = %121, %119
%124 = phi double [ %120, %119 ], [ %122, %121 ]
%125 = load double, double* %25
%126 = fcmp ogt double %124, %125
br i1 %126, label %127, label %137
127: ; preds = %123
%128 = load double, double* %23
%129 = load double, double* %24
%130 = fcmp ogt double %128, %129
br i1 %130, label %131, label %133
131: ; preds = %127
%132 = load double, double* %23
br label %135
133: ; preds = %127
%134 = load double, double* %24
br label %135
135: ; preds = %133, %131
%136 = phi double [ %132, %131 ], [ %134, %133 ]
br label %139
137: ; preds = %123
%138 = load double, double* %25
br label %139
139: ; preds = %137, %135
%140 = phi double [ %136, %135 ], [ %138, %137 ]
br label %143
141: ; preds = %111
%142 = load double, double* %26
br label %143
143: ; preds = %141, %139
%144 = phi double [ %140, %139 ], [ %142, %141 ]
%145 = fadd double %144, 5.000000e-01
%146 = fmul double %87, %145
%147 = fptosi double %146 to i32
%148 = load i32*, i32** %16
store i32 %147, i32* %148
%149 = load i32*, i32** %16
%150 = load i32, i32* %149
%151 = load i32*, i32** %16
%152 = load i32, i32* %151
%153 = mul nsw i32 %150, %152
%154 = sext i32 %153 to i64
%155 = call i8* @calloc(i64 %154, i64 1)
%156 = load i8**, i8*** %10
store i8* %155, i8** %156
store i32 0, i32* %18
br label %157
157: ; preds = %210, %143
%158 = load i32, i32* %18
%159 = load i32*, i32** %16
%160 = load i32, i32* %159
%161 = icmp slt i32 %158, %160
br i1 %161, label %162, label %213
162: ; preds = %157
store i32 0, i32* %17
br label %163
163: ; preds = %206, %162
%164 = load i32, i32* %17
%165 = load i32*, i32** %16
%166 = load i32, i32* %165
%167 = icmp slt i32 %164, %166
br i1 %167, label %168, label %209
168: ; preds = %163
%169 = load i32, i32* %17
%170 = sitofp i32 %169 to double
store double %170, double* %19
%171 = load i32, i32* %18
%172 = sitofp i32 %171 to double
%173 = load i32*, i32** %16
%174 = load i32, i32* %173
%175 = sitofp i32 %174 to double
%176 = fdiv double %172, %175
%177 = fmul double %176, 0x400921FB54442D18
%178 = fmul double %177, 2.000000e+00
store double %178, double* %20
%179 = load double, double* %19
%180 = load double, double* %20
%181 = call double @cos(double %180)
%182 = load double, double* %13
%183 = call double @llvm.fmuladd.f64(double %179, double %181, double %182)
store double %183, double* %21
%184 = load double, double* %19
%185 = load double, double* %20
%186 = call double @sin(double %185)
%187 = load double, double* %14
%188 = call double @llvm.fmuladd.f64(double %184, double %186, double %187)
store double %188, double* %22
%189 = load i8*, i8** %9
%190 = load i32, i32* %11
%191 = load i32, i32* %12
%192 = load double, double* %21
%193 = load double, double* %22
%194 = call i32 (i8*, i32, i32, double, double, ...) bitcast (i32 (...)* @p3dBicubicInterpolation_8 to i32 (i8*, i32, i32, double, double, ...)*)(i8* %189, i32 %190, i32 %191, double %192, double %193)
%195 = trunc i32 %194 to i8
%196 = load i8**, i8*** %10
%197 = load i8*, i8** %196
%198 = load i32, i32* %18
%199 = load i32*, i32** %16
%200 = load i32, i32* %199
%201 = mul nsw i32 %198, %200
%202 = load i32, i32* %17
%203 = add nsw i32 %201, %202
%204 = sext i32 %203 to i64
%205 = getelementptr inbounds i8, i8* %197, i64 %204
store i8 %195, i8* %205
br label %206
206: ; preds = %168
%207 = load i32, i32* %17
%208 = add nsw i32 %207, 1
store i32 %208, i32* %17
br label %163
209: ; preds = %163
br label %210
210: ; preds = %209
%211 = load i32, i32* %18
%212 = add nsw i32 %211, 1
store i32 %212, i32* %18
br label %157
213: ; preds = %157
ret void
}

LLVM IR (-O2):
define void @p3dCartesian2polar_8(i8* %0, i8** nocapture %1, i32 %2, i32 %3, double %4, double %5, double %6, i32* nocapture %7) {
%9 = fmul double %5, %5
%10 = tail call double @llvm.fmuladd.f64(double %4, double %4, double %9)
%11 = tail call double @sqrt(double %10)
%12 = sitofp i32 %2 to double
%13 = fsub double %4, %12
%14 = tail call double @llvm.fmuladd.f64(double %13, double %13, double %9)
%15 = tail call double @sqrt(double %14)
%16 = sitofp i32 %3 to double
%17 = fsub double %5, %16
%18 = fmul double %17, %17
%19 = tail call double @llvm.fmuladd.f64(double %4, double %4, double %18)
%20 = tail call double @sqrt(double %19)
%21 = tail call double @llvm.fmuladd.f64(double %13, double %13, double %18)
%22 = tail call double @sqrt(double %21)
%23 = fcmp ogt double %11, %15
%24 = select i1 %23, double %11, double %15
%25 = fcmp ogt double %24, %20
%26 = select i1 %25, double %24, double %20
%27 = fcmp ogt double %26, %22
%28 = select i1 %27, double %26, double %22
%29 = fadd double %28, 5.000000e-01
%30 = fmul double %29, %6
%31 = fptosi double %30 to i32
store i32 %31, i32* %7
%32 = mul nsw i32 %31, %31
%33 = zext i32 %32 to i64
%34 = tail call i8* @calloc(i64 %33, i64 1)
store i8* %34, i8** %1
%35 = icmp sgt i32 %31, 0
br i1 %35, label %36, label %69
36: ; preds = %8, %65
%37 = phi i32 [ %66, %65 ], [ %31, %8 ]
%38 = phi i32 [ %67, %65 ], [ 0, %8 ]
%39 = icmp sgt i32 %37, 0
br i1 %39, label %40, label %65
40: ; preds = %36
%41 = sitofp i32 %38 to double
br label %42
42: ; preds = %40, %42
%43 = phi i32 [ %37, %40 ], [ %63, %42 ]
%44 = phi i32 [ 0, %40 ], [ %62, %42 ]
%45 = sitofp i32 %44 to double
%46 = sitofp i32 %43 to double
%47 = fdiv double %41, %46
%48 = fmul double %47, 0x400921FB54442D18
%49 = fmul double %48, 2.000000e+00
%50 = tail call double @cos(double %49)
%51 = tail call double @llvm.fmuladd.f64(double %45, double %50, double %4)
%52 = tail call double @sin(double %49)
%53 = tail call double @llvm.fmuladd.f64(double %45, double %52, double %5)
%54 = tail call i32 (i8*, i32, i32, double, double, ...) bitcast (i32 (...)* @p3dBicubicInterpolation_8 to i32 (i8*, i32, i32, double, double, ...)*)(i8* %0, i32 %2, i32 %3, double %51, double %53)
%55 = trunc i32 %54 to i8
%56 = load i8*, i8** %1
%57 = load i32, i32* %7
%58 = mul nsw i32 %57, %38
%59 = add nsw i32 %58, %44
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds i8, i8* %56, i64 %60
store i8 %55, i8* %61
%62 = add nuw nsw i32 %44, 1
%63 = load i32, i32* %7
%64 = icmp slt i32 %62, %63
br i1 %64, label %42, label %65
65: ; preds = %42, %36
%66 = phi i32 [ %37, %36 ], [ %63, %42 ]
%67 = add nuw nsw i32 %38, 1
%68 = icmp slt i32 %67, %66
br i1 %68, label %36, label %69
69: ; preds = %65, %8
ret void
}